import{B as s}from"./index118.js?v=20260328163632";import{u as a,l as t,d8 as e,x as l,b8 as n,z as i,d9 as c,_ as o}from"./utils-lib.js?v=20260328163632";import{r}from"./controller.js?v=20260328163632";import{k as u,t as p,r as m,o as d,U as x,l as f,Y as k,V as v,W as j,X as y,O as b,a3 as g,Z as h,F as _,L as w,K as C,_ as I,a1 as T}from"./base-lib.js?v=20260328163632";import{aw as L,A as q}from"./naive-ui.js?v=20260328163632";import"./__commonjsHelpers__.js?v=20260328163632";import"./env-lib.js?v=20260328163632";import"./index84.js?v=20260328163632";import"./index85.js?v=20260328163632";import"./index86.js?v=20260328163632";const z={class:"w-full h-full flex flex-col justify-center content-center"},B={key:0,class:"h-full"},H={class:"flex justify-center items-center h-350px"},O={class:"text-[16px] text-medium"},S={key:1,class:"taskList pr-[10px] mb-[10px]"},A={class:"taskTips flex justify-between"},F=["title"],K={class:"taskItemHeader"},N={class:"taskItemName"},U=["onClick"],V=o(u({__name:"index",setup(o,{expose:u}){const{panel:V}=a(),W=p(V.value,"msgBoxTaskCount"),X=m(!1),Y=m([]);let Z=null;const D=async(s=!0)=>{Z&&clearTimeout(Z),"taskList"===e.value&&(s&&(X.value=!0),await l({request:n({status:0}),success:s=>{s.data&&(Y.value=s.data.data,W.value=s.data.data.length,s.data.data.length>0&&(Z=setTimeout((()=>{D(!1)}),2e3)))}}),X.value=!1)};return d(D),u({init:D}),(a,e)=>{const n=L,o=q,u=x("bt-loading");return f((v(),j("div",z,[k(Y).length?(v(),j("div",S,[y("div",A,[y("span",{class:"truncate",title:k(t)("提示：若任务长时间未执行，请尝试点击【重启服务】来重置任务队列")},h(k(t)("提示：若任务长时间未执行，请尝试点击【重启服务】来重置任务队列")),9,F),y("span",{class:"bt-link whitespace-pre flex-shrink-0",onClick:e[0]||(e[0]=(...s)=>k(r)&&k(r)(...s))},h(k(t)("重启服务")),1)]),b(o,{class:"!my-10px"}),(v(!0),j(_,null,w(k(Y),((a,e)=>(v(),j("div",{key:e,class:"taskItem"},["execshell"===a.type?(v(),j(_,{key:0},[y("div",K,[y("span",N,h(a.name),1),y("span",null,[y("span",{class:C({leaveOut:"-1"===a.status})},h("0"===a.status?k(t)("等待"):k(t)("正在安装")),3),b(o,{vertical:""}),y("span",{class:"bt-link",onClick:s=>(async s=>{await i({icon:"warning-filled",title:t("删除任务"),content:t("删除当前选中任务，删除后将取消任务执行，是否继续操作？")}),l({loading:t("正在删除任务，请稍后..."),request:c({id:s}),message:!0,success:s=>{s.status&&D()}})})(a.id)},h(k(t)("删除")),9,U)])]),"-1"===a.status&&"execshell"===a.type?(v(),I(s,{key:0,class:"!h-200px",autoScroll:!0,content:a.logs,fullScreen:!1},null,8,["content"])):T("",!0)],64)):T("",!0)])))),128))])):(v(),j("div",B,[y("div",H,[b(n,{size:"large"},{icon:g((()=>e[1]||(e[1]=[y("i",{class:"!text-light svgtofont-empty !text-46px"},null,-1)]))),default:g((()=>[y("span",O,h(k(t)("当前没有任务执行")),1)])),_:1})])]))])),[[u,k(X)]])}}}),[["__scopeId","data-v-3b22cb28"]]);export{V as default};
