JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.
Python
fix(web-frontend): Modified functions of the configuration panel
openJiuwen-bot23d3f352c84a
diff --git a/jiuwenswarm/channels/web/frontend/src/components/ConfigPanel/index.tsx b/jiuwenswarm/channels/web/frontend/src/components/ConfigPanel/index.tsxindex 28e8f98cc6..ae074cdec0 100644--- a/jiuwenswarm/channels/web/frontend/src/components/ConfigPanel/index.tsx+++ b/jiuwenswarm/channels/web/frontend/src/components/ConfigPanel/index.tsx@@ -1412,7 +1412,7 @@ function MultiAgentSection({onChange={(e) => handleModelSelect(idx, e.target.value)}className="flex-1 rounded border border-border bg-bg px-2 py-1 text-text text-xs">- <option value="">-- Select Model --</option>+ <option value="" disabled>-- Select Model --</option>{availableModels.map((m, mi) => {const sameNameModels = availableModels.filter((x) => x.model_name === m.model_name);const sameNameCount = sameNameModels.length;@@ -1516,7 +1516,7 @@ function MultiAgentSection({}}className="flex-1 rounded border border-border bg-bg px-2 py-1 text-text text-xs">- <option value="">-- Select Model --</option>+ <option value="" disabled>-- Select Model --</option>{availableModels.map((m, mi) => {const sameNameModels = availableModels.filter((x) => x.model_name === m.model_name);const sameNameCount = sameNameModels.length;@@ -2340,15 +2340,6 @@ export function ConfigPanel({}}, [agentNameChangeWarning]);- useEffect(() => {- if (modelReferenceLostWarning) {- const timer = setTimeout(() => {- setModelReferenceLostWarning(null);- }, 3000);- return () => clearTimeout(timer);- }- }, [modelReferenceLostWarning]);-const handleDeleteAgent = (idx: number, agentName: string, references: string[]) => {setDeleteAgentConfirm({ idx, agentName, references });};@@ -2716,6 +2707,8 @@ export function ConfigPanel({useEffect(() => {if (agentModelReferencesLost.length > 0) {setModelReferenceLostWarning({ agentNames: agentModelReferencesLost.map((r) => r.agentName) });+ } else {+ setModelReferenceLostWarning(null);}}, [agentModelReferencesLost]);@@ -2992,19 +2985,12 @@ export function ConfigPanel({) : null}{- !error && hasAgentsTeamsValidationError ? (+ !error && hasAgentsTeamsChanges && hasAgentsTeamsValidationError ? (<div className="mb-4 rounded-md border border-[var(--border-danger)] bg-danger-subtle px-3 py-2 text-sm text-danger">{t('config.agentsTeamsValidationError')}</div>) : null}- {- !error && agentModelReferencesLost.length > 0 ? (- <div className="mb-4 rounded-md border border-amber-500 bg-amber-50 dark:bg-amber-900/20 px-3 py-2 text-sm text-amber-700 dark:text-amber-300">- {t('config.model.referenceLostWarning')}: {agentModelReferencesLost.map((r) => r.agentName).join(', ')}- </div>- ) : null- }{!groups.length ? (<div className="text-sm text-text-muted flex-1 min-h-0">diff --git a/jiuwenswarm/channels/web/frontend/src/i18n/locales/en.json b/jiuwenswarm/channels/web/frontend/src/i18n/locales/en.jsonindex 4c191582bc..40273123fd 100644--- a/jiuwenswarm/channels/web/frontend/src/i18n/locales/en.json+++ b/jiuwenswarm/channels/web/frontend/src/i18n/locales/en.json@@ -592,7 +592,7 @@"deleteConfirmTitle": "Delete Model?","deleteConfirmMessage": "Are you sure you want to delete model \"{{modelName}}\"?","deleteConfirmMessageSimple": "Model \"{{modelName}}\" is referenced by {{count}} Agent(s). After deletion, related Agents will no longer be able to use this model.",- "referenceLostWarning": "Model Reference Lost Warning",+ "referenceLostWarning": "Model Reference Lost Warning, please reconfigure the Agent model","notSelected": "No model selected"},"agentList": {diff --git a/jiuwenswarm/channels/web/frontend/src/i18n/locales/zh.json b/jiuwenswarm/channels/web/frontend/src/i18n/locales/zh.jsonindex e5561d0b12..f034dd425c 100644--- a/jiuwenswarm/channels/web/frontend/src/i18n/locales/zh.json+++ b/jiuwenswarm/channels/web/frontend/src/i18n/locales/zh.json@@ -591,7 +591,7 @@"deleteConfirmTitle": "确认删除模型?","deleteConfirmMessage": "确定要删除模型 \"{{modelName}}\" 吗?","deleteConfirmMessageSimple": "模型 \"{{modelName}}\" 正在被 {{count}} 个 Agent 引用,删除后相关 Agent 将无法使用该模型。",- "referenceLostWarning": "Agent引用模型丢失警告",+ "referenceLostWarning": "Agent引用模型丢失警告,请重新配置Agent模型","notSelected": "未选择模型"},"agentList": {