diff --git a/index.html b/index.html index 065be23..efb830f 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,8 @@ Server Status + +
diff --git a/src/api/index.ts b/src/api/index.ts index 21d6a97..4940f61 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -6,6 +6,8 @@ export interface Status { os: { name: string; version: string; + release: string; + machine: string; }; labels: string[]; // 服务器标签 location: string; // Chongqing, China diff --git a/src/api/utils.ts b/src/api/utils.ts index 92d7da1..44301e5 100644 --- a/src/api/utils.ts +++ b/src/api/utils.ts @@ -109,11 +109,10 @@ export function getBlankColor(percent: number, disable: boolean = false) { // 1727998501 export function formatUptime(uptime: number): string { - - const seconds = uptime - const d = Math.floor(seconds / 86400) - const h = Math.floor((seconds % 86400) / 3600) - const m = Math.floor((seconds % 3600) / 60) - const s = Math.floor(seconds % 60) - return `${d}:${h}:${m}:${s}` + const seconds = uptime; + const d = Math.floor(seconds / 86400); + const h = Math.floor((seconds % 86400) / 3600).toString().padStart(2, '0'); + const m = Math.floor((seconds % 3600) / 60).toString().padStart(2, '0'); + const s = Math.floor(seconds % 60).toString().padStart(2, '0'); + return `${d}:${h}:${m}:${s}`; } \ No newline at end of file diff --git a/src/components/Host.vue b/src/components/Host.vue index 1d55429..5f0ce4f 100644 --- a/src/components/Host.vue +++ b/src/components/Host.vue @@ -340,33 +340,35 @@ onMounted(