time local
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
<div class="card stat-card text-center py-3 h-100">
|
||||
<div class="fs-6 fw-semibold text-secondary">
|
||||
{% set last_fetch = logs | selectattr('event_type', 'equalto', 'yodeck_fetch') | first %}
|
||||
{% if last_fetch %}{{ last_fetch.timestamp[:19] }} UTC{% else %}—{% endif %}
|
||||
{% if last_fetch %}<span class="local-time" data-utc="{{ last_fetch.timestamp }}">{{ last_fetch.timestamp[:19] }}</span>{% else %}—{% endif %}
|
||||
</div>
|
||||
<div class="text-muted small">Last API Fetch</div>
|
||||
</div>
|
||||
@@ -86,7 +86,7 @@
|
||||
<th>Workspace</th>
|
||||
<th>Type</th>
|
||||
<th>Status</th>
|
||||
<th>Last Seen (UTC)</th>
|
||||
<th>Last Seen</th>
|
||||
<th>Last Pushed</th>
|
||||
<th>Status Updated</th>
|
||||
<th>Resolution</th>
|
||||
@@ -112,9 +112,9 @@
|
||||
<span class="offline">● Offline</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="font-monospace small">{{ (p.last_seen or '—')[:19] }}</td>
|
||||
<td class="font-monospace small">{{ (p.last_pushed or '—')[:19] }}</td>
|
||||
<td class="font-monospace small">{{ (p.status_last_updated or '—')[:19] }}</td>
|
||||
<td class="font-monospace small">{% if p.last_seen %}<span class="local-time" data-utc="{{ p.last_seen }}">{{ p.last_seen[:19] }}</span>{% else %}—{% endif %}</td>
|
||||
<td class="font-monospace small">{% if p.last_pushed %}<span class="local-time" data-utc="{{ p.last_pushed }}">{{ p.last_pushed[:19] }}</span>{% else %}—{% endif %}</td>
|
||||
<td class="font-monospace small">{% if p.status_last_updated %}<span class="local-time" data-utc="{{ p.status_last_updated }}">{{ p.status_last_updated[:19] }}</span>{% else %}—{% endif %}</td>
|
||||
<td class="small">{{ p.screen_resolution or '—' }}</td>
|
||||
<td class="small">{{ p.hardware_version or '—' }}</td>
|
||||
<td class="font-monospace small">{{ p.last_ip_address or '—' }}</td>
|
||||
@@ -140,7 +140,7 @@
|
||||
<table class="table table-sm table-hover mb-0">
|
||||
<thead class="table-dark sticky-top">
|
||||
<tr>
|
||||
<th style="width:180px">Timestamp (UTC)</th>
|
||||
<th style="width:180px">Timestamp</th>
|
||||
<th style="width:160px">Event</th>
|
||||
<th>Message</th>
|
||||
</tr>
|
||||
@@ -148,7 +148,7 @@
|
||||
<tbody>
|
||||
{% for l in logs %}
|
||||
<tr>
|
||||
<td class="font-monospace small text-muted">{{ l.timestamp[:19] }}</td>
|
||||
<td class="font-monospace small text-muted"><span class="local-time" data-utc="{{ l.timestamp }}">{{ l.timestamp[:19] }}</span></td>
|
||||
<td>
|
||||
<span class="badge badge-{{ l.event_type }}">{{ l.event_type }}</span>
|
||||
</td>
|
||||
@@ -171,6 +171,26 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const TZ = 'Europe/Vienna';
|
||||
const dtFmt = new Intl.DateTimeFormat('sv-SE', {
|
||||
timeZone: TZ,
|
||||
year: 'numeric', month: '2-digit', day: '2-digit',
|
||||
hour: '2-digit', minute: '2-digit', second: '2-digit',
|
||||
hour12: false,
|
||||
});
|
||||
|
||||
function toVienna(isoStr) {
|
||||
try {
|
||||
const d = new Date(isoStr);
|
||||
if (isNaN(d)) return isoStr;
|
||||
return dtFmt.format(d).replace('T', ' ');
|
||||
} catch { return isoStr; }
|
||||
}
|
||||
|
||||
document.querySelectorAll('.local-time').forEach(el => {
|
||||
el.textContent = toVienna(el.dataset.utc);
|
||||
});
|
||||
|
||||
let offlineFilter = false;
|
||||
|
||||
function applyFilter() {
|
||||
|
||||
Reference in New Issue
Block a user