75 lines
2.3 KiB
HTML
75 lines
2.3 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="it">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
<title>${title} — RPA Report</title>
|
|
<style>${css}</style>
|
|
<style>${page_css}</style>
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<div class="hdr-left">
|
|
<a href="/" class="hdr-nav ${nav_dashboard}">Dashboard</a>
|
|
<a href="/runs" class="hdr-nav ${nav_runs}">Processi RPA</a>
|
|
<a href="/logs" class="hdr-nav ${nav_logs}">Log DB</a>
|
|
</div>
|
|
<h1>${h1_title}</h1>
|
|
<div class="hdr-right">
|
|
<span class="ts">${now} | ${db_name}</span>
|
|
<button class="refresh-btn" title="Aggiorna dati" onclick="location.reload()">↻</button>
|
|
<div class="wrench-menu">
|
|
<button class="wrench-btn" title="Impostazioni">⚙</button>
|
|
<div class="wrench-drop">
|
|
<a href="/change-db">📂 Cambia DB…</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
<nav>
|
|
${nav_step_link}
|
|
${nav_report_link}
|
|
${nav_pec_link}
|
|
</nav>
|
|
<main>
|
|
${content}
|
|
</main>
|
|
<footer>RPA Process Dashboard — ${now} • ATG</footer>
|
|
<script>${page_js}</script>
|
|
<script>
|
|
(function(){
|
|
var btn = document.querySelector('.wrench-btn');
|
|
var drop = document.querySelector('.wrench-drop');
|
|
if(btn && drop){
|
|
btn.addEventListener('click', function(e){
|
|
e.stopPropagation();
|
|
drop.classList.toggle('open');
|
|
});
|
|
document.addEventListener('click', function(){
|
|
drop.classList.remove('open');
|
|
});
|
|
}
|
|
})();
|
|
|
|
document.querySelectorAll('th').forEach(function(th, i) {
|
|
th.style.cursor = 'pointer';
|
|
th.title = 'Clicca per ordinare';
|
|
var asc = true;
|
|
th.addEventListener('click', function() {
|
|
var tbody = th.closest('table').querySelector('tbody');
|
|
var rows = Array.prototype.slice.call(tbody.querySelectorAll('tr'));
|
|
rows.sort(function(a, b) {
|
|
var av = (a.cells[i] ? a.cells[i].textContent : '').trim();
|
|
var bv = (b.cells[i] ? b.cells[i].textContent : '').trim();
|
|
return asc ? av.localeCompare(bv, 'it', {numeric: true}) : bv.localeCompare(av, 'it', {numeric: true});
|
|
});
|
|
rows.forEach(function(r) { tbody.appendChild(r); });
|
|
th.closest('thead').querySelectorAll('th').forEach(function(h) { h.classList.remove('sort-asc','sort-desc'); });
|
|
th.classList.add(asc ? 'sort-asc' : 'sort-desc');
|
|
asc = !asc;
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|