Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
2f26972
i18n(ru): translate common fallback labels
VladimirAndreev1985 Dec 3, 2026
194dd06
i18n(ru): translate account fallback labels
VladimirAndreev1985 Dec 3, 2026
1a7eefc
i18n(ru): translate dashboard and assessment fallback labels
VladimirAndreev1985 Dec 3, 2026
0e6e348
i18n(ru): translate deep assessments fallback labels
VladimirAndreev1985 Dec 3, 2026
18248d7
i18n(ru): translate C2 fallback labels
VladimirAndreev1985 Dec 3, 2026
95e6563
i18n(ru): translate chat fallback labels
VladimirAndreev1985 Dec 3, 2026
9a050a7
i18n(ru): translate settings fallback labels
VladimirAndreev1985 Dec 3, 2026
cfe8432
i18n(ru): translate token usage and webshell fallback labels
VladimirAndreev1985 Dec 3, 2026
07ce437
i18n(ru): translate vulnerabilities, workflows, login fallback labels
VladimirAndreev1985 Dec 3, 2026
fd114f2
i18n(ru): translate remaining asset, monitor and task fallback labels
VladimirAndreev1985 Dec 3, 2026
32ebfa2
i18n(ru): translate final placeholder labels and fix Pi agent hints
VladimirAndreev1985 Dec 3, 2026
f5bd32a
i18n(ru): translate settings display and probe fallback labels
VladimirAndreev1985 Dec 3, 2026
d87bae3
i18n(ru): translate probe profiles and update job fallback labels
VladimirAndreev1985 Dec 3, 2026
af3cce6
i18n(ru): translate remaining long hint labels
VladimirAndreev1985 Dec 3, 2026
6897e10
i18n(ru): replace hardcoded Chinese UI strings in agents/skills manag…
VladimirAndreev1985 Dec 4, 2026
699b9c7
i18n(ru): replace hardcoded Chinese UI strings in knowledge managemen…
VladimirAndreev1985 Dec 4, 2026
1a90304
i18n(ru): replace hardcoded Chinese UI strings in dashboard and roles…
VladimirAndreev1985 Dec 4, 2026
e39b328
i18n(ru): replace hardcoded Chinese UI strings across tasks pages, lo…
VladimirAndreev1985 Dec 4, 2026
6f1ad01
Merge branch 'Sycun:main' into main
VladimirAndreev1985 Dec 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 34 additions & 34 deletions web/frontend/src/pages/agents-management/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function AgentsManagementPage() {
try {
setDetail(await api.get(`/multi-agent/markdown-agents/${encodeURIComponent(record.filename)}`));
} catch (error) {
toastError(error, '读取智能体失败');
toastError(error, t('agents.loadFailed'));
}
};

Expand All @@ -46,43 +46,43 @@ export default function AgentsManagementPage() {
kind: values.kind || 'sub',
tools: String(values.tools || '').split(',').map(item => item.trim()).filter(Boolean)
});
toastSuccess('智能体已保存');
toastSuccess(t('agents.saved'));
setEditor(null);
agents.reload();
} catch (error) {
toastError(error, '保存智能体失败');
toastError(error, t('agents.saveFailed'));
} finally {
setSaving(false);
}
};

const remove = row => confirmAction({
title: `删除智能体「${row.name || row.filename}」?`,
title: t('agents.confirmDelete', { name: row.name || row.filename }),
onOk: async () => {
await api.del(`/multi-agent/markdown-agents/${encodeURIComponent(row.filename)}`);
toastSuccess('已删除');
toastSuccess(t('agents.deleted'));
agents.reload();
}
});

const columns = [
{
title: '智能体', dataIndex: 'name', render: (value, record) => (
title: t('agents.agent'), dataIndex: 'name', render: (value, record) => (
<Space vertical spacing={0} align="start">
<Space>
<Text strong>{value || record.id}</Text>
{record.is_orchestrator && <Tag size="small" color="purple">编排器</Tag>}
{record.is_orchestrator && <Tag size="small" color="purple">{t('agents.orchestrator')}</Tag>}
</Space>
<Text type="tertiary">{record.filename}</Text>
</Space>
)
},
{ title: '类型', dataIndex: 'kind', width: 110, render: value => <Tag size="small">{value || 'sub'}</Tag> },
{ title: '描述', dataIndex: 'description', render: value => <Text type="tertiary" ellipsis={{ showTooltip: true }} style={{ maxWidth: 460 }}>{value || '—'}</Text> },
{ title: t('agents.kind'), dataIndex: 'kind', width: 110, render: value => <Tag size="small">{value || 'sub'}</Tag> },
{ title: t('agents.description'), dataIndex: 'description', render: value => <Text type="tertiary" ellipsis={{ showTooltip: true }} style={{ maxWidth: 460 }}>{value || '—'}</Text> },
{
title: '操作', width: 180, render: (_, record) => (
title: t('agents.actions'), width: 180, render: (_, record) => (
<Space>
<Button size="small" theme="borderless" onClick={() => openDetail(record)}>详情</Button>
<Button size="small" theme="borderless" onClick={() => openDetail(record)}>{t('agents.details')}</Button>
{canWrite && <Button size="small" theme="borderless" icon={<IconEdit />} onClick={() => setEditor({ record, form: {} })} />}
{canDelete && <Button size="small" theme="borderless" type="danger" icon={<IconDelete />} onClick={() => remove(record)} />}
</Space>
Expand All @@ -93,30 +93,30 @@ export default function AgentsManagementPage() {
return (
<div>
<PageHeader
title={t('agents.title', null, '智能体管理')}
description={agents.data?.dir ? `目录:${agents.data.dir}` : '以 Markdown 文件定义的子智能体与编排器。'}
title={t('agents.title')}
description={agents.data?.dir ? t('agents.dir', { dir: agents.data.dir }) : t('agents.pageDescription')}
extra={(
<Space>
<Button icon={<IconRefresh />} onClick={() => agents.reload()} loading={agents.loading}>刷新</Button>
{canWrite && <Button theme="solid" type="primary" icon={<IconPlus />} onClick={() => setEditor({ record: null, form: {} })}>新建智能体</Button>}
<Button icon={<IconRefresh />} onClick={() => agents.reload()} loading={agents.loading}>{t('common.refresh')}</Button>
{canWrite && <Button theme="solid" type="primary" icon={<IconPlus />} onClick={() => setEditor({ record: null, form: {} })}>{t('agents.create')}</Button>}
</Space>
)}
/>
{agents.data?.error && <ErrorBanner error={agents.data.error} />}
<SectionCard title={`智能体(${rows.length})`}>
<SectionCard title={t('agents.count', { count: rows.length })}>
<ErrorBanner error={agents.error} onRetry={() => agents.reload()} />
<DataTable
columns={columns}
dataSource={rows}
rowKey="filename"
loading={agents.loading}
pagination={{ pageSize: 20 }}
toolbar={<Input prefix={<IconSearch />} value={search} onChange={setSearch} placeholder="搜索名称或文件名" style={{ width: 280 }} />}
toolbar={<Input prefix={<IconSearch />} value={search} onChange={setSearch} placeholder={t('agents.searchPlaceholder')} style={{ width: 280 }} />}
/>
</SectionCard>

<Drawer
title={editor?.record ? '编辑智能体' : '新建智能体'}
title={editor?.record ? t('agents.edit') : t('agents.create')}
visible={Boolean(editor)}
key={editor?.record?.filename || 'new-agent'}
onCancel={() => setEditor(null)}
Expand All @@ -133,32 +133,32 @@ export default function AgentsManagementPage() {
kind: editor.record.kind || 'sub'
} : { kind: 'sub' }}
>
<Form.Input field="filename" label="文件名(留空自动生成)" placeholder="例如 recon.md" />
<Form.Input field="name" label="名称" rules={[{ required: true, message: '请输入名称' }]} />
<Form.Input field="description" label="描述" />
<Form.Select field="kind" label="类型" optionList={[
{ value: 'sub', label: '子智能体' },
{ value: 'orchestrator', label: '编排器' },
{ value: 'plan_execute', label: '计划执行' }
<Form.Input field="filename" label={t('agents.filenameLabel')} placeholder="recon.md" />
<Form.Input field="name" label={t('agents.nameLabel')} rules={[{ required: true, message: t('agents.nameRequired') }]} />
<Form.Input field="description" label={t('agents.description')} />
<Form.Select field="kind" label={t('agents.kind')} optionList={[
{ value: 'sub', label: t('agents.kindSub') },
{ value: 'orchestrator', label: t('agents.orchestrator') },
{ value: 'plan_execute', label: t('agents.kindPlanExecute') }
]} />
<Form.Input field="tools" label="工具(逗号分隔)" placeholder="toolName, mcp::tool" />
<Form.TextArea field="instruction" label="指令(Markdown)" autosize={{ minRows: 8, maxRows: 20 }} />
<Form.Input field="tools" label={t('agents.toolsLabel')} placeholder="toolName, mcp::tool" />
<Form.TextArea field="instruction" label={t('agents.instructionLabel')} autosize={{ minRows: 8, maxRows: 20 }} />
</Form>
</Drawer>

<Drawer title={detail?.name || '智能体详情'} visible={Boolean(detail)} onCancel={() => setDetail(null)} width={720}>
<Drawer title={detail?.name || t('agents.detailTitle')} visible={Boolean(detail)} onCancel={() => setDetail(null)} width={720}>
{detail && (
<div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
<KeyValueList items={[
{ label: '文件名', value: detail.filename },
{ label: t('agents.filenameLabel'), value: detail.filename },
{ label: 'ID', value: detail.id },
{ label: '类型', value: detail.kind },
{ label: '绑定角色', value: detail.bind_role || '—' },
{ label: '最大迭代', value: detail.max_iterations ?? '—' },
{ label: '工具', value: Array.isArray(detail.tools) && detail.tools.length ? detail.tools.join('、') : '—' }
{ label: t('agents.kind'), value: detail.kind },
{ label: t('agents.bindRole'), value: detail.bind_role || '—' },
{ label: t('agents.maxIterations'), value: detail.max_iterations ?? '—' },
{ label: t('agents.toolsLabel'), value: Array.isArray(detail.tools) && detail.tools.length ? detail.tools.join(', ') : '—' }
]} />
<MarkdownView content={detail.instruction || detail.raw || ''} />
<JsonViewer value={detail.raw || detail} title="原始 Markdown" collapsed />
<JsonViewer value={detail.raw || detail} title={t('agents.rawMarkdown')} collapsed />
</div>
)}
</Drawer>
Expand Down
Loading