feat: simplify DSH tool navigation and remove account onboarding

This commit is contained in:
阿白叔 committed 2026-10-30 11:47:20 +08:00
1 parent 96227eed2e
commit f437df2a83
10 files changed
+109 -50

No files matched your search

+23
View File
@@ -1,6 +1,25 @@
window.__ModuleLoader__.load({id:'@dx/dsh-task',factory:require=>{
const React=require('react'),h=React.createElement;
const {IconSettingsOutlineMedium}=require('@deepseek-ai/dsh-client-ui-primitives');
const names={observe:'待命',draft:'待配置',configuring:'待配置',running:'执行中',paused:'已暂停',completed:'已完成',blocked:'已阻断',uncertain:'待核验',failed:'失败'};
function ToolSettings(){
return h('div',{'data-testid':'dx-tool-settings-panel',style:{lineHeight:1.9}},
h('h2',null,'DSH工具'),
h('p',null,'面向 DxDesigner 器件替换任务的异常分析与执行监管。直接使用当前任务上下文,无需另外登录。'),
h('h3',null,'工作方式'),
h('p',null,'在顶部切换任务中心和 DSH助手。会话、任务选择和未发送草稿会保留。'),
h('h3',null,'任务能力'),
h('ul',null,...['读取当前任务快照并分析异常','刷新任务上下文','确认后准备失败项重试','确认后在安全边界暂停'].map(text=>h('li',{key:text},text))),
h('h3',null,'模型与数据'),
h('p',null,'使用主工具配置的模型,在输入框下方选择。会话保存在本机任务中心数据目录。'),
h('p',null,'工程修改与执行核验由任务中心完成。模型不直接访问工程文件或执行命令。'));
}
function SettingsLauncher({wide,openSettings}){
return h('button',{'data-testid':'dx-tool-settings',type:'button','aria-label':'工具设置',onClick:()=>openSettings(),
style:{display:'flex',alignItems:'center',gap:8,width:wide?'100%':36,height:38,padding:wide?'0 10px':8,
border:0,borderRadius:10,background:'transparent',color:'var(--dsw-alias-label-primary)',cursor:'pointer',font:'inherit'}},
h(IconSettingsOutlineMedium,{size:18}),wide&&'工具设置');
}
function TaskPanel(){
const[data,setData]=React.useState(null),[notice,setNotice]=React.useState('');
React.useEffect(()=>{
@@ -31,6 +50,10 @@ window.__ModuleLoader__.load({id:'@dx/dsh-task',factory:require=>{
section('监管记录',(data?.events||[]).join('\n')||'等待任务事件'));
}
return{inject:['slots','sidebarRightTabs','sidebarRight','uiSession'],apply(ctx){
ctx.slots.inject('settings.launcher',()=>ctx.slots.register({name:'settings.launcher',priority:-10},SettingsLauncher));
ctx.slots.inject('settings.section',()=>ctx.slots.register({name:'settings.section',id:'dx-tool',order:-100,label:()=>'DSH工具'},ToolSettings));
ctx.slots.inject('conversation.hero.options',()=>ctx.slots.register({name:'conversation.hero.options',id:'dx-tool-hint'},
()=>h('p',{style:{fontSize:13,color:'var(--dsw-alias-label-secondary)',textAlign:'center',margin:'4px 0 12px'}},'任务异常分析 · 规则内处理 · 执行监管')));
ctx.sidebarRightTabs.register({id:'@dx/dsh-task',kind:'dx-task',priority:'extension',title:()=>'任务监管',guide:[{id:'dx-task',order:0,title:()=>'任务监管',description:()=>'当前任务与受控操作'}]});
ctx.slots.inject('sidebar.right.pane.tab',()=>ctx.slots.register({name:'sidebar.right.pane.tab',key:'@dx/dsh-task'},TaskPanel));
ctx.slots.inject('sidebar.brand.name',()=>ctx.slots.register({name:'sidebar.brand.name',priority:-10},()=>h('span',null,'DSH助手')));