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