diff --git a/src/components/ServerDetailOverview.tsx b/src/components/ServerDetailOverview.tsx index 8f3d536..64016c7 100644 --- a/src/components/ServerDetailOverview.tsx +++ b/src/components/ServerDetailOverview.tsx @@ -74,6 +74,7 @@ export default function ServerDetailOverview({ server_id }: { server_id: string net_out_transfer, net_in_transfer, last_active_time_string, + boot_time_string, } = formatNezhaInfo(nezhaWsData.now, server) const customBackgroundImage = (window.CustomBackgroundImage as string) !== "" ? window.CustomBackgroundImage : undefined @@ -285,6 +286,14 @@ export default function ServerDetailOverview({ server_id }: { server_id: string
+ + +
+

{t("serverDetail.bootTime")}

+
{boot_time_string ? boot_time_string : "N/A"}
+
+
+
diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 59248a7..7618c95 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -35,6 +35,7 @@ export function formatNezhaInfo(now: number, serverInfo: NezhaServer) { swap_total: serverInfo.host.swap_total || 0, disk_total: serverInfo.host.disk_total || 0, boot_time: serverInfo.host.boot_time || 0, + boot_time_string: serverInfo.host.boot_time ? dayjs(serverInfo.host.boot_time * 1000).format("YYYY-MM-DD HH:mm:ss") : "", platform_version: serverInfo.host.platform_version || "", cpu_info: serverInfo.host.cpu || [], gpu_info: serverInfo.host.gpu || [], diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index f261519..c584d32 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -67,7 +67,8 @@ "upload": "Upload", "download": "Download", "lastActive": "Last active time", - "temperature": "Temperature" + "temperature": "Temperature", + "bootTime": "Boot time" }, "serverDetailChart": { "process": "Process", diff --git a/src/locales/zh-CN/translation.json b/src/locales/zh-CN/translation.json index 6047bd1..63db741 100644 --- a/src/locales/zh-CN/translation.json +++ b/src/locales/zh-CN/translation.json @@ -67,7 +67,8 @@ "upload": "上传", "download": "下载", "lastActive": "最后上报时间", - "temperature": "温度" + "temperature": "温度", + "bootTime": "启动时间" }, "serverDetailChart": { "process": "进程数", diff --git a/src/locales/zh-TW/translation.json b/src/locales/zh-TW/translation.json index c60cfb9..1f5297e 100644 --- a/src/locales/zh-TW/translation.json +++ b/src/locales/zh-TW/translation.json @@ -67,7 +67,8 @@ "upload": "上傳", "download": "下載", "lastActive": "最後上報時間", - "temperature": "溫度" + "temperature": "溫度", + "bootTime": "啟動時間" }, "serverDetailChart": { "process": "進程數",