import{a as B,b as $,u as I,c as W,d as z}from"./search-form.vue_vue_type_script_setup_true_lang-xYfW9G7N.js";import{d as S,Q as C,R as M,o as R,c as O,w as k,f as t,h as e,$ as o,C as U,b as j,ae as w,bl as D,P as y,g as N,U as T,au as F,O as V,ag as K}from"./index-D3rICic-.js";import{d as q}from"./dashboard-dvIvAY5p.js";import{_ as A}from"./select-group.vue_vue_type_script_setup_true_lang-Bk3YnuuX.js";import{_ as E}from"./Grid-CRDcRyPk.js";import"./group-frwXGSCG.js";const G=S({name:"PodsSearch",__name:"pods-search",props:{model:{required:!0},modelModifiers:{}},emits:C(["reset","search"],["update:model"]),setup(d,{emit:b}){const m=b,l=M(d,"model");function h(){m("reset")}function i(){m("search")}return(x,g)=>{const u=B,v=$;return R(),O(v,{model:l.value,onSearch:i,onReset:h},{default:k(()=>[t(u,{span:"24 s:12 m:6",label:e(o)("page.pods.groupName"),path:"groupName",class:"pr-24px"},{default:k(()=>[t(A,{value:l.value.groupName,"onUpdate:value":g[0]||(g[0]=p=>l.value.groupName=p),placeholder:e(o)("page.pods.form.groupName"),clearable:""},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])}}}),H={class:"min-h-500px flex-col-stretch gap-16px overflow-hidden lt-sm:overflow-auto"};function P(d){return typeof d=="function"||Object.prototype.toString.call(d)==="[object Object]"&&!K(d)}const ee=S({name:"pods",__name:"index",setup(d){const b=U(),{columns:m,columnChecks:l,data:h,getData:i,loading:x,mobilePagination:g,searchParams:u,resetSearchParams:v}=I({apiFn:q,apiParams:{page:1,size:10,groupName:null},columns:()=>[{key:"hostId",title:o("page.pods.hostId"),align:"left",resizable:!0,width:150,minWidth:150,maxWidth:200},{key:"nodeType",title:o("page.pods.nodeType"),align:"center",width:80,render:s=>{if(s.nodeType===null)return null;const a={1:"info",2:"primary"},r=o(D[s.nodeType]);return t(y,{type:a[s.nodeType]},P(r)?r:{default:()=>[r]})}},{key:"groupName",title:o("page.pods.groupName"),align:"left",width:120,resizable:!0,minWidth:120,maxWidth:200},{key:"hostIp",title:o("page.pods.hostIp"),align:"left",width:120},{key:"hostPort",title:o("page.pods.hostPort"),align:"left",width:80},{key:"consumerBuckets",title:o("page.pods.consumerBuckets"),align:"left",width:300,resizable:!0,minWidth:120,maxWidth:400,render:s=>{if(s.nodeType===null)return null;const a=f=>{var n;const c=f?(n=s.consumerBuckets)==null?void 0:n.slice(0,f):s.consumerBuckets;return c==null?void 0:c.map(_=>t(y,{type:"error",key:_,class:"m-1 justify-center"},P(_)?_:{default:()=>[_]}))},r=()=>t(y,{type:"info"},{default:()=>[s.contextPath??"/"]});return s.nodeType===1?t(T,null,[N("Path: "),r()]):t(T,null,[t("span",null,[N("Bucket: ")]),a(10),t(F,{trigger:"hover"},{trigger:()=>t(y,{type:"error"},{default:()=>[N("...")]}),default:()=>t("div",{class:"grid grid-cols-16"},[a()])})])}},{key:"updateDt",title:o("page.pods.updateDt"),align:"left",width:130}]}),{checkedRowKeys:p}=W(h,i);return(s,a)=>{const r=z,f=E,c=V;return R(),j("div",H,[t(G,{model:e(u),"onUpdate:model":a[0]||(a[0]=n=>w(u)?u.value=n:null),onReset:e(v),onSearch:e(i)},null,8,["model","onReset","onSearch"]),t(c,{title:e(o)("page.pods.title"),bordered:!1,size:"small","header-class":"view-card-header",class:"sm:flex-1-hidden card-wrapper"},{"header-extra":k(()=>[t(r,{columns:e(l),"onUpdate:columns":a[1]||(a[1]=n=>w(l)?l.value=n:null),"disabled-delete":e(p).length===0,loading:e(x),"show-add":!1,"show-delete":!1,onRefresh:e(i)},null,8,["columns","disabled-delete","loading","onRefresh"])]),default:k(()=>[t(f,{"checked-row-keys":e(p),"onUpdate:checkedRowKeys":a[2]||(a[2]=n=>w(p)?p.value=n:null),columns:e(m),data:e(h),"flex-height":!e(b).isMobile,"scroll-x":962,loading:e(x),remote:"","row-key":n=>n.hostId,pagination:e(g),class:"sm:h-full"},null,8,["checked-row-keys","columns","data","flex-height","loading","row-key","pagination"])]),_:1},8,["title"])])}}});export{ee as default};
