This commit is contained in:
2026-01-09 09:41:47 +00:00
parent 51c83f846a
commit 5234411c9d
7 changed files with 71 additions and 33 deletions

View File

@@ -5,6 +5,7 @@
*/
import type { EcoDaemon } from '../daemon/index.ts';
import { VERSION } from '../version.ts';
export class UIServer {
private port: number;
@@ -137,7 +138,19 @@ export class UIServer {
padding: 20px;
}
.container { max-width: 1200px; margin: 0 auto; }
h1 { font-size: 24px; margin-bottom: 20px; }
.header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
h1 { font-size: 24px; margin: 0; }
.clock {
font-size: 18px;
font-weight: 500;
color: var(--text);
font-variant-numeric: tabular-nums;
}
.grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
@@ -240,7 +253,10 @@ export class UIServer {
</head>
<body>
<div class="container">
<h1>EcoOS Management</h1>
<div class="header">
<h1>EcoOS Management <span style="font-size: 12px; color: var(--text-dim); font-weight: normal;">v${VERSION}</span></h1>
<div class="clock" id="clock"></div>
</div>
<div class="grid">
<div class="card">
<h2>Services</h2>
@@ -528,6 +544,24 @@ export class UIServer {
updateStatus(JSON.parse(e.data));
} catch {}
};
// Clock update
function updateClock() {
const now = new Date();
const options = {
weekday: 'short',
year: 'numeric',
month: 'short',
day: 'numeric',
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
hour12: false
};
document.getElementById('clock').textContent = now.toLocaleString('en-US', options);
}
updateClock();
setInterval(updateClock, 1000);
</script>
</body>
</html>`;