import{u as a,R as t,o as s,q as e,l as o,_ as l,d as n,p as i}from"./page_layout.js?v=1764830988434";import{d as r,a as u}from"./public.js?v=1764830988434";import{g as c,s as m}from"./php.js?v=1764830988434";import{a as p}from"./soft.js?v=1764830988434";import{k as f,P as d,a0 as _,r as S,c as v,a2 as b,V as y,a3 as g,W as k,U as x,j as C,a4 as P,R as h,S as j,H as $}from"./vue.js?v=1764830988434";import{dh as w,da as R,aC as N}from"./naive.js?v=1764830988434";const W={key:0,class:"i-material-symbols:network-node color-#20a53a text-16px"},q={class:"m-2px"},z=i(f({__name:"index",props:{softName:{default:""},openSoft:{default:""},isWebSite:{type:Boolean,default:!1}},setup(i){const f=i,{t:z}=d(),{multiService:L}=_(a()),B=S({status:!0,s_status:!0,msg:"",version:"0",name:"",title:"",admin:!1,s_version:""}),D=v(()=>t(B.value.name)+" "+B.value.version),{loading:H,setLoading:I}=r(),M=async()=>{try{I(!0);const{message:a}=await c({name:f.softName});n(a)&&(B.value=a)}finally{I(!1)}},U=(a,s)=>{const e="".concat(s," ").concat(D.value),o=z("Component.SoftState.index_1",[s.toLowerCase(),t(B.value.name)]);u({title:e,content:o,onConfirm:async()=>{await m({name:B.value.s_version,type:a}),M()}})},V=()=>{p({name:f.openSoft?f.openSoft:f.softName,title:t(B.value.name),admin:!1})};return M(),(a,t)=>{const n=o,i=l,r=N,u=s,c=e,m=R,p=w;return y(),b(p,{trigger:"hover"},{trigger:g(()=>[x(H)?(y(),b(n,{key:0,width:120,height:32,sharp:!1})):(y(),b(r,{key:1,class:"min-w-120px soft-btn",type:x(B).s_status?"default":"error",onClick:V},{default:g(()=>[a.isWebSite&&x(L)?(y(),h("i",W)):(y(),b(i,{key:1,name:"soft-".concat(a.softName),size:"20"},null,8,["name"])),j("span",q,P(x(D)),1),j("span",{class:$(["iconfont","icon-".concat(x(B).s_status?"start":"stop")])},null,2)]),_:1},8,["type"]))]),default:g(()=>[k(m,{class:"items-center",size:8},{default:g(()=>[k(u,{onClick:t[0]||(t[0]=t=>U(x(B).s_status?"stop":"start",x(B).s_status?a.$t("Public.Status.Stop"):a.$t("Public.Status.Start")))},{default:g(()=>[C(P(x(B).s_status?a.$t("Public.Status.Stop"):a.$t("Public.Status.Start")),1)]),_:1}),k(c,{class:"mx-0!",vertical:""}),k(u,{onClick:t[1]||(t[1]=a=>U("restart",x(z)("Public.Status.Restart")))},{default:g(()=>[C(P(a.$t("Public.Status.Restart")),1)]),_:1}),k(c,{class:"mx-0!",vertical:""}),k(u,{onClick:t[2]||(t[2]=a=>U("reload",x(z)("Public.Status.Reload")))},{default:g(()=>[C(P(a.$t("Public.Status.Reload")),1)]),_:1}),k(c,{class:"mx-0!",vertical:""}),k(u,{onClick:V},{default:g(()=>[C(P(a.$t("Database.Mysql.index_26")),1)]),_:1})]),_:1})]),_:1})}}}),[["__scopeId","data-v-8b588c10"]]);export{z as _};
