Add Updated time stamp

This commit is contained in:
Josh Holtrop 2026-04-20 21:07:23 -04:00
parent 93c9bf27fa
commit c14f08d4b1

View File

@ -123,10 +123,17 @@
background: #166534; background: #166534;
} }
.logout-form { .header-controls {
position: fixed; position: fixed;
top: 1rem; top: 1rem;
right: 1rem; right: 1rem;
display: flex;
align-items: center;
gap: 1rem;
}
.logout-form {
margin: 0;
} }
.logout-btn { .logout-btn {
@ -380,10 +387,13 @@
<body> <body>
<% if authenticated %> <% if authenticated %>
<div class="header-controls">
<div class="last-updated" id="last-updated"></div>
<form method="post" class="logout-form"> <form method="post" class="logout-form">
<input type="hidden" name="action" value="logout"> <input type="hidden" name="action" value="logout">
<button type="submit" class="logout-btn">Log Out</button> <button type="submit" class="logout-btn">Log Out</button>
</form> </form>
</div>
<% end %> <% end %>
<header> <header>
@ -400,6 +410,11 @@
}) })
.then(function(html) { .then(function(html) {
document.getElementById("content").innerHTML = html; document.getElementById("content").innerHTML = html;
var now = new Date();
var pad = function(n) { return String(n).padStart(2, "0"); };
var stamp = now.getFullYear() + "-" + pad(now.getMonth() + 1) + "-" + pad(now.getDate()) +
" " + pad(now.getHours()) + ":" + pad(now.getMinutes());
document.getElementById("last-updated").textContent = "Updated: " + stamp;
}) })
.catch(function() { .catch(function() {
document.getElementById("content").innerHTML = "Error"; document.getElementById("content").innerHTML = "Error";