feat(vulnerabilities): restore one-click retest from detail drawer
Semi 迁移时丢失了旧版漏洞详情的复测入口,此前只能新建对话手动传漏洞 ID。 恢复为一致的一键流程:详情抽屉底栏新增复测主按钮(需 vulnerability:write, 无关联会话时禁用);弹窗预填默认提示词并附漏洞记录的复测方式,可编辑、 校验非空、服务端报错可重试。确认后调用既有 POST /vulnerabilities/:id/retest 创建分支,跳转聊天页自动发送服务端解析后的提示词;手动打开分支或发送 失败时回填服务端持久化的 pending_prompt 供手动续发。复测词条沿用 web/static/i18n 既有四语言文案,新增 Playwright 回归覆盖全链路。
This commit is contained in:
parent
a97f9b4b95
commit
5570c387a1
|
|
@ -0,0 +1,35 @@
|
|||
/**
|
||||
* 漏洞复测的跨页交接:漏洞页创建分支后写入待发送提示词,
|
||||
* 聊天页加载到对应分支时取出并自动发送;sessionStorage 使刷新后仍可恢复。
|
||||
*/
|
||||
export const RETEST_AUTOSEND_KEY = 'csai-retest-autosend';
|
||||
|
||||
function readEntry() {
|
||||
try {
|
||||
const raw = sessionStorage.getItem(RETEST_AUTOSEND_KEY);
|
||||
return raw ? JSON.parse(raw) : null;
|
||||
} catch (error) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export function queueRetestAutosend(conversationId, prompt) {
|
||||
try {
|
||||
sessionStorage.setItem(RETEST_AUTOSEND_KEY, JSON.stringify({
|
||||
conversationId: String(conversationId || ''),
|
||||
prompt: String(prompt || '')
|
||||
}));
|
||||
} catch (error) { /* storage unavailable */ }
|
||||
}
|
||||
|
||||
export function peekRetestAutosend(conversationId) {
|
||||
const entry = readEntry();
|
||||
return entry && entry.conversationId === conversationId ? entry : null;
|
||||
}
|
||||
|
||||
export function consumeRetestAutosend(conversationId) {
|
||||
if (!peekRetestAutosend(conversationId)) return;
|
||||
try {
|
||||
sessionStorage.removeItem(RETEST_AUTOSEND_KEY);
|
||||
} catch (error) { /* storage unavailable */ }
|
||||
}
|
||||
|
|
@ -6,6 +6,7 @@ import { Button, Collapse, Progress, SideSheet, Typography } from '@douyinfe/sem
|
|||
import { api } from '../../lib/http';
|
||||
import { useAuth } from '../../lib/auth';
|
||||
import { useT } from '../../lib/i18n';
|
||||
import { consumeRetestAutosend, peekRetestAutosend } from '../../lib/retest';
|
||||
import { useDebounced, useInterval, useLocalStorage, useResource } from '../../components/hooks';
|
||||
import { toastError, toastSuccess, toastWarning } from '../../components/ui';
|
||||
import ProjectFormModal from '../projects/project-form';
|
||||
|
|
@ -513,6 +514,64 @@ export default function Page() {
|
|||
});
|
||||
}, [attachments, backgroundRunning, canWrite, canExecute, canDecideHitl, checkingRun, conversationId, draft, draftHitl, mode, model, newProjectId, projectSaving, resetRun, role, roleResolved, run, sending, t, updateComposer]);
|
||||
|
||||
// 漏洞页创建复测分支后跳转过来:自动发出服务端已解析的复测提示词(一键执行)。
|
||||
const retestAutoSentRef = useRef(new Set());
|
||||
const retestNotifiedRef = useRef('');
|
||||
const retestDraftRestoredRef = useRef('');
|
||||
useEffect(() => {
|
||||
if (!conversationId) return;
|
||||
const entry = peekRetestAutosend(conversationId);
|
||||
if (!entry) return;
|
||||
const message = String(entry.prompt || '').trim();
|
||||
if (!message) {
|
||||
consumeRetestAutosend(conversationId);
|
||||
return;
|
||||
}
|
||||
if (detail.error || !canWrite || !canExecute) {
|
||||
// 无法发送时提示并放弃自动执行;服务端仍保存 pending_prompt,回填输入框供手动续发。
|
||||
if (retestNotifiedRef.current !== conversationId) {
|
||||
retestNotifiedRef.current = conversationId;
|
||||
consumeRetestAutosend(conversationId);
|
||||
toastWarning(t('vulnerabilityRetest.startFailed', null, '复测尚未成功发送,提示词已保存在分支中,请返回该分支继续。'));
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (sending || backgroundRunning || checkingRun || !roleResolved) return;
|
||||
// 等分支详情加载完成再发送:角色/审批配置继承自原始对话。
|
||||
if (detail.conversation?.id !== conversationId) return;
|
||||
consumeRetestAutosend(conversationId);
|
||||
const id = conversationRef.current;
|
||||
retestAutoSentRef.current.add(id);
|
||||
updateComposer(id, current => ({ ...current, draft: '', attachments: [] }));
|
||||
setDetail(prev => prev.conversation?.id === id ? {
|
||||
...prev,
|
||||
messages: [
|
||||
...(prev.messages || []),
|
||||
{ id: `local-${Date.now()}`, role: 'user', content: message, createdAt: new Date().toISOString() }
|
||||
]
|
||||
} : prev);
|
||||
resetRun();
|
||||
run.send({ message, mode, role, ...model.request });
|
||||
}, [conversationId, detail.conversation, detail.error, sending, backgroundRunning, checkingRun,
|
||||
roleResolved, canWrite, canExecute, mode, model, resetRun, role, run, t, updateComposer]);
|
||||
|
||||
// 手动打开复测分支或自动发送被中断时:把服务端保存的 pending_prompt 回填输入框。
|
||||
useEffect(() => {
|
||||
const conversation = detail.conversation;
|
||||
const pendingPrompt = String(conversation?.retest?.pending_prompt || '').trim();
|
||||
if (!conversationId || conversation?.id !== conversationId || !pendingPrompt) return;
|
||||
if (retestAutoSentRef.current.has(conversationId)) return;
|
||||
// 一键执行还在等前置条件时不回填,避免发送时输入框残留提示词。
|
||||
if (peekRetestAutosend(conversationId)) return;
|
||||
if (sending || backgroundRunning) return;
|
||||
if (String(draft || '').trim()) return;
|
||||
// 只回填一次:用户清空后不再覆盖。
|
||||
if (retestDraftRestoredRef.current !== conversationId) {
|
||||
retestDraftRestoredRef.current = conversationId;
|
||||
updateComposer(conversationId, current => ({ ...current, draft: pendingPrompt }));
|
||||
}
|
||||
}, [conversationId, detail.conversation, draft, sending, backgroundRunning, updateComposer]);
|
||||
|
||||
const conversation = detail.conversation;
|
||||
const revealedConversation = useRef('');
|
||||
useEffect(() => {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
import { useEffect, useState } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { Button, Collapse, Radio, RadioGroup, SideSheet, Space, Spin, Tabs, Timeline, Typography } from '@douyinfe/semi-ui';
|
||||
import { IconDelete, IconEdit, IconRefresh } from '@douyinfe/semi-icons';
|
||||
import { IconDelete, IconEdit, IconPlay, IconRefresh } from '@douyinfe/semi-icons';
|
||||
import { api, downloadFile } from '../../lib/http';
|
||||
import { formatDateTime } from '../../lib/format';
|
||||
import { useResource } from '../../components/hooks';
|
||||
|
|
@ -10,6 +10,7 @@ import {
|
|||
CopyButton, ErrorBanner, KeyValueList, MarkdownView, SeverityTag, StatusTag, toastError, toastSuccess
|
||||
} from '../../components/ui';
|
||||
import { historyText, hostPortText, hostText, shortId, statusText } from './shared';
|
||||
import RetestModal from './RetestModal';
|
||||
|
||||
const { Text, Paragraph } = Typography;
|
||||
|
||||
|
|
@ -85,6 +86,7 @@ export default function DetailDrawer({
|
|||
const [tab, setTab] = useState('overview');
|
||||
const [format, setFormat] = useState('docx');
|
||||
const [downloading, setDownloading] = useState(false);
|
||||
const [retestOpen, setRetestOpen] = useState(false);
|
||||
|
||||
const context = useResource(
|
||||
() => api.get(`/vulnerabilities/${encodeURIComponent(vulnId)}/context`),
|
||||
|
|
@ -190,6 +192,17 @@ export default function DetailDrawer({
|
|||
<Button icon={<IconRefresh />} onClick={() => context.reload()} loading={context.loading}>
|
||||
{t('common.refresh', null, '刷新')}
|
||||
</Button>
|
||||
{canWrite && (
|
||||
<Button
|
||||
theme="solid"
|
||||
type="primary"
|
||||
icon={<IconPlay />}
|
||||
disabled={!vuln || !vuln.conversation_id}
|
||||
onClick={() => setRetestOpen(true)}
|
||||
>
|
||||
{t('vulnerabilityRetest.button', null, '复测')}
|
||||
</Button>
|
||||
)}
|
||||
{canWrite && (
|
||||
<Button icon={<IconEdit />} disabled={!vuln} onClick={() => onEdit(vuln)}>
|
||||
{t('common.edit', null, '编辑')}
|
||||
|
|
@ -372,6 +385,7 @@ export default function DetailDrawer({
|
|||
</Tabs.TabPane>
|
||||
</Tabs>
|
||||
)}
|
||||
<RetestModal visible={retestOpen} vuln={vuln} onClose={() => setRetestOpen(false)} />
|
||||
</SideSheet>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,87 @@
|
|||
/** 复测漏洞:从原始对话创建独立分支并跳转聊天页一键执行(POST /vulnerabilities/:id/retest)。 */
|
||||
import { useEffect, useId, useState } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { Form, Typography } from '@douyinfe/semi-ui';
|
||||
import { api } from '../../lib/http';
|
||||
import { useT } from '../../lib/i18n';
|
||||
import { Drawer, ErrorBanner } from '../../components/ui';
|
||||
import { queueRetestAutosend } from '../../lib/retest';
|
||||
|
||||
const { Text } = Typography;
|
||||
const MAX_PROMPT = 20000;
|
||||
|
||||
export function retestPromptDraft(vuln, t) {
|
||||
// 不传 vars,保留 {{vulnerability_id}} 等占位符由服务端在创建分支时解析。
|
||||
const base = t('vulnerabilityRetest.defaultPrompt', null,
|
||||
'请帮我对漏洞 {{vulnerability_id}} 进行验证,确认是否已修复。完成后更新该漏洞状态。');
|
||||
const guidance = String(vuln?.retest_notes || '').trim();
|
||||
if (!guidance) return base;
|
||||
return `${base}\n\n${t('vulnerabilityRetest.guidanceHeading', null, '验证方式(来自漏洞记录的复测方式):')}\n${guidance}`;
|
||||
}
|
||||
|
||||
export default function RetestModal({ visible, vuln, onClose }) {
|
||||
const t = useT();
|
||||
const navigate = useNavigate();
|
||||
const formId = useId();
|
||||
const [saving, setSaving] = useState(false);
|
||||
const [error, setError] = useState(null);
|
||||
|
||||
useEffect(() => { setError(null); }, [visible, vuln?.id]);
|
||||
|
||||
const submit = async values => {
|
||||
if (saving || !vuln?.id) return;
|
||||
setSaving(true);
|
||||
setError(null);
|
||||
try {
|
||||
const result = await api.post(`/vulnerabilities/${encodeURIComponent(vuln.id)}/retest`, {
|
||||
prompt: String(values.prompt || '').trim()
|
||||
});
|
||||
// 服务端已解析占位符;交给聊天页在分支上自动发送。
|
||||
queueRetestAutosend(result.conversation.id, result.prompt);
|
||||
onClose?.();
|
||||
navigate(`/chat?conversation=${encodeURIComponent(result.conversation.id)}`);
|
||||
} catch (err) {
|
||||
setError(err);
|
||||
} finally {
|
||||
setSaving(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<Drawer
|
||||
visible={visible}
|
||||
width={640}
|
||||
closable={!saving}
|
||||
closeOnEsc={!saving}
|
||||
onCancel={saving ? undefined : onClose}
|
||||
cancelButtonProps={{ disabled: saving }}
|
||||
title={t('vulnerabilityRetest.title', null, '复测漏洞')}
|
||||
formId={formId}
|
||||
okText={t('vulnerabilityRetest.confirm', null, '确认并开始复测')}
|
||||
confirmLoading={saving}
|
||||
>
|
||||
<Text strong>{vuln?.title}</Text>
|
||||
<Text type="tertiary" size="small">
|
||||
{t('vulnerabilityRetest.hint', null, '每次确认都会从原始对话创建独立分支,继承原项目和历史,可继续多轮验证。')}
|
||||
</Text>
|
||||
<Form id={formId} key={`${visible}-${vuln?.id || ''}`} onSubmit={submit}
|
||||
initValues={{ prompt: retestPromptDraft(vuln, t) }}>
|
||||
<Form.TextArea
|
||||
id={`${formId}-prompt`}
|
||||
field="prompt"
|
||||
rows={8}
|
||||
maxCount={MAX_PROMPT}
|
||||
autosize
|
||||
label={t('vulnerabilityRetest.promptLabel', null, '复测提示词')}
|
||||
extraText={t('vulnerabilityRetest.placeholderHint', null, '占位符发送时自动替换,也支持在后续对话中手动输入。')}
|
||||
rules={[{
|
||||
required: true,
|
||||
whitespace: true,
|
||||
message: t('vulnerabilityRetest.promptRequired', null, '请输入复测提示词。')
|
||||
}]}
|
||||
/>
|
||||
<ErrorBanner error={error} />
|
||||
</Form>
|
||||
</Drawer>
|
||||
);
|
||||
}
|
||||
|
|
@ -48,6 +48,7 @@ export const VULNERABILITY = {
|
|||
type: '访问控制', project_id: PROJECT.id, target: 'http://localhost:8080/example',
|
||||
host: 'localhost', description: '匿名回归数据,不代表真实漏洞。',
|
||||
evidence: 'FAKE-EVIDENCE: local fixture only', recommendation: '核对示例访问权限。',
|
||||
conversation_id: 'fixture-conversation', retest_notes: '修复后该路径应返回 403。',
|
||||
created_at: STAMP, updated_at: STAMP
|
||||
};
|
||||
export const ASSESSMENT = {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,129 @@
|
|||
import { expect, label, screenshot, test, visit, CONVERSATION, VULNERABILITY } from './fixtures.mjs';
|
||||
|
||||
const BRANCH_ID = 'fixture-retest-branch';
|
||||
const RETEST_PATH = `/api/vulnerabilities/${VULNERABILITY.id}/retest`;
|
||||
const DEFAULT_PROMPT = label('vulnerabilityRetest.defaultPrompt',
|
||||
'请帮我对漏洞 {{vulnerability_id}} 进行验证,确认是否已修复。完成后更新该漏洞状态。');
|
||||
const GUIDANCE = label('vulnerabilityRetest.guidanceHeading', '验证方式(来自漏洞记录的复测方式):');
|
||||
const RESOLVED_PROMPT = `请帮我对漏洞 ${VULNERABILITY.id} 进行验证,确认是否已修复。完成后更新该漏洞状态。`;
|
||||
const REPLY = '复测完成:示例路径已返回 403,漏洞已修复。';
|
||||
const MODAL_TITLE = label('vulnerabilityRetest.title', '复测漏洞');
|
||||
|
||||
function branchConversation({ pendingPrompt = '' } = {}) {
|
||||
return {
|
||||
id: BRANCH_ID, title: `复测:${VULNERABILITY.title}`, projectId: VULNERABILITY.project_id,
|
||||
createdAt: CONVERSATION.createdAt, updatedAt: CONVERSATION.updatedAt,
|
||||
messages: [
|
||||
{ id: 'fixture-retest-user', role: 'user', content: RESOLVED_PROMPT, createdAt: CONVERSATION.createdAt },
|
||||
{ id: 'fixture-retest-assistant', role: 'assistant', content: REPLY, createdAt: CONVERSATION.createdAt }
|
||||
],
|
||||
retest: pendingPrompt ? {
|
||||
conversation_id: BRANCH_ID, source_conversation_id: CONVERSATION.id,
|
||||
vulnerability_id: VULNERABILITY.id, pending_prompt: pendingPrompt
|
||||
} : undefined
|
||||
};
|
||||
}
|
||||
|
||||
function mockRetestStream(mockApi) {
|
||||
mockApi.respond('GET', `/api/conversations/${BRANCH_ID}`, { json: branchConversation() });
|
||||
mockApi.respond('GET', `/api/conversations/${BRANCH_ID}/plan-tasks`,
|
||||
{ json: { tasks: [], total: 0, completed: 0, running: false } });
|
||||
mockApi.respond('POST', '/api/agent/stream', () => {
|
||||
const events = [
|
||||
{ type: 'conversation', data: { conversationId: BRANCH_ID } },
|
||||
{ type: 'response_start', data: { conversationId: BRANCH_ID } },
|
||||
{ type: 'response_delta', message: REPLY, data: { accumulated: REPLY } },
|
||||
{ type: 'response', message: REPLY, data: { conversationId: BRANCH_ID, messageId: 'fixture-retest-assistant', finalizable: true } },
|
||||
{ type: 'done', data: {} }
|
||||
];
|
||||
return {
|
||||
contentType: 'text/event-stream; charset=utf-8',
|
||||
body: events.map(event => `data: ${JSON.stringify(event)}\n\n`).join('') + 'data: [DONE]\n\n'
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
test('detail drawer retest creates a branch and auto-sends the resolved prompt', async ({ page, mockApi }, testInfo) => {
|
||||
mockRetestStream(mockApi);
|
||||
mockApi.respond('POST', RETEST_PATH, { json: {
|
||||
conversation: branchConversation(),
|
||||
prompt: RESOLVED_PROMPT,
|
||||
vulnerability_id: VULNERABILITY.id,
|
||||
source_conversation_id: CONVERSATION.id
|
||||
} });
|
||||
|
||||
await visit(page, `vulnerabilities?id=${VULNERABILITY.id}`);
|
||||
const drawer = page.getByRole('dialog');
|
||||
await expect(drawer).toContainText(VULNERABILITY.title);
|
||||
|
||||
const retestButton = drawer.getByRole('button', { name: /复测$/ });
|
||||
await expect(retestButton).toBeEnabled();
|
||||
await retestButton.click();
|
||||
|
||||
const modal = page.getByRole('dialog', { name: MODAL_TITLE });
|
||||
await expect(modal).toBeVisible();
|
||||
await expect(modal).toContainText(VULNERABILITY.title);
|
||||
const textarea = modal.locator('textarea');
|
||||
await expect(textarea).toHaveValue(`${DEFAULT_PROMPT}\n\n${GUIDANCE}\n${VULNERABILITY.retest_notes}`);
|
||||
await screenshot(page, testInfo, 'vulnerability-retest-modal');
|
||||
|
||||
await modal.getByRole('button', { name: label('vulnerabilityRetest.confirm', '确认并开始复测'), exact: true }).click();
|
||||
|
||||
// 分支创建请求携带弹窗里的提示词(占位符交给服务端解析)。
|
||||
await expect.poll(() => mockApi.calls('POST', RETEST_PATH).length).toBe(1);
|
||||
expect(mockApi.calls('POST', RETEST_PATH)[0].body).toEqual({
|
||||
prompt: `${DEFAULT_PROMPT}\n\n${GUIDANCE}\n${VULNERABILITY.retest_notes}`
|
||||
});
|
||||
|
||||
// 跳转到分支会话并自动发送解析后的提示词。
|
||||
await expect.poll(() => mockApi.calls('POST', '/api/agent/stream').length).toBe(1);
|
||||
expect(mockApi.calls('POST', '/api/agent/stream')[0].body).toMatchObject({
|
||||
message: RESOLVED_PROMPT,
|
||||
conversationId: BRANCH_ID
|
||||
});
|
||||
const chat = page.locator('#main-content');
|
||||
await expect(chat).toContainText(REPLY);
|
||||
const composer = chat.getByRole('textbox', { name: label('chat.composerLabel', '对话内容'), exact: true });
|
||||
await expect(composer).toHaveValue('');
|
||||
expect(await page.evaluate(() => sessionStorage.getItem('csai-retest-autosend'))).toBe(null);
|
||||
await screenshot(page, testInfo, 'vulnerability-retest-autosend');
|
||||
expect(mockApi.writes().map(write => write.path)).toEqual([RETEST_PATH, '/api/agent/stream']);
|
||||
});
|
||||
|
||||
test('opening a retest branch manually restores the pending prompt without auto-sending', async ({ page, mockApi }) => {
|
||||
mockApi.respond('GET', `/api/conversations/${BRANCH_ID}`, { json: branchConversation({ pendingPrompt: RESOLVED_PROMPT }) });
|
||||
mockApi.respond('GET', `/api/conversations/${BRANCH_ID}/plan-tasks`,
|
||||
{ json: { tasks: [], total: 0, completed: 0, running: false } });
|
||||
|
||||
await page.goto(`/static/app/#/chat?conversation=${BRANCH_ID}`);
|
||||
const main = await page.locator('#main-content');
|
||||
await expect(main).toContainText(`复测:${VULNERABILITY.title}`);
|
||||
const composer = main.getByRole('textbox', { name: label('chat.composerLabel', '对话内容'), exact: true });
|
||||
await expect(composer).toHaveValue(RESOLVED_PROMPT);
|
||||
expect(mockApi.writes()).toEqual([]);
|
||||
});
|
||||
|
||||
test('retest button stays disabled without a source conversation and reports server errors', async ({ page, mockApi }) => {
|
||||
const standalone = { ...VULNERABILITY, id: 'fixture-retest-standalone', conversation_id: '' };
|
||||
mockApi.respond('GET', `/api/vulnerabilities/${standalone.id}/context`,
|
||||
{ json: { vulnerability: standalone, history: [], members: [], assets: [] } });
|
||||
mockApi.respond('GET', `/api/vulnerabilities/${standalone.id}`, { json: standalone });
|
||||
|
||||
await visit(page, `vulnerabilities?id=${standalone.id}`);
|
||||
const drawer = page.getByRole('dialog');
|
||||
await expect(drawer).toContainText(standalone.title);
|
||||
await expect(drawer.getByRole('button', { name: /复测$/ })).toBeDisabled();
|
||||
|
||||
// 服务器拒绝(如原始对话仍在执行)时错误留在弹窗内,可调整后重试。
|
||||
await page.goto(`/static/app/#/vulnerabilities?id=${VULNERABILITY.id}`);
|
||||
await page.reload();
|
||||
const retryDrawer = page.getByRole('dialog');
|
||||
await expect(retryDrawer).toContainText(VULNERABILITY.title);
|
||||
await retryDrawer.getByRole('button', { name: /复测$/ }).click();
|
||||
mockApi.fail('POST', RETEST_PATH, '原始对话仍在执行,请等待完成或停止后再复测');
|
||||
const modal = page.getByRole('dialog', { name: MODAL_TITLE });
|
||||
await modal.getByRole('button', { name: label('vulnerabilityRetest.confirm', '确认并开始复测'), exact: true }).click();
|
||||
await expect(modal).toContainText('原始对话仍在执行,请等待完成或停止后再复测');
|
||||
await expect(modal).toBeVisible();
|
||||
expect(page.url()).toContain('/vulnerabilities');
|
||||
});
|
||||
|
|
@ -1 +0,0 @@
|
|||
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{F as t,M as n,Qt as r,W as i}from"./semi-Dpcldp_F.js";import{A as a,T as o,j as s,x as c}from"./assetTarget-D2PEjBAg.js";import{t as l}from"./react-QV7DAAIx.js";var u=e(l(),1),{Text:d}=i;function f({text:e,max:t=42,className:n=``,placeholder:i=`—`}){let a=String(e??``).trim();if(!a)return(0,u.jsx)(d,{type:`tertiary`,children:i});if(a.length<=t)return(0,u.jsx)(`span`,{className:n,children:a});let o=`${a.slice(0,t)}…`;return(0,u.jsx)(r,{content:a,position:`topLeft`,children:(0,u.jsx)(`span`,{className:n,children:o})})}function p({asset:e,size:t=`small`}){let r=s(e);return(0,u.jsx)(n,{size:t,color:c[r]||`grey`,shape:`circle`,children:a(r)})}function m({status:e,size:t=`small`}){let r=String(e||`active`).toLowerCase();return(0,u.jsx)(n,{size:t,color:r===`inactive`?`grey`:`green`,shape:`square`,children:o[r]||e||`—`})}function h({protocol:e,port:r,size:i=`small`}){let a=String(e||``).trim(),o=Number(r||0)>0?`:${r}`:``;return!a&&!o?(0,u.jsx)(d,{type:`tertiary`,children:`—`}):(0,u.jsxs)(t,{spacing:4,children:[a?(0,u.jsx)(n,{size:i,color:`blue`,shape:`square`,children:a}):null,o?(0,u.jsx)(d,{type:`tertiary`,size:`small`,children:o}):null]})}function g({tags:e,max:i=3}){let a=Array.isArray(e)?e.filter(Boolean):[];if(!a.length)return(0,u.jsx)(d,{type:`tertiary`,children:`—`});let o=a.slice(0,i),s=a.slice(i);return(0,u.jsxs)(t,{spacing:4,wrap:!0,children:[o.map(e=>(0,u.jsx)(n,{size:`small`,color:`violet`,shape:`square`,children:e},e)),s.length?(0,u.jsx)(r,{content:s.join(`、`),children:(0,u.jsx)(`span`,{children:(0,u.jsxs)(n,{size:`small`,shape:`square`,children:[`+`,s.length]})})}):null]})}export{f as a,g as i,h as n,p as r,m as t};
|
||||
|
|
@ -0,0 +1 @@
|
|||
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{$t as t,F as n,M as r,W as i}from"./semi-CHxO7u8f.js";import{A as a,T as o,j as s,x as c}from"./assetTarget-D2PEjBAg.js";import{t as l}from"./react-QV7DAAIx.js";var u=e(l(),1),{Text:d}=i;function f({text:e,max:n=42,className:r=``,placeholder:i=`—`}){let a=String(e??``).trim();if(!a)return(0,u.jsx)(d,{type:`tertiary`,children:i});if(a.length<=n)return(0,u.jsx)(`span`,{className:r,children:a});let o=`${a.slice(0,n)}…`;return(0,u.jsx)(t,{content:a,position:`topLeft`,children:(0,u.jsx)(`span`,{className:r,children:o})})}function p({asset:e,size:t=`small`}){let n=s(e);return(0,u.jsx)(r,{size:t,color:c[n]||`grey`,shape:`circle`,children:a(n)})}function m({status:e,size:t=`small`}){let n=String(e||`active`).toLowerCase();return(0,u.jsx)(r,{size:t,color:n===`inactive`?`grey`:`green`,shape:`square`,children:o[n]||e||`—`})}function h({protocol:e,port:t,size:i=`small`}){let a=String(e||``).trim(),o=Number(t||0)>0?`:${t}`:``;return!a&&!o?(0,u.jsx)(d,{type:`tertiary`,children:`—`}):(0,u.jsxs)(n,{spacing:4,children:[a?(0,u.jsx)(r,{size:i,color:`blue`,shape:`square`,children:a}):null,o?(0,u.jsx)(d,{type:`tertiary`,size:`small`,children:o}):null]})}function g({tags:e,max:i=3}){let a=Array.isArray(e)?e.filter(Boolean):[];if(!a.length)return(0,u.jsx)(d,{type:`tertiary`,children:`—`});let o=a.slice(0,i),s=a.slice(i);return(0,u.jsxs)(n,{spacing:4,wrap:!0,children:[o.map(e=>(0,u.jsx)(r,{size:`small`,color:`violet`,shape:`square`,children:e},e)),s.length?(0,u.jsx)(t,{content:s.join(`、`),children:(0,u.jsx)(`span`,{children:(0,u.jsxs)(r,{size:`small`,shape:`square`,children:[`+`,s.length]})})}):null]})}export{f as a,g as i,h as n,p as r,m 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{At as r,Dt as i,F as a,H as o,L as s,M as c,W as l,i as u,lt as d,ot as f,st as p}from"./semi-Dpcldp_F.js";import{F as m,I as h,P as g,a as _,b as v,c as y,d as b,f as x,l as S,m as C,p as w,s as T,u as E,x as D,y as O}from"./index-BqK3vieJ.js";var k=e(t(),1),A=e(n(),1),{Text:j}=l;function M(){let e=g(),{hasPermission:t}=m(),n=t(`agents:write`),l=t(`agents:delete`),[M,N]=(0,k.useState)(``),[P,F]=(0,k.useState)(null),[I,L]=(0,k.useState)(null),[R,z]=(0,k.useState)(!1),B=_(()=>h.get(`/multi-agent/markdown-agents`),[]),V=(Array.isArray(B.data?.agents)?B.data.agents:[]).filter(e=>{if(!M)return!0;let t=M.toLowerCase();return[e.name,e.id,e.filename,e.description].some(e=>String(e||``).toLowerCase().includes(t))}),H=async e=>{try{F(await h.get(`/multi-agent/markdown-agents/${encodeURIComponent(e.filename)}`))}catch(e){v(e,`读取智能体失败`)}},U=async()=>{let e=await I.form.validate();z(!0);try{await h.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)}),D(`智能体已保存`),L(null),B.reload()}catch(e){v(e,`保存智能体失败`)}finally{z(!1)}},W=e=>O({title:`删除智能体「${e.name||e.filename}」?`,onOk:async()=>{await h.del(`/multi-agent/markdown-agents/${encodeURIComponent(e.filename)}`),D(`已删除`),B.reload()}});return(0,A.jsxs)(`div`,{children:[(0,A.jsx)(w,{title:e(`agents.title`,null,`智能体管理`),description:B.data?.dir?`目录:${B.data.dir}`:`以 Markdown 文件定义的子智能体与编排器。`,extra:(0,A.jsxs)(a,{children:[(0,A.jsx)(s,{icon:(0,A.jsx)(p,{}),onClick:()=>B.reload(),loading:B.loading,children:`刷新`}),n&&(0,A.jsx)(s,{theme:`solid`,type:`primary`,icon:(0,A.jsx)(d,{}),onClick:()=>L({record:null,form:{}}),children:`新建智能体`})]})}),B.data?.error&&(0,A.jsx)(S,{error:B.data.error}),(0,A.jsxs)(C,{title:`智能体(${V.length})`,children:[(0,A.jsx)(S,{error:B.error,onRetry:()=>B.reload()}),(0,A.jsx)(T,{columns:[{title:`智能体`,dataIndex:`name`,render:(e,t)=>(0,A.jsxs)(a,{vertical:!0,spacing:0,align:`start`,children:[(0,A.jsxs)(a,{children:[(0,A.jsx)(j,{strong:!0,children:e||t.id}),t.is_orchestrator&&(0,A.jsx)(c,{size:`small`,color:`purple`,children:`编排器`})]}),(0,A.jsx)(j,{type:`tertiary`,children:t.filename})]})},{title:`类型`,dataIndex:`kind`,width:110,render:e=>(0,A.jsx)(c,{size:`small`,children:e||`sub`})},{title:`描述`,dataIndex:`description`,render:e=>(0,A.jsx)(j,{type:`tertiary`,ellipsis:{showTooltip:!0},style:{maxWidth:460},children:e||`—`})},{title:`操作`,width:180,render:(e,t)=>(0,A.jsxs)(a,{children:[(0,A.jsx)(s,{size:`small`,theme:`borderless`,onClick:()=>H(t),children:`详情`}),n&&(0,A.jsx)(s,{size:`small`,theme:`borderless`,icon:(0,A.jsx)(i,{}),onClick:()=>L({record:t,form:{}})}),l&&(0,A.jsx)(s,{size:`small`,theme:`borderless`,type:`danger`,icon:(0,A.jsx)(r,{}),onClick:()=>W(t)})]})}],dataSource:V,rowKey:`filename`,loading:B.loading,pagination:{pageSize:20},toolbar:(0,A.jsx)(o,{prefix:(0,A.jsx)(f,{}),value:M,onChange:N,placeholder:`搜索名称或文件名`,style:{width:280}})})]}),(0,A.jsx)(y,{title:I?.record?`编辑智能体`:`新建智能体`,visible:!!I,onCancel:()=>L(null),onOk:U,confirmLoading:R,width:760,children:(0,A.jsxs)(u,{getFormApi:e=>L(t=>t&&{...t,form:e}),initValues:I?.record?{filename:I.record.filename,name:I.record.name,description:I.record.description,kind:I.record.kind||`sub`}:{kind:`sub`},children:[(0,A.jsx)(u.Input,{field:`filename`,label:`文件名(留空自动生成)`,placeholder:`例如 recon.md`}),(0,A.jsx)(u.Input,{field:`name`,label:`名称`,rules:[{required:!0,message:`请输入名称`}]}),(0,A.jsx)(u.Input,{field:`description`,label:`描述`}),(0,A.jsx)(u.Select,{field:`kind`,label:`类型`,optionList:[{value:`sub`,label:`子智能体`},{value:`orchestrator`,label:`编排器`},{value:`plan_execute`,label:`计划执行`}]}),(0,A.jsx)(u.Input,{field:`tools`,label:`工具(逗号分隔)`,placeholder:`toolName, mcp::tool`}),(0,A.jsx)(u.TextArea,{field:`instruction`,label:`指令(Markdown)`,autosize:{minRows:8,maxRows:20}})]})},I?.record?.filename||`new-agent`),(0,A.jsx)(y,{title:P?.name||`智能体详情`,visible:!!P,onCancel:()=>F(null),width:720,children:P&&(0,A.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,A.jsx)(b,{items:[{label:`文件名`,value:P.filename},{label:`ID`,value:P.id},{label:`类型`,value:P.kind},{label:`绑定角色`,value:P.bind_role||`—`},{label:`最大迭代`,value:P.max_iterations??`—`},{label:`工具`,value:Array.isArray(P.tools)&&P.tools.length?P.tools.join(`、`):`—`}]}),(0,A.jsx)(x,{content:P.instruction||P.raw||``}),(0,A.jsx)(E,{value:P.raw||P,title:`原始 Markdown`,collapsed:!0})]})})]})}export{M as default};
|
||||
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{S as t,t as n}from"./react-QV7DAAIx.js";import{F as r,H as i,L as a,M as o,Ot as s,W as c,i as l,jt as u,lt as d,ot as f,st as p}from"./semi-CHxO7u8f.js";import{F as m,I as h,P as g,a as _,b as v,c as y,d as b,f as x,l as S,m as C,p as w,s as T,u as E,x as D,y as O}from"./index-Cn5SR2KP.js";var k=e(t(),1),A=e(n(),1),{Text:j}=c;function M(){let e=g(),{hasPermission:t}=m(),n=t(`agents:write`),c=t(`agents:delete`),[M,N]=(0,k.useState)(``),[P,F]=(0,k.useState)(null),[I,L]=(0,k.useState)(null),[R,z]=(0,k.useState)(!1),B=_(()=>h.get(`/multi-agent/markdown-agents`),[]),V=(Array.isArray(B.data?.agents)?B.data.agents:[]).filter(e=>{if(!M)return!0;let t=M.toLowerCase();return[e.name,e.id,e.filename,e.description].some(e=>String(e||``).toLowerCase().includes(t))}),H=async e=>{try{F(await h.get(`/multi-agent/markdown-agents/${encodeURIComponent(e.filename)}`))}catch(e){v(e,`读取智能体失败`)}},U=async()=>{let e=await I.form.validate();z(!0);try{await h.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)}),D(`智能体已保存`),L(null),B.reload()}catch(e){v(e,`保存智能体失败`)}finally{z(!1)}},W=e=>O({title:`删除智能体「${e.name||e.filename}」?`,onOk:async()=>{await h.del(`/multi-agent/markdown-agents/${encodeURIComponent(e.filename)}`),D(`已删除`),B.reload()}});return(0,A.jsxs)(`div`,{children:[(0,A.jsx)(w,{title:e(`agents.title`,null,`智能体管理`),description:B.data?.dir?`目录:${B.data.dir}`:`以 Markdown 文件定义的子智能体与编排器。`,extra:(0,A.jsxs)(r,{children:[(0,A.jsx)(a,{icon:(0,A.jsx)(p,{}),onClick:()=>B.reload(),loading:B.loading,children:`刷新`}),n&&(0,A.jsx)(a,{theme:`solid`,type:`primary`,icon:(0,A.jsx)(d,{}),onClick:()=>L({record:null,form:{}}),children:`新建智能体`})]})}),B.data?.error&&(0,A.jsx)(S,{error:B.data.error}),(0,A.jsxs)(C,{title:`智能体(${V.length})`,children:[(0,A.jsx)(S,{error:B.error,onRetry:()=>B.reload()}),(0,A.jsx)(T,{columns:[{title:`智能体`,dataIndex:`name`,render:(e,t)=>(0,A.jsxs)(r,{vertical:!0,spacing:0,align:`start`,children:[(0,A.jsxs)(r,{children:[(0,A.jsx)(j,{strong:!0,children:e||t.id}),t.is_orchestrator&&(0,A.jsx)(o,{size:`small`,color:`purple`,children:`编排器`})]}),(0,A.jsx)(j,{type:`tertiary`,children:t.filename})]})},{title:`类型`,dataIndex:`kind`,width:110,render:e=>(0,A.jsx)(o,{size:`small`,children:e||`sub`})},{title:`描述`,dataIndex:`description`,render:e=>(0,A.jsx)(j,{type:`tertiary`,ellipsis:{showTooltip:!0},style:{maxWidth:460},children:e||`—`})},{title:`操作`,width:180,render:(e,t)=>(0,A.jsxs)(r,{children:[(0,A.jsx)(a,{size:`small`,theme:`borderless`,onClick:()=>H(t),children:`详情`}),n&&(0,A.jsx)(a,{size:`small`,theme:`borderless`,icon:(0,A.jsx)(s,{}),onClick:()=>L({record:t,form:{}})}),c&&(0,A.jsx)(a,{size:`small`,theme:`borderless`,type:`danger`,icon:(0,A.jsx)(u,{}),onClick:()=>W(t)})]})}],dataSource:V,rowKey:`filename`,loading:B.loading,pagination:{pageSize:20},toolbar:(0,A.jsx)(i,{prefix:(0,A.jsx)(f,{}),value:M,onChange:N,placeholder:`搜索名称或文件名`,style:{width:280}})})]}),(0,A.jsx)(y,{title:I?.record?`编辑智能体`:`新建智能体`,visible:!!I,onCancel:()=>L(null),onOk:U,confirmLoading:R,width:760,children:(0,A.jsxs)(l,{getFormApi:e=>L(t=>t&&{...t,form:e}),initValues:I?.record?{filename:I.record.filename,name:I.record.name,description:I.record.description,kind:I.record.kind||`sub`}:{kind:`sub`},children:[(0,A.jsx)(l.Input,{field:`filename`,label:`文件名(留空自动生成)`,placeholder:`例如 recon.md`}),(0,A.jsx)(l.Input,{field:`name`,label:`名称`,rules:[{required:!0,message:`请输入名称`}]}),(0,A.jsx)(l.Input,{field:`description`,label:`描述`}),(0,A.jsx)(l.Select,{field:`kind`,label:`类型`,optionList:[{value:`sub`,label:`子智能体`},{value:`orchestrator`,label:`编排器`},{value:`plan_execute`,label:`计划执行`}]}),(0,A.jsx)(l.Input,{field:`tools`,label:`工具(逗号分隔)`,placeholder:`toolName, mcp::tool`}),(0,A.jsx)(l.TextArea,{field:`instruction`,label:`指令(Markdown)`,autosize:{minRows:8,maxRows:20}})]})},I?.record?.filename||`new-agent`),(0,A.jsx)(y,{title:P?.name||`智能体详情`,visible:!!P,onCancel:()=>F(null),width:720,children:P&&(0,A.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,A.jsx)(b,{items:[{label:`文件名`,value:P.filename},{label:`ID`,value:P.id},{label:`类型`,value:P.kind},{label:`绑定角色`,value:P.bind_role||`—`},{label:`最大迭代`,value:P.max_iterations??`—`},{label:`工具`,value:Array.isArray(P.tools)&&P.tools.length?P.tools.join(`、`):`—`}]}),(0,A.jsx)(x,{content:P.instruction||P.raw||``}),(0,A.jsx)(E,{value:P.raw||P,title:`原始 Markdown`,collapsed:!0})]})})]})}export{M 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{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{F as t,L as n,W as r}from"./semi-Dpcldp_F.js";import{E as i,P as a,k as o}from"./index-BqK3vieJ.js";import"./c2-shared-VhMEmc_e.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)(t,{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(t=>(0,c.jsx)(n,{size:`small`,theme:t.value===e?`solid`:`borderless`,type:t.value===e?`primary`:`tertiary`,onClick:()=>r(t.value),children:o(`c2.${i}.preset${t.value===`all`?`All`:t.value}`,null,t.label)},t.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{F as t,L as n,W as r}from"./semi-CHxO7u8f.js";import{E as i,P as a,k as o}from"./index-Cn5SR2KP.js";import"./c2-shared-CffAVjCc.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)(t,{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(t=>(0,c.jsx)(n,{size:`small`,theme:t.value===e?`solid`:`borderless`,type:t.value===e?`primary`:`tertiary`,onClick:()=>r(t.value),children:o(`c2.${i}.preset${t.value===`all`?`All`:t.value}`,null,t.label)},t.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};
|
||||
|
|
@ -1 +1 @@
|
|||
import{I as e,L as t}from"./index-BqK3vieJ.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-Cn5SR2KP.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};
|
||||
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{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{t}from"./react-QV7DAAIx.js";import{Ht as n,Tt as r,Wt as i,X as a,Xt as o,_t as s,bt as c,ht as l,it as u,ot as d,wt as f,xt as p}from"./semi-Dpcldp_F.js";var m=e(t(),1),h={target:p,infra:u,auth:s,finding:d,chain:n,exploit:i,poc:a,vulnerability:o,missing:c,goal:f,step:n,fact:r,receipt:a,observation:d,memory:l,digest:r,guidance:i};function g({type:e}){let t=h[e]||r;return(0,m.jsx)(`span`,{className:`graph-node-icon`,"aria-hidden":`true`,children:(0,m.jsx)(t,{size:`small`})})}function _({id:e,title:t,type:n,category:r,color:i,factKey:a,boundary:o,ports:s=[],selected:c,card:l,onSelect:u,onPreview:d}){let{density:f,box:p}=l,h=f===`detail`,_=Math.min(Math.max(p.width/216,1),1.6);return(0,m.jsxs)(`button`,{type:`button`,className:`graph-node graph-node--${f}`,title:t,"aria-label":t,"aria-pressed":c,"data-root":n===`goal`||n===`target`||void 0,"data-boundary":o||void 0,"data-wrap":f===`standard`&&p.height>=50||void 0,style:{...p,"--graph-node-color":i,"--graph-node-text-scale":_},onClick:()=>u(e),onMouseEnter:()=>d?.(e,!0),onMouseLeave:()=>d?.(e,!1),onFocus:()=>d?.(e,!0),onBlur:()=>d?.(e,!1),children:[(0,m.jsxs)(`span`,{className:`graph-node-content`,children:[f!==`compact`&&(0,m.jsxs)(`span`,{className:`graph-node-kind`,children:[(0,m.jsx)(g,{type:n}),(0,m.jsx)(`span`,{children:r})]}),(0,m.jsx)(`span`,{className:`graph-node-title`,dir:`auto`,children:t}),h&&p.height>=84&&a&&t!==a&&(0,m.jsx)(`span`,{className:`graph-node-keyline`,dir:`auto`,children:a})]}),h&&[...s].map(e=>(0,m.jsx)(`span`,{className:`graph-node-port is-${e}`,"aria-hidden":`true`},e))]})}function v(e,{anchorId:t,allowCompact:n=()=>!0}={}){let r=e.width(),i=e.height(),a=216*e.zoom(),o=98*e.zoom(),s=o>=68?`detail`:o>=36?`standard`:`compact`,c=[];for(let l of e.nodes(`:visible`)){let e=l.id();if(l.hasClass(`dim`)||s===`compact`&&e!==t&&(a<49||!n(l)))continue;let{x:u,y:d}=l.renderedPosition(),f=u-a/2,p=d-o/2;if(f+a<=0||f>=r||p+o<=0||p>=i)continue;let m={left:f,top:p,width:a,height:o};e===t&&a<49&&(m={left:Math.max(3,f),top:d-13,width:Math.min(108,r-Math.max(3,f)),height:26}),c.push({id:e,density:s,box:m})}return c}function y(e,t,n={x:e.width()/2,y:e.height()/2}){e.zoom({level:e.zoom()*t,renderedPosition:n})}function b(e,t){let n=n=>{if(!n.deltaY)return;n.preventDefault();let{left:r,top:i,height:a}=e.getBoundingClientRect(),o=n.deltaMode===1?33:n.deltaMode===2?a:1;y(t,10**(-n.deltaY*o/1250),{x:n.clientX-r,y:n.clientY-i})};return e.addEventListener(`wheel`,n,{passive:!1}),()=>e.removeEventListener(`wheel`,n)}function x(e,t){let n=new Map,r=new Set;for(let i of e){if(t(i.target)||n.has(i.target))continue;let e=i.source;for(;e&&e!==i.target;)e=n.get(e);e!==i.target&&(n.set(i.target,i.source),r.add(i))}return{parents:n,parentEdges:r}}export{v as a,b as i,_ as n,y as o,g as r,x as t};
|
||||
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{t}from"./react-QV7DAAIx.js";import{Et as n,Gt as r,St as i,Tt as a,Ut as o,X as s,Zt as c,gt as l,it as u,ot as d,vt as f,xt as p}from"./semi-CHxO7u8f.js";var m=e(t(),1),h={target:i,infra:u,auth:f,finding:d,chain:o,exploit:r,poc:s,vulnerability:c,missing:p,goal:a,step:o,fact:n,receipt:s,observation:d,memory:l,digest:n,guidance:r};function g({type:e}){let t=h[e]||n;return(0,m.jsx)(`span`,{className:`graph-node-icon`,"aria-hidden":`true`,children:(0,m.jsx)(t,{size:`small`})})}function _({id:e,title:t,type:n,category:r,color:i,factKey:a,boundary:o,ports:s=[],selected:c,card:l,onSelect:u,onPreview:d}){let{density:f,box:p}=l,h=f===`detail`,_=Math.min(Math.max(p.width/216,1),1.6);return(0,m.jsxs)(`button`,{type:`button`,className:`graph-node graph-node--${f}`,title:t,"aria-label":t,"aria-pressed":c,"data-root":n===`goal`||n===`target`||void 0,"data-boundary":o||void 0,"data-wrap":f===`standard`&&p.height>=50||void 0,style:{...p,"--graph-node-color":i,"--graph-node-text-scale":_},onClick:()=>u(e),onMouseEnter:()=>d?.(e,!0),onMouseLeave:()=>d?.(e,!1),onFocus:()=>d?.(e,!0),onBlur:()=>d?.(e,!1),children:[(0,m.jsxs)(`span`,{className:`graph-node-content`,children:[f!==`compact`&&(0,m.jsxs)(`span`,{className:`graph-node-kind`,children:[(0,m.jsx)(g,{type:n}),(0,m.jsx)(`span`,{children:r})]}),(0,m.jsx)(`span`,{className:`graph-node-title`,dir:`auto`,children:t}),h&&p.height>=84&&a&&t!==a&&(0,m.jsx)(`span`,{className:`graph-node-keyline`,dir:`auto`,children:a})]}),h&&[...s].map(e=>(0,m.jsx)(`span`,{className:`graph-node-port is-${e}`,"aria-hidden":`true`},e))]})}function v(e,{anchorId:t,allowCompact:n=()=>!0}={}){let r=e.width(),i=e.height(),a=216*e.zoom(),o=98*e.zoom(),s=o>=68?`detail`:o>=36?`standard`:`compact`,c=[];for(let l of e.nodes(`:visible`)){let e=l.id();if(l.hasClass(`dim`)||s===`compact`&&e!==t&&(a<49||!n(l)))continue;let{x:u,y:d}=l.renderedPosition(),f=u-a/2,p=d-o/2;if(f+a<=0||f>=r||p+o<=0||p>=i)continue;let m={left:f,top:p,width:a,height:o};e===t&&a<49&&(m={left:Math.max(3,f),top:d-13,width:Math.min(108,r-Math.max(3,f)),height:26}),c.push({id:e,density:s,box:m})}return c}function y(e,t,n={x:e.width()/2,y:e.height()/2}){e.zoom({level:e.zoom()*t,renderedPosition:n})}function b(e,t){let n=n=>{if(!n.deltaY)return;n.preventDefault();let{left:r,top:i,height:a}=e.getBoundingClientRect(),o=n.deltaMode===1?33:n.deltaMode===2?a:1;y(t,10**(-n.deltaY*o/1250),{x:n.clientX-r,y:n.clientY-i})};return e.addEventListener(`wheel`,n,{passive:!1}),()=>e.removeEventListener(`wheel`,n)}function x(e,t){let n=new Map,r=new Set;for(let i of e){if(t(i.target)||n.has(i.target))continue;let e=i.source;for(;e&&e!==i.target;)e=n.get(e);e!==i.target&&(n.set(i.target,i.source),r.add(i))}return{parents:n,parentEdges:r}}export{v as a,b as i,_ as n,y as o,g as r,x as t};
|
||||
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{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{S as t,t as n}from"./react-QV7DAAIx.js";import{At as r,F as i,H as a,L as o,M as s,W as c,ot as l,st as u}from"./semi-Dpcldp_F.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-BqK3vieJ.js";var T=e(t(),1),E=e(n(),1),{Text:D}=c;function O(){let e=m(),{hasPermission:t}=f(),n=t(`knowledge:delete`),[c,O]=(0,T.useState)(``),[k,A]=(0,T.useState)(50),[j,M]=(0,T.useState)(null),N=h(()=>p.get(`/knowledge/retrieval-logs`,{conversationId:c||void 0,limit:k}),[c,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)(o,{icon:(0,E.jsx)(u,{}),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)(s,{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)(o,{size:`small`,theme:`borderless`,onClick:()=>M(t),children:`详情`}),n&&(0,E.jsx)(o,{size:`small`,theme:`borderless`,type:`danger`,icon:(0,E.jsx)(r,{}),onClick:()=>F(t)})]})}],dataSource:P,rowKey:`id`,loading:N.loading,pagination:!1,toolbar:(0,E.jsxs)(i,{children:[(0,E.jsx)(a,{prefix:(0,E.jsx)(l,{}),placeholder:`按会话 ID 过滤`,value:c,onChange:O,style:{width:260}}),(0,E.jsx)(a,{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{F as r,H as i,L as a,M as o,W as s,jt as c,ot as l,st as u}from"./semi-CHxO7u8f.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-Cn5SR2KP.js";var T=e(t(),1),E=e(n(),1),{Text:D}=s;function O(){let e=m(),{hasPermission:t}=f(),n=t(`knowledge:delete`),[s,O]=(0,T.useState)(``),[k,A]=(0,T.useState)(50),[j,M]=(0,T.useState)(null),N=h(()=>p.get(`/knowledge/retrieval-logs`,{conversationId:s||void 0,limit:k}),[s,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)(a,{icon:(0,E.jsx)(u,{}),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)(o,{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)(r,{children:[(0,E.jsx)(a,{size:`small`,theme:`borderless`,onClick:()=>M(t),children:`详情`}),n&&(0,E.jsx)(a,{size:`small`,theme:`borderless`,type:`danger`,icon:(0,E.jsx)(c,{}),onClick:()=>F(t)})]})}],dataSource:P,rowKey:`id`,loading:N.loading,pagination:!1,toolbar:(0,E.jsxs)(r,{children:[(0,E.jsx)(i,{prefix:(0,E.jsx)(l,{}),placeholder:`按会话 ID 过滤`,value:s,onChange:O,style:{width:260}}),(0,E.jsx)(i,{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{W as r,i}from"./semi-Dpcldp_F.js";import{I as a,P as o,c as s,l as c,x as l}from"./index-BqK3vieJ.js";var u=e(t(),1),d=e(n(),1),{Text:f}=r,p=120,m=4e3;function h({visible:e,project:t,onCancel:n,onSaved:r}){let h=o(),g=(0,u.useId)(),[_,v]=(0,u.useState)(!1),[y,b]=(0,u.useState)(null),x=!!t?.id;return(0,u.useEffect)(()=>{b(null)},[e,t?.id]),(0,d.jsxs)(s,{visible:e,width:560,closable:!_,closeOnEsc:!_,onCancel:n,cancelButtonProps:{disabled:_},title:x?h(`projects.modalEditTitle`,null,`编辑项目`):h(`projects.modalNewTitle`,null,`新建项目`),formId:g,okText:x?h(`projects.saveChanges`,null,`保存修改`):h(`projects.createProject`,null,`创建项目`),confirmLoading:_,children:[(0,d.jsx)(f,{type:`tertiary`,size:`small`,children:x?h(`projects.modalEditSubtitle`,null,`修改项目名称与描述`):h(`projects.modalNewSubtitle`,null,`创建后可绑定对话,跨会话共享事实黑板`)}),(0,d.jsxs)(i,{id:g,onSubmit:async e=>{if(!_){v(!0),b(null);try{let n={name:e.name.trim(),description:(e.description||``).slice(0,m)},i=x?await a.put(`/projects/${t.id}`,n):await a.post(`/projects`,n);l(x?h(`projects.saved`,null,`已保存`):h(`projects.createProject`,null,`创建项目`)),r?.(i)}catch(e){b(e)}finally{v(!1)}}},initValues:{name:t?.name||``,description:t?.description||``},children:[(0,d.jsx)(i.Input,{id:`${g}-name`,field:`name`,maxLength:p,label:h(`projects.projectName`,null,`项目名称`),placeholder:h(`projects.projectNamePlaceholder`,null,`例如:某客户 Web 渗透`),rules:[{required:!0,whitespace:!0,message:h(`projects.enterProjectName`,null,`请输入项目名称`)}]}),(0,d.jsx)(i.TextArea,{id:`${g}-description`,field:`description`,rows:4,maxCount:m,label:h(`projects.projectDescription`,null,`项目描述`),placeholder:h(`projects.projectDescriptionPlaceholder`,null,`客户/任务备注、协作说明…`),extraText:h(`projects.descriptionLengthHint`,null,`仅供团队成员查阅,Agent 不会读取;需让 Agent 知晓的内容请写入事实黑板`)}),(0,d.jsx)(c,{error:y})]},`${e}-${t?.id||`new`}`)]})}export{h as t};
|
||||
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{S as t,t as n}from"./react-QV7DAAIx.js";import{W as r,i}from"./semi-CHxO7u8f.js";import{I as a,P as o,c as s,l as c,x as l}from"./index-Cn5SR2KP.js";var u=e(t(),1),d=e(n(),1),{Text:f}=r,p=120,m=4e3;function h({visible:e,project:t,onCancel:n,onSaved:r}){let h=o(),g=(0,u.useId)(),[_,v]=(0,u.useState)(!1),[y,b]=(0,u.useState)(null),x=!!t?.id;return(0,u.useEffect)(()=>{b(null)},[e,t?.id]),(0,d.jsxs)(s,{visible:e,width:560,closable:!_,closeOnEsc:!_,onCancel:n,cancelButtonProps:{disabled:_},title:x?h(`projects.modalEditTitle`,null,`编辑项目`):h(`projects.modalNewTitle`,null,`新建项目`),formId:g,okText:x?h(`projects.saveChanges`,null,`保存修改`):h(`projects.createProject`,null,`创建项目`),confirmLoading:_,children:[(0,d.jsx)(f,{type:`tertiary`,size:`small`,children:x?h(`projects.modalEditSubtitle`,null,`修改项目名称与描述`):h(`projects.modalNewSubtitle`,null,`创建后可绑定对话,跨会话共享事实黑板`)}),(0,d.jsxs)(i,{id:g,onSubmit:async e=>{if(!_){v(!0),b(null);try{let n={name:e.name.trim(),description:(e.description||``).slice(0,m)},i=x?await a.put(`/projects/${t.id}`,n):await a.post(`/projects`,n);l(x?h(`projects.saved`,null,`已保存`):h(`projects.createProject`,null,`创建项目`)),r?.(i)}catch(e){b(e)}finally{v(!1)}}},initValues:{name:t?.name||``,description:t?.description||``},children:[(0,d.jsx)(i.Input,{id:`${g}-name`,field:`name`,maxLength:p,label:h(`projects.projectName`,null,`项目名称`),placeholder:h(`projects.projectNamePlaceholder`,null,`例如:某客户 Web 渗透`),rules:[{required:!0,whitespace:!0,message:h(`projects.enterProjectName`,null,`请输入项目名称`)}]}),(0,d.jsx)(i.TextArea,{id:`${g}-description`,field:`description`,rows:4,maxCount:m,label:h(`projects.projectDescription`,null,`项目描述`),placeholder:h(`projects.projectDescriptionPlaceholder`,null,`客户/任务备注、协作说明…`),extraText:h(`projects.descriptionLengthHint`,null,`仅供团队成员查阅,Agent 不会读取;需让 Agent 知晓的内容请写入事实黑板`)}),(0,d.jsx)(c,{error:y})]},`${e}-${t?.id||`new`}`)]})}export{h as t};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1 @@
|
|||
var e=`csai-retest-autosend`;function t(){try{let t=sessionStorage.getItem(e);return t?JSON.parse(t):null}catch{return null}}function n(t,n){try{sessionStorage.setItem(e,JSON.stringify({conversationId:String(t||``),prompt:String(n||``)}))}catch{}}function r(e){let n=t();return n&&n.conversationId===e?n:null}function i(t){if(r(t))try{sessionStorage.removeItem(e)}catch{}}export{r as n,n as r,i as t};
|
||||
|
|
@ -1 +1 @@
|
|||
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{S as t,t as n}from"./react-QV7DAAIx.js";import{At as r,Dt as i,F as a,H as o,L as s,M as c,W as l,i as u,lt as d,ot as f,st as p}from"./semi-Dpcldp_F.js";import{F as m,I as h,P as g,a as _,b as v,c as y,l as b,m as x,p as S,s as C,x as w,y as T}from"./index-BqK3vieJ.js";var E=e(t(),1),D=e(n(),1),{Text:O}=l;function k(){let e=g(),{hasPermission:t}=m(),n=t(`roles:write`),l=t(`roles:delete`),[k,A]=(0,E.useState)(``),[j,M]=(0,E.useState)(null),[N,P]=(0,E.useState)(!1),F=_(()=>h.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 h.post(`/roles`,t),await h.del(`/roles/${encodeURIComponent(n)}`)):n?await h.put(`/roles/${encodeURIComponent(n)}`,t):await h.post(`/roles`,t),w(`角色已保存`),M(null),F.reload()}catch(e){v(e,`保存角色失败`)}finally{P(!1)}},R=e=>T({title:`删除角色「${e.name}」?`,content:`已绑定该角色的对话将失去对应提示词与工具配置。`,onOk:async()=>{await h.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)(s,{icon:(0,D.jsx)(p,{}),onClick:()=>F.reload(),loading:F.loading,children:`刷新`}),n&&(0,D.jsx)(s,{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)(c,{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)(c,{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)(s,{size:`small`,theme:`borderless`,icon:(0,D.jsx)(i,{}),onClick:()=>M({role:t,form:{}}),children:`编辑`}),l&&(0,D.jsx)(s,{size:`small`,theme:`borderless`,type:`danger`,icon:(0,D.jsx)(r,{}),onClick:()=>R(t)})]})}],dataSource:I,rowKey:`name`,loading:F.loading,pagination:{pageSize:20},toolbar:(0,D.jsx)(o,{prefix:(0,D.jsx)(f,{}),value:k,onChange:A,placeholder:`搜索角色名称`,style:{width:260}})})]}),(0,D.jsx)(y,{title:j?.role?`编辑角色`:`新建角色`,visible:!!j,onCancel:()=>M(null),onOk:L,confirmLoading:N,width:760,children:(0,D.jsxs)(u,{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)(u.Input,{field:`name`,label:`角色名称`,rules:[{required:!0,message:`请输入角色名称`}]}),(0,D.jsx)(u.Input,{field:`description`,label:`描述`}),(0,D.jsx)(u.Input,{field:`tools`,label:`工具(逗号分隔)`,placeholder:`toolName, mcp::toolName`}),(0,D.jsx)(u.TextArea,{field:`user_prompt`,label:`用户提示词(追加到用户消息前)`,autosize:{minRows:6,maxRows:18}}),(0,D.jsx)(u.Slot,{label:`启用`,children:(0,D.jsx)(u.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{F as r,H as i,L as a,M as o,Ot as s,W as c,i as l,jt as u,lt as d,ot as f,st as p}from"./semi-CHxO7u8f.js";import{F as m,I as h,P as g,a as _,b as v,c as y,l as b,m as x,p as S,s as C,x as w,y as T}from"./index-Cn5SR2KP.js";var E=e(t(),1),D=e(n(),1),{Text:O}=c;function k(){let e=g(),{hasPermission:t}=m(),n=t(`roles:write`),c=t(`roles:delete`),[k,A]=(0,E.useState)(``),[j,M]=(0,E.useState)(null),[N,P]=(0,E.useState)(!1),F=_(()=>h.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 h.post(`/roles`,t),await h.del(`/roles/${encodeURIComponent(n)}`)):n?await h.put(`/roles/${encodeURIComponent(n)}`,t):await h.post(`/roles`,t),w(`角色已保存`),M(null),F.reload()}catch(e){v(e,`保存角色失败`)}finally{P(!1)}},R=e=>T({title:`删除角色「${e.name}」?`,content:`已绑定该角色的对话将失去对应提示词与工具配置。`,onOk:async()=>{await h.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)(r,{children:[(0,D.jsx)(a,{icon:(0,D.jsx)(p,{}),onClick:()=>F.reload(),loading:F.loading,children:`刷新`}),n&&(0,D.jsx)(a,{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)(r,{vertical:!0,spacing:0,align:`start`,children:[(0,D.jsxs)(r,{children:[(0,D.jsx)(O,{strong:!0,children:e}),t.enabled===!1&&(0,D.jsx)(o,{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)(r,{wrap:!0,spacing:4,children:[e.slice(0,4).map(e=>(0,D.jsx)(o,{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)(r,{children:[n&&(0,D.jsx)(a,{size:`small`,theme:`borderless`,icon:(0,D.jsx)(s,{}),onClick:()=>M({role:t,form:{}}),children:`编辑`}),c&&(0,D.jsx)(a,{size:`small`,theme:`borderless`,type:`danger`,icon:(0,D.jsx)(u,{}),onClick:()=>R(t)})]})}],dataSource:I,rowKey:`name`,loading:F.loading,pagination:{pageSize:20},toolbar:(0,D.jsx)(i,{prefix:(0,D.jsx)(f,{}),value:k,onChange:A,placeholder:`搜索角色名称`,style:{width:260}})})]}),(0,D.jsx)(y,{title:j?.role?`编辑角色`:`新建角色`,visible:!!j,onCancel:()=>M(null),onOk:L,confirmLoading:N,width:760,children:(0,D.jsxs)(l,{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)(l.Input,{field:`name`,label:`角色名称`,rules:[{required:!0,message:`请输入角色名称`}]}),(0,D.jsx)(l.Input,{field:`description`,label:`描述`}),(0,D.jsx)(l.Input,{field:`tools`,label:`工具(逗号分隔)`,placeholder:`toolName, mcp::toolName`}),(0,D.jsx)(l.TextArea,{field:`user_prompt`,label:`用户提示词(追加到用户消息前)`,autosize:{minRows:6,maxRows:18}}),(0,D.jsx)(l.Slot,{label:`启用`,children:(0,D.jsx)(l.Switch,{field:`enabled`})})]})},j?.role?.name||`new-role`)]})}export{k 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
|
|
@ -1 +1 @@
|
|||
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{At as t,F as n,L as r,W as i,st as a}from"./semi-Dpcldp_F.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-BqK3vieJ.js";import{t as y}from"./react-QV7DAAIx.js";var b=e(y(),1),{Text:x}=i;function S(){let e=u(),{hasPermission:i}=s(),y=i(`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)(r,{icon:(0,b.jsx)(a,{}),onClick:()=>S.reload(),loading:S.loading,children:`刷新`}),y&&(0,b.jsx)(r,{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)(r,{size:`small`,theme:`borderless`,type:`danger`,icon:(0,b.jsx)(t,{}),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{F as t,L as n,W as r,jt as i,st as a}from"./semi-CHxO7u8f.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-Cn5SR2KP.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)(t,{children:[(0,b.jsx)(n,{icon:(0,b.jsx)(a,{}),onClick:()=>S.reload(),loading:S.loading,children:`刷新`}),y&&(0,b.jsx)(n,{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,t)=>y&&Number(t.total_calls)>0?(0,b.jsx)(n,{size:`small`,theme:`borderless`,type:`danger`,icon:(0,b.jsx)(i,{}),onClick:()=>O(t.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
File diff suppressed because one or more lines are too long
|
|
@ -18,10 +18,10 @@
|
|||
} catch (error) { /* first paint fallback */ }
|
||||
})();
|
||||
</script>
|
||||
<script type="module" crossorigin src="/static/app/assets/index-BqK3vieJ.js"></script>
|
||||
<script type="module" crossorigin src="/static/app/assets/index-Cn5SR2KP.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-Dpcldp_F.js">
|
||||
<link rel="modulepreload" crossorigin href="/static/app/assets/semi-CHxO7u8f.js">
|
||||
<link rel="stylesheet" crossorigin href="/static/app/assets/semi-BUXPdXzR.css">
|
||||
<link rel="stylesheet" crossorigin href="/static/app/assets/index-DDEfT02L.css">
|
||||
</head>
|
||||
|
|
|
|||
Loading…
Reference in New Issue