import{_ as a}from"./index246.js?v=1764830988434";import{u as e,q as s,dV as t,dW as n,dX as l,h as o,p as u,T as i,dY as p,d as r}from"./page_layout.js?v=1764830988434";import{j as c,C as A,h as d,d as g,Y as m}from"./public.js?v=1764830988434";import{G as _,da as x,aC as f}from"./naive.js?v=1764830988434";import{k as y,P as C,W as v,F as k,u as b,r as h,w as j,b as w,aK as B,a2 as L,V as M,a3 as Q,S as R,R as D,O as E,U as I,an as z,l as F,a4 as U,j as O,a0 as S,e as H,x as N,ak as P}from"./vue.js?v=1764830988434";import{_ as V}from"./index.vue_vue_type_script_setup_true_lang5.js?v=1764830988434";import{_ as G}from"./index.vue_vue_type_script_setup_true_lang7.js?v=1764830988434";import{_ as K}from"./index102.js?v=1764830988434";import"./common.js?v=1764830988434";import"./__commonjsHelpers__.js?v=1764830988434";import"./index.vue_vue_type_script_setup_true_lang6.js?v=1764830988434";const T=y({name:"EmptyBox",setup(a,{slots:t}){const n=e(),{t:l}=C(),o=()=>{c()};return()=>{var a;let e;return v(k,null,[0===n.taskCount?v(_,{class:"pt-80px",size:"huge",description:l("Layout.MessageBox.index_1")},null):v(k,null,[v(x,{class:"justify-between! flex-nowrap!"},{default:()=>{return[v("span",null,[l("Layout.MessageBox.index_2")]),v(f,{text:!0,type:"primary",onClick:o},(a=e=l("Public.Status.Restart"),"function"==typeof a||"[object Object]"===Object.prototype.toString.call(a)&&!b(a)?e:{default:()=>[e]}))];var a}}),v(s,{class:"mt-12px! mb-16px!"},null),null==(a=t.default)?void 0:a.call(t)])])}}}),W={class:"h-460px overflow-auto"},Y={class:"install"},$={key:0,class:"cmd"},q=u(y({__name:"index",setup(a,{expose:s}){const u=e(),i=t(),p=n(),r=h(""),{send:c,close:d}=A("/sock_shell",{onMessage:(a,e)=>{const s=e.data;o(s)&&(r.value+=s)}}),g=()=>{if(p.taskList.length){const{type:a,status:e}=p.taskList[0];"execshell"===a&&("-1"===e?(r.value="",c("tail -n 100 -f /tmp/panelExec.log")):setTimeout(async()=>{await p.getList(),g()},2e3))}};j(()=>u.taskCount,a=>{a&&g(),i.getMessageCount()}),w(()=>{d()});const m=async()=>{await p.getList(),0!==u.taskCount&&(g(),p.onRepetion())};return m(),s({init:m}),(a,e)=>{const s=f,t=x,n=B("scroll-bottom");return M(),L(I(T),null,{default:Q(()=>[R("div",W,[(M(!0),D(k,null,E(I(p).taskList,o=>(M(),D("div",{key:o.id},["execshell"===o.type?(M(),D(k,{key:0},[v(t,{class:"justify-between! mb-8px"},{default:Q(()=>[R("span",Y,U(o.name),1),R("div",null,[O(U("0"===o.status?"waiting":a.$t("Soft.index_40"))+" ",1),e[0]||(e[0]=R("img",{src:"data:image/gif;base64,R0lGODlhDgACAIAAAHNzcwAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQFDgABACwAAAAAAgACAAACAoRRACH5BAUOAAEALAQAAAACAAIAAAIChFEAIfkEBQ4AAQAsCAAAAAIAAgAAAgKEUQAh+QQJDgABACwAAAAADgACAAACBoyPBpu9BQA7"},null,-1)),e[1]||(e[1]=R("span",{class:"px-5px"},"|",-1)),v(s,{text:"",color:"#20a53a",onClick:a=>(async a=>{d(),await l({id:a}),await p.getList()})(o.id)},{default:Q(()=>[O(U(a.$t("Public.Btn.Del")),1)]),_:2},1032,["onClick"])])]),_:2},1024),"-1"===o.status?F((M(),D("pre",$,[O(U(I(r)),1)])),[[n]]):z("",!0)],64)):z("",!0)]))),128))])]),_:1})}}}),[["__scopeId","data-v-7b9da2ab"]]),J=y({__name:"index",setup(a,{expose:e}){const s=t(),{loading:n,table:l,columns:o,search:u}=S(s),i=()=>{s.getMessageCount()};return e({init:i}),(a,e)=>{const s=d,t=G,p=V;return M(),L(p,null,{table:Q(()=>[v(s,{loading:I(n),data:I(l).data,columns:I(o)},null,8,["loading","data","columns"])]),pageRight:Q(()=>[v(t,{page:I(u).p,"onUpdate:page":e[0]||(e[0]=a=>I(u).p=a),"page-size":I(u).limit,"onUpdate:pageSize":e[1]||(e[1]=a=>I(u).limit=a),"item-count":I(l).total,"page-slot":5,"show-size-picker":!1,onRefresh:i},null,8,["page","page-size","item-count"])]),_:1})}}}),X=u(y({__name:"index",setup(a,{expose:e}){const s=h("None"),{loading:t,setLoading:n}=g(),l=async()=>{try{n(!0);const{message:a}=await p();r(a)&&(s.value=o(a.result)?a.result:"None")}finally{n(!1)}};return l(),e({init:l}),(a,e)=>{const n=K,l=i;return M(),L(l,{class:"h-full",show:I(t)},{default:Q(()=>[v(n,{log:I(s)},null,8,["log"])]),_:1},8,["show"])}}}),[["__scopeId","data-v-8405edde"]]),Z={class:"h-550px"},aa=y({__name:"index",setup(s,{expose:n}){const{t:l}=C(),o=e(),u=t(),i=h("task"),p=H([{key:"task",label:()=>v("span",null,[l("Layout.MessageBox.index_3"),O(" ("),o.taskCount,O(")")]),component:N(q)},{key:"message",label:()=>v("span",null,[l("Layout.MessageBox.index_4"),O(" ("),u.listConut,O(")")]),component:N(J)},{key:"log",label:l("Layout.MessageBox.index_5"),component:N(X)}]);return u.getMessageCount(),n({onClose:()=>{m()}}),(e,s)=>{const t=a;return M(),D("div",Z,[v(t,{value:I(i),"onUpdate:value":s[0]||(s[0]=a=>P(i)?i.value=a:null),ref:"tabsRef",data:I(p)},null,8,["value","data"])])}}});export{aa as default};
