修复设置页重新出现连接与工具 #287
@@ -1,6 +1,5 @@
|
||||
import {
|
||||
Bot,
|
||||
Cable,
|
||||
CheckCircle2,
|
||||
CircleAlert,
|
||||
Info,
|
||||
@@ -102,7 +101,6 @@ function formatAccountCredentialState(
|
||||
type RuntimeSettingsSection =
|
||||
| 'general'
|
||||
| 'agents'
|
||||
| 'connections'
|
||||
| 'extensions'
|
||||
| 'advanced'
|
||||
| 'about';
|
||||
@@ -127,12 +125,6 @@ const runtimeSettingsSections = [
|
||||
description: '查看各角色运行状态',
|
||||
icon: Bot,
|
||||
},
|
||||
{
|
||||
id: 'connections',
|
||||
label: '连接与工具',
|
||||
description: '外部服务',
|
||||
icon: Cable,
|
||||
},
|
||||
{
|
||||
id: 'extensions',
|
||||
label: '扩展',
|
||||
@@ -917,57 +909,6 @@ export function RuntimeConfigDialog({
|
||||
<small>普通用户无需配置服务连接信息。</small>
|
||||
</div>
|
||||
) : null}
|
||||
{activeSection === 'connections' ? (
|
||||
<section
|
||||
className="runtime-settings-section"
|
||||
aria-label="外部连接"
|
||||
>
|
||||
<header className="runtime-settings-section-header">
|
||||
<div>
|
||||
<h3>外部连接</h3>
|
||||
<p>配置图片编辑器使用的外部服务</p>
|
||||
</div>
|
||||
</header>
|
||||
{advancedExternalEditorConfigEnabled ? (
|
||||
<div className="runtime-settings-fields">
|
||||
<label>
|
||||
External Editor Base URL
|
||||
<input
|
||||
aria-label="External Editor Base URL"
|
||||
value={runtimeConfigDraft.editorApi.baseUrl}
|
||||
onChange={(event) =>
|
||||
setRuntimeConfigDraft((current) => ({
|
||||
...current,
|
||||
editorApi: {
|
||||
...current.editorApi,
|
||||
baseUrl: event.currentTarget.value,
|
||||
},
|
||||
}))
|
||||
}
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
External Editor API Key
|
||||
<input
|
||||
aria-label="External Editor API Key"
|
||||
autoComplete="off"
|
||||
type="password"
|
||||
value={runtimeConfigDraft.editorApi.apiKey}
|
||||
onChange={(event) =>
|
||||
setRuntimeConfigDraft((current) => ({
|
||||
...current,
|
||||
editorApi: {
|
||||
...current.editorApi,
|
||||
apiKey: event.currentTarget.value,
|
||||
},
|
||||
}))
|
||||
}
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
) : null}
|
||||
</section>
|
||||
) : null}
|
||||
{activeSection === 'extensions' ? (
|
||||
<section
|
||||
className="runtime-settings-section runtime-settings-extensions"
|
||||
|
||||
@@ -843,9 +843,7 @@ export function registerPublishedRuntimeSettingsTests() {
|
||||
expect(screen.queryByLabelText('LLM Base URL')).toBeNull();
|
||||
expect(screen.queryByLabelText('LLM 模型')).toBeNull();
|
||||
expect(screen.queryByLabelText('LLM API 类型')).toBeNull();
|
||||
fireEvent.click(screen.getByRole('button', { name: /连接与工具/ }));
|
||||
expect(screen.queryByLabelText('External Editor Base URL')).toBeNull();
|
||||
expect(screen.queryByLabelText('External Editor API Key')).toBeNull();
|
||||
expect(screen.queryByRole('button', { name: /连接与工具/ })).toBeNull();
|
||||
fireEvent.click(screen.getByRole('button', { name: /Agent 分工/ }));
|
||||
expect(screen.getByText('所有角色使用统一账号服务')).not.toBeNull();
|
||||
fireEvent.click(screen.getByRole('button', { name: /常用设置/ }));
|
||||
@@ -896,9 +894,7 @@ export function registerPublishedRuntimeSettingsTests() {
|
||||
});
|
||||
fireEvent.click(screen.getByRole('button', { name: /Agent 分工/ }));
|
||||
expect(screen.getByText('所有角色使用统一账号服务')).not.toBeNull();
|
||||
fireEvent.click(screen.getByRole('button', { name: /连接与工具/ }));
|
||||
expect(screen.queryByLabelText('External Editor Base URL')).toBeNull();
|
||||
expect(screen.queryByLabelText('External Editor API Key')).toBeNull();
|
||||
expect(screen.queryByRole('button', { name: /连接与工具/ })).toBeNull();
|
||||
fireEvent.click(
|
||||
within(runtimeConfigDialog).getByRole('button', { name: '保存' }),
|
||||
);
|
||||
@@ -1009,9 +1005,7 @@ export function registerPublishedRuntimeSettingsTests() {
|
||||
'value',
|
||||
'12000',
|
||||
);
|
||||
fireEvent.click(screen.getByRole('button', { name: /连接与工具/ }));
|
||||
expect(screen.queryByLabelText('External Editor Base URL')).toBeNull();
|
||||
expect(screen.queryByLabelText('External Editor API Key')).toBeNull();
|
||||
expect(screen.queryByRole('button', { name: /连接与工具/ })).toBeNull();
|
||||
fireEvent.click(
|
||||
within(runtimeConfigDialog).getByRole('button', { name: '保存' }),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user