mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
feat: add boot time display to server details and update localization
This commit is contained in:
parent
ac15be6e71
commit
0f435ee7c1
@ -83,6 +83,7 @@ export default function ServerDetailClient({
|
|||||||
net_out_transfer,
|
net_out_transfer,
|
||||||
net_in_transfer,
|
net_in_transfer,
|
||||||
last_active_time_string,
|
last_active_time_string,
|
||||||
|
boot_time_string,
|
||||||
} = formatNezhaInfo(serverData)
|
} = formatNezhaInfo(serverData)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -251,6 +252,14 @@ export default function ServerDetailClient({
|
|||||||
</Card>
|
</Card>
|
||||||
</section>
|
</section>
|
||||||
<section className="mt-1 flex flex-wrap gap-2">
|
<section className="mt-1 flex flex-wrap gap-2">
|
||||||
|
<Card className="rounded-[10px] border-none bg-transparent shadow-none">
|
||||||
|
<CardContent className="px-1.5 py-1">
|
||||||
|
<section className="flex flex-col items-start gap-0.5">
|
||||||
|
<p className="text-muted-foreground text-xs">{t("BootTime")}</p>
|
||||||
|
<div className="text-xs">{boot_time_string ? boot_time_string : "N/A"}</div>
|
||||||
|
</section>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
<Card className="rounded-[10px] border-none bg-transparent shadow-none">
|
<Card className="rounded-[10px] border-none bg-transparent shadow-none">
|
||||||
<CardContent className="px-1.5 py-1">
|
<CardContent className="px-1.5 py-1">
|
||||||
<section className="flex flex-col items-start gap-0.5">
|
<section className="flex flex-col items-start gap-0.5">
|
||||||
|
@ -16,6 +16,10 @@ export function formatNezhaInfo(serverInfo: NezhaAPISafe) {
|
|||||||
last_active_time_string: serverInfo.last_active
|
last_active_time_string: serverInfo.last_active
|
||||||
? new Date(serverInfo.last_active * 1000).toLocaleString()
|
? new Date(serverInfo.last_active * 1000).toLocaleString()
|
||||||
: "",
|
: "",
|
||||||
|
boot_time: serverInfo.host.BootTime,
|
||||||
|
boot_time_string: serverInfo.host.BootTime
|
||||||
|
? new Date(serverInfo.host.BootTime * 1000).toLocaleString()
|
||||||
|
: "",
|
||||||
online: serverInfo.online_status,
|
online: serverInfo.online_status,
|
||||||
uptime: serverInfo.status.Uptime || 0,
|
uptime: serverInfo.status.Uptime || 0,
|
||||||
version: serverInfo.host.Version || null,
|
version: serverInfo.host.Version || null,
|
||||||
|
@ -86,7 +86,8 @@
|
|||||||
"Upload": "Upload",
|
"Upload": "Upload",
|
||||||
"Download": "Download",
|
"Download": "Download",
|
||||||
"Load": "Load",
|
"Load": "Load",
|
||||||
"LastActive": "Last Active"
|
"LastActive": "Last Active",
|
||||||
|
"BootTime": "Boot Time"
|
||||||
},
|
},
|
||||||
"ServerDetailChartClient": {
|
"ServerDetailChartClient": {
|
||||||
"chart_fetch_error_message": "Please check your environment variables and review the server console",
|
"chart_fetch_error_message": "Please check your environment variables and review the server console",
|
||||||
|
@ -86,7 +86,8 @@
|
|||||||
"Load": "負荷",
|
"Load": "負荷",
|
||||||
"Upload": "Upload",
|
"Upload": "Upload",
|
||||||
"Download": "Download",
|
"Download": "Download",
|
||||||
"LastActive": "Last Active"
|
"LastActive": "Last Active",
|
||||||
|
"BootTime": "Boot Time"
|
||||||
},
|
},
|
||||||
"ServerDetailChartClient": {
|
"ServerDetailChartClient": {
|
||||||
"chart_fetch_error_message": "環境変数を確認し、サーバーコンソールを確認してください",
|
"chart_fetch_error_message": "環境変数を確認し、サーバーコンソールを確認してください",
|
||||||
|
@ -86,7 +86,8 @@
|
|||||||
"Upload": "上傳",
|
"Upload": "上傳",
|
||||||
"Download": "下載",
|
"Download": "下載",
|
||||||
"Load": "負載",
|
"Load": "負載",
|
||||||
"LastActive": "最後上報時間"
|
"LastActive": "最後上報時間",
|
||||||
|
"BootTime": "啟動時間"
|
||||||
},
|
},
|
||||||
"ServerDetailChartClient": {
|
"ServerDetailChartClient": {
|
||||||
"chart_fetch_error_message": "獲取伺服器詳情失敗,請檢查您的環境變數並檢查伺服器控制台",
|
"chart_fetch_error_message": "獲取伺服器詳情失敗,請檢查您的環境變數並檢查伺服器控制台",
|
||||||
|
@ -86,7 +86,8 @@
|
|||||||
"Upload": "上传",
|
"Upload": "上传",
|
||||||
"Download": "下载",
|
"Download": "下载",
|
||||||
"Load": "负载",
|
"Load": "负载",
|
||||||
"LastActive": "最后上报时间"
|
"LastActive": "最后上报时间",
|
||||||
|
"BootTime": "启动时间"
|
||||||
},
|
},
|
||||||
"ServerDetailChartClient": {
|
"ServerDetailChartClient": {
|
||||||
"chart_fetch_error_message": "获取服务器详情失败,请检查您的环境变量并检查服务器控制台",
|
"chart_fetch_error_message": "获取服务器详情失败,请检查您的环境变量并检查服务器控制台",
|
||||||
|
Loading…
Reference in New Issue
Block a user