fix(frontend): restore deep assessment drawers
This commit is contained in:
parent
b0f6a07af0
commit
db7373e5e1
|
|
@ -1,6 +1,6 @@
|
|||
/** 验收证据:覆盖度、证据关联与来源检索。 */
|
||||
import { useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { Button, Checkbox, Input, Modal, Progress, Select, Space, Tag, TextArea, Typography } from '@douyinfe/semi-ui';
|
||||
import { Button, Checkbox, Input, Progress, Select, Space, Tag, TextArea, Typography } from '@douyinfe/semi-ui';
|
||||
import { IconSearch } from '@douyinfe/semi-icons';
|
||||
import { api } from '../../lib/http';
|
||||
import { useT } from '../../lib/i18n';
|
||||
|
|
@ -17,6 +17,7 @@ const STATUS_FILTERS = ['', 'has_evidence', 'missing', 'needs_review'];
|
|||
|
||||
function SourceBrowser({ visible, id, onCancel, edit, onEdit, onSave, saving, saveError }) {
|
||||
const t = useT();
|
||||
const title = edit ? '编辑验收证据关联' : '证据来源';
|
||||
const [kind, setKind] = useState('fact');
|
||||
const [query, setQuery] = useState('');
|
||||
const [offset, setOffset] = useState(0);
|
||||
|
|
@ -80,8 +81,22 @@ function SourceBrowser({ visible, id, onCancel, edit, onEdit, onSave, saving, sa
|
|||
];
|
||||
|
||||
return (
|
||||
<Modal visible={visible} title={edit ? '编辑验收证据关联' : '证据来源'}
|
||||
onCancel={() => { if (!saving) onCancel(); }} footer={null} width={900}>
|
||||
<Drawer
|
||||
visible={visible}
|
||||
title={title}
|
||||
aria-label={title}
|
||||
onCancel={onCancel}
|
||||
width={900}
|
||||
closable={!saving}
|
||||
closeOnEsc={!saving}
|
||||
maskClosable={!saving}
|
||||
footer={edit && (
|
||||
<div className="assessment-form-actions">
|
||||
<Button onClick={onCancel} disabled={saving}>取消</Button>
|
||||
<Button theme="solid" onClick={onSave} loading={saving} disabled={saving}>保存证据关联</Button>
|
||||
</div>
|
||||
)}
|
||||
>
|
||||
<div className="assessment-toolbar">
|
||||
<Select
|
||||
value={kind}
|
||||
|
|
@ -135,12 +150,8 @@ function SourceBrowser({ visible, id, onCancel, edit, onEdit, onSave, saving, sa
|
|||
<TextArea aria-label="复核说明" placeholder="复核说明" value={edit.review_note} disabled={saving}
|
||||
onChange={value => onEdit('review_note', value)} />
|
||||
<ErrorBanner error={saveError} />
|
||||
<Space>
|
||||
<Button onClick={onCancel} disabled={saving}>取消</Button>
|
||||
<Button theme="solid" onClick={onSave} loading={saving}>保存证据关联</Button>
|
||||
</Space>
|
||||
</div>}
|
||||
</Modal>
|
||||
</Drawer>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -338,6 +349,7 @@ export default function AcceptanceTab({ id, criterion, canWrite, reloadToken })
|
|||
onCancel={() => openRow(null)}
|
||||
title={row ? `验收项 ${row.number}` : '验收项'}
|
||||
width={720}
|
||||
closeOnEsc={!sourcesOpen}
|
||||
footer={null}
|
||||
>
|
||||
{row ? (
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/** 资产:本次测评关联的共享资产、观察覆盖度与手动关联。 */
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
import { Button, Input, Modal, Space, Tag, Typography } from '@douyinfe/semi-ui';
|
||||
import { Button, Input, Space, Tag, Typography } from '@douyinfe/semi-ui';
|
||||
import { IconPlus, IconSearch } from '@douyinfe/semi-icons';
|
||||
import { api } from '../../lib/http';
|
||||
import { useT } from '../../lib/i18n';
|
||||
|
|
@ -78,16 +78,23 @@ function AssetPicker({ visible, task, onCancel, onSaved }) {
|
|||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
<Drawer
|
||||
visible={visible}
|
||||
title="关联共享资产"
|
||||
aria-label="关联共享资产"
|
||||
onCancel={onCancel}
|
||||
onOk={submit}
|
||||
confirmLoading={saving}
|
||||
okText={`关联${selected.length ? ` ${selected.length} 项` : ''}`}
|
||||
cancelText="取消"
|
||||
okButtonProps={{ disabled: !selected.length }}
|
||||
width={760}
|
||||
closable={!saving}
|
||||
closeOnEsc={!saving}
|
||||
maskClosable={!saving}
|
||||
footer={(
|
||||
<div className="assessment-form-actions">
|
||||
<Button onClick={onCancel} disabled={saving}>取消</Button>
|
||||
<Button theme="solid" onClick={submit} loading={saving} disabled={!selected.length || saving}>
|
||||
{`关联${selected.length ? ` ${selected.length} 项` : ''}`}
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
>
|
||||
<div className="assessment-toolbar">
|
||||
<Input
|
||||
|
|
@ -124,7 +131,7 @@ function AssetPicker({ visible, task, onCancel, onSaved }) {
|
|||
</Button>
|
||||
</Space>
|
||||
</div>
|
||||
</Modal>
|
||||
</Drawer>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
/** 新建深度测评表单:字段与 internal/handler/deep_assessment.go 的创建结构体一致。 */
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
import { Banner, Button, Form, Modal, Spin } from '@douyinfe/semi-ui';
|
||||
import { useCallback, useEffect, useId, useState } from 'react';
|
||||
import { Banner, Button, Form, Spin } from '@douyinfe/semi-ui';
|
||||
import { api } from '../../lib/http';
|
||||
import { useT } from '../../lib/i18n';
|
||||
import { modelChannelOptions, selectedModelChannelName } from '../../lib/model-channel';
|
||||
import { ErrorBanner, toastError, toastSuccess } from '../../components/ui';
|
||||
import { Drawer, ErrorBanner, toastError, toastSuccess } from '../../components/ui';
|
||||
|
||||
const HITL_OPTIONS = [
|
||||
{ value: '', label: '系统默认' },
|
||||
|
|
@ -14,8 +14,10 @@ const HITL_OPTIONS = [
|
|||
{ value: 'review_edit', label: '复核并允许编辑' }
|
||||
];
|
||||
|
||||
export default function CreateAssessmentModal({ visible, onCancel, onCreated }) {
|
||||
export default function CreateAssessmentDrawer({ visible, onCancel, onCreated }) {
|
||||
const t = useT();
|
||||
const title = t('deepAssessments.create', null, '新建测评');
|
||||
const formId = useId();
|
||||
const [options, setOptions] = useState(null);
|
||||
const [error, setError] = useState(null);
|
||||
const [saving, setSaving] = useState(false);
|
||||
|
|
@ -34,6 +36,7 @@ export default function CreateAssessmentModal({ visible, onCancel, onCreated })
|
|||
}, [visible, loadOptions]);
|
||||
|
||||
const submit = async values => {
|
||||
if (saving) return;
|
||||
setSaving(true);
|
||||
try {
|
||||
const body = {
|
||||
|
|
@ -63,14 +66,32 @@ export default function CreateAssessmentModal({ visible, onCancel, onCreated })
|
|||
const projects = (options?.projects || []).map(project => ({ value: project.id, label: project.name || project.id }));
|
||||
|
||||
return (
|
||||
<Modal
|
||||
<Drawer
|
||||
visible={visible}
|
||||
title={t('deepAssessments.create', null, '新建测评')}
|
||||
title={title}
|
||||
aria-label={title}
|
||||
onCancel={onCancel}
|
||||
footer={null}
|
||||
width={680}
|
||||
closable={!saving}
|
||||
closeOnEsc={!saving}
|
||||
maskClosable={!saving}
|
||||
footer={(
|
||||
<div className="assessment-form-actions">
|
||||
<Button theme="borderless" onClick={onCancel} disabled={saving}>
|
||||
{t('deepAssessments.close', null, '关闭')}
|
||||
</Button>
|
||||
<Button
|
||||
htmlType="submit"
|
||||
form={formId}
|
||||
theme="solid"
|
||||
type="primary"
|
||||
loading={saving}
|
||||
disabled={saving || (!options && !error)}
|
||||
>
|
||||
{t('deepAssessments.save', null, '保存草稿')}
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
>
|
||||
{error ? (
|
||||
<div className="assessment-error-block">
|
||||
|
|
@ -82,8 +103,10 @@ export default function CreateAssessmentModal({ visible, onCancel, onCreated })
|
|||
<div className="assessment-loading"><Spin /></div>
|
||||
) : (
|
||||
<Form
|
||||
id={formId}
|
||||
initValues={{ concurrency: 2, auto_resume: true, hitl_policy: '' }}
|
||||
labelPosition="top"
|
||||
autoScrollToError
|
||||
onSubmit={submit}
|
||||
>
|
||||
<Form.Input
|
||||
|
|
@ -159,16 +182,8 @@ export default function CreateAssessmentModal({ visible, onCancel, onCreated })
|
|||
className="assessment-form-note"
|
||||
description="创建后保存为草稿;打开页面不会自动启动,需要手动点击“开始 / 继续”。"
|
||||
/>
|
||||
<div className="assessment-form-actions">
|
||||
<Button theme="borderless" onClick={onCancel} disabled={saving}>
|
||||
{t('deepAssessments.close', null, '关闭')}
|
||||
</Button>
|
||||
<Button htmlType="submit" theme="solid" type="primary" loading={saving}>
|
||||
{t('deepAssessments.save', null, '保存草稿')}
|
||||
</Button>
|
||||
</div>
|
||||
</Form>
|
||||
)}
|
||||
</Modal>
|
||||
</Drawer>
|
||||
);
|
||||
}
|
||||
|
|
@ -11,7 +11,7 @@ import {
|
|||
} from '../../components/ui';
|
||||
import { formatDateTime, formatNumber } from '../../lib/format';
|
||||
import { PERM_DELETE, PERM_WRITE, STATUS_LABEL, canDeleteTask, countsProgress, needsReview, statusText } from './labels';
|
||||
import CreateAssessmentModal from './CreateModal';
|
||||
import CreateAssessmentDrawer from './CreateDrawer';
|
||||
|
||||
const { Text } = Typography;
|
||||
|
||||
|
|
@ -250,7 +250,7 @@ export default function AssessmentList({ onOpen }) {
|
|||
</Space>
|
||||
</div>
|
||||
</SectionCard>
|
||||
<CreateAssessmentModal
|
||||
<CreateAssessmentDrawer
|
||||
visible={createOpen}
|
||||
onCancel={() => setCreateOpen(false)}
|
||||
onCreated={task => {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
/** 深度测评工作台:状态控制、事件轮询与分区标签页。 */
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { Banner, Button, Modal, Space, Tabs, TextArea, Typography } from '@douyinfe/semi-ui';
|
||||
import { Banner, Button, Space, Tabs, TextArea, Typography } from '@douyinfe/semi-ui';
|
||||
import { IconDelete, IconRefresh } from '@douyinfe/semi-icons';
|
||||
import { api } from '../../lib/http';
|
||||
import { useT } from '../../lib/i18n';
|
||||
import { useAuth } from '../../lib/auth';
|
||||
import { useInterval, useResource } from '../../components/hooks';
|
||||
import {
|
||||
PageHeader, ErrorBanner, StatusTag, confirmAction, toastError, toastSuccess, toastWarning
|
||||
PageHeader, Drawer, ErrorBanner, StatusTag, confirmAction, toastError, toastSuccess, toastWarning
|
||||
} from '../../components/ui';
|
||||
import { formatDateTime, formatNumber } from '../../lib/format';
|
||||
import {
|
||||
|
|
@ -51,6 +51,7 @@ export default function Workbench({ id, tab, criterion, evidencePath, evidenceSt
|
|||
const [intentFilter, setIntentFilter] = useState('');
|
||||
const [messageMode, setMessageMode] = useState('');
|
||||
const [messageText, setMessageText] = useState('');
|
||||
const messageTitle = messageMode === 'answer' ? '答复并继续' : '补充线索或调整方向';
|
||||
const lastEventRef = useRef(0);
|
||||
const eventsBusyRef = useRef(false);
|
||||
|
||||
|
|
@ -357,15 +358,23 @@ export default function Workbench({ id, tab, criterion, evidencePath, evidenceSt
|
|||
|
||||
{!task && resource.loading ? <div className="assessment-loading">正在读取测评…</div> : null}
|
||||
|
||||
<Modal
|
||||
<Drawer
|
||||
visible={Boolean(messageMode)}
|
||||
title={messageMode === 'answer' ? '答复并继续' : '补充线索或调整方向'}
|
||||
title={messageTitle}
|
||||
aria-label={messageTitle}
|
||||
onCancel={() => setMessageMode('')}
|
||||
onOk={submitMessage}
|
||||
confirmLoading={busy === 'message'}
|
||||
okText="提交"
|
||||
cancelText="取消"
|
||||
width={560}
|
||||
closable={busy !== 'message'}
|
||||
closeOnEsc={busy !== 'message'}
|
||||
maskClosable={busy !== 'message'}
|
||||
footer={(
|
||||
<div className="assessment-form-actions">
|
||||
<Button onClick={() => setMessageMode('')} disabled={busy === 'message'}>取消</Button>
|
||||
<Button theme="solid" onClick={submitMessage} loading={busy === 'message'} disabled={busy === 'message'}>
|
||||
提交
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
>
|
||||
<p className="assessment-hint">
|
||||
{messageMode === 'answer'
|
||||
|
|
@ -379,7 +388,7 @@ export default function Workbench({ id, tab, criterion, evidencePath, evidenceSt
|
|||
maxLength={8000}
|
||||
placeholder="例如:优先验证登录接口的越权风险,并附上原始请求回执。"
|
||||
/>
|
||||
</Modal>
|
||||
</Drawer>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -177,9 +177,6 @@
|
|||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 8px;
|
||||
margin-top: 16px;
|
||||
padding-top: 12px;
|
||||
border-top: 1px solid var(--semi-color-border);
|
||||
}
|
||||
|
||||
/* 图谱 */
|
||||
|
|
|
|||
|
|
@ -285,8 +285,15 @@ test('a legacy acceptance link opens the selected criterion and writes revision-
|
|||
await page.goto('/static/app/#deep-assessments?assessment_id=' + id + '&tab=acceptance&criterion=2');
|
||||
const main = await ready(page);
|
||||
await expect(main.getByRole('tab', { name: /验收/ })).toHaveAttribute('aria-selected', 'true');
|
||||
await page.getByRole('button', { name: '编辑证据关联' }).click();
|
||||
const editor = page.getByRole('dialog').filter({ hasText: '编辑验收证据关联' });
|
||||
const criterion = page.getByRole('dialog').filter({ hasText: '验收项 2' });
|
||||
const edit = criterion.getByRole('button', { name: '编辑证据关联' });
|
||||
await edit.click();
|
||||
const editor = page.getByRole('dialog', { name: '编辑验收证据关联' });
|
||||
await expect(editor).toHaveClass(/semi-sidesheet-inner/);
|
||||
await page.keyboard.press('Escape');
|
||||
await expect(editor).toHaveCount(0);
|
||||
await expect(criterion).toBeVisible();
|
||||
await edit.click();
|
||||
const evidence = editor.getByRole('checkbox', { name: '关联 示例观察事实' });
|
||||
await evidence.press('Space');
|
||||
await expect(evidence).toBeChecked();
|
||||
|
|
|
|||
|
|
@ -544,22 +544,69 @@ test('deep assessment: graph switches views and resets pagination on a narrow sc
|
|||
expect(mockApi.writes()).toEqual([]);
|
||||
});
|
||||
|
||||
test('deep assessment: options retry, required objective, close new-draft modal without execution', async ({ page, mockApi }, testInfo) => {
|
||||
test('deep assessment: new-draft drawer retries options, validates and saves without execution', async ({ page, mockApi }, testInfo) => {
|
||||
mockApi.fail('GET', '/api/deep-assessments/options', '示例选项加载失败');
|
||||
const main = await visit(page, 'deep-assessments');
|
||||
await button(main, label('deepAssessments.create', '新建测评')).click();
|
||||
const dialog = page.getByRole('dialog');
|
||||
await expect(dialog).toContainText('示例选项加载失败');
|
||||
const create = button(main, label('deepAssessments.create', '新建测评'));
|
||||
await create.click();
|
||||
const drawer = page.getByRole('dialog', { name: label('deepAssessments.create', '新建测评') });
|
||||
const save = button(drawer, label('deepAssessments.save', '保存草稿'));
|
||||
await expect(drawer).toHaveClass(/semi-sidesheet-inner/);
|
||||
await expect.poll(async () => {
|
||||
const { x, width } = await drawer.boundingBox();
|
||||
return Math.round(x + width);
|
||||
}).toBe(page.viewportSize().width);
|
||||
expect((await drawer.boundingBox()).x).toBeGreaterThan(0);
|
||||
await expect(drawer).toContainText('示例选项加载失败');
|
||||
mockApi.restore('GET', '/api/deep-assessments/options');
|
||||
await button(dialog, '重试').click();
|
||||
await expect(dialog.locator('.cs-error-banner')).toHaveCount(0);
|
||||
await button(dialog, label('deepAssessments.save', '保存草稿')).click();
|
||||
await expect(dialog.getByText('请填写测评目标', { exact: true })).toBeVisible();
|
||||
await button(drawer, '重试').click();
|
||||
await expect(drawer.locator('.cs-error-banner')).toHaveCount(0);
|
||||
await save.click();
|
||||
await expect(drawer.getByText('请填写测评目标', { exact: true })).toBeVisible();
|
||||
expect(mockApi.writes()).toEqual([]);
|
||||
await screenshot(page, testInfo, 'assessment-validation');
|
||||
await button(dialog.locator('.assessment-form-actions'), label('deepAssessments.close', '关闭')).click();
|
||||
await expect(dialog).toHaveCount(0);
|
||||
await button(drawer.locator('.semi-sidesheet-footer'), label('deepAssessments.close', '关闭')).click();
|
||||
await expect(drawer).toHaveCount(0);
|
||||
await expect(button(main, ASSESSMENT.name)).toBeVisible();
|
||||
|
||||
await page.setViewportSize({ width: 390, height: 650 });
|
||||
await create.click();
|
||||
await expect(save).toBeInViewport({ ratio: 1 });
|
||||
await drawer.locator('.assessment-form-note').scrollIntoViewIfNeeded();
|
||||
await expect(save).toBeInViewport({ ratio: 1 });
|
||||
|
||||
mockApi.respond('POST', '/api/deep-assessments', { json: { task: ASSESSMENT } });
|
||||
mockApi.respond('GET', `/api/deep-assessments/${ASSESSMENT.id}/events`, { json: { events: [] } });
|
||||
await drawer.getByRole('textbox', { name: /目标/ }).fill(ASSESSMENT.objective);
|
||||
await save.click();
|
||||
await expect(page).toHaveURL(/id=fixture-assessment&tab=overview$/);
|
||||
await expect(drawer).toHaveCount(0);
|
||||
const writes = mockApi.writes();
|
||||
expect(writes).toHaveLength(1);
|
||||
expect(writes[0]).toMatchObject({ method: 'POST', path: '/api/deep-assessments', body: { objective: ASSESSMENT.objective } });
|
||||
});
|
||||
|
||||
test('deep assessment: guidance and asset selection open as drawers', async ({ page, mockApi }) => {
|
||||
const path = `/api/deep-assessments/${ASSESSMENT.id}`;
|
||||
mockApi.respond('GET', `${path}/events`, { json: { events: [] } });
|
||||
mockApi.respond('GET', `${path}/assets`, { json: { assets: [] } });
|
||||
await page.goto(`/static/app/#/deep-assessments?id=${ASSESSMENT.id}`);
|
||||
const main = await ready(page);
|
||||
|
||||
await button(main, '补充方向').click();
|
||||
const guidance = page.getByRole('dialog', { name: '补充线索或调整方向' });
|
||||
await expect(guidance).toHaveClass(/semi-sidesheet-inner/);
|
||||
await button(guidance, '取消').click();
|
||||
await expect(guidance).toHaveCount(0);
|
||||
|
||||
await main.getByRole('tab', { name: label('deepAssessments.assets', '资产'), exact: true }).click();
|
||||
await button(main, '添加资产').click();
|
||||
const assets = page.getByRole('dialog', { name: '关联共享资产' });
|
||||
await expect(assets).toHaveClass(/semi-sidesheet-inner/);
|
||||
await expect(button(assets, '关联')).toBeDisabled();
|
||||
await button(assets, '取消').click();
|
||||
await expect(assets).toHaveCount(0);
|
||||
expect(mockApi.writes()).toEqual([]);
|
||||
});
|
||||
|
||||
test('vulnerability: dashboard deep link, detail retry, evidence and close; new form validation', async ({ page, mockApi }, testInfo) => {
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{S as t,t as n}from"./react-QV7DAAIx.js";import{C as r,I as i,P as a,U as o,V as s,i as c,it as l,j as u,ot as d,rt as f,xt as p,yt as m}from"./semi-DNxeCrHm.js";import{F as h,I as g,P as _,a as v,b as y,c as b,d as x,f as S,l as C,m as w,p as T,s as E,u as D,x as O,y as k}from"./index-Cyc27pJG.js";var A=e(t(),1),j=e(n(),1),{Text:M}=o;function N(){let e=_(),{hasPermission:t}=h(),n=t(`agents:write`),o=t(`agents:delete`),[N,P]=(0,A.useState)(``),[F,I]=(0,A.useState)(null),[L,R]=(0,A.useState)(null),[z,B]=(0,A.useState)(!1),V=v(()=>g.get(`/multi-agent/markdown-agents`),[]),H=(Array.isArray(V.data?.agents)?V.data.agents:[]).filter(e=>{if(!N)return!0;let t=N.toLowerCase();return[e.name,e.id,e.filename,e.description].some(e=>String(e||``).toLowerCase().includes(t))}),U=async e=>{try{I(await g.get(`/multi-agent/markdown-agents/${encodeURIComponent(e.filename)}`))}catch(e){y(e,`读取智能体失败`)}},W=async()=>{let e=await L.form.validate();B(!0);try{await g.post(`/multi-agent/markdown-agents`,{filename:e.filename?.trim()||``,name:e.name.trim(),description:e.description?.trim()||``,instruction:e.instruction,kind:e.kind||`sub`,tools:String(e.tools||``).split(`,`).map(e=>e.trim()).filter(Boolean)}),O(`智能体已保存`),R(null),V.reload()}catch(e){y(e,`保存智能体失败`)}finally{B(!1)}},G=e=>k({title:`删除智能体「${e.name||e.filename}」?`,onOk:async()=>{await g.del(`/multi-agent/markdown-agents/${encodeURIComponent(e.filename)}`),O(`已删除`),V.reload()}});return(0,j.jsxs)(`div`,{children:[(0,j.jsx)(T,{title:e(`agents.title`,null,`智能体管理`),description:V.data?.dir?`目录:${V.data.dir}`:`以 Markdown 文件定义的子智能体与编排器。`,extra:(0,j.jsxs)(a,{children:[(0,j.jsx)(i,{icon:(0,j.jsx)(l,{}),onClick:()=>V.reload(),loading:V.loading,children:`刷新`}),n&&(0,j.jsx)(i,{theme:`solid`,type:`primary`,icon:(0,j.jsx)(d,{}),onClick:()=>R({record:null,form:{}}),children:`新建智能体`})]})}),V.data?.error&&(0,j.jsx)(C,{error:V.data.error}),(0,j.jsxs)(w,{title:`智能体(${H.length})`,children:[(0,j.jsx)(C,{error:V.error,onRetry:()=>V.reload()}),(0,j.jsx)(E,{columns:[{title:`智能体`,dataIndex:`name`,render:(e,t)=>(0,j.jsxs)(a,{vertical:!0,spacing:0,align:`start`,children:[(0,j.jsxs)(a,{children:[(0,j.jsx)(M,{strong:!0,children:e||t.id}),t.is_orchestrator&&(0,j.jsx)(u,{size:`small`,color:`purple`,children:`编排器`})]}),(0,j.jsx)(M,{type:`tertiary`,children:t.filename})]})},{title:`类型`,dataIndex:`kind`,width:110,render:e=>(0,j.jsx)(u,{size:`small`,children:e||`sub`})},{title:`描述`,dataIndex:`description`,render:e=>(0,j.jsx)(M,{type:`tertiary`,ellipsis:{showTooltip:!0},style:{maxWidth:460},children:e||`—`})},{title:`操作`,width:180,render:(e,t)=>(0,j.jsxs)(a,{children:[(0,j.jsx)(i,{size:`small`,theme:`borderless`,onClick:()=>U(t),children:`详情`}),n&&(0,j.jsx)(i,{size:`small`,theme:`borderless`,icon:(0,j.jsx)(m,{}),onClick:()=>R({record:t,form:{}})}),o&&(0,j.jsx)(i,{size:`small`,theme:`borderless`,type:`danger`,icon:(0,j.jsx)(p,{}),onClick:()=>G(t)})]})}],dataSource:H,rowKey:`filename`,loading:V.loading,pagination:{pageSize:20},toolbar:(0,j.jsx)(s,{prefix:(0,j.jsx)(f,{}),value:N,onChange:P,placeholder:`搜索名称或文件名`,style:{width:280}})})]}),(0,j.jsx)(r,{title:L?.record?`编辑智能体`:`新建智能体`,visible:!!L,onCancel:()=>R(null),onOk:W,confirmLoading:z,width:760,children:(0,j.jsxs)(c,{getFormApi:e=>R(t=>t&&{...t,form:e}),initValues:L?.record?{filename:L.record.filename,name:L.record.name,description:L.record.description,kind:L.record.kind||`sub`}:{kind:`sub`},children:[(0,j.jsx)(c.Input,{field:`filename`,label:`文件名(留空自动生成)`,placeholder:`例如 recon.md`}),(0,j.jsx)(c.Input,{field:`name`,label:`名称`,rules:[{required:!0,message:`请输入名称`}]}),(0,j.jsx)(c.Input,{field:`description`,label:`描述`}),(0,j.jsx)(c.Select,{field:`kind`,label:`类型`,optionList:[{value:`sub`,label:`子智能体`},{value:`orchestrator`,label:`编排器`},{value:`plan_execute`,label:`计划执行`}]}),(0,j.jsx)(c.Input,{field:`tools`,label:`工具(逗号分隔)`,placeholder:`toolName, mcp::tool`}),(0,j.jsx)(c.TextArea,{field:`instruction`,label:`指令(Markdown)`,autosize:{minRows:8,maxRows:20}})]})},L?.record?.filename||`new-agent`),(0,j.jsx)(b,{title:F?.name||`智能体详情`,visible:!!F,onCancel:()=>I(null),width:720,children:F&&(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,j.jsx)(x,{items:[{label:`文件名`,value:F.filename},{label:`ID`,value:F.id},{label:`类型`,value:F.kind},{label:`绑定角色`,value:F.bind_role||`—`},{label:`最大迭代`,value:F.max_iterations??`—`},{label:`工具`,value:Array.isArray(F.tools)&&F.tools.length?F.tools.join(`、`):`—`}]}),(0,j.jsx)(S,{content:F.instruction||F.raw||``}),(0,j.jsx)(D,{value:F.raw||F,title:`原始 Markdown`,collapsed:!0})]})})]})}export{N as default};
|
||||
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{S as t,t as n}from"./react-QV7DAAIx.js";import{C as r,I as i,P as a,U as o,V as s,i as c,it as l,j as u,ot as d,rt as f,xt as p,yt as m}from"./semi-DNxeCrHm.js";import{F as h,I as g,P as _,a as v,b as y,c as b,d as x,f as S,l as C,m as w,p as T,s as E,u as D,x as O,y as k}from"./index-FWC8CWwt.js";var A=e(t(),1),j=e(n(),1),{Text:M}=o;function N(){let e=_(),{hasPermission:t}=h(),n=t(`agents:write`),o=t(`agents:delete`),[N,P]=(0,A.useState)(``),[F,I]=(0,A.useState)(null),[L,R]=(0,A.useState)(null),[z,B]=(0,A.useState)(!1),V=v(()=>g.get(`/multi-agent/markdown-agents`),[]),H=(Array.isArray(V.data?.agents)?V.data.agents:[]).filter(e=>{if(!N)return!0;let t=N.toLowerCase();return[e.name,e.id,e.filename,e.description].some(e=>String(e||``).toLowerCase().includes(t))}),U=async e=>{try{I(await g.get(`/multi-agent/markdown-agents/${encodeURIComponent(e.filename)}`))}catch(e){y(e,`读取智能体失败`)}},W=async()=>{let e=await L.form.validate();B(!0);try{await g.post(`/multi-agent/markdown-agents`,{filename:e.filename?.trim()||``,name:e.name.trim(),description:e.description?.trim()||``,instruction:e.instruction,kind:e.kind||`sub`,tools:String(e.tools||``).split(`,`).map(e=>e.trim()).filter(Boolean)}),O(`智能体已保存`),R(null),V.reload()}catch(e){y(e,`保存智能体失败`)}finally{B(!1)}},G=e=>k({title:`删除智能体「${e.name||e.filename}」?`,onOk:async()=>{await g.del(`/multi-agent/markdown-agents/${encodeURIComponent(e.filename)}`),O(`已删除`),V.reload()}});return(0,j.jsxs)(`div`,{children:[(0,j.jsx)(T,{title:e(`agents.title`,null,`智能体管理`),description:V.data?.dir?`目录:${V.data.dir}`:`以 Markdown 文件定义的子智能体与编排器。`,extra:(0,j.jsxs)(a,{children:[(0,j.jsx)(i,{icon:(0,j.jsx)(l,{}),onClick:()=>V.reload(),loading:V.loading,children:`刷新`}),n&&(0,j.jsx)(i,{theme:`solid`,type:`primary`,icon:(0,j.jsx)(d,{}),onClick:()=>R({record:null,form:{}}),children:`新建智能体`})]})}),V.data?.error&&(0,j.jsx)(C,{error:V.data.error}),(0,j.jsxs)(w,{title:`智能体(${H.length})`,children:[(0,j.jsx)(C,{error:V.error,onRetry:()=>V.reload()}),(0,j.jsx)(E,{columns:[{title:`智能体`,dataIndex:`name`,render:(e,t)=>(0,j.jsxs)(a,{vertical:!0,spacing:0,align:`start`,children:[(0,j.jsxs)(a,{children:[(0,j.jsx)(M,{strong:!0,children:e||t.id}),t.is_orchestrator&&(0,j.jsx)(u,{size:`small`,color:`purple`,children:`编排器`})]}),(0,j.jsx)(M,{type:`tertiary`,children:t.filename})]})},{title:`类型`,dataIndex:`kind`,width:110,render:e=>(0,j.jsx)(u,{size:`small`,children:e||`sub`})},{title:`描述`,dataIndex:`description`,render:e=>(0,j.jsx)(M,{type:`tertiary`,ellipsis:{showTooltip:!0},style:{maxWidth:460},children:e||`—`})},{title:`操作`,width:180,render:(e,t)=>(0,j.jsxs)(a,{children:[(0,j.jsx)(i,{size:`small`,theme:`borderless`,onClick:()=>U(t),children:`详情`}),n&&(0,j.jsx)(i,{size:`small`,theme:`borderless`,icon:(0,j.jsx)(m,{}),onClick:()=>R({record:t,form:{}})}),o&&(0,j.jsx)(i,{size:`small`,theme:`borderless`,type:`danger`,icon:(0,j.jsx)(p,{}),onClick:()=>G(t)})]})}],dataSource:H,rowKey:`filename`,loading:V.loading,pagination:{pageSize:20},toolbar:(0,j.jsx)(s,{prefix:(0,j.jsx)(f,{}),value:N,onChange:P,placeholder:`搜索名称或文件名`,style:{width:280}})})]}),(0,j.jsx)(r,{title:L?.record?`编辑智能体`:`新建智能体`,visible:!!L,onCancel:()=>R(null),onOk:W,confirmLoading:z,width:760,children:(0,j.jsxs)(c,{getFormApi:e=>R(t=>t&&{...t,form:e}),initValues:L?.record?{filename:L.record.filename,name:L.record.name,description:L.record.description,kind:L.record.kind||`sub`}:{kind:`sub`},children:[(0,j.jsx)(c.Input,{field:`filename`,label:`文件名(留空自动生成)`,placeholder:`例如 recon.md`}),(0,j.jsx)(c.Input,{field:`name`,label:`名称`,rules:[{required:!0,message:`请输入名称`}]}),(0,j.jsx)(c.Input,{field:`description`,label:`描述`}),(0,j.jsx)(c.Select,{field:`kind`,label:`类型`,optionList:[{value:`sub`,label:`子智能体`},{value:`orchestrator`,label:`编排器`},{value:`plan_execute`,label:`计划执行`}]}),(0,j.jsx)(c.Input,{field:`tools`,label:`工具(逗号分隔)`,placeholder:`toolName, mcp::tool`}),(0,j.jsx)(c.TextArea,{field:`instruction`,label:`指令(Markdown)`,autosize:{minRows:8,maxRows:20}})]})},L?.record?.filename||`new-agent`),(0,j.jsx)(b,{title:F?.name||`智能体详情`,visible:!!F,onCancel:()=>I(null),width:720,children:F&&(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,j.jsx)(x,{items:[{label:`文件名`,value:F.filename},{label:`ID`,value:F.id},{label:`类型`,value:F.kind},{label:`绑定角色`,value:F.bind_role||`—`},{label:`最大迭代`,value:F.max_iterations??`—`},{label:`工具`,value:Array.isArray(F.tools)&&F.tools.length?F.tools.join(`、`):`—`}]}),(0,j.jsx)(S,{content:F.instruction||F.raw||``}),(0,j.jsx)(D,{value:F.raw||F,title:`原始 Markdown`,collapsed:!0})]})})]})}export{N as default};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
import{I as e,L as t}from"./index-Cyc27pJG.js";var n=encodeURIComponent,r=t=>e.get(`/c2/listeners`,t),i=t=>e.post(`/c2/listeners`,t),a=(t,r)=>e.put(`/c2/listeners/${n(t)}`,r),o=t=>e.del(`/c2/listeners/${n(t)}`),s=t=>e.post(`/c2/listeners/${n(t)}/start`,{}),c=t=>e.post(`/c2/listeners/${n(t)}/stop`,{}),l=t=>e.get(`/c2/sessions`,t),u=t=>e.get(`/c2/sessions/${n(t)}`),d=t=>e.del(`/c2/sessions/${n(t)}`),f=t=>e.del(`/c2/sessions`,{body:{ids:t}}),p=(t,{sleepSeconds:r,jitterPercent:i})=>e.put(`/c2/sessions/${n(t)}/sleep`,{sleep_seconds:r,jitter_percent:i}),m=(t,r)=>e.put(`/c2/sessions/${n(t)}/note`,{note:r}),h=t=>e.get(`/c2/tasks`,t),g=t=>e.get(`/c2/tasks/${n(t)}`),_=t=>e.post(`/c2/tasks`,t),v=(t,r)=>e.post(`/c2/sessions/${n(t)}/tasks`,r),y=t=>e.post(`/c2/tasks/${n(t)}/cancel`,{}),b=(t,r=30)=>e.get(`/c2/tasks/${n(t)}/wait`,{timeout:r},{timeout:(r+10)*1e3}),x=t=>e.del(`/c2/tasks`,{body:{ids:t}}),S=(e,r)=>t(`/c2/tasks/${n(e)}/result-file`,{filename:r}),C=t=>e.post(`/c2/payloads/oneliner`,t),w=t=>e.post(`/c2/payloads/build`,t),T=(e,r)=>t(`/c2/payloads/${n(e)}/download`,{filename:r}),E=t=>e.get(`/c2/events`,t),D=t=>e.del(`/c2/events`,{body:{ids:t}}),O=()=>e.get(`/c2/profiles`),k=t=>e.post(`/c2/profiles`,t),A=(t,r)=>e.put(`/c2/profiles/${n(t)}`,r),j=t=>e.del(`/c2/profiles/${n(t)}`);async function M(){try{let t=await e.get(`/projects`,{limit:200});return Array.isArray(t?.projects)?t.projects:[]}catch{return[]}}export{b as A,h as C,c as D,s as E,a as O,l as S,p as T,g as _,k as a,O as b,D as c,d,f,u as g,S as h,i,A as k,o as l,T as m,w as n,v as o,x as p,y as r,_ as s,C as t,j as u,E as v,m as w,M as x,r as y};
|
||||
import{I as e,L as t}from"./index-FWC8CWwt.js";var n=encodeURIComponent,r=t=>e.get(`/c2/listeners`,t),i=t=>e.post(`/c2/listeners`,t),a=(t,r)=>e.put(`/c2/listeners/${n(t)}`,r),o=t=>e.del(`/c2/listeners/${n(t)}`),s=t=>e.post(`/c2/listeners/${n(t)}/start`,{}),c=t=>e.post(`/c2/listeners/${n(t)}/stop`,{}),l=t=>e.get(`/c2/sessions`,t),u=t=>e.get(`/c2/sessions/${n(t)}`),d=t=>e.del(`/c2/sessions/${n(t)}`),f=t=>e.del(`/c2/sessions`,{body:{ids:t}}),p=(t,{sleepSeconds:r,jitterPercent:i})=>e.put(`/c2/sessions/${n(t)}/sleep`,{sleep_seconds:r,jitter_percent:i}),m=(t,r)=>e.put(`/c2/sessions/${n(t)}/note`,{note:r}),h=t=>e.get(`/c2/tasks`,t),g=t=>e.get(`/c2/tasks/${n(t)}`),_=t=>e.post(`/c2/tasks`,t),v=(t,r)=>e.post(`/c2/sessions/${n(t)}/tasks`,r),y=t=>e.post(`/c2/tasks/${n(t)}/cancel`,{}),b=(t,r=30)=>e.get(`/c2/tasks/${n(t)}/wait`,{timeout:r},{timeout:(r+10)*1e3}),x=t=>e.del(`/c2/tasks`,{body:{ids:t}}),S=(e,r)=>t(`/c2/tasks/${n(e)}/result-file`,{filename:r}),C=t=>e.post(`/c2/payloads/oneliner`,t),w=t=>e.post(`/c2/payloads/build`,t),T=(e,r)=>t(`/c2/payloads/${n(e)}/download`,{filename:r}),E=t=>e.get(`/c2/events`,t),D=t=>e.del(`/c2/events`,{body:{ids:t}}),O=()=>e.get(`/c2/profiles`),k=t=>e.post(`/c2/profiles`,t),A=(t,r)=>e.put(`/c2/profiles/${n(t)}`,r),j=t=>e.del(`/c2/profiles/${n(t)}`);async function M(){try{let t=await e.get(`/projects`,{limit:200});return Array.isArray(t?.projects)?t.projects:[]}catch{return[]}}export{b as A,h as C,c as D,s as E,a as O,l as S,p as T,g as _,k as a,O as b,D as c,d,f,u as g,S as h,i,A as k,o as l,T as m,w as n,v as o,x as p,y as r,_ as s,C as t,j as u,E as v,m as w,M as x,r as y};
|
||||
|
|
@ -1 +1 @@
|
|||
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{I as t,P as n,U as r}from"./semi-DNxeCrHm.js";import{E as i,P as a,k as o}from"./index-Cyc27pJG.js";import"./c2-shared-DRwD2-ub.js";import{t as s}from"./react-QV7DAAIx.js";var c=e(s(),1),{Text:l}=r,u=[{value:`http_beacon`,label:`HTTP Beacon`},{value:`https_beacon`,label:`HTTPS Beacon`},{value:`tcp_reverse`,label:`TCP 反向`},{value:`websocket`,label:`WebSocket`}],d={running:`运行中`,stopped:`已停止`,error:`异常`},f={tcp_reverse:[{value:`bash`,label:`Bash (/dev/tcp)`},{value:`nc`,label:`Netcat (-e)`},{value:`nc_mkfifo`,label:`Netcat (mkfifo)`},{value:`python`,label:`Python`},{value:`perl`,label:`Perl`},{value:`powershell`,label:`PowerShell`}],http_beacon:[{value:`curl_beacon`,label:`Curl Beacon (HTTP)`}],https_beacon:[{value:`curl_beacon`,label:`Curl Beacon (HTTP)`}],websocket:[{value:`curl_beacon`,label:`Curl Beacon (HTTP)`}]},p=[{value:`shell`,label:`shell`},{value:`exec`,label:`exec`},{value:`ls`,label:`ls`},{value:`pwd`,label:`pwd`},{value:`cd`,label:`cd`},{value:`ps`,label:`ps`},{value:`kill_proc`,label:`kill_proc`},{value:`download`,label:`download`},{value:`upload`,label:`upload`},{value:`screenshot`,label:`screenshot`},{value:`sleep`,label:`sleep`},{value:`exit`,label:`exit`},{value:`self_delete`,label:`self_delete`},{value:`port_fwd`,label:`port_fwd`},{value:`socks_start`,label:`socks_start`},{value:`socks_stop`,label:`socks_stop`},{value:`load_assembly`,label:`load_assembly`},{value:`persist`,label:`persist`}],m=[{value:`queued`,label:`队列中`},{value:`sent`,label:`已发送`},{value:`running`,label:`执行中`},{value:`success`,label:`成功`},{value:`failed`,label:`失败`},{value:`cancelled`,label:`已取消`}],h=[{value:`info`,label:`信息`},{value:`warn`,label:`警告`},{value:`critical`,label:`严重`}],g=[{value:`listener`,label:`监听器`},{value:`session`,label:`会话`},{value:`task`,label:`任务`},{value:`payload`,label:`Payload`},{value:`opsec`,label:`OPSEC`}],_=[{value:`active`,label:`活跃`},{value:`sleeping`,label:`休眠`},{value:`dead`,label:`离线`},{value:`killed`,label:`已终止`}],v=[{value:`15m`,label:`最近15分钟`,ms:9e5},{value:`1h`,label:`最近1小时`,ms:36e5},{value:`24h`,label:`最近24小时`,ms:864e5},{value:`7d`,label:`最近7天`,ms:6048e5},{value:`all`,label:`全部`,ms:0}];function y(e){let t=v.find(t=>t.value===e);return!t||!t.ms?``:new Date(Date.now()-t.ms).toISOString()}function b({value:e,onChange:r,ns:i=`tasks`}){let o=a();return(0,c.jsxs)(n,{spacing:6,wrap:!0,className:`c2-time-presets`,children:[(0,c.jsx)(l,{type:`tertiary`,size:`small`,children:o(`c2.tasks.timePresets`,null,`快捷`)}),v.map(n=>(0,c.jsx)(t,{size:`small`,theme:n.value===e?`solid`:`borderless`,type:n.value===e?`primary`:`tertiary`,onClick:()=>r(n.value),children:o(`c2.${i}.preset${n.value===`all`?`All`:n.value}`,null,n.label)},n.value))]})}function x(e){let t=Number(e);return!Number.isFinite(t)||t<=0?`—`:t<1e3?`${Math.round(t)}ms`:t<6e4?`${(t/1e3).toFixed(1)}秒`:`${Math.round(t/6e4)}分钟`}function S({value:e}){let t=a();return e?(0,c.jsx)(`span`,{className:`c2-time-text`,title:i(e),children:o(e,t)}):(0,c.jsx)(l,{type:`tertiary`,children:`—`})}var C={running:`green`,stopped:`grey`,error:`red`},w={queued:`amber`,sent:`blue`,running:`blue`,success:`green`,failed:`red`,cancelled:`grey`},T={active:`green`,sleeping:`amber`,dead:`grey`,killed:`red`},E={info:`blue`,warn:`amber`,critical:`red`};export{d as a,T as c,m as d,p as f,y as g,x as h,C as i,_ as l,S as m,E as n,u as o,b as p,h as r,f as s,g as t,w as u};
|
||||
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{I as t,P as n,U as r}from"./semi-DNxeCrHm.js";import{E as i,P as a,k as o}from"./index-FWC8CWwt.js";import"./c2-shared-Bx7Ynuhk.js";import{t as s}from"./react-QV7DAAIx.js";var c=e(s(),1),{Text:l}=r,u=[{value:`http_beacon`,label:`HTTP Beacon`},{value:`https_beacon`,label:`HTTPS Beacon`},{value:`tcp_reverse`,label:`TCP 反向`},{value:`websocket`,label:`WebSocket`}],d={running:`运行中`,stopped:`已停止`,error:`异常`},f={tcp_reverse:[{value:`bash`,label:`Bash (/dev/tcp)`},{value:`nc`,label:`Netcat (-e)`},{value:`nc_mkfifo`,label:`Netcat (mkfifo)`},{value:`python`,label:`Python`},{value:`perl`,label:`Perl`},{value:`powershell`,label:`PowerShell`}],http_beacon:[{value:`curl_beacon`,label:`Curl Beacon (HTTP)`}],https_beacon:[{value:`curl_beacon`,label:`Curl Beacon (HTTP)`}],websocket:[{value:`curl_beacon`,label:`Curl Beacon (HTTP)`}]},p=[{value:`shell`,label:`shell`},{value:`exec`,label:`exec`},{value:`ls`,label:`ls`},{value:`pwd`,label:`pwd`},{value:`cd`,label:`cd`},{value:`ps`,label:`ps`},{value:`kill_proc`,label:`kill_proc`},{value:`download`,label:`download`},{value:`upload`,label:`upload`},{value:`screenshot`,label:`screenshot`},{value:`sleep`,label:`sleep`},{value:`exit`,label:`exit`},{value:`self_delete`,label:`self_delete`},{value:`port_fwd`,label:`port_fwd`},{value:`socks_start`,label:`socks_start`},{value:`socks_stop`,label:`socks_stop`},{value:`load_assembly`,label:`load_assembly`},{value:`persist`,label:`persist`}],m=[{value:`queued`,label:`队列中`},{value:`sent`,label:`已发送`},{value:`running`,label:`执行中`},{value:`success`,label:`成功`},{value:`failed`,label:`失败`},{value:`cancelled`,label:`已取消`}],h=[{value:`info`,label:`信息`},{value:`warn`,label:`警告`},{value:`critical`,label:`严重`}],g=[{value:`listener`,label:`监听器`},{value:`session`,label:`会话`},{value:`task`,label:`任务`},{value:`payload`,label:`Payload`},{value:`opsec`,label:`OPSEC`}],_=[{value:`active`,label:`活跃`},{value:`sleeping`,label:`休眠`},{value:`dead`,label:`离线`},{value:`killed`,label:`已终止`}],v=[{value:`15m`,label:`最近15分钟`,ms:9e5},{value:`1h`,label:`最近1小时`,ms:36e5},{value:`24h`,label:`最近24小时`,ms:864e5},{value:`7d`,label:`最近7天`,ms:6048e5},{value:`all`,label:`全部`,ms:0}];function y(e){let t=v.find(t=>t.value===e);return!t||!t.ms?``:new Date(Date.now()-t.ms).toISOString()}function b({value:e,onChange:r,ns:i=`tasks`}){let o=a();return(0,c.jsxs)(n,{spacing:6,wrap:!0,className:`c2-time-presets`,children:[(0,c.jsx)(l,{type:`tertiary`,size:`small`,children:o(`c2.tasks.timePresets`,null,`快捷`)}),v.map(n=>(0,c.jsx)(t,{size:`small`,theme:n.value===e?`solid`:`borderless`,type:n.value===e?`primary`:`tertiary`,onClick:()=>r(n.value),children:o(`c2.${i}.preset${n.value===`all`?`All`:n.value}`,null,n.label)},n.value))]})}function x(e){let t=Number(e);return!Number.isFinite(t)||t<=0?`—`:t<1e3?`${Math.round(t)}ms`:t<6e4?`${(t/1e3).toFixed(1)}秒`:`${Math.round(t/6e4)}分钟`}function S({value:e}){let t=a();return e?(0,c.jsx)(`span`,{className:`c2-time-text`,title:i(e),children:o(e,t)}):(0,c.jsx)(l,{type:`tertiary`,children:`—`})}var C={running:`green`,stopped:`grey`,error:`red`},w={queued:`amber`,sent:`blue`,running:`blue`,success:`green`,failed:`red`,cancelled:`grey`},T={active:`green`,sleeping:`amber`,dead:`grey`,killed:`red`},E={info:`blue`,warn:`amber`,critical:`red`};export{d as a,T as c,m as d,p as f,y as g,x as h,C as i,_ as l,S as m,E as n,u as o,b as p,h as r,f as s,g as t,w as u};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
.assessment-page{flex-direction:column;gap:12px;display:flex}.assessment-page .cs-page-header-extra{flex-wrap:wrap;justify-content:flex-end}.assessment-meta{align-items:center;margin-top:6px}.assessment-banner{margin-bottom:0}.assessment-tabs{background:var(--semi-color-bg-1);border-radius:var(--semi-border-radius-large);padding:4px 16px 16px}.assessment-tab{flex-direction:column;gap:12px;padding-top:4px;display:flex}.assessment-loading{color:var(--semi-color-text-2);justify-content:center;align-items:center;padding:48px;display:flex}.assessment-hint{color:var(--semi-color-text-2);margin:8px 0 0;font-size:12px}.assessment-view-options{white-space:nowrap}.assessment-toolbar{flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:12px;display:flex}.assessment-pager{justify-content:flex-end;padding-top:12px;display:flex}.assessment-list-name{flex-direction:column;gap:2px;min-width:0;display:flex}.assessment-link{text-align:left;justify-content:flex-start;height:auto;padding:0;font-weight:600}.assessment-ellipsis{text-overflow:ellipsis;white-space:nowrap;max-width:420px;overflow:hidden}.assessment-progress{flex-direction:column;gap:4px;display:flex}.assessment-progress .semi-progress-track{min-width:120px}.assessment-pre{white-space:pre-wrap;word-break:break-word;margin:0;font-family:inherit;line-height:1.6}.assessment-facts-row{flex-wrap:wrap;gap:16px;margin-top:12px;display:flex}.assessment-guidance{border-top:1px solid var(--semi-color-border);flex-direction:column;gap:8px;margin-top:16px;padding-top:12px;display:flex}.assessment-guidance-item{grid-template-columns:32px minmax(0,1fr);align-items:start;gap:8px;display:grid}.assessment-section{border-top:1px solid var(--semi-color-border);flex-direction:column;gap:8px;margin-top:4px;padding-top:12px;display:flex}.assessment-timeline{max-height:480px;padding-right:8px;overflow-y:auto}.assessment-event-head{align-items:center;gap:8px;display:flex}.assessment-event-message{white-space:pre-wrap;word-break:break-word;color:var(--semi-color-text-1);margin-top:2px;font-size:12px}.assessment-drawer{flex-direction:column;gap:12px;display:flex}.assessment-form-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:0 16px;display:grid}.assessment-form-note{margin-top:8px}.assessment-form-actions{border-top:1px solid var(--semi-color-border);justify-content:flex-end;gap:8px;margin-top:16px;padding-top:12px;display:flex}.assessment-graph-meta,.assessment-graph-toolbar{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px;margin-bottom:8px;display:flex}.assessment-graph-layout{grid-template-columns:minmax(0,1fr) 340px;align-items:stretch;gap:12px;display:grid}.assessment-graph-canvas{border:1px solid var(--semi-color-border);border-radius:var(--semi-border-radius-medium);background:var(--semi-color-bg-2);width:100%;height:520px;overflow:hidden}.assessment-node-panel{border:1px solid var(--semi-color-border);border-radius:var(--semi-border-radius-medium);background:var(--semi-color-bg-1);height:520px;padding:12px;overflow-y:auto}.assessment-node-body{flex-direction:column;gap:10px;display:flex}.assessment-node-head{flex-direction:column;gap:6px;display:flex}.assessment-node-content{border-radius:var(--semi-border-radius-small);background:var(--semi-color-fill-0);max-height:220px;padding:8px;overflow-y:auto}.assessment-relations{flex-wrap:wrap;gap:4px;display:flex}.assessment-path-list{flex-direction:column;gap:4px;max-height:240px;display:flex;overflow-y:auto}.assessment-path-node{border-radius:var(--semi-border-radius-small);background:var(--semi-color-fill-0);align-items:center;gap:8px;min-width:0;padding:4px 6px;display:flex}.assessment-report{max-width:960px}@media (max-width:1180px){.assessment-graph-layout{grid-template-columns:minmax(0,1fr)}.assessment-node-panel{height:auto;max-height:420px}}@media (max-width:720px){.assessment-form-grid{grid-template-columns:minmax(0,1fr)}.assessment-graph-canvas{height:420px}}.assessment-error-block{flex-direction:column;align-items:flex-start;gap:8px;margin-bottom:12px;display:flex}
|
||||
.assessment-page{flex-direction:column;gap:12px;display:flex}.assessment-page .cs-page-header-extra{flex-wrap:wrap;justify-content:flex-end}.assessment-meta{align-items:center;margin-top:6px}.assessment-banner{margin-bottom:0}.assessment-tabs{background:var(--semi-color-bg-1);border-radius:var(--semi-border-radius-large);padding:4px 16px 16px}.assessment-tab{flex-direction:column;gap:12px;padding-top:4px;display:flex}.assessment-loading{color:var(--semi-color-text-2);justify-content:center;align-items:center;padding:48px;display:flex}.assessment-hint{color:var(--semi-color-text-2);margin:8px 0 0;font-size:12px}.assessment-view-options{white-space:nowrap}.assessment-toolbar{flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:12px;display:flex}.assessment-pager{justify-content:flex-end;padding-top:12px;display:flex}.assessment-list-name{flex-direction:column;gap:2px;min-width:0;display:flex}.assessment-link{text-align:left;justify-content:flex-start;height:auto;padding:0;font-weight:600}.assessment-ellipsis{text-overflow:ellipsis;white-space:nowrap;max-width:420px;overflow:hidden}.assessment-progress{flex-direction:column;gap:4px;display:flex}.assessment-progress .semi-progress-track{min-width:120px}.assessment-pre{white-space:pre-wrap;word-break:break-word;margin:0;font-family:inherit;line-height:1.6}.assessment-facts-row{flex-wrap:wrap;gap:16px;margin-top:12px;display:flex}.assessment-guidance{border-top:1px solid var(--semi-color-border);flex-direction:column;gap:8px;margin-top:16px;padding-top:12px;display:flex}.assessment-guidance-item{grid-template-columns:32px minmax(0,1fr);align-items:start;gap:8px;display:grid}.assessment-section{border-top:1px solid var(--semi-color-border);flex-direction:column;gap:8px;margin-top:4px;padding-top:12px;display:flex}.assessment-timeline{max-height:480px;padding-right:8px;overflow-y:auto}.assessment-event-head{align-items:center;gap:8px;display:flex}.assessment-event-message{white-space:pre-wrap;word-break:break-word;color:var(--semi-color-text-1);margin-top:2px;font-size:12px}.assessment-drawer{flex-direction:column;gap:12px;display:flex}.assessment-form-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:0 16px;display:grid}.assessment-form-note{margin-top:8px}.assessment-form-actions{justify-content:flex-end;gap:8px;display:flex}.assessment-graph-meta,.assessment-graph-toolbar{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px;margin-bottom:8px;display:flex}.assessment-graph-layout{grid-template-columns:minmax(0,1fr) 340px;align-items:stretch;gap:12px;display:grid}.assessment-graph-canvas{border:1px solid var(--semi-color-border);border-radius:var(--semi-border-radius-medium);background:var(--semi-color-bg-2);width:100%;height:520px;overflow:hidden}.assessment-node-panel{border:1px solid var(--semi-color-border);border-radius:var(--semi-border-radius-medium);background:var(--semi-color-bg-1);height:520px;padding:12px;overflow-y:auto}.assessment-node-body{flex-direction:column;gap:10px;display:flex}.assessment-node-head{flex-direction:column;gap:6px;display:flex}.assessment-node-content{border-radius:var(--semi-border-radius-small);background:var(--semi-color-fill-0);max-height:220px;padding:8px;overflow-y:auto}.assessment-relations{flex-wrap:wrap;gap:4px;display:flex}.assessment-path-list{flex-direction:column;gap:4px;max-height:240px;display:flex;overflow-y:auto}.assessment-path-node{border-radius:var(--semi-border-radius-small);background:var(--semi-color-fill-0);align-items:center;gap:8px;min-width:0;padding:4px 6px;display:flex}.assessment-report{max-width:960px}@media (max-width:1180px){.assessment-graph-layout{grid-template-columns:minmax(0,1fr)}.assessment-node-panel{height:auto;max-height:420px}}@media (max-width:720px){.assessment-form-grid{grid-template-columns:minmax(0,1fr)}.assessment-graph-canvas{height:420px}}.assessment-error-block{flex-direction:column;align-items:flex-start;gap:8px;margin-bottom:12px;display:flex}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{S as t,t as n}from"./react-QV7DAAIx.js";import{I as r,P as i,U as a,V as o,it as s,j as c,rt as l,xt as u}from"./semi-DNxeCrHm.js";import{E as d,F as f,I as p,P as m,a as h,c as g,d as _,l as v,m as y,p as b,s as x,u as S,x as C,y as w}from"./index-Cyc27pJG.js";var T=e(t(),1),E=e(n(),1),{Text:D}=a;function O(){let e=m(),{hasPermission:t}=f(),n=t(`knowledge:delete`),[a,O]=(0,T.useState)(``),[k,A]=(0,T.useState)(50),[j,M]=(0,T.useState)(null),N=h(()=>p.get(`/knowledge/retrieval-logs`,{conversationId:a||void 0,limit:k}),[a,k]),P=Array.isArray(N.data?.logs)?N.data.logs:[],F=e=>w({title:`删除该检索日志?`,content:e.query||e.id,onOk:async()=>{await p.del(`/knowledge/retrieval-logs/${encodeURIComponent(e.id)}`),C(`已删除`),N.reload()}});return(0,E.jsxs)(`div`,{children:[(0,E.jsx)(b,{title:e(`knowledge.retrievalLogsTitle`,null,`检索历史`),description:`记录智能体每次知识库检索的语句、命中项与会话,用于回溯回答依据。`,extra:(0,E.jsx)(r,{icon:(0,E.jsx)(s,{}),onClick:()=>N.reload(),loading:N.loading,children:`刷新`})}),(0,E.jsxs)(y,{title:`检索记录(${P.length})`,children:[(0,E.jsx)(v,{error:N.error,onRetry:()=>N.reload()}),(0,E.jsx)(x,{columns:[{title:`检索语句`,dataIndex:`query`,render:(e,t)=>(0,E.jsx)(`button`,{type:`button`,className:`link-button`,onClick:()=>M(t),style:{background:`none`,border:`none`,padding:0,cursor:`pointer`,textAlign:`left`,color:`var(--semi-color-primary)`},children:e||`—`})},{title:`风险类型`,dataIndex:`riskType`,width:140,render:e=>e?(0,E.jsx)(c,{size:`small`,children:e}):`—`},{title:`命中知识项`,dataIndex:`retrievedItems`,width:120,render:e=>(0,E.jsxs)(D,{type:`tertiary`,children:[Array.isArray(e)?e.length:0,` 条`]})},{title:`会话`,dataIndex:`conversationId`,width:200,render:e=>(0,E.jsx)(D,{type:`tertiary`,ellipsis:{showTooltip:!0},children:e||`—`})},{title:`时间`,dataIndex:`createdAt`,width:180,render:e=>d(e)},{title:`操作`,width:110,render:(e,t)=>(0,E.jsxs)(i,{children:[(0,E.jsx)(r,{size:`small`,theme:`borderless`,onClick:()=>M(t),children:`详情`}),n&&(0,E.jsx)(r,{size:`small`,theme:`borderless`,type:`danger`,icon:(0,E.jsx)(u,{}),onClick:()=>F(t)})]})}],dataSource:P,rowKey:`id`,loading:N.loading,pagination:!1,toolbar:(0,E.jsxs)(i,{children:[(0,E.jsx)(o,{prefix:(0,E.jsx)(l,{}),placeholder:`按会话 ID 过滤`,value:a,onChange:O,style:{width:260}}),(0,E.jsx)(o,{placeholder:`条数`,value:String(k),onChange:e=>A(Math.min(Math.max(Number(e)||50,1),500)),style:{width:100},suffix:(0,E.jsx)(D,{type:`tertiary`,children:`条`})})]})})]}),(0,E.jsx)(g,{title:`检索日志详情`,visible:!!j,onCancel:()=>M(null),width:560,children:j&&(0,E.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,E.jsx)(_,{items:[{label:`日志 ID`,value:j.id},{label:`检索语句`,value:j.query},{label:`风险类型`,value:j.riskType||`—`},{label:`会话 ID`,value:j.conversationId||`—`},{label:`消息 ID`,value:j.messageId||`—`},{label:`时间`,value:d(j.createdAt)}]}),(0,E.jsx)(S,{value:j.retrievedItems||[],title:`命中知识项`})]})})]})}export{O as default};
|
||||
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{S as t,t as n}from"./react-QV7DAAIx.js";import{I as r,P as i,U as a,V as o,it as s,j as c,rt as l,xt as u}from"./semi-DNxeCrHm.js";import{E as d,F as f,I as p,P as m,a as h,c as g,d as _,l as v,m as y,p as b,s as x,u as S,x as C,y as w}from"./index-FWC8CWwt.js";var T=e(t(),1),E=e(n(),1),{Text:D}=a;function O(){let e=m(),{hasPermission:t}=f(),n=t(`knowledge:delete`),[a,O]=(0,T.useState)(``),[k,A]=(0,T.useState)(50),[j,M]=(0,T.useState)(null),N=h(()=>p.get(`/knowledge/retrieval-logs`,{conversationId:a||void 0,limit:k}),[a,k]),P=Array.isArray(N.data?.logs)?N.data.logs:[],F=e=>w({title:`删除该检索日志?`,content:e.query||e.id,onOk:async()=>{await p.del(`/knowledge/retrieval-logs/${encodeURIComponent(e.id)}`),C(`已删除`),N.reload()}});return(0,E.jsxs)(`div`,{children:[(0,E.jsx)(b,{title:e(`knowledge.retrievalLogsTitle`,null,`检索历史`),description:`记录智能体每次知识库检索的语句、命中项与会话,用于回溯回答依据。`,extra:(0,E.jsx)(r,{icon:(0,E.jsx)(s,{}),onClick:()=>N.reload(),loading:N.loading,children:`刷新`})}),(0,E.jsxs)(y,{title:`检索记录(${P.length})`,children:[(0,E.jsx)(v,{error:N.error,onRetry:()=>N.reload()}),(0,E.jsx)(x,{columns:[{title:`检索语句`,dataIndex:`query`,render:(e,t)=>(0,E.jsx)(`button`,{type:`button`,className:`link-button`,onClick:()=>M(t),style:{background:`none`,border:`none`,padding:0,cursor:`pointer`,textAlign:`left`,color:`var(--semi-color-primary)`},children:e||`—`})},{title:`风险类型`,dataIndex:`riskType`,width:140,render:e=>e?(0,E.jsx)(c,{size:`small`,children:e}):`—`},{title:`命中知识项`,dataIndex:`retrievedItems`,width:120,render:e=>(0,E.jsxs)(D,{type:`tertiary`,children:[Array.isArray(e)?e.length:0,` 条`]})},{title:`会话`,dataIndex:`conversationId`,width:200,render:e=>(0,E.jsx)(D,{type:`tertiary`,ellipsis:{showTooltip:!0},children:e||`—`})},{title:`时间`,dataIndex:`createdAt`,width:180,render:e=>d(e)},{title:`操作`,width:110,render:(e,t)=>(0,E.jsxs)(i,{children:[(0,E.jsx)(r,{size:`small`,theme:`borderless`,onClick:()=>M(t),children:`详情`}),n&&(0,E.jsx)(r,{size:`small`,theme:`borderless`,type:`danger`,icon:(0,E.jsx)(u,{}),onClick:()=>F(t)})]})}],dataSource:P,rowKey:`id`,loading:N.loading,pagination:!1,toolbar:(0,E.jsxs)(i,{children:[(0,E.jsx)(o,{prefix:(0,E.jsx)(l,{}),placeholder:`按会话 ID 过滤`,value:a,onChange:O,style:{width:260}}),(0,E.jsx)(o,{placeholder:`条数`,value:String(k),onChange:e=>A(Math.min(Math.max(Number(e)||50,1),500)),style:{width:100},suffix:(0,E.jsx)(D,{type:`tertiary`,children:`条`})})]})})]}),(0,E.jsx)(g,{title:`检索日志详情`,visible:!!j,onCancel:()=>M(null),width:560,children:j&&(0,E.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,E.jsx)(_,{items:[{label:`日志 ID`,value:j.id},{label:`检索语句`,value:j.query},{label:`风险类型`,value:j.riskType||`—`},{label:`会话 ID`,value:j.conversationId||`—`},{label:`消息 ID`,value:j.messageId||`—`},{label:`时间`,value:d(j.createdAt)}]}),(0,E.jsx)(S,{value:j.retrievedItems||[],title:`命中知识项`})]})})]})}export{O as default};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{S as t,t as n}from"./react-QV7DAAIx.js";import{C as r,I as i,P as a,U as o,i as s}from"./semi-DNxeCrHm.js";import{I as c,P as l,l as u,x as d}from"./index-Cyc27pJG.js";var f=e(t(),1),p=e(n(),1),{Text:m}=o,h=120,g=4e3;function _({visible:e,project:t,onCancel:n,onSaved:o}){let _=l(),[v,y]=(0,f.useState)(!1),[b,x]=(0,f.useState)(null),S=!!t?.id;return(0,f.useEffect)(()=>{x(null)},[e,t?.id]),(0,p.jsxs)(r,{visible:e,width:560,maskClosable:!1,footer:null,onCancel:n,title:S?_(`projects.modalEditTitle`,null,`编辑项目`):_(`projects.modalNewTitle`,null,`新建项目`),children:[(0,p.jsx)(m,{type:`tertiary`,size:`small`,children:S?_(`projects.modalEditSubtitle`,null,`修改项目名称与描述`):_(`projects.modalNewSubtitle`,null,`创建后可绑定对话,跨会话共享事实黑板`)}),(0,p.jsxs)(s,{onSubmit:async e=>{y(!0),x(null);try{let n={name:e.name.trim(),description:(e.description||``).slice(0,g)},r=S?await c.put(`/projects/${t.id}`,n):await c.post(`/projects`,n);d(S?_(`projects.saved`,null,`已保存`):_(`projects.createProject`,null,`创建项目`)),o?.(r)}catch(e){x(e)}finally{y(!1)}},initValues:{name:t?.name||``,description:t?.description||``},children:[(0,p.jsx)(s.Input,{field:`name`,maxLength:h,label:_(`projects.projectName`,null,`项目名称`),placeholder:_(`projects.projectNamePlaceholder`,null,`例如:某客户 Web 渗透`),rules:[{required:!0,whitespace:!0,message:_(`projects.enterProjectName`,null,`请输入项目名称`)}]}),(0,p.jsx)(s.TextArea,{field:`description`,rows:4,maxCount:g,label:_(`projects.projectDescription`,null,`项目描述`),placeholder:_(`projects.projectDescriptionPlaceholder`,null,`客户/任务备注、协作说明…`),extraText:_(`projects.descriptionLengthHint`,null,`仅供团队成员查阅,Agent 不会读取;需让 Agent 知晓的内容请写入事实黑板`)}),(0,p.jsx)(u,{error:b}),(0,p.jsxs)(a,{style:{display:`flex`,justifyContent:`flex-end`,width:`100%`,marginTop:12},children:[(0,p.jsx)(i,{onClick:n,children:_(`common.cancel`,null,`取消`)}),(0,p.jsx)(i,{htmlType:`submit`,theme:`solid`,loading:v,children:S?_(`projects.saveChanges`,null,`保存修改`):_(`projects.createProject`,null,`创建项目`)})]})]},`${e}-${t?.id||`new`}`)]})}export{_ as t};
|
||||
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{S as t,t as n}from"./react-QV7DAAIx.js";import{C as r,I as i,P as a,U as o,i as s}from"./semi-DNxeCrHm.js";import{I as c,P as l,l as u,x as d}from"./index-FWC8CWwt.js";var f=e(t(),1),p=e(n(),1),{Text:m}=o,h=120,g=4e3;function _({visible:e,project:t,onCancel:n,onSaved:o}){let _=l(),[v,y]=(0,f.useState)(!1),[b,x]=(0,f.useState)(null),S=!!t?.id;return(0,f.useEffect)(()=>{x(null)},[e,t?.id]),(0,p.jsxs)(r,{visible:e,width:560,maskClosable:!1,footer:null,onCancel:n,title:S?_(`projects.modalEditTitle`,null,`编辑项目`):_(`projects.modalNewTitle`,null,`新建项目`),children:[(0,p.jsx)(m,{type:`tertiary`,size:`small`,children:S?_(`projects.modalEditSubtitle`,null,`修改项目名称与描述`):_(`projects.modalNewSubtitle`,null,`创建后可绑定对话,跨会话共享事实黑板`)}),(0,p.jsxs)(s,{onSubmit:async e=>{y(!0),x(null);try{let n={name:e.name.trim(),description:(e.description||``).slice(0,g)},r=S?await c.put(`/projects/${t.id}`,n):await c.post(`/projects`,n);d(S?_(`projects.saved`,null,`已保存`):_(`projects.createProject`,null,`创建项目`)),o?.(r)}catch(e){x(e)}finally{y(!1)}},initValues:{name:t?.name||``,description:t?.description||``},children:[(0,p.jsx)(s.Input,{field:`name`,maxLength:h,label:_(`projects.projectName`,null,`项目名称`),placeholder:_(`projects.projectNamePlaceholder`,null,`例如:某客户 Web 渗透`),rules:[{required:!0,whitespace:!0,message:_(`projects.enterProjectName`,null,`请输入项目名称`)}]}),(0,p.jsx)(s.TextArea,{field:`description`,rows:4,maxCount:g,label:_(`projects.projectDescription`,null,`项目描述`),placeholder:_(`projects.projectDescriptionPlaceholder`,null,`客户/任务备注、协作说明…`),extraText:_(`projects.descriptionLengthHint`,null,`仅供团队成员查阅,Agent 不会读取;需让 Agent 知晓的内容请写入事实黑板`)}),(0,p.jsx)(u,{error:b}),(0,p.jsxs)(a,{style:{display:`flex`,justifyContent:`flex-end`,width:`100%`,marginTop:12},children:[(0,p.jsx)(i,{onClick:n,children:_(`common.cancel`,null,`取消`)}),(0,p.jsx)(i,{htmlType:`submit`,theme:`solid`,loading:v,children:S?_(`projects.saveChanges`,null,`保存修改`):_(`projects.createProject`,null,`创建项目`)})]})]},`${e}-${t?.id||`new`}`)]})}export{_ as t};
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{S as t,t as n}from"./react-QV7DAAIx.js";import{C as r,I as i,P as a,U as o,V as s,i as c,it as l,j as u,ot as d,rt as f,xt as p,yt as m}from"./semi-DNxeCrHm.js";import{F as h,I as g,P as _,a as v,b as y,l as b,m as x,p as S,s as C,x as w,y as T}from"./index-Cyc27pJG.js";var E=e(t(),1),D=e(n(),1),{Text:O}=o;function k(){let e=_(),{hasPermission:t}=h(),n=t(`roles:write`),o=t(`roles:delete`),[k,A]=(0,E.useState)(``),[j,M]=(0,E.useState)(null),[N,P]=(0,E.useState)(!1),F=v(()=>g.get(`/roles`),[]),I=(Array.isArray(F.data?.roles)?F.data.roles:[]).filter(e=>{if(!k)return!0;let t=k.toLowerCase();return[e.name,e.description].some(e=>String(e||``).toLowerCase().includes(t))}),L=async()=>{let e=await j.form.validate();P(!0);try{let t={name:e.name.trim(),description:e.description?.trim()||``,user_prompt:e.user_prompt||``,tools:String(e.tools||``).split(`,`).map(e=>e.trim()).filter(Boolean),enabled:e.enabled!==!1},n=j.role?.name;n&&n!==t.name?(await g.post(`/roles`,t),await g.del(`/roles/${encodeURIComponent(n)}`)):n?await g.put(`/roles/${encodeURIComponent(n)}`,t):await g.post(`/roles`,t),w(`角色已保存`),M(null),F.reload()}catch(e){y(e,`保存角色失败`)}finally{P(!1)}},R=e=>T({title:`删除角色「${e.name}」?`,content:`已绑定该角色的对话将失去对应提示词与工具配置。`,onOk:async()=>{await g.del(`/roles/${encodeURIComponent(e.name)}`),w(`已删除`),F.reload()}});return(0,D.jsxs)(`div`,{children:[(0,D.jsx)(S,{title:e(`roles.title`,null,`角色管理`),description:`角色定义对话的系统提示词、可用工具与绑定工作流。`,extra:(0,D.jsxs)(a,{children:[(0,D.jsx)(i,{icon:(0,D.jsx)(l,{}),onClick:()=>F.reload(),loading:F.loading,children:`刷新`}),n&&(0,D.jsx)(i,{theme:`solid`,type:`primary`,icon:(0,D.jsx)(d,{}),onClick:()=>M({role:null,form:{}}),children:`新建角色`})]})}),(0,D.jsxs)(x,{title:`角色(${I.length})`,children:[(0,D.jsx)(b,{error:F.error,onRetry:()=>F.reload()}),(0,D.jsx)(C,{columns:[{title:`角色`,dataIndex:`name`,render:(e,t)=>(0,D.jsxs)(a,{vertical:!0,spacing:0,align:`start`,children:[(0,D.jsxs)(a,{children:[(0,D.jsx)(O,{strong:!0,children:e}),t.enabled===!1&&(0,D.jsx)(u,{size:`small`,color:`grey`,children:`已停用`})]}),(0,D.jsx)(O,{type:`tertiary`,ellipsis:{showTooltip:!0},style:{maxWidth:460},children:t.description||`—`})]})},{title:`工具`,dataIndex:`tools`,width:260,render:e=>Array.isArray(e)&&e.length?(0,D.jsxs)(a,{wrap:!0,spacing:4,children:[e.slice(0,4).map(e=>(0,D.jsx)(u,{size:`small`,children:e},e)),e.length>4&&(0,D.jsxs)(O,{type:`tertiary`,children:[`+`,e.length-4]})]}):(0,D.jsx)(O,{type:`tertiary`,children:`未绑定`})},{title:`工作流`,dataIndex:`workflow_id`,width:160,render:e=>e||`—`},{title:`操作`,width:150,render:(e,t)=>(0,D.jsxs)(a,{children:[n&&(0,D.jsx)(i,{size:`small`,theme:`borderless`,icon:(0,D.jsx)(m,{}),onClick:()=>M({role:t,form:{}}),children:`编辑`}),o&&(0,D.jsx)(i,{size:`small`,theme:`borderless`,type:`danger`,icon:(0,D.jsx)(p,{}),onClick:()=>R(t)})]})}],dataSource:I,rowKey:`name`,loading:F.loading,pagination:{pageSize:20},toolbar:(0,D.jsx)(s,{prefix:(0,D.jsx)(f,{}),value:k,onChange:A,placeholder:`搜索角色名称`,style:{width:260}})})]}),(0,D.jsx)(r,{title:j?.role?`编辑角色`:`新建角色`,visible:!!j,onCancel:()=>M(null),onOk:L,confirmLoading:N,width:760,children:(0,D.jsxs)(c,{getFormApi:e=>M(t=>t&&{...t,form:e}),initValues:j?.role?{name:j.role.name,description:j.role.description,user_prompt:j.role.user_prompt,tools:Array.isArray(j.role.tools)?j.role.tools.join(`, `):``,enabled:j.role.enabled!==!1}:{enabled:!0},children:[(0,D.jsx)(c.Input,{field:`name`,label:`角色名称`,rules:[{required:!0,message:`请输入角色名称`}]}),(0,D.jsx)(c.Input,{field:`description`,label:`描述`}),(0,D.jsx)(c.Input,{field:`tools`,label:`工具(逗号分隔)`,placeholder:`toolName, mcp::toolName`}),(0,D.jsx)(c.TextArea,{field:`user_prompt`,label:`用户提示词(追加到用户消息前)`,autosize:{minRows:6,maxRows:18}}),(0,D.jsx)(c.Slot,{label:`启用`,children:(0,D.jsx)(c.Switch,{field:`enabled`})})]})},j?.role?.name||`new-role`)]})}export{k as default};
|
||||
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{S as t,t as n}from"./react-QV7DAAIx.js";import{C as r,I as i,P as a,U as o,V as s,i as c,it as l,j as u,ot as d,rt as f,xt as p,yt as m}from"./semi-DNxeCrHm.js";import{F as h,I as g,P as _,a as v,b as y,l as b,m as x,p as S,s as C,x as w,y as T}from"./index-FWC8CWwt.js";var E=e(t(),1),D=e(n(),1),{Text:O}=o;function k(){let e=_(),{hasPermission:t}=h(),n=t(`roles:write`),o=t(`roles:delete`),[k,A]=(0,E.useState)(``),[j,M]=(0,E.useState)(null),[N,P]=(0,E.useState)(!1),F=v(()=>g.get(`/roles`),[]),I=(Array.isArray(F.data?.roles)?F.data.roles:[]).filter(e=>{if(!k)return!0;let t=k.toLowerCase();return[e.name,e.description].some(e=>String(e||``).toLowerCase().includes(t))}),L=async()=>{let e=await j.form.validate();P(!0);try{let t={name:e.name.trim(),description:e.description?.trim()||``,user_prompt:e.user_prompt||``,tools:String(e.tools||``).split(`,`).map(e=>e.trim()).filter(Boolean),enabled:e.enabled!==!1},n=j.role?.name;n&&n!==t.name?(await g.post(`/roles`,t),await g.del(`/roles/${encodeURIComponent(n)}`)):n?await g.put(`/roles/${encodeURIComponent(n)}`,t):await g.post(`/roles`,t),w(`角色已保存`),M(null),F.reload()}catch(e){y(e,`保存角色失败`)}finally{P(!1)}},R=e=>T({title:`删除角色「${e.name}」?`,content:`已绑定该角色的对话将失去对应提示词与工具配置。`,onOk:async()=>{await g.del(`/roles/${encodeURIComponent(e.name)}`),w(`已删除`),F.reload()}});return(0,D.jsxs)(`div`,{children:[(0,D.jsx)(S,{title:e(`roles.title`,null,`角色管理`),description:`角色定义对话的系统提示词、可用工具与绑定工作流。`,extra:(0,D.jsxs)(a,{children:[(0,D.jsx)(i,{icon:(0,D.jsx)(l,{}),onClick:()=>F.reload(),loading:F.loading,children:`刷新`}),n&&(0,D.jsx)(i,{theme:`solid`,type:`primary`,icon:(0,D.jsx)(d,{}),onClick:()=>M({role:null,form:{}}),children:`新建角色`})]})}),(0,D.jsxs)(x,{title:`角色(${I.length})`,children:[(0,D.jsx)(b,{error:F.error,onRetry:()=>F.reload()}),(0,D.jsx)(C,{columns:[{title:`角色`,dataIndex:`name`,render:(e,t)=>(0,D.jsxs)(a,{vertical:!0,spacing:0,align:`start`,children:[(0,D.jsxs)(a,{children:[(0,D.jsx)(O,{strong:!0,children:e}),t.enabled===!1&&(0,D.jsx)(u,{size:`small`,color:`grey`,children:`已停用`})]}),(0,D.jsx)(O,{type:`tertiary`,ellipsis:{showTooltip:!0},style:{maxWidth:460},children:t.description||`—`})]})},{title:`工具`,dataIndex:`tools`,width:260,render:e=>Array.isArray(e)&&e.length?(0,D.jsxs)(a,{wrap:!0,spacing:4,children:[e.slice(0,4).map(e=>(0,D.jsx)(u,{size:`small`,children:e},e)),e.length>4&&(0,D.jsxs)(O,{type:`tertiary`,children:[`+`,e.length-4]})]}):(0,D.jsx)(O,{type:`tertiary`,children:`未绑定`})},{title:`工作流`,dataIndex:`workflow_id`,width:160,render:e=>e||`—`},{title:`操作`,width:150,render:(e,t)=>(0,D.jsxs)(a,{children:[n&&(0,D.jsx)(i,{size:`small`,theme:`borderless`,icon:(0,D.jsx)(m,{}),onClick:()=>M({role:t,form:{}}),children:`编辑`}),o&&(0,D.jsx)(i,{size:`small`,theme:`borderless`,type:`danger`,icon:(0,D.jsx)(p,{}),onClick:()=>R(t)})]})}],dataSource:I,rowKey:`name`,loading:F.loading,pagination:{pageSize:20},toolbar:(0,D.jsx)(s,{prefix:(0,D.jsx)(f,{}),value:k,onChange:A,placeholder:`搜索角色名称`,style:{width:260}})})]}),(0,D.jsx)(r,{title:j?.role?`编辑角色`:`新建角色`,visible:!!j,onCancel:()=>M(null),onOk:L,confirmLoading:N,width:760,children:(0,D.jsxs)(c,{getFormApi:e=>M(t=>t&&{...t,form:e}),initValues:j?.role?{name:j.role.name,description:j.role.description,user_prompt:j.role.user_prompt,tools:Array.isArray(j.role.tools)?j.role.tools.join(`, `):``,enabled:j.role.enabled!==!1}:{enabled:!0},children:[(0,D.jsx)(c.Input,{field:`name`,label:`角色名称`,rules:[{required:!0,message:`请输入角色名称`}]}),(0,D.jsx)(c.Input,{field:`description`,label:`描述`}),(0,D.jsx)(c.Input,{field:`tools`,label:`工具(逗号分隔)`,placeholder:`toolName, mcp::toolName`}),(0,D.jsx)(c.TextArea,{field:`user_prompt`,label:`用户提示词(追加到用户消息前)`,autosize:{minRows:6,maxRows:18}}),(0,D.jsx)(c.Slot,{label:`启用`,children:(0,D.jsx)(c.Switch,{field:`enabled`})})]})},j?.role?.name||`new-role`)]})}export{k as default};
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{S as t,_ as n,t as r,y as i}from"./react-QV7DAAIx.js";import{D as a,F as o,Ht as s,I as c,J as l,P as u,R as d,U as f,V as p,_ as m,b as h,bt as g,c as _,d as v,f as y,it as b,j as x,k as S,m as C,p as w,rt as T,s as E,u as D}from"./semi-DNxeCrHm.js";import{A as O,D as k,E as A,F as ee,I as j,L as M,M as N,N as P,P as F,R as I,S as L,T as R,_ as te,a as z,b as B,d as V,j as ne,l as H,m as U,n as re,o as ie,p as ae,s as W,u as G,x as K,y as oe}from"./index-Cyc27pJG.js";import{n as se,r as ce,t as le}from"./model-channel-mQ6lfvSO.js";var q=e(t(),1),J=class extends Error{constructor(e,t){super(t?`第 ${t} 行:${e}`:e),this.name=`YamlError`,this.line=t||0}},ue=/^(?:[-?:,\[\]{}#&*!|>'"%@`]|.*[:\s]$|.*\s#|.*[\n\r\t])/,de=/^(?:true|false|null|~|yes|no|on|off|[-+]?(?:\d+|\d*\.\d+)(?:[eE][-+]?\d+)?)$/i;function fe(e){let t=String(e);return!(t===``||de.test(t)||/^[-+]?(?:\d+\.\d*|\.\d+|\d+)(?:[eE][-+]?\d+)?$/.test(t)||ue.test(t)||/^(?:\s)|:(?:\s|$)|[\r\n\t]/.test(t)||/[,[\]{}]/.test(t)||/^[!&*|>@`]/.test(t))}function pe(e){return JSON.stringify(String(e))}function me(e){let t=String(e);return fe(t)?t:pe(t)}function he(e){if(e==null)return`null`;if(typeof e==`boolean`)return e?`true`:`false`;if(typeof e==`number`)return Number.isFinite(e)?String(e):pe(String(e));let t=String(e);return fe(t)?t:pe(t)}function ge(e){return e==null||[`string`,`number`,`boolean`].includes(typeof e)}function _e(e,t,n,r){let i=` `.repeat(n),a=me(e);if(ge(t))r.push(`${i}${a}: ${he(t)}`);else if(Array.isArray(t)){if(!t.length){r.push(`${i}${a}: []`);return}r.push(`${i}${a}:`),be(t,n+2,r)}else Object.entries(t).length?(r.push(`${i}${a}:`),ve(t,n+2,r)):r.push(`${i}${a}: {}`)}function ve(e,t,n){for(let[r,i]of Object.entries(e))_e(r,i,t,n)}function ye(e,t,n){let r=` `.repeat(t);if(ge(e)){n.push(`${r}- ${he(e)}`);return}if(Array.isArray(e)){if(!e.length){n.push(`${r}- []`);return}n.push(`${r}-`),be(e,t+2,n);return}let i=Object.entries(e);if(!i.length){n.push(`${r}- {}`);return}let[a,o]=i[0],s=i.slice(1);ge(o)?n.push(`${r}- ${me(a)}: ${he(o)}`):(n.push(`${r}-`),_e(a,o,t+2,n));for(let[e,r]of s)_e(e,r,t+2,n)}function be(e,t,n){for(let r of e)ye(r,t,n)}function xe(e,{header:t}={}){let n=[];if(t){for(let e of String(t).replace(/\r\n?/g,`
|
||||
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{S as t,_ as n,t as r,y as i}from"./react-QV7DAAIx.js";import{D as a,F as o,Ht as s,I as c,J as l,P as u,R as d,U as f,V as p,_ as m,b as h,bt as g,c as _,d as v,f as y,it as b,j as x,k as S,m as C,p as w,rt as T,s as E,u as D}from"./semi-DNxeCrHm.js";import{A as O,D as k,E as A,F as ee,I as j,L as M,M as N,N as P,P as F,R as I,S as L,T as R,_ as te,a as z,b as B,d as V,j as ne,l as H,m as U,n as re,o as ie,p as ae,s as W,u as G,x as K,y as oe}from"./index-FWC8CWwt.js";import{n as se,r as ce,t as le}from"./model-channel-mQ6lfvSO.js";var q=e(t(),1),J=class extends Error{constructor(e,t){super(t?`第 ${t} 行:${e}`:e),this.name=`YamlError`,this.line=t||0}},ue=/^(?:[-?:,\[\]{}#&*!|>'"%@`]|.*[:\s]$|.*\s#|.*[\n\r\t])/,de=/^(?:true|false|null|~|yes|no|on|off|[-+]?(?:\d+|\d*\.\d+)(?:[eE][-+]?\d+)?)$/i;function fe(e){let t=String(e);return!(t===``||de.test(t)||/^[-+]?(?:\d+\.\d*|\.\d+|\d+)(?:[eE][-+]?\d+)?$/.test(t)||ue.test(t)||/^(?:\s)|:(?:\s|$)|[\r\n\t]/.test(t)||/[,[\]{}]/.test(t)||/^[!&*|>@`]/.test(t))}function pe(e){return JSON.stringify(String(e))}function me(e){let t=String(e);return fe(t)?t:pe(t)}function he(e){if(e==null)return`null`;if(typeof e==`boolean`)return e?`true`:`false`;if(typeof e==`number`)return Number.isFinite(e)?String(e):pe(String(e));let t=String(e);return fe(t)?t:pe(t)}function ge(e){return e==null||[`string`,`number`,`boolean`].includes(typeof e)}function _e(e,t,n,r){let i=` `.repeat(n),a=me(e);if(ge(t))r.push(`${i}${a}: ${he(t)}`);else if(Array.isArray(t)){if(!t.length){r.push(`${i}${a}: []`);return}r.push(`${i}${a}:`),be(t,n+2,r)}else Object.entries(t).length?(r.push(`${i}${a}:`),ve(t,n+2,r)):r.push(`${i}${a}: {}`)}function ve(e,t,n){for(let[r,i]of Object.entries(e))_e(r,i,t,n)}function ye(e,t,n){let r=` `.repeat(t);if(ge(e)){n.push(`${r}- ${he(e)}`);return}if(Array.isArray(e)){if(!e.length){n.push(`${r}- []`);return}n.push(`${r}-`),be(e,t+2,n);return}let i=Object.entries(e);if(!i.length){n.push(`${r}- {}`);return}let[a,o]=i[0],s=i.slice(1);ge(o)?n.push(`${r}- ${me(a)}: ${he(o)}`):(n.push(`${r}-`),_e(a,o,t+2,n));for(let[e,r]of s)_e(e,r,t+2,n)}function be(e,t,n){for(let r of e)ye(r,t,n)}function xe(e,{header:t}={}){let n=[];if(t){for(let e of String(t).replace(/\r\n?/g,`
|
||||
`).split(`
|
||||
`))n.push(`# ${e}`.trimEnd());n.length&&n.push(``)}return ge(e)?(n.push(he(e)),`${n.join(`
|
||||
`)}\n`):Array.isArray(e)?(e.length?be(e,0,n):n.push(`[]`),`${n.join(`
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{I as t,P as n,U as r,it as i,xt as a}from"./semi-DNxeCrHm.js";import{D as o,F as s,I as c,O as l,P as u,_ as d,a as f,l as p,m,p as h,s as g,x as _,y as v}from"./index-Cyc27pJG.js";import{t as y}from"./react-QV7DAAIx.js";var b=e(y(),1),{Text:x}=r;function S(){let e=u(),{hasPermission:r}=s(),y=r(`skills:delete`),S=f(()=>c.get(`/skills/stats`),[]),C=Array.isArray(S.data?.stats)?S.data.stats:[],w=Number(S.data?.total_calls||0),T=Number(S.data?.total_success||0),E=w>0?T/w:null,D=()=>v({title:`清空所有技能调用统计?`,content:`只影响统计计数,不删除技能文件。`,onOk:async()=>{await c.del(`/skills/stats`),_(`统计已清空`),S.reload()}}),O=e=>v({title:`清空「${e}」的统计?`,onOk:async()=>{await c.del(`/skills/${encodeURIComponent(e)}/stats`),_(`已清空`),S.reload()}});return(0,b.jsxs)(`div`,{children:[(0,b.jsx)(h,{title:e(`skills.monitorTitle`,null,`技能状态`),description:S.data?.skills_dir?`技能目录:${S.data.skills_dir}`:`统计技能被调用的次数、成功率与最近使用时间。`,extra:(0,b.jsxs)(n,{children:[(0,b.jsx)(t,{icon:(0,b.jsx)(i,{}),onClick:()=>S.reload(),loading:S.loading,children:`刷新`}),y&&(0,b.jsx)(t,{type:`danger`,theme:`light`,onClick:D,children:`清空全部统计`})]})}),(0,b.jsx)(d,{columns:4,metrics:[{id:`skills`,label:`技能总数`,value:o(S.data?.total_skills||0),loading:S.loading},{id:`calls`,label:`调用总数`,value:o(w),loading:S.loading},{id:`success`,label:`成功次数`,value:o(T),loading:S.loading},{id:`rate`,label:`成功率`,value:E===null?`—`:l(E),tone:E!==null&&E<.8?`warning`:`success`,loading:S.loading}]}),(0,b.jsxs)(m,{title:`按技能统计`,children:[(0,b.jsx)(p,{error:S.error,onRetry:()=>S.reload()}),(0,b.jsx)(g,{columns:[{title:`技能`,dataIndex:`skill_name`,render:e=>(0,b.jsx)(x,{strong:!0,children:e})},{title:`调用次数`,dataIndex:`total_calls`,width:120,render:e=>o(e||0)},{title:`成功`,dataIndex:`success_calls`,width:100,render:e=>o(e||0)},{title:`失败`,dataIndex:`failed_calls`,width:100,render:e=>Number(e)>0?(0,b.jsx)(x,{type:`danger`,children:o(e)}):`0`},{title:`最后调用`,dataIndex:`last_call_time`,width:180,render:e=>e||`—`},{title:`操作`,width:110,render:(e,n)=>y&&Number(n.total_calls)>0?(0,b.jsx)(t,{size:`small`,theme:`borderless`,type:`danger`,icon:(0,b.jsx)(a,{}),onClick:()=>O(n.skill_name),children:`清空`}):null}],dataSource:C,rowKey:`skill_name`,loading:S.loading,pagination:{pageSize:20}})]})]})}export{S as default};
|
||||
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{I as t,P as n,U as r,it as i,xt as a}from"./semi-DNxeCrHm.js";import{D as o,F as s,I as c,O as l,P as u,_ as d,a as f,l as p,m,p as h,s as g,x as _,y as v}from"./index-FWC8CWwt.js";import{t as y}from"./react-QV7DAAIx.js";var b=e(y(),1),{Text:x}=r;function S(){let e=u(),{hasPermission:r}=s(),y=r(`skills:delete`),S=f(()=>c.get(`/skills/stats`),[]),C=Array.isArray(S.data?.stats)?S.data.stats:[],w=Number(S.data?.total_calls||0),T=Number(S.data?.total_success||0),E=w>0?T/w:null,D=()=>v({title:`清空所有技能调用统计?`,content:`只影响统计计数,不删除技能文件。`,onOk:async()=>{await c.del(`/skills/stats`),_(`统计已清空`),S.reload()}}),O=e=>v({title:`清空「${e}」的统计?`,onOk:async()=>{await c.del(`/skills/${encodeURIComponent(e)}/stats`),_(`已清空`),S.reload()}});return(0,b.jsxs)(`div`,{children:[(0,b.jsx)(h,{title:e(`skills.monitorTitle`,null,`技能状态`),description:S.data?.skills_dir?`技能目录:${S.data.skills_dir}`:`统计技能被调用的次数、成功率与最近使用时间。`,extra:(0,b.jsxs)(n,{children:[(0,b.jsx)(t,{icon:(0,b.jsx)(i,{}),onClick:()=>S.reload(),loading:S.loading,children:`刷新`}),y&&(0,b.jsx)(t,{type:`danger`,theme:`light`,onClick:D,children:`清空全部统计`})]})}),(0,b.jsx)(d,{columns:4,metrics:[{id:`skills`,label:`技能总数`,value:o(S.data?.total_skills||0),loading:S.loading},{id:`calls`,label:`调用总数`,value:o(w),loading:S.loading},{id:`success`,label:`成功次数`,value:o(T),loading:S.loading},{id:`rate`,label:`成功率`,value:E===null?`—`:l(E),tone:E!==null&&E<.8?`warning`:`success`,loading:S.loading}]}),(0,b.jsxs)(m,{title:`按技能统计`,children:[(0,b.jsx)(p,{error:S.error,onRetry:()=>S.reload()}),(0,b.jsx)(g,{columns:[{title:`技能`,dataIndex:`skill_name`,render:e=>(0,b.jsx)(x,{strong:!0,children:e})},{title:`调用次数`,dataIndex:`total_calls`,width:120,render:e=>o(e||0)},{title:`成功`,dataIndex:`success_calls`,width:100,render:e=>o(e||0)},{title:`失败`,dataIndex:`failed_calls`,width:100,render:e=>Number(e)>0?(0,b.jsx)(x,{type:`danger`,children:o(e)}):`0`},{title:`最后调用`,dataIndex:`last_call_time`,width:180,render:e=>e||`—`},{title:`操作`,width:110,render:(e,n)=>y&&Number(n.total_calls)>0?(0,b.jsx)(t,{size:`small`,theme:`borderless`,type:`danger`,icon:(0,b.jsx)(a,{}),onClick:()=>O(n.skill_name),children:`清空`}):null}],dataSource:C,rowKey:`skill_name`,loading:S.loading,pagination:{pageSize:20}})]})]})}export{S as default};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -18,7 +18,7 @@
|
|||
} catch (error) { /* first paint fallback */ }
|
||||
})();
|
||||
</script>
|
||||
<script type="module" crossorigin src="/static/app/assets/index-Cyc27pJG.js"></script>
|
||||
<script type="module" crossorigin src="/static/app/assets/index-FWC8CWwt.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/static/app/assets/rolldown-runtime-WkwZ5CU-.js">
|
||||
<link rel="modulepreload" crossorigin href="/static/app/assets/react-QV7DAAIx.js">
|
||||
<link rel="modulepreload" crossorigin href="/static/app/assets/semi-DNxeCrHm.js">
|
||||
|
|
|
|||
Loading…
Reference in New Issue