import{E as e,N as t,O as n,Q as r,Rt as i,S as a,T as o,_t as s,b as c,dt as l,ft as u,kt as d,mt as f,n as p,p as m,q as h,v as g,y as _}from"./vue-i18n-Bp4YYb-2.js";import{C as v,D as y,F as b,Lt as x,_ as S,hr as C,ir as w,mr as T,pr as E,r as D,v as O,w as k,wr as A,x as j,y as M,ya as N}from"./index-BOiiIZox.js";import{n as P,t as F}from"./column-Bqn4T3tI.js";var I={class:`flex h-[3.5rem] border-b-4 border-border-one items-center justify-between`},L={class:`pl-4 py-2 text-2xl font-bold`},R={class:`mt-8 flex flex-col`},z={class:`w-max`},B={class:`flex items-center justify-between`},V={class:`pb-1 ml-1 font-semibold text-xl text-text-color`},H={class:`mt-8 flex flex-col`},U={class:`pb-3 ml-1 font-semibold text-xl text-text-color`},W=k(n({__name:`AlertsOverView`,setup(n){let k=x(),W=w(),{getREMSize:G}=x(),K=N(),{t:q}=p(),J=t(`emitter`),Y=g(()=>{let e=[];for(let t of W.alerts)e.push(t);let t=W.menuOrder.find(e=>e.id===`alerts`);if(t?.children?.length){let n=e=>{let n=t.children.indexOf(e.uid);return n>=0?n:2**53-1};e.sort((e,t)=>n(e)-n(t))}return e}),X=d({global:{value:null,matchMode:D.CONTAINS}}),Z=e=>{K.push({name:`alerts`,params:{alertUID:e.data.uid}})};return(t,n)=>{let d=r(`tooltip`);return h(),a(m,null,[_(`div`,I,[_(`div`,L,s(i(q)(`views.alerts.alertsOverview`)),1)]),e(i(j),{style:{"--scrollbar-size":`10px`}},{default:l(()=>[e(i(S),{class:`p-4 pb-16 h-screen w-full`},{default:l(()=>[_(`div`,R,[_(`div`,z,[_(`div`,B,[_(`span`,V,s(i(q)(`layout.topbar.alerts`)),1),u((h(),c(i(b),{class:`h-8 my-2`,onClick:n[0]||(n[0]=e=>i(J).emit(`alert-add`))},{default:l(()=>[e(i(v),{class:`outline-0`,type:`mdi`,path:i(A),size:i(k).getREMSize(1.25)},null,8,[`path`,`size`])]),_:1})),[[d,{value:i(q)(`layout.menu.tooltips.addAlert`)},void 0,{top:!0}]])]),e(i(P),{value:Y.value,"selection-mode":`single`,"data-key":`uid`,"meta-key-selection":!1,onRowSelect:Z},{default:l(()=>[e(i(F),{header:``},{body:l(t=>[e(i(v),{type:`mdi`,class:f({"text-error":t.data.state===i(E).Active}),path:i(C)(t.data.state),size:i(G)(1.5)},null,8,[`class`,`path`,`size`])]),_:1}),e(i(F),{field:`state`,header:i(q)(`common.state`)},{body:l(e=>[_(`span`,{class:f([`underline`,{"text-error":e.data.state===i(E).Active,"text-success":e.data.state===i(E).Inactive}])},s(i(T)(e.data.state)),3)]),_:1},8,[`header`]),e(i(F),{field:`name`,header:i(q)(`common.name`),"body-class":`w-full text-ellipsis underline`},null,8,[`header`])]),_:1},8,[`value`])])]),_(`div`,H,[_(`span`,U,s(i(q)(`views.alerts.alertLogs`)),1),e(i(P),{class:`w-full`,value:i(W).alertLogs,filters:X.value,"onUpdate:filters":n[2]||(n[2]=e=>X.value=e),"global-filter-fields":[`name`,`message`],"sort-field":`timestamp`,"sort-order":-1,"selection-mode":`single`,"meta-key-selection":!1,paginator:``,"paginator-position":`top`,rows:20,"rows-per-page-options":[20,50,100],onRowSelect:Z},{paginatorstart:l(()=>[e(i(y),{modelValue:X.value.global.value,"onUpdate:modelValue":n[1]||(n[1]=e=>X.value.global.value=e),placeholder:i(q)(`common.search`),size:`small`},null,8,[`modelValue`,`placeholder`])]),default:l(()=>[e(i(F),{field:`timestamp`,header:i(q)(`common.timestamp`),sortable:!0},{body:l(e=>[o(s(new Date(e.data.timestamp).toLocaleString()),1)]),_:1},8,[`header`]),e(i(F),{field:`state`,header:i(q)(`common.state`)},{body:l(e=>[_(`span`,{class:f([`underline`,{"text-error":e.data.state===i(E).Active,"text-success":e.data.state===i(E).Inactive}])},s(i(T)(e.data.state)),3)]),_:1},8,[`header`]),e(i(F),{field:`name`,header:i(q)(`common.name`),"body-class":`underline`},null,8,[`header`]),e(i(F),{field:`message`,header:i(q)(`common.message`),"body-class":`w-full text-ellipsis`},null,8,[`header`])]),_:1},8,[`value`,`filters`])])]),_:1}),e(i(M),{class:`flex select-none touch-none p-0.5 bg-transparent transition-colors duration-[120ms] ease-out data-[orientation=vertical]:w-2.5`,orientation:`vertical`},{default:l(()=>[e(i(O),{class:`flex-1 bg-border-one opacity-80 rounded-lg relative before:content-[''] before:absolute before:top-1/2 before:left-1/2 before:-translate-x-1/2 before:-translate-y-1/2 before:w-full before:h-full before:min-w-[44px] before:min-h-[44px]`})]),_:1})]),_:1})],64)}}}),[[`__scopeId`,`data-v-8c977230`]]);export{W as default};