Add Updated time stamp
This commit is contained in:
parent
93c9bf27fa
commit
c14f08d4b1
@ -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 %>
|
||||||
<form method="post" class="logout-form">
|
<div class="header-controls">
|
||||||
<input type="hidden" name="action" value="logout">
|
<div class="last-updated" id="last-updated"></div>
|
||||||
<button type="submit" class="logout-btn">Log Out</button>
|
<form method="post" class="logout-form">
|
||||||
</form>
|
<input type="hidden" name="action" value="logout">
|
||||||
|
<button type="submit" class="logout-btn">Log Out</button>
|
||||||
|
</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";
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user