import{p as f,e as a,f as n,z as s,F as d,A as m,o as r,n as l,g as o,h as y,N as g}from"./vue-CSzJdJby.js";import{$ as h}from"./jquery-BALIvAru.js";import{l as v}from"./lodash-uc_7-CSk.js";import"./highlight.js-CWp04Ajj.js";const x=s("div",{class:"text-end text-body-secondary small"},"Auto refresh every 1 min",-1),w={id:"checks-container",class:"row"},C={key:0,class:"col-3"},N=["id"],B={class:"card-body p-2"},A=["href"],E=s("hr",{class:"mt-1 mb-1"},null,-1),F={class:"list-unstyled small ms-2 mb-0",style:{"max-height":"100px","overflow-y":"auto"}},L=s("hr",{class:"mt-1 mb-1"},null,-1),D={class:"list-inline small text-body-secondary mb-0"},U={class:"list-inline-item"},V={class:"list-inline-item"},j={__name:"AlertingChecks",setup(z){const c=f([]);function p(t){if(t!="OK"&&t!="UNDEF")return"border-"+t.toLowerCase()}function b(t,_){return v.orderBy(t,_)}function u(){h.ajax({url:apiUrl+"/checks.json",success:function(t){c.value=t},error:function(t){console.error(t)}})}return window.setInterval(function(){u()},60*1e3),u(),(t,_)=>(r(),a("div",null,[x,n(),s("div",w,[(r(!0),a(d,null,m(c.value,e=>(r(),a(d,null,[e.state!="UNDEF"?(r(),a("div",C,[s("div",{id:"status-"+e.name,class:l(["card mb-3 w-100 border",[p(e.state),{"striped bg-light":!e.enabled}]])},[s("div",B,[s("div",null,[s("a",{href:"alerting/"+e.name,class:l({"text-body-secondary":!e.enabled})},[s("span",{class:l("badge text-bg-"+e.state.toLowerCase())},o(e.state),3),n(" "+o(e.description),1)],10,A)]),n(),E,n(),s("ul",F,[(r(!0),a(d,null,m(b(e.state_by_key,"key"),i=>(r(),a("li",null,[s("span",{class:l("badge text-bg-"+i.state.toLowerCase())},o(i.state),3),n(" "+o(i.key),1)]))),256))]),n(),L,n(),s("div",null,[s("ul",D,[s("li",U,`
                    Warning: `+o(e.warning)+o(e.value_type=="percent"?"%":""),1),n(),s("li",V,`
                    Critical: `+o(e.critical)+o(e.value_type=="percent"?"%":""),1)])])])],10,N)])):y("",!0)],64))),256))])]))}};g({el:"#app",components:{"alerting-checks":j}}).mount("#app");
