mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-08 02:52:07 +08:00
* feat(contract): export wire contract from backend and generate frontend types Adds a zero-dependency `frontend-contract` bin that serializes the real NoticeStatus variants and FrontendEvent payloads, scripts/gen-contract.mjs which emits the committed src/services/contract.ts, and a CI job that regenerates it and fails on a non-empty diff. events.ts now derives its event map from the generated contract instead of hand-typed shapes. * feat(events): route all backend events through a single event bus and store Adds src/services/bus (the only listen/emit site: one handler per contract event plus the frontend-internal test-all event) and the React context/reducer app store. Migrates the five scattered subscriptions (layout events, pending failures, proxy refresh, profile update/timer, test-all), deletes the old glue (events.ts, use-listen, use-layout-events, LoadingCacheProvider), moves run state into the store, and adds an architecture gate script wired into CI. Behavior is unchanged; the run-state query's poll/focus safety net is preserved by the store provider. * refactor(notice): make the notice table exhaustive and drop dead wire entries D5 cleanup, frontend and backend in one commit: removes the six config_validate::* statuses that never receive a backend send and the set_config::ok send (enum variants, golden list 41→34, send point in restart_clash_core), their frontend handlers, and the five i18n keys only those handlers used. The notice table is now typed as a Record over the generated NoticeStatus union, so a status without a frontend entry fails to compile. The info status (sent by the silent updater for breaking change notices, previously dropped with a console warning) now shows an info toast — the one deliberate behavior delta. * feat(mutate): single funnel for user-intent commands and invoke gate Adds src/services/mutate.ts: one path for optimistic apply, services-layer invoke, Busy handling, failure rollback, and the error toast, with busy bookkeeping mirrored into the app store. The patch hooks (verge, clash, profiles) now route through it. Moves the remaining direct invokes (unlock ×3, DNS ×4) into cmds.ts and turns on the invoke-only-in-services architecture gate in CI. * refactor(settings): route settings-domain commands through the mutate funnel Ports port saving, webdav/local backup operations, core change/restart/ upgrade, service install/uninstall/repair flows, the system-proxy toggle queue, the DNS override toggle, and app lifecycle commands onto the single funnel. Bespoke flows keep their own error handling via errorNotice:false; simple flows gain the funnel's default error toast and revalidation. * refactor(profiles): route profile operations through the mutate funnel Ports profile create/import/reorder/delete/update/patch/save-file and enhance calls onto the funnel; retry and editor flows keep their own error handling with errorNotice:false. Per-uid ids keep the update worker pool concurrent under the funnel's in-flight dedupe. * refactor(proxies): route proxy/home/misc commands through the mutate funnel Ports mode switching (page and home card), chain runtime updates, node selection with tray sync, selection recording, provider updates and syncs, and lightweight-mode entry onto the funnel; every site keeps its existing optimistic/revert and error-handling behavior. * docs: add frontend architecture guardrails for src Layering rules for the contract flow: generated contract as the only wire-typing source, event bus as the only listen/emit site, pure-reducer store for event-derived state, the mutate funnel for user intent, and invoke only in the services layer — each backed by the CI gates. * fix(events): close run-state race and restore single error toasts Self-review findings: the bus now re-reads the run-state snapshot in onSubscribed so an event racing the store's initial read cannot leave a stale snapshot (the ordering the old layout listener guaranteed), and the patch hooks pass errorNotice:false so GuardState/page handlers remain the only error toast, matching the pre-migration behavior. * fix(frontend): preserve queued intents and fresh runtime snapshots * refactor(frontend): trim unused mutation and busy state APIs * docs(frontend): focus guardrails on architecture ownership
140 lines
4.1 KiB
JSON
140 lines
4.1 KiB
JSON
{
|
|
"actions": {
|
|
"cancel": "取消",
|
|
"close": "關閉",
|
|
"confirm": "確認",
|
|
"save": "儲存",
|
|
"delete": "刪除",
|
|
"edit": "編輯",
|
|
"new": "新增",
|
|
"enable": "啟用",
|
|
"upgrade": "升級內核",
|
|
"restart": "重啟內核",
|
|
"resetToDefault": "重設為預設值",
|
|
"refresh": "重整",
|
|
"retry": "重試",
|
|
"refreshPage": "重新整理頁面",
|
|
"showDetails": "顯示詳情",
|
|
"hideDetails": "隱藏詳情",
|
|
"listView": "列表檢視",
|
|
"tableView": "表格檢視",
|
|
"pause": "暫停",
|
|
"resume": "繼續",
|
|
"closeAll": "關閉全部",
|
|
"clear": "清除",
|
|
"previous": "上一頁",
|
|
"next": "下一頁",
|
|
"check": "檢測"
|
|
},
|
|
"labels": {
|
|
"updateAt": "更新於",
|
|
"timeout": "逾時",
|
|
"icon": "圖示",
|
|
"name": "名稱",
|
|
"readOnly": "唯讀",
|
|
"expireTime": "到期時間",
|
|
"updateTime": "更新時間",
|
|
"usedTotal": "已使用 / 總量",
|
|
"from": "來自",
|
|
"password": "密碼",
|
|
"retryAttempts": "重試次數",
|
|
"downloaded": "下載量",
|
|
"uploaded": "上傳量"
|
|
},
|
|
"statuses": {
|
|
"enabled": "已啟用",
|
|
"disabled": "已停用",
|
|
"saving": "儲存中...",
|
|
"empty": "空空如也",
|
|
"loading": "載入中..."
|
|
},
|
|
"units": {
|
|
"milliseconds": "毫秒",
|
|
"seconds": "秒",
|
|
"minutes": "分鐘",
|
|
"hours": "小時",
|
|
"kilobytes": "KB",
|
|
"files": "檔案"
|
|
},
|
|
"placeholders": {
|
|
"resetInput": "清空輸入框",
|
|
"filter": "篩選條件",
|
|
"matchCase": "區分大小寫",
|
|
"matchWholeWord": "完整字詞配對",
|
|
"useRegex": "使用正規表示式"
|
|
},
|
|
"validation": {
|
|
"invalidRegex": "無效的正規表示式"
|
|
},
|
|
"window": {
|
|
"maximize": "最大化",
|
|
"minimize": "最小化"
|
|
},
|
|
"editorModes": {
|
|
"visualization": "視覺化",
|
|
"advanced": "進階"
|
|
},
|
|
"feedback": {
|
|
"errors": {
|
|
"unexpected": "發生了一些問題",
|
|
"label": "錯誤",
|
|
"unknown": "未知錯誤",
|
|
"details": "錯誤詳情",
|
|
"stack": "錯誤堆疊",
|
|
"componentStack": "元件堆疊",
|
|
"trafficUnavailable": "流量資料暫時無法使用",
|
|
"operationFailed": "操作失敗",
|
|
"trafficStats": "流量統計錯誤",
|
|
"trafficStatsDescription": "流量統計元件發生錯誤,已停用以避免當機。"
|
|
},
|
|
"notices": {
|
|
"raw": "{{message}}",
|
|
"prefixedRaw": "{{prefix}} {{message}}"
|
|
},
|
|
"notifications": {
|
|
"importSuccess": "匯入設定檔成功",
|
|
"importSubscriptionSuccess": "匯入訂閱成功",
|
|
"importWithClashProxy": "使用 Clash 代理匯入訂閱成功",
|
|
"updateAvailable": "有可用更新",
|
|
"saved": "儲存成功",
|
|
"common": {
|
|
"copySuccess": "複製成功",
|
|
"saveSuccess": "設定儲存完成",
|
|
"saveFailed": "設定儲存失敗",
|
|
"refreshFailed": "重整失敗"
|
|
}
|
|
},
|
|
"validation": {
|
|
"config": {
|
|
"failed": "訂閱配置校驗失敗,請檢查訂閱配置文件,變更已撤銷,錯誤詳情:",
|
|
"bootFailed": "啟動訂閱配置校驗失敗,已使用預設配置啟動;請檢查訂閱配置文件,錯誤詳情:",
|
|
"processTerminated": "驗證程序被終止,請檢查是否有安全軟體阻止了內核執行,或電腦的 CPU/執行環境是否支援該內核程式。"
|
|
},
|
|
"script": {
|
|
"syntaxError": "指令碼語法錯誤,變更已撤銷",
|
|
"missingMain": "指令碼錯誤,變更已撤銷",
|
|
"fileNotFound": "檔案遺失,變更已撤銷",
|
|
"fileError": "指令碼檔案錯誤,變更已撤銷"
|
|
},
|
|
"yaml": {
|
|
"syntaxError": "YAML 語法錯誤,變更已撤銷",
|
|
"readError": "YAML 讀取錯誤,變更已撤銷",
|
|
"mappingError": "YAML 映射錯誤,變更已撤銷"
|
|
},
|
|
"merge": {
|
|
"syntaxError": "覆寫檔案語法錯誤,變更已撤銷",
|
|
"mappingError": "覆寫檔案映射錯誤,變更已撤銷"
|
|
}
|
|
}
|
|
},
|
|
"filters": {
|
|
"logLevels": {
|
|
"all": "ALL",
|
|
"debug": "DEBUG",
|
|
"info": "INFO",
|
|
"warn": "WARN",
|
|
"error": "ERROR"
|
|
}
|
|
}
|
|
}
|