Compare commits

...

3 Commits

Author SHA1 Message Date
仓鼠
b5ac8251d9
Merge pull request #256 from hamster1963/boot-time
feat: add boot time display to server details and update localization
2025-03-12 09:34:58 +08:00
hamster1963
0b7a5be3c0 chore: update dependencies to latest versions 2025-03-12 09:31:24 +08:00
hamster1963
0f435ee7c1 feat: add boot time display to server details and update localization 2025-03-12 09:30:01 +08:00
8 changed files with 31 additions and 14 deletions

View File

@ -83,6 +83,7 @@ export default function ServerDetailClient({
net_out_transfer,
net_in_transfer,
last_active_time_string,
boot_time_string,
} = formatNezhaInfo(serverData)
return (
@ -251,6 +252,14 @@ export default function ServerDetailClient({
</Card>
</section>
<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">
<CardContent className="px-1.5 py-1">
<section className="flex flex-col items-start gap-0.5">

BIN
bun.lockb

Binary file not shown.

View File

@ -16,6 +16,10 @@ export function formatNezhaInfo(serverInfo: NezhaAPISafe) {
last_active_time_string: serverInfo.last_active
? 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,
uptime: serverInfo.status.Uptime || 0,
version: serverInfo.host.Version || null,

View File

@ -86,7 +86,8 @@
"Upload": "Upload",
"Download": "Download",
"Load": "Load",
"LastActive": "Last Active"
"LastActive": "Last Active",
"BootTime": "Boot Time"
},
"ServerDetailChartClient": {
"chart_fetch_error_message": "Please check your environment variables and review the server console",

View File

@ -86,7 +86,8 @@
"Load": "負荷",
"Upload": "Upload",
"Download": "Download",
"LastActive": "Last Active"
"LastActive": "Last Active",
"BootTime": "Boot Time"
},
"ServerDetailChartClient": {
"chart_fetch_error_message": "環境変数を確認し、サーバーコンソールを確認してください",

View File

@ -86,7 +86,8 @@
"Upload": "上傳",
"Download": "下載",
"Load": "負載",
"LastActive": "最後上報時間"
"LastActive": "最後上報時間",
"BootTime": "啟動時間"
},
"ServerDetailChartClient": {
"chart_fetch_error_message": "獲取伺服器詳情失敗,請檢查您的環境變數並檢查伺服器控制台",

View File

@ -86,7 +86,8 @@
"Upload": "上传",
"Download": "下载",
"Load": "负载",
"LastActive": "最后上报时间"
"LastActive": "最后上报时间",
"BootTime": "启动时间"
},
"ServerDetailChartClient": {
"chart_fetch_error_message": "获取服务器详情失败,请检查您的环境变量并检查服务器控制台",

View File

@ -30,7 +30,7 @@
"@types/d3-geo": "^3.1.0",
"@types/luxon": "^3.4.2",
"babel-plugin-react-compiler": "^19.0.0-beta-e552027-20250112",
"caniuse-lite": "^1.0.30001701",
"caniuse-lite": "^1.0.30001703",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"cmdk": "^1.0.4",
@ -43,32 +43,32 @@
"lucide-react": "^0.474.0",
"luxon": "^3.5.0",
"maxmind": "^4.3.24",
"next": "^15.2.0",
"next": "^15.2.2",
"next-auth": "^5.0.0-beta.25",
"next-intl": "^3.26.5",
"next-runtime-env": "^3.2.2",
"next-themes": "^0.4.4",
"next-themes": "^0.4.6",
"react": "^19.0.0",
"react-device-detect": "^2.2.3",
"react-dom": "^19.0.0",
"react-intersection-observer": "^9.15.1",
"react-intersection-observer": "^9.16.0",
"react-wrap-balancer": "^1.1.1",
"recharts": "^2.15.1",
"sharp": "^0.33.5",
"swr": "^2.3.2",
"swr": "^2.3.3",
"tailwind-merge": "^2.6.0",
"tailwindcss-animate": "^1.0.7"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@next/bundle-analyzer": "^15.2.0",
"@tailwindcss/postcss": "^4.0.9",
"@types/node": "^22.13.5",
"@next/bundle-analyzer": "^15.2.2",
"@tailwindcss/postcss": "^4.0.13",
"@types/node": "^22.13.10",
"@types/react": "^19.0.10",
"@types/react-dom": "^19.0.4",
"postcss": "^8.5.3",
"tailwindcss": "^4.0.9",
"typescript": "^5.7.3",
"tailwindcss": "^4.0.13",
"typescript": "^5.8.2",
"vercel": "^39.4.2"
},
"overrides": {