fix(dsh): address intervention cancellation and verification review
Core regression / Python 3.12 core, intervention UI and release configuration (push) Failing after 21s
Core regression / JavaScript syntax (push) Successful in 3s
Core regression / Python 3.12 core, intervention UI and release configuration (pull_request) Failing after 21s
Core regression / JavaScript syntax (pull_request) Successful in 3s
Core regression / Python 3.12 core, intervention UI and release configuration (push) Failing after 21s
Core regression / JavaScript syntax (push) Successful in 3s
Core regression / Python 3.12 core, intervention UI and release configuration (pull_request) Failing after 21s
Core regression / JavaScript syntax (pull_request) Successful in 3s
This commit is contained in:
1 parent
de9cb2908d
commit
775bc23dc3
26 files changed
+1280
-119
No files matched your search
@@ -3,6 +3,7 @@ window.__ModuleLoader__.load({id:'@dx/dsh-task',factory:require=>{
|
||||
const {IconSettingsOutlineMedium}=require('@deepseek-ai/dsh-client-ui-primitives');
|
||||
const names={observe:'待命',draft:'待配置',ready:'待执行',deleted:'已归档',configuring:'待配置',running:'执行中',paused:'已暂停',completed:'已完成',blocked:'已阻断',uncertain:'待核验',failed:'失败'};
|
||||
const stages={collecting:'收集异常证据',analyzing:'AI 自动诊断中',retrying:'按规则重试中',verifying:'核验实际执行结果',cleaning_resources:'清理并核验后台资源',
|
||||
observed_cleared:'阻塞已自行解除,未执行清理',cancelled:'诊断已取消,证据已保留',
|
||||
reflecting:'AI 复盘与补充诊断中',resolved:'处理结果已通过核验',pending_issue:'证据已保存,工单待完整提交',escalated:'证据已保存并提交 Git 工单'};
|
||||
function ToolSettings(){
|
||||
return h('div',{'data-testid':'dx-tool-settings-panel',style:{lineHeight:1.9}},
|
||||
@@ -28,6 +29,15 @@ window.__ModuleLoader__.load({id:'@dx/dsh-task',factory:require=>{
|
||||
h(IconSettingsOutlineMedium,{size:18}),wide&&'工具设置');
|
||||
}
|
||||
function OverviewPanel({data,notice,request,perform}){
|
||||
const verification=data?.automation?.verification;
|
||||
const resourceVerification=verification&&Object.hasOwn(verification,'resources_released');
|
||||
const remaining=verification?.remaining_resources;
|
||||
const truncated=Array.isArray(remaining)&&remaining.some(row=>row?.__truncated__);
|
||||
const remainingCount=Array.isArray(remaining)?remaining.filter(row=>!row?.__truncated__).length:0;
|
||||
const verificationText=verification?.resources_released===true?'资源释放已独立核验通过;不代表 CAD 任务成功。':
|
||||
!Array.isArray(remaining)?'资源释放尚未核验通过;剩余资源数量未知。':
|
||||
truncated?(remainingCount?'资源释放尚未核验通过;至少 '+remainingCount+' 项资源尚未释放(明细已截断)。':'资源释放尚未核验通过;剩余资源数量未知(明细已截断)。'):
|
||||
remaining.length?'资源释放尚未核验通过;剩余 '+remaining.length+' 项资源。':'资源释放尚未核验通过;当前未见剩余资源,仍需确认。';
|
||||
const section=(title,text)=>h('section',{style:{marginBottom:24}},h('h3',{style:{fontSize:14,fontWeight:500,marginBottom:10}},title),
|
||||
h('div',{style:{whiteSpace:'pre-wrap',color:'var(--dsw-alias-label-secondary)',lineHeight:1.8}},text));
|
||||
const health=data?.operations?.health;
|
||||
@@ -68,7 +78,11 @@ window.__ModuleLoader__.load({id:'@dx/dsh-task',factory:require=>{
|
||||
h('h3',{style:{fontSize:14,fontWeight:500}},'AI 自动介入'),
|
||||
h('p',null,data.automation.task_name||'异常任务'),
|
||||
h('p',{'data-testid':'dx-auto-status'},stages[data.automation.status]||data.automation.status),
|
||||
h('p',{style:{whiteSpace:'pre-wrap'}},data.automation.summary?.slice(0,650)||'正在保留现场并核对异常依据…'),
|
||||
data.automation.cleanup_attempts!==undefined&&h('p',{'data-testid':'dx-auto-cleanup-attempts',style:{fontSize:12}},'资源清理尝试:'+count(data.automation.cleanup_attempts)+' 次'),
|
||||
resourceVerification&&h('p',{'data-testid':'dx-auto-verification',style:{fontSize:12,lineHeight:1.7}},verificationText),
|
||||
data.automation.can_cancel===true&&h('button',{'data-testid':'dx-auto-cancel',type:'button',onClick:()=>request('cancel_diagnosis'),style:{...buttonStyle,marginBottom:8}},'取消 AI 诊断'),
|
||||
h('p',{style:{whiteSpace:'pre-wrap'}},data.automation.summary?.slice(0,650)||
|
||||
(['observed_cleared','cancelled'].includes(data.automation.status)?stages[data.automation.status]:'正在保留现场并核对异常依据…')),
|
||||
h('p',{style:{fontSize:12,overflowWrap:'anywhere',color:'var(--dsw-alias-label-secondary)'}},
|
||||
'事件 '+data.automation.incident_id+' · '+data.automation.issue_code),
|
||||
data.automation.ticket?.url&&h('p',{'data-testid':'dx-auto-ticket',style:{overflowWrap:'anywhere',userSelect:'text'}},'Git 工单:'+data.automation.ticket.url),
|
||||
@@ -252,7 +266,15 @@ window.__ModuleLoader__.load({id:'@dx/dsh-task',factory:require=>{
|
||||
setData(fresh);await post('/dx/operations',{revision:fresh.revision,spec});
|
||||
}catch{setNotice('任务上下文暂不可用,请稍后重试。');}
|
||||
};
|
||||
const request=action=>data&&post('/dx/action',{action,task_id:data.task_id,revision:data.revision});
|
||||
const request=async action=>{
|
||||
if(!data||pending)return;
|
||||
if(action!=='cancel_diagnosis')return post('/dx/action',{action,task_id:data.task_id,revision:data.revision});
|
||||
try{
|
||||
const fresh=await fetch('/dx/context',{credentials:'same-origin'}).then(r=>{if(!r.ok)throw Error();return r.json();});
|
||||
if(fresh.task_id!==data.task_id){setData(fresh);setNotice('任务选择已变化,请核对后重新点击。');return;}
|
||||
setData(fresh);return post('/dx/action',{action,task_id:fresh.task_id,revision:fresh.revision});
|
||||
}catch{setNotice('诊断上下文暂不可用,请稍后重试。');}
|
||||
};
|
||||
const control=spec=>post('/dx/runtime/control',spec);
|
||||
const operations=data?.operations||{},scope=data?.task_id?[data.task_id]:[];
|
||||
const tabs=[['overview','概览'],['running','运行'],['impact','影响'],['schedules','排期'],['experiences','经验'],['tickets','工单'],['usage','用量']];
|
||||
|
||||
Reference in new issue
Block a user