import{t as h,_ as z,l as T,i as V,h as F,au as I,c as M}from"./index-BTglIPU2.js?v=1773287522785";import{c as g}from"./data-BVsViUMm.js?v=1773287522785";import{b as j,s as q}from"./php-D3q5Oj7O.js?v=1773287522785";import{u as D}from"./useLoading-CZ2gSAW7.js?v=1773287522785";import{k as O,R as W,a6 as E,r as G,c as Z,$ as l,a8 as c,a9 as o,a0 as n,S as s,j as m,aa as i,Z as x,F as A,ak as H,_ as C,L as J}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{a5 as K,a0 as Q,k as U,ax as X,B as Y}from"./naive-ui--dJnpVcV.js?v=1773287522785";const tt={key:0,class:"i-material-symbols:network-node color-primary text-16px"},et={class:"m-2px"},st=O({__name:"index",props:{softName:{default:""},openSoft:{default:""},isWebSite:{type:Boolean,default:!1}},setup(N){const r=N,{t:_}=W(),{multiService:P}=E(h()),e=G({status:!0,s_status:!0,msg:"",version:"0",name:"",title:"",admin:!1,s_version:""}),v=Z(()=>g(e.value.name)+" "+e.value.version),{loading:w,setLoading:b}=D(),k=async()=>{try{b(!0);const{message:t}=await j({name:r.softName});V(t)&&(e.value=t)}finally{b(!1)}},p=(t,a)=>{const f="".concat(a," ").concat(v.value),d=_("Component.SoftState.index_1",[a.toLowerCase(),g(e.value.name)]);F({title:f,content:d,onConfirm:async()=>{await q({name:e.value.s_version,type:t}),k()}})},y=()=>{I({name:r.openSoft?r.openSoft:r.softName,title:g(e.value.name),admin:!0})};return k(),(t,a)=>{const f=X,d=T,B=Y,u=z,S=Q,L=U,R=K;return l(),c(R,{trigger:"hover"},{trigger:o(()=>[s(w)?(l(),c(f,{key:0,width:120,height:32,sharp:!1})):(l(),c(B,{key:1,class:"min-w-120px soft-btn",type:s(e).s_status?"default":"error",onClick:y},{default:o(()=>[t.isWebSite&&s(P)?(l(),x("i",tt)):(l(),c(d,{key:1,name:"soft-".concat(t.softName),size:"20"},null,8,["name"])),C("span",et,i(s(v)),1),C("span",{class:J(["text-14px","".concat(s(e).s_status?"i-mage:play-fill text-primary":"i-mage:pause-fill text-error")])},null,2)]),_:1},8,["type"]))]),default:o(()=>[n(L,{class:"items-center",size:8},{default:o(()=>[n(u,{onClick:a[0]||(a[0]=$=>p(s(e).s_status?"stop":"start",s(e).s_status?t.$t("Public.Status.Stop"):t.$t("Public.Status.Start")))},{default:o(()=>[m(i(s(e).s_status?t.$t("Public.Status.Stop"):t.$t("Public.Status.Start")),1)]),_:1}),n(S,{class:"mx-0!",vertical:""}),n(u,{onClick:a[1]||(a[1]=$=>p("restart",s(_)("Public.Status.Restart")))},{default:o(()=>[m(i(t.$t("Public.Status.Restart")),1)]),_:1}),n(S,{class:"mx-0!",vertical:""}),n(u,{onClick:a[2]||(a[2]=$=>p("reload",s(_)("Public.Status.Reload")))},{default:o(()=>[m(i(t.$t("Public.Status.Reload")),1)]),_:1}),t.softName!=="pgsql"?(l(),x(A,{key:0},[n(S,{class:"mx-0!",vertical:""}),n(u,{onClick:y},{default:o(()=>[m(i(t.$t("Database.Mysql.index_26")),1)]),_:1})],64)):H("",!0)]),_:1})]),_:1})}}}),ut=M(st,[["__scopeId","data-v-5600598b"]]);export{ut as _};
