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