mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-25 13:45:03 +08:00
fix: align OpenClaw tool permission profiles with upstream schema (#1355)
* fix: align OpenClaw tool permission profiles with upstream schema * fix: remove dead i18n keys and save-blocking validation - Remove unused `profiles.*` nested i18n keys (dead code, ToolsPanel uses flat `profileMinimal` etc.) - Remove `invalidProfile` i18n key no longer referenced - Remove handleSave validation that blocked saving allow/deny when legacy profile exists - Keep the profile destructuring cleanup from the original PR --------- Co-authored-by: Your Name <your.email@example.com> Co-authored-by: Jason <farion1231@gmail.com>
This commit is contained in:
@@ -77,10 +77,10 @@ const ToolsPanel: React.FC = () => {
|
|||||||
|
|
||||||
const handleSave = async () => {
|
const handleSave = async () => {
|
||||||
try {
|
try {
|
||||||
const { allow, deny, ...other } = config;
|
const { profile, allow, deny, ...other } = config;
|
||||||
const newConfig: OpenClawToolsConfig = {
|
const newConfig: OpenClawToolsConfig = {
|
||||||
...other,
|
...other,
|
||||||
profile: config.profile,
|
profile,
|
||||||
allow: allowList.map((item) => item.value).filter((s) => s.trim()),
|
allow: allowList.map((item) => item.value).filter((s) => s.trim()),
|
||||||
deny: denyList.map((item) => item.value).filter((s) => s.trim()),
|
deny: denyList.map((item) => item.value).filter((s) => s.trim()),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1373,12 +1373,6 @@
|
|||||||
"unsupportedProfileTitle": "Unsupported tools profile detected",
|
"unsupportedProfileTitle": "Unsupported tools profile detected",
|
||||||
"unsupportedProfileDescription": "The current tools.profile value '{{value}}' is not in the supported OpenClaw list. It will be preserved until you choose a new value.",
|
"unsupportedProfileDescription": "The current tools.profile value '{{value}}' is not in the supported OpenClaw list. It will be preserved until you choose a new value.",
|
||||||
"unsupportedProfileLabel": "unsupported",
|
"unsupportedProfileLabel": "unsupported",
|
||||||
"profiles": {
|
|
||||||
"default": "Default",
|
|
||||||
"strict": "Strict",
|
|
||||||
"permissive": "Permissive",
|
|
||||||
"custom": "Custom"
|
|
||||||
},
|
|
||||||
"allowList": "Allow List",
|
"allowList": "Allow List",
|
||||||
"denyList": "Deny List",
|
"denyList": "Deny List",
|
||||||
"patternPlaceholder": "Tool name or pattern",
|
"patternPlaceholder": "Tool name or pattern",
|
||||||
|
|||||||
@@ -1373,12 +1373,6 @@
|
|||||||
"unsupportedProfileTitle": "未対応のツールプロファイルを検出しました",
|
"unsupportedProfileTitle": "未対応のツールプロファイルを検出しました",
|
||||||
"unsupportedProfileDescription": "現在の tools.profile の値 '{{value}}' は OpenClaw の対応リストにありません。新しい値を選択するまでこの値を保持します。",
|
"unsupportedProfileDescription": "現在の tools.profile の値 '{{value}}' は OpenClaw の対応リストにありません。新しい値を選択するまでこの値を保持します。",
|
||||||
"unsupportedProfileLabel": "未対応",
|
"unsupportedProfileLabel": "未対応",
|
||||||
"profiles": {
|
|
||||||
"default": "デフォルト",
|
|
||||||
"strict": "厳格",
|
|
||||||
"permissive": "寛容",
|
|
||||||
"custom": "カスタム"
|
|
||||||
},
|
|
||||||
"allowList": "許可リスト",
|
"allowList": "許可リスト",
|
||||||
"denyList": "拒否リスト",
|
"denyList": "拒否リスト",
|
||||||
"patternPlaceholder": "ツール名またはパターン",
|
"patternPlaceholder": "ツール名またはパターン",
|
||||||
|
|||||||
@@ -1373,12 +1373,6 @@
|
|||||||
"unsupportedProfileTitle": "检测到不受支持的工具配置",
|
"unsupportedProfileTitle": "检测到不受支持的工具配置",
|
||||||
"unsupportedProfileDescription": "当前 tools.profile 的值“{{value}}”不在 OpenClaw 支持列表内。在你手动选择新值之前,它会被保留。",
|
"unsupportedProfileDescription": "当前 tools.profile 的值“{{value}}”不在 OpenClaw 支持列表内。在你手动选择新值之前,它会被保留。",
|
||||||
"unsupportedProfileLabel": "不受支持",
|
"unsupportedProfileLabel": "不受支持",
|
||||||
"profiles": {
|
|
||||||
"default": "默认",
|
|
||||||
"strict": "严格",
|
|
||||||
"permissive": "宽松",
|
|
||||||
"custom": "自定义"
|
|
||||||
},
|
|
||||||
"allowList": "允许列表",
|
"allowList": "允许列表",
|
||||||
"denyList": "拒绝列表",
|
"denyList": "拒绝列表",
|
||||||
"patternPlaceholder": "工具名称或模式",
|
"patternPlaceholder": "工具名称或模式",
|
||||||
|
|||||||
Reference in New Issue
Block a user