mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-08-01 04:02:02 +08:00
fix(providers): only block explicit official providers under proxy takeover
The proxy-takeover block previously fell back to the isOfficial heuristic (empty base_url / missing key) when category was absent. That misjudged custom providers whose endpoint lives in meta or whose fields are simply unfilled: their switch button got disabled, making users think the config was broken. That extra UI block was also "virtual" — the executor in useProviderActions only ever honored category === "official", so the front end blocked more than the backend would enforce. Gate the block solely on explicit category === "official", matching the executor and unifying both verdicts on a single source of truth. Also rework the blocked-state UI: - drop the red "blocked" badge for a plain disabled Enable button - move title/cursor onto a wrapper span (disabled buttons set pointer-events:none, so an on-button title/cursor never fired) - replace the account-ban warning tooltip with a lighter hint (provider.blockedByProxyHint), four locales kept in sync
This commit is contained in:
@@ -109,7 +109,7 @@
|
||||
"currentlyUsing": "Currently Using",
|
||||
"enable": "Enable",
|
||||
"inUse": "In Use",
|
||||
"blockedByProxy": "Blocked",
|
||||
"blockedByProxyHint": "Can't switch to an official provider while proxy takeover is active",
|
||||
"editProvider": "Edit Provider",
|
||||
"editProviderHint": "Configuration will be applied to the current provider immediately after update.",
|
||||
"deleteProvider": "Delete Provider",
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
"currentlyUsing": "現在使用中",
|
||||
"enable": "有効化",
|
||||
"inUse": "使用中",
|
||||
"blockedByProxy": "ブロック",
|
||||
"blockedByProxyHint": "プロキシ引き継ぎモードでは公式プロバイダーに切り替えできません",
|
||||
"editProvider": "プロバイダーを編集",
|
||||
"editProviderHint": "保存すると現在のプロバイダーにすぐ反映されます。",
|
||||
"deleteProvider": "プロバイダーを削除",
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
"currentlyUsing": "目前使用",
|
||||
"enable": "啟用",
|
||||
"inUse": "使用中",
|
||||
"blockedByProxy": "已攔截",
|
||||
"blockedByProxyHint": "代理接管模式下無法切換至官方供應商",
|
||||
"editProvider": "編輯供應商",
|
||||
"editProviderHint": "更新設定後將立即套用至目前供應商。",
|
||||
"deleteProvider": "刪除供應商",
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
"currentlyUsing": "当前使用",
|
||||
"enable": "启用",
|
||||
"inUse": "使用中",
|
||||
"blockedByProxy": "已拦截",
|
||||
"blockedByProxyHint": "代理接管模式下不可切换到官方供应商",
|
||||
"editProvider": "编辑供应商",
|
||||
"editProviderHint": "更新配置后将立即应用到当前供应商。",
|
||||
"deleteProvider": "删除供应商",
|
||||
|
||||
Reference in New Issue
Block a user