import{d as I,t as E,_ as T}from"./index.e4ceb7bd.js";/* empty css              *//* empty css               *//* empty css               *//* empty css              *//* empty css               *//* empty css               *//* empty css              *//* empty css               *//* empty css               */import{d as j,r as S,j as x,aP as O,bu as $,C as _,D as A,aI as e,aH as a,aJ as i,b5 as k,aE as m,E as H,aK as J,aF as K,bq as X,br as Y,b0 as G,a$ as L,bt as Q,aV as Z,ac as ee,aU as ae,aX as te,bh as oe,bv as re,bw as ne,aY as se}from"./arco.2329baeb.js";import"./chart.db8aed57.js";import"./vue.46369188.js";const ie={class:"container"},le={name:"ServerManagement"},de=j({...le,setup(pe){const o=S({service_ipaddr:"",service_name:"",page:1,page_size:10,total:0}),g=S({...o}),h=[{title:"service_name",dataIndex:"service_name"},{title:"service_ipaddr",dataIndex:"service_ipaddr"},{title:"service_version",dataIndex:"service_version"},{title:"max_process",dataIndex:"worker_max_process"},{title:"run_process",dataIndex:"worker_run_process",slotName:"worker_run_process"},{title:"operations",dataIndex:"operations",slotName:"operations",width:200}],w=x([]),l=()=>{const n="/api/service/list";I.get(n,{params:o}).then(t=>{w.value=t.data,g.total=t.total})},b=()=>{o.page=1,o.total=0,o.page_size=10,o.service_ipaddr="",o.service_name="",l()},U=n=>{o.page=n,l()},d=x(!1),p=x({worker_name:"",worker_ipaddr:"",worker_max_process:10}),D=n=>{p.value.worker_name=n.worker_name,p.value.worker_ipaddr=n.worker_ipaddr,d.value=!0},F=()=>{const n="/api/service/update_max_process";I.post(n,p.value).then(t=>{d.value=!1,l()})};return l(),(n,t)=>{const M=O("Breadcrumb"),u=X,y=Y,s=G,c=L,B=Q,V=Z,N=ee,v=ae,C=E,z=te,P=oe,R=re,q=ne,W=se,f=$("permission");return _(),A("div",ie,[e(M,{items:"System / ServerManagement"}),e(W,{title:"ServerManagement",class:"general-card"},{default:a(()=>[e(c,null,{default:a(()=>[e(s,{flex:1},{default:a(()=>[e(B,{"label-col-props":{span:6},model:o,"wrapper-col-props":{span:18},"label-align":"left"},{default:a(()=>[e(c,{gutter:16},{default:a(()=>[e(s,{span:8},{default:a(()=>[e(y,{field:"service_ipaddr","hide-label":""},{default:a(()=>[e(u,{modelValue:o.service_ipaddr,"onUpdate:modelValue":t[0]||(t[0]=r=>o.service_ipaddr=r),placeholder:"Please enter the query parameters"},{prefix:a(()=>t[4]||(t[4]=[i("IP Addr")])),_:1},8,["modelValue"])]),_:1})]),_:1}),e(s,{span:8},{default:a(()=>[e(y,{field:"service_name","hide-label":""},{default:a(()=>[e(u,{modelValue:o.service_name,"onUpdate:modelValue":t[1]||(t[1]=r=>o.service_name=r),placeholder:"Please enter the query parameters"},{prefix:a(()=>t[5]||(t[5]=[i("Service Name")])),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),e(V,{direction:"vertical",style:{height:"84px"}}),e(s,{flex:"100px",style:{"text-align":"right"}},{default:a(()=>[e(z,{size:18,direction:"vertical"},{default:a(()=>[k((_(),m(v,{type:"primary",onClick:l},{icon:a(()=>[e(N)]),default:a(()=>[t[6]||(t[6]=i(" Search "))]),_:1})),[[f,["admin"]]]),k((_(),m(v,{onClick:b},{icon:a(()=>[e(C)]),default:a(()=>[t[7]||(t[7]=i(" SearchReset "))]),_:1})),[[f,["admin"]]])]),_:1})]),_:1})]),_:1}),e(V,{style:{"margin-top":"0"}}),e(c,{style:{"margin-bottom":"16px"}},{default:a(()=>[e(s,{span:12}),e(s,{span:12,style:{display:"flex","align-items":"center","justify-content":"end"}},{default:a(()=>[e(P,{content:"Refresh"},{default:a(()=>[H("div",{class:"action-icon",onClick:b},[e(C,{size:"18"})])]),_:1})]),_:1})]),_:1}),e(R,{"row-key":"id",pagination:g,columns:h,data:w.value,bordered:!1,size:"small",onPageChange:U},{operations:a(({record:r})=>[e(c,null,{default:a(()=>[e(s,{span:8},{default:a(()=>[k((_(),m(v,{type:"outline",size:"mini",status:"success",onClick:_e=>D(r)},{default:a(()=>t[8]||(t[8]=[i(" ViewDetails ")])),_:2},1032,["onClick"])),[[f,["admin"]]])]),_:2},1024)]),_:2},1024)]),worker_run_process:a(({record:r})=>[i(J(r.worker_run_process.length),1)]),_:1},8,["pagination","data"]),d.value?(_(),m(q,{key:0,visible:d.value,"onUpdate:visible":t[3]||(t[3]=r=>d.value=r),width:"85%","on-before-ok":F},{title:a(()=>t[9]||(t[9]=[i("UpdateMaxWorker")])),default:a(()=>[e(u,{"model-value":p.value.worker_max_process,"onUpdate:modelValue":t[2]||(t[2]=r=>p.value.worker_max_process=r)},null,8,["model-value"])]),_:1},8,["visible"])):K("",!0)]),_:1})])}}});const Ie=T(de,[["__scopeId","data-v-d17977c9"]]);export{Ie as default};
