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