perf(home): reduce continuous homepage animations (#100)

* perf(home): remove continuous status and clock animations

* chore: auto-fix linting and formatting issues
This commit is contained in:
仓鼠 authored and GitHub committed 2026-10-22 11:56:43 +08:00
1 parent 2750d9858a
commit 2a250378fe
3 files changed
+181 -178

No files matched your search

+9 -4
View File
@@ -12,7 +12,6 @@ import { useWebSocketContext } from "@/hooks/use-websocket-context";
import { fetchLoginUser, fetchSetting } from "@/lib/nezha-api";
import { cn } from "@/lib/utils";
import AnimateCountClient from "./AnimatedCount";
import { LanguageSwitcher } from "./LanguageSwitcher";
import { Loader, LoadingSpinner } from "./loading/Loader";
import NumericText from "./NumericText";
@@ -358,12 +357,18 @@ function Overview() {
<p className="text-sm font-medium opacity-50">{t("whereTheTimeIs")}</p>
{mounted ? (
<div className="flex items-center font-medium text-sm">
<AnimateCountClient count={time.hh} minDigits={2} />
<span className="tabular-nums">
{String(time.hh).padStart(2, "0")}
</span>
<span className="mb-px font-medium text-sm opacity-50">:</span>
<AnimateCountClient count={time.mm} minDigits={2} />
<span className="tabular-nums">
{String(time.mm).padStart(2, "0")}
</span>
<span className="mb-px font-medium text-sm opacity-50">:</span>
<span className="font-medium text-sm">
<AnimateCountClient count={time.ss} minDigits={2} />
<span className="tabular-nums">
{String(time.ss).padStart(2, "0")}
</span>
</span>
</div>
) : (
-2
View File
@@ -91,7 +91,6 @@ export default function ServerOverview({
</p>
<div className="flex items-center gap-2">
<span className="relative flex h-2 w-2">
<span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-green-500 opacity-75"></span>
<span className="relative inline-flex h-2 w-2 rounded-full bg-green-500"></span>
</span>
<NumericText value={online} className="text-lg font-semibold" />
@@ -121,7 +120,6 @@ export default function ServerOverview({
</p>
<div className="flex items-center gap-2">
<span className="relative flex h-2 w-2">
<span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-red-500 opacity-75"></span>
<span className="relative inline-flex h-2 w-2 rounded-full bg-red-500"></span>
</span>
<NumericText value={offline} className="text-lg font-semibold" />
+172 -172
View File
@@ -1,174 +1,174 @@
{
"nezha": "哪吒監控",
"overview": "概覽",
"dashboard": "管理後台",
"login": "登入",
"online": "線上",
"offline": "離線",
"whereTheTimeIs": "目前時間",
"refreshing": "重新整理中",
"info": {
"websocketConnecting": "WebSocket 連線中",
"websocketConnected": "WebSocket 連線成功",
"websocketDisconnected": "WebSocket 連線中斷",
"processing": "處理中...",
"noServers": "暫無伺服器",
"noMatchingServers": "沒有符合目前篩選條件的伺服器"
},
"serverOverview": {
"totalServers": "總伺服器",
"onlineServers": "線上伺服器",
"offlineServers": "離線伺服器",
"totalBandwidth": "總頻寬",
"speed": "速率",
"network": "網路"
},
"map": {
"Distributions": "伺服器分布在",
"Regions": "個區域",
"Servers": "個伺服器"
},
"serverCard": {
"mem": "記憶體",
"stg": "儲存空間",
"days": "天",
"hours": "小時",
"upload": "上傳",
"download": "下載",
"system": "系統",
"uptime": "運作時間",
"totalUpload": "總上傳",
"totalDownload": "總下載"
},
"cycleTransfer": {
"used": "已使用",
"total": "總量",
"nextUpdate": "下次更新"
},
"serviceTracker": {
"noService": "無服務資料",
"uptime": "上線率",
"delay": "延遲",
"daysAgo": "天前",
"today": "今天",
"loading": "載入中..."
},
"serverDetail": {
"status": "狀態",
"online": "線上",
"days": "天",
"hours": "小時",
"offline": "離線",
"unknown": "未知",
"uptime": "運作時間",
"version": "版本",
"arch": "架構",
"mem": "記憶體",
"disk": "磁碟",
"region": "地區",
"system": "系統",
"upload": "上傳",
"download": "下載",
"lastActive": "最後回報時間",
"temperature": "溫度",
"bootTime": "啟動時間"
},
"serverDetailChart": {
"process": "程序數",
"disk": "磁碟",
"mem": "記憶體",
"swap": "虛擬記憶體",
"upload": "上傳",
"download": "下載",
"realtime": "即時",
"period1d": "1 天",
"period7d": "7 天",
"period30d": "30 天",
"tsdbRequired": "請啟用 TSDB 以使用歷史資料",
"loginRequired": "請先登入才能查看"
},
"footer": {
"themeBy": "主題-"
},
"language": {
"zh-CN": "简体中文",
"zh-TW": "繁體中文",
"en-US": "English",
"de-DE": "德文",
"es-ES": "西班牙文",
"ru-RU": "俄文",
"ta-IN": "தமிழ்"
},
"theme": {
"light": "亮色",
"dark": "暗色",
"system": "跟隨系統"
},
"error": {
"pageNotFound": "頁面不存在",
"backToHome": "回到首頁",
"backendUnavailableTitle": "後端 API 無法存取",
"backendUnavailableDescription": "頁面仍會正常顯示,但暫時無法載入監控資料。"
},
"tabSwitch": {
"detail": "詳細資訊",
"network": "網路",
"Detail": "詳細資訊",
"Network": "網路"
},
"monitor": {
"noData": "沒有伺服器監控資料,請先新增服務監控",
"status": "狀態",
"avgDelay": "延遲",
"monitorCount": "個監控",
"packetLoss": "封包遺失率",
"clearSelections": "清除",
"peakCut": "削峰",
"period1d": "1 天",
"period7d": "7 天",
"period30d": "30 天",
"loginRequired": "請先登入才能查看"
},
"billingInfo": {
"remaining": "剩餘天數",
"error": "取得失敗",
"indefinite": "無限期",
"expired": "已過期",
"days": "天",
"price": "價格",
"free": "免費",
"usage-baseed": "按量計費"
},
"TypeCommand": "輸入命令或搜尋",
"NoResults": "沒有結果",
"Servers": "伺服器",
"Shortcuts": "快捷鍵",
"ToggleLightMode": "切換亮色模式",
"ToggleDarkMode": "切換暗色模式",
"ToggleSystemMode": "切換系統模式",
"Home": "首頁",
"pwa": {
"offlineReady": "可離線使用之應用程式",
"newContent": "有新內容可用",
"reload": "更新"
},
"sort": {
"label": "排序",
"types": {
"default": "預設",
"name": "名稱",
"uptime": "運作時間",
"system": "系統",
"cpu": "CPU",
"mem": "記憶體",
"disk": "磁碟",
"up": "上傳",
"down": "下載",
"up_total": "上傳總量",
"down_total": "下載總量"
}
},
"group": {
"all": "全部"
}
"nezha": "哪吒監控",
"overview": "概覽",
"dashboard": "管理後台",
"login": "登入",
"online": "線上",
"offline": "離線",
"whereTheTimeIs": "目前時間",
"refreshing": "重新整理中",
"info": {
"websocketConnecting": "WebSocket 連線中",
"websocketConnected": "WebSocket 連線成功",
"websocketDisconnected": "WebSocket 連線中斷",
"processing": "處理中...",
"noServers": "暫無伺服器",
"noMatchingServers": "沒有符合目前篩選條件的伺服器"
},
"serverOverview": {
"totalServers": "總伺服器",
"onlineServers": "線上伺服器",
"offlineServers": "離線伺服器",
"totalBandwidth": "總頻寬",
"speed": "速率",
"network": "網路"
},
"map": {
"Distributions": "伺服器分布在",
"Regions": "個區域",
"Servers": "個伺服器"
},
"serverCard": {
"mem": "記憶體",
"stg": "儲存空間",
"days": "天",
"hours": "小時",
"upload": "上傳",
"download": "下載",
"system": "系統",
"uptime": "運作時間",
"totalUpload": "總上傳",
"totalDownload": "總下載"
},
"cycleTransfer": {
"used": "已使用",
"total": "總量",
"nextUpdate": "下次更新"
},
"serviceTracker": {
"noService": "無服務資料",
"uptime": "上線率",
"delay": "延遲",
"daysAgo": "天前",
"today": "今天",
"loading": "載入中..."
},
"serverDetail": {
"status": "狀態",
"online": "線上",
"days": "天",
"hours": "小時",
"offline": "離線",
"unknown": "未知",
"uptime": "運作時間",
"version": "版本",
"arch": "架構",
"mem": "記憶體",
"disk": "磁碟",
"region": "地區",
"system": "系統",
"upload": "上傳",
"download": "下載",
"lastActive": "最後回報時間",
"temperature": "溫度",
"bootTime": "啟動時間"
},
"serverDetailChart": {
"process": "程序數",
"disk": "磁碟",
"mem": "記憶體",
"swap": "虛擬記憶體",
"upload": "上傳",
"download": "下載",
"realtime": "即時",
"period1d": "1 天",
"period7d": "7 天",
"period30d": "30 天",
"tsdbRequired": "請啟用 TSDB 以使用歷史資料",
"loginRequired": "請先登入才能查看"
},
"footer": {
"themeBy": "主題-"
},
"language": {
"zh-CN": "简体中文",
"zh-TW": "繁體中文",
"en-US": "English",
"de-DE": "德文",
"es-ES": "西班牙文",
"ru-RU": "俄文",
"ta-IN": "தமிழ்"
},
"theme": {
"light": "亮色",
"dark": "暗色",
"system": "跟隨系統"
},
"error": {
"pageNotFound": "頁面不存在",
"backToHome": "回到首頁",
"backendUnavailableTitle": "後端 API 無法存取",
"backendUnavailableDescription": "頁面仍會正常顯示,但暫時無法載入監控資料。"
},
"tabSwitch": {
"detail": "詳細資訊",
"network": "網路",
"Detail": "詳細資訊",
"Network": "網路"
},
"monitor": {
"noData": "沒有伺服器監控資料,請先新增服務監控",
"status": "狀態",
"avgDelay": "延遲",
"monitorCount": "個監控",
"packetLoss": "封包遺失率",
"clearSelections": "清除",
"peakCut": "削峰",
"period1d": "1 天",
"period7d": "7 天",
"period30d": "30 天",
"loginRequired": "請先登入才能查看"
},
"billingInfo": {
"remaining": "剩餘天數",
"error": "取得失敗",
"indefinite": "無限期",
"expired": "已過期",
"days": "天",
"price": "價格",
"free": "免費",
"usage-baseed": "按量計費"
},
"TypeCommand": "輸入命令或搜尋",
"NoResults": "沒有結果",
"Servers": "伺服器",
"Shortcuts": "快捷鍵",
"ToggleLightMode": "切換亮色模式",
"ToggleDarkMode": "切換暗色模式",
"ToggleSystemMode": "切換系統模式",
"Home": "首頁",
"pwa": {
"offlineReady": "可離線使用之應用程式",
"newContent": "有新內容可用",
"reload": "更新"
},
"sort": {
"label": "排序",
"types": {
"default": "預設",
"name": "名稱",
"uptime": "運作時間",
"system": "系統",
"cpu": "CPU",
"mem": "記憶體",
"disk": "磁碟",
"up": "上傳",
"down": "下載",
"up_total": "上傳總量",
"down_total": "下載總量"
}
},
"group": {
"all": "全部"
}
}