Files
flutter_server_box/lib/l10n/app_zh_tw.arb
lollipopkit🏳️‍⚧️ 3a615449e3 feat: Windows compatibility (#836)
* feat: win compatibility

* fix

* fix: uptime parse

* opt.: linux uptime accuracy

* fix: windows temperature fetching

* opt.

* opt.: powershell exec

* refactor: address PR review feedback and improve code quality

### Major Improvements:
- **Refactored Windows status parsing**: Broke down large `_getWindowsStatus` method into 13 smaller, focused helper methods for better maintainability and readability
- **Extracted system detection logic**: Created dedicated `SystemDetector` helper class to separate OS detection concerns from ServerProvider
- **Improved concurrency handling**: Implemented proper synchronization for server updates using Future-based locks to prevent race conditions

### Bug Fixes:
- **Fixed CPU percentage parsing**: Removed incorrect '*100' multiplication in BSD CPU parsing (values were already percentages)
- **Enhanced memory parsing**: Added validation and error handling to BSD memory fallback parsing with proper logging
- **Improved uptime parsing**: Added support for multiple Windows date formats and robust error handling with validation
- **Fixed division by zero**: Added safety checks in Swap.usedPercent getter

### Code Quality Enhancements:
- **Added comprehensive documentation**: Documented Windows CPU counter limitations and approach
- **Strengthened error handling**: Added detailed logging and validation throughout parsing methods
- **Improved robustness**: Enhanced BSD CPU parsing with percentage validation and warnings
- **Better separation of concerns**: Each parsing method now has single responsibility

### Files Changed:
- `lib/data/helper/system_detector.dart` (new): System detection helper
- `lib/data/model/server/cpu.dart`: Fixed percentage parsing and added validation
- `lib/data/model/server/memory.dart`: Enhanced fallback parsing and division-by-zero protection
- `lib/data/model/server/server_status_update_req.dart`: Refactored into 13 focused parsing methods
- `lib/data/provider/server.dart`: Improved synchronization and extracted system detection

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor: parse & shell fn struct

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-08-08 16:56:36 +08:00

240 lines
12 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"@@locale": "zh_TW",
"aboutThanks": "感謝以下參與的各位。",
"acceptBeta": "接受測試版更新推送",
"addSystemPrivateKeyTip": "偵測到尚無私鑰,是否要加入系統預設的私鑰(~/.ssh/id_rsa",
"added2List": "已新增至任務清單",
"addr": "位址",
"alreadyLastDir": "已是頂層目錄",
"authFailTip": "認證失敗,請檢查連線資訊是否正確",
"autoBackupConflict": "僅能啟用一項自動備份任務",
"autoConnect": "自動連線",
"autoRun": "自動執行",
"autoUpdateHomeWidget": "自動更新桌面小工具",
"backupTip": "匯出的資料可透過密碼加密,請妥善保管。",
"backupVersionNotMatch": "備份版本不相容,無法還原",
"backupPassword": "備份密碼",
"backupPasswordTip": "設定密碼來加密備份檔案。留空則停用加密。",
"backupPasswordWrong": "備份密碼錯誤",
"backupEncrypted": "備份已加密",
"backupNotEncrypted": "備份未加密",
"backupPasswordSet": "備份密碼已設定",
"backupPasswordRemoved": "備份密碼已移除",
"battery": "電池",
"bgRun": "背景執行",
"bgRunTip": "此開關僅代表程式會嘗試於背景執行,能否成功取決於系統權限。在原生 Android 上,請關閉本應用的「電池最佳化」;在 MIUI / HyperOS 上,請將省電策略調整為「無限制」。",
"closeAfterSave": "儲存後關閉",
"cmd": "指令",
"collapseUITip": "是否預設折疊 UI 中存在的長列表",
"conn": "連線",
"container": "容器",
"containerTrySudoTip": "例如App 內設定使用者為 aaa但是 Docker 安裝在 root 使用者,這時就需要開啟此選項",
"convert": "轉換",
"copyPath": "複製路徑",
"cpuViewAsProgressTip": "以進度條樣式顯示每個CPU的使用率舊版樣式",
"cursorType": "游標類型",
"customCmd": "自訂指令",
"customCmdDocUrl": "https://github.com/lollipopkit/flutter_server_box/wiki/主页#自定义指令",
"customCmdHint": "\"指令名稱\": \"指令\"",
"decode": "解碼",
"decompress": "解壓縮",
"deleteServers": "大量刪除伺服器",
"desktopTerminalTip": "啟動 SSH 連線時用於打開終端機模擬器的指令。",
"dirEmpty": "請確保目錄為空",
"disconnected": "已中斷連線",
"disk": "磁碟",
"diskHealth": "磁碟健康",
"diskIgnorePath": "忽略的磁碟路徑",
"displayCpuIndex": "顯示 CPU 索引",
"dl2Local": "下載 {fileName} 到本地?",
"dockerEmptyRunningItems": "沒有正在執行的容器。\n這可能是因為\n- Docker 安裝使用者與 App 內配置的使用者名稱不同\n- 環境變數 DOCKER_HOST 沒有被正確讀取。你可以通過在終端機內執行 `echo $DOCKER_HOST` 來獲取。",
"dockerImagesFmt": "{count} 個映像檔",
"dockerNotInstalled": "未安裝 Docker",
"dockerStatusRunningAndStoppedFmt": "{runningCount} 個正在執行, {stoppedCount} 個已停止",
"dockerStatusRunningFmt": "{count} 個容器正在執行",
"doubleColumnMode": "雙列模式",
"doubleColumnTip": "此選項僅用於啟用此功能,是否生效取決於裝置寬度",
"editVirtKeys": "編輯虛擬按鍵",
"editor": "編輯器",
"editorHighlightTip": "程式碼高亮功能可能影響效能,可選擇性關閉。",
"emulator": "模擬器",
"encode": "編碼",
"envVars": "環境變數",
"experimentalFeature": "實驗性功能",
"extraArgs": "額外參數",
"fallbackSshDest": "備選 SSH 目標",
"fdroidReleaseTip": "如果你是從 F-Droid 下載的本App推薦關閉此選項",
"fgService": "前台服務",
"fgServiceTip": "開啟後,可能會導致部分機型閃退。關閉可能導致部分機型無法背景保持 SSH 連線。請在系統設定內允許 ServerBox 通知權限、背景執行、自我喚醒。",
"fileTooLarge": "檔案 '{file}' 過大 '{size}',超過了 {sizeMax}",
"followSystem": "跟隨系統",
"font": "字型",
"fontSize": "字型大小",
"force": "強制",
"fullScreen": "全螢幕模式",
"fullScreenJitter": "全螢幕模式抖動",
"fullScreenJitterHelp": "防止螢幕烙印",
"fullScreenTip": "當設備旋轉為橫向時,是否開啟全螢幕模式?此選項僅適用於伺服器分頁。",
"goBackQ": "返回?",
"goto": "前往",
"hideTitleBar": "隱藏標題欄",
"highlight": "程式碼標記",
"homeWidgetUrlConfig": "桌面小工具連結配置",
"host": "主機",
"httpFailedWithCode": "請求失敗,狀態碼:{code}",
"ignoreCert": "忽略憑證",
"image": "映像檔",
"imagesList": "映像檔列表",
"init": "初始化",
"inner": "內建",
"install": "安裝",
"installDockerWithUrl": "請先前往 https://docs.docker.com/engine/install 安裝 Docker",
"invalid": "無效",
"jumpServer": "跳板伺服器",
"keepForeground": "請讓 App 保持在前景執行",
"keepStatusWhenErr": "保留上次的伺服器狀態",
"keepStatusWhenErrTip": "僅在執行腳本出錯時",
"keyAuth": "金鑰認證",
"letterCache": "輸入法字符快取",
"letterCacheTip": "建議關閉,但關閉後將無法輸入 CJK 等文字。",
"license": "憑證",
"location": "位置",
"loss": "逾時",
"madeWithLove": "用❤️製作 by {myGithub}",
"manual": "手動",
"max": "最大",
"maxRetryCount": "伺服器嘗試重連次數",
"maxRetryCountEqual0": "將無限次重試",
"min": "最小",
"mission": "任務",
"more": "更多",
"moveOutServerFuncBtnsHelp": "開啟:可以在伺服器 Tab 頁的每個卡片下方顯示。關閉:在伺服器詳情頁頂部顯示。",
"ms": "毫秒",
"needHomeDir": "如果你是群暉使用者,[看這裡](https://kb.synology.com/DSM/tutorial/user_enable_home_service)。其他系統使用者需搜尋如何建立家目錄home directory。",
"needRestart": "需要重開 App",
"net": "網路",
"netViewType": "網路檢視類型",
"newContainer": "新建容器",
"noLineChart": "不使用折線圖",
"noLineChartForCpu": "CPU 不使用折線圖",
"noPrivateKeyTip": "私鑰不存在,可能已被刪除/配置錯誤。",
"noPromptAgain": "不再提示",
"node": "節點",
"notAvailable": "不可用",
"onServerDetailPage": "在伺服器詳情頁",
"onlyOneLine": "僅顯示為一行(可捲動)",
"onlyWhenCoreBiggerThan8": "僅當核心數大於 8 時生效",
"openLastPath": "打開上次的路徑",
"openLastPathTip": "將為每台伺服器紀錄其最後存取路徑",
"parseContainerStatsTip": "Docker 解析消耗狀態較為緩慢",
"percentOfSize": "{size} 的 {percent}%",
"permission": "權限",
"pingAvg": "平均:",
"pingInputIP": "請輸入目標 IP 或域名",
"pingNoServer": "沒有伺服器可用於 Ping\n請在伺服器 Tab 新增伺服器後再試",
"pkg": "套件管理",
"plugInType": "插入類型",
"port": "埠",
"preferDiskAmount": "優先顯示硬碟容量",
"preview": "預覽",
"privateKey": "私鑰",
"process": "處理程序",
"prune": "修剪",
"pushToken": "消息推送 Token",
"pveIgnoreCertTip": "不建議啟用,請注意安全風險!如果您使用的是 PVE 的預設憑證,則需要啟用此選項。",
"pveLoginFailed": "登入失敗。無法使用伺服器設定中的使用者名稱或密碼透過 Linux PAM 方式認證。",
"pveVersionLow": "此功能目前處於測試階段,僅在 PVE 8+ 上進行過測試。請謹慎使用。",
"read": "讀取",
"reboot": "重開",
"rememberPwdInMem": "在記憶體中記住密碼",
"rememberPwdInMemTip": "用於容器、暫停等",
"rememberWindowSize": "記住視窗大小",
"remotePath": "遠端路徑",
"restart": "重開",
"result": "結果",
"rotateAngel": "旋轉角度",
"route": "路由",
"run": "執行",
"running": "運作中",
"sameIdServerExist": "已存在相同 ID 的伺服器",
"save": "儲存",
"saved": "已儲存",
"second": "秒",
"sensors": "感應器",
"sequence": "順序",
"server": "伺服器",
"serverDetailOrder": "詳情頁部件順序",
"serverFuncBtns": "伺服器功能按鈕",
"serverOrder": "伺服器順序",
"sftpDlPrepare": "準備連線至伺服器...",
"sftpEditorTip": "如果為空, 使用App內建的檔案編輯器。如果有值, 則使用遠端伺服器的編輯器, 例如 `vim`(建議根據 `EDITOR` 自動獲取)。",
"sftpRmrDirSummary": "在 SFTP 中使用 `rm -r` 來刪除檔案夾",
"sftpSSHConnected": "SFTP 已連線",
"sftpShowFoldersFirst": "資料夾顯示在前",
"showDistLogo": "顯示發行版 Logo",
"shutdown": "關機",
"size": "大小",
"snippet": "程式片段",
"softWrap": "軟換行",
"specifyDev": "指定裝置",
"specifyDevTip": "例如網路流量統計預設是所有裝置,你可以在這裡指定特定的裝置。",
"speed": "速度",
"spentTime": "耗時:{time}",
"sshTermHelp": "在終端機可捲動時,橫向拖動可以選中文字。點擊鍵盤按鈕可以開啟/關閉鍵盤。檔案圖示會打開目前路徑 SFTP。剪貼簿按鈕會在有選中文字時複製內容在未選中並且剪貼簿有內容時貼上內容到終端機。程式碼圖示會貼上程式碼片段到終端機並執行。",
"sshTip": "該功能目前處於測試階段。\n\n請在 {url} 回饋問題,或者加入我們開發。",
"sshVirtualKeyAutoOff": "虛擬按鍵自動切換",
"start": "開始",
"stat": "統計",
"stats": "統計",
"stop": "停止",
"stopped": "已停止",
"storage": "存儲",
"supportFmtArgs": "支援以下格式化參數:",
"suspend": "當機",
"suspendTip": "suspend 功能需要 root 權限及 systemd 支援。",
"switchTo": "切換到 {val}",
"sync": "同步",
"syncTip": "可能需要重新啟動,某些更改才能生效。",
"system": "系統",
"tag": "標籤",
"temperature": "溫度",
"termFontSizeTip": "此設定將影響終端機大小(寬度和高度)。您可以在終端機頁面縮放,來調整目前會話的字型大小。",
"terminal": "终端機",
"test": "測試",
"textScaler": "字型縮放",
"textScalerTip": "1.0 => 100%(原大小),僅作用於伺服器頁面部分字型,不建議修改。",
"theme": "主題",
"time": "時間",
"times": "次",
"total": "總共",
"traffic": "流量",
"trySudo": "嘗試使用 sudo",
"ttl": "TTL",
"unknown": "未知",
"unkownConvertMode": "未知轉換模式",
"update": "更新",
"updateIntervalEqual0": "設定為 0 將不自動刷新伺服器狀態,\n也無法計算 CPU 使用率。",
"updateServerStatusInterval": "伺服器狀態更新間隔",
"upload": "上傳",
"upsideDown": "上下交換",
"uptime": "運作時間",
"useCdn": "使用 CDN",
"useCdnTip": "非中國使用者建議使用 CDN是否使用",
"useNoPwd": "將使用無密碼",
"usePodmanByDefault": "預設使用 Podman",
"used": "已使用",
"view": "檢視",
"viewErr": "查看錯誤",
"virtKeyHelpClipboard": "如果終端機有選中字元,則復製選中字元至剪貼簿,否則貼上剪貼簿內容至終端機。",
"virtKeyHelpIME": "打開/關閉鍵盤",
"virtKeyHelpSFTP": "在 SFTP 中打開目前路徑。",
"waitConnection": "請等待連線建立",
"wakeLock": "保持喚醒",
"watchNotPaired": "沒有已配對的 Apple Watch",
"webdavSettingEmpty": "WebDav 設定項爲空",
"whenOpenApp": "當打開 App 時",
"wolTip": "設定 WOL 後,每次連線伺服器時將自動發送喚醒請求",
"write": "寫入",
"writeScriptFailTip": "寫入腳本失敗,可能是沒有權限/目錄不存在等。",
"writeScriptTip": "連線到伺服器後,將會在 `~/.config/server_box` \n | `/tmp/server_box` 中寫入一個腳本來監測系統狀態。你可以審查腳本內容。"
}