import{_ as e}from"./index178.js?v=1763625242172";import{_ as a}from"./index107.js?v=1763625242172";import{c as s}from"./page_layout.js?v=1763625242172";import{d as l,C as t}from"./public.js?v=1763625242172";import{g as n,a as i}from"./index29.js?v=1763625242172";import{k as o,t as u,P as p,c as r,r as c,R as _,S as m,X as v,V as d,aj as f}from"./vue.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";import"./naive.js?v=1763625242172";import"./common.js?v=1763625242172";import"./index.vue_vue_type_script_setup_true_lang.js?v=1763625242172";import"./index.vue_vue_type_script_setup_true_lang8.js?v=1763625242172";import"./index.vue_vue_type_script_setup_true_lang2.js?v=1763625242172";import"./index98.js?v=1763625242172";import"./index99.js?v=1763625242172";const g={class:"p-20px"},j=o({__name:"index",props:{app:{}},setup(o){const j=u(o,"app"),{t:x}=p(),y=r((()=>"initializing"===j.value.status)),k=c(y.value?"install":"run"),b=[{key:"run",show:!y.value,label:x("Docker.App.index_5")},{key:"install",label:x("Docker.App.index_6")}],h=c(""),{loading:w,setLoading:z}=l(),A=()=>{C(k.value)},C=e=>{switch(e){case"run":(async()=>{try{z(!0),h.value="";const{message:e}=await n({service_name:j.value.service_name,app_name:j.value.appname});s(e)&&(h.value=e.result)}finally{z(!1)}})();break;case"install":y.value?K():(async()=>{try{z(!0),h.value="";const{message:e}=await i({service_name:j.value.service_name});s(e)&&(h.value=e.result)}finally{z(!1)}})()}},{open:D,send:V,close:H}=t("/sock_shell",{immediate:!1,onMessage:(e,a)=>{const{data:s}=a;h.value+=a.data,(s.includes("bt_successful")||s.includes("bt_failed"))&&H()}}),K=()=>{const e=j.value.appinfo.filter((e=>"installed_log"===e.fieldKey));e.length>0&&(h.value="",H(),D(),V("tail -f ".concat(e[0].fieldValue)))};return A(),(s,l)=>{const t=a,n=e;return _(),m("div",g,[v(t,{value:d(k),"onUpdate:value":[l[0]||(l[0]=e=>f(k)?k.value=e:null),C],options:b,onClick:A},null,8,["value"]),v(n,{class:"h-468px",lang:"log","font-size":12,loading:d(w),content:d(h)},null,8,["loading","content"])])}}});export{j as default};
