feat: move status to footer and clean up home page
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { escapeHtml } from "../utils/html";
|
||||
import { formatUptime } from "../utils/format";
|
||||
|
||||
interface LayoutProps {
|
||||
title: string;
|
||||
@@ -7,6 +8,12 @@ interface LayoutProps {
|
||||
|
||||
export function BaseLayout({ title, content }: LayoutProps): string {
|
||||
const safeTitle = escapeHtml(title);
|
||||
|
||||
// Calculate uptime for the footer
|
||||
const uptimeSeconds = process.uptime();
|
||||
const startTimestamp = Date.now() - (uptimeSeconds * 1000);
|
||||
const initialUptimeString = formatUptime(uptimeSeconds);
|
||||
|
||||
return `<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
@@ -30,7 +37,15 @@ export function BaseLayout({ title, content }: LayoutProps): string {
|
||||
${content}
|
||||
</main>
|
||||
<footer>
|
||||
<p>© ${new Date().getFullYear()} Aurora Bot</p>
|
||||
<div class="footer-content">
|
||||
<p>© ${new Date().getFullYear()} Aurora Bot</p>
|
||||
<div class="footer-status">
|
||||
<span class="status-indicator online">●</span>
|
||||
<span>System Operational</span>
|
||||
<span class="separator">|</span>
|
||||
<span>Uptime: <span id="uptime-display" data-start-timestamp="${Math.floor(startTimestamp)}">${initialUptimeString}</span></span>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<script src="/script.js" defer></script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user