This commit is contained in:
2026-07-01 14:48:45 +07:00
parent d201b53442
commit 5d2c055912
12 changed files with 412 additions and 497 deletions

View File

@@ -17,8 +17,8 @@
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
<script src="/js/dashboard/filter.js"></script>
<script src="/js/dashboard/charts.js"></script>
<script src="/js/dashboard/export.js"></script>
<script src="/js/dashboard/globals.js" type="module"></script>
<script src="/js/dashboard/export.js" type="module"></script>
<style>
@@ -278,8 +278,8 @@
</button>
<div id="exportItems" class="align-items-center gap-2">
<button class="btn btn-sm btn-light" onclick="openChartSelector()">Charts</button>
<button class="btn btn-sm btn-light" onclick="exportFullDashboard()">Screen</button>
<button class="btn btn-sm btn-light" id="btnCharts">Charts</button>
<button class="btn btn-sm btn-light" id="btnExport">Screen</button>
<button class="btn btn-sm btn-light" onclick="window.print()">Print</button>
<button class="btn btn-sm btn-outline-secondary" id="exportClose"></button>
</div>
@@ -290,8 +290,8 @@
<div id="chartList"></div>
<div class="mt-3 d-flex justify-content-end gap-2">
<button onclick="closeChartSelector()">Cancel</button>
<button onclick="exportSelectedCharts()">Download PDF</button>
<button id="chartCancel" class="btn btn-sm btn-secondary">Cancel</button>
<button id="chartDownload" class="btn btn-sm btn-primary">Download PDF</button>
</div>
</div>
</div>
@@ -328,7 +328,14 @@
<script>
document.addEventListener("DOMContentLoaded", () => {
updateLastUpdated();
const lastUpdated = localStorage.getItem('dashboardLastUpdated');
if (lastUpdated) {
document.getElementById('lastUpdated').innerHTML =
`Last update: ${lastUpdated}`;
}
});
window.addEventListener("click", (e) => {
const modal = document.getElementById("chartModal");
@@ -360,7 +367,21 @@
.then(res => res.json())
.then(() => {
updateLastUpdated();
const now = new Date();
const time = now.toLocaleTimeString([], {
hour: '2-digit',
minute: '2-digit'
});
const date = now.toISOString().split('T')[0];
const timestamp = `${time} | ${date}`;
localStorage.setItem(
'dashboardLastUpdated',
timestamp
);
location.reload();