gatus/web/static/js/app.js

1 line
34 KiB
JavaScript
Raw Normal View History

(function(){"use strict";var e={14:function(e,t,s){s.d(t,{L:function(){return nt}});var r=s(963),a=s(252),o=s.p+"img/logo.png";const n={class:"container container-xs relative mx-auto xl:rounded xl:border xl:shadow-xl xl:my-5 p-5 pb-12 xl:pb-5 text-left dark:bg-gray-800 dark:text-gray-200 dark:border-gray-500",id:"global"},i=(0,a.Wm)("div",{class:"mb-2"},[(0,a.Wm)("div",{class:"flex flex-wrap"},[(0,a.Wm)("div",{class:"w-3/4 text-left my-auto"},[(0,a.Wm)("div",{class:"text-3xl xl:text-5xl lg:text-4xl font-light"},"Health Status")]),(0,a.Wm)("div",{class:"w-1/4 flex justify-end"},[(0,a.Wm)("img",{src:o,alt:"Gatus",class:"object-scale-down",style:{"max-width":"100px","min-width":"50px","min-height":"50px"}})])])],-1);function l(e,t,s,r,o,l){const g=(0,a.up)("router-view"),h=(0,a.up)("Tooltip"),d=(0,a.up)("Social");return(0,a.wg)(),(0,a.j4)(a.HY,null,[(0,a.Wm)("div",n,[i,(0,a.Wm)(g,{onShowTooltip:l.showTooltip},null,8,["onShowTooltip"])]),(0,a.Wm)(h,{result:o.tooltip.result,event:o.tooltip.event},null,8,["result","event"]),(0,a.Wm)(d)],64)}var g=s.p+"img/github.png";const h=(0,a.HX)("data-v-1cbbc992");(0,a.dD)("data-v-1cbbc992");const d={id:"social"},u=(0,a.Wm)("a",{href:"https://github.com/TwinProduction/gatus",target:"_blank",title:"Gatus on GitHub"},[(0,a.Wm)("img",{src:g,alt:"GitHub",width:"32",height:"auto"})],-1);(0,a.Cn)();const c=h(((e,t,s,r,o,n)=>((0,a.wg)(),(0,a.j4)("div",d,[u]))));var m={name:"Social"};m.render=c,m.__scopeId="data-v-1cbbc992";var p=m,A=s(577);const v=(0,a.Wm)("div",{class:"tooltip-title"},"Timestamp:",-1),f={id:"tooltip-timestamp"},w=(0,a.Wm)("div",{class:"tooltip-title"},"Response time:",-1),y={id:"tooltip-response-time"},x=(0,a.Wm)("div",{class:"tooltip-title"},"Conditions:",-1),T={id:"tooltip-conditions"},I=(0,a.Wm)("br",null,null,-1),b={key:0,id:"tooltip-errors-container"},k=(0,a.Wm)("div",{class:"tooltip-title"},"Errors:",-1),R={id:"tooltip-errors"},S=(0,a.Wm)("br",null,null,-1);function W(e,t,s,r,o,n){return(0,a.wg)(),(0,a.j4)("div",{id:"tooltip",ref:"tooltip",class:o.hidden?"invisible":"",style:"top:"+o.top+"px; left:"+o.left+"px"},[s.result?(0,a.WI)(e.$slots,"default",{key:0},(()=>[v,(0,a.Wm)("code",f,(0,A.zw)(n.prettifyTimestamp(s.result.timestamp)),1),w,(0,a.Wm)("code",y,(0,A.zw)((s.result.duration/1e6).toFixed(0))+"ms",1),x,(0,a.Wm)("code",T,[((0,a.wg)(!0),(0,a.j4)(a.HY,null,(0,a.Ko)(s.result.conditionResults,(t=>(0,a.WI)(e.$slots,"default",{key:t},(()=>[(0,a.Uk)((0,A.zw)(t.success?"✓":"X")+" ~ "+(0,A.zw)(t.condition),1),I])))),128))]),s.result.errors&&s.result.errors.length?((0,a.wg)(),(0,a.j4)("div",b,[k,(0,a.Wm)("code",R,[((0,a.wg)(!0),(0,a.j4)(a.HY,null,(0,a.Ko)(s.result.errors,(t=>(0,a.WI)(e.$slots,"default",{key:t},(()=>[(0,a.Uk)(" - "+(0,A.zw)(t),1),S])))),128))])])):(0,a.ry)("",!0)])):(0,a.ry)("",!0)],6)}var C={name:"Services",props:{event:Event,result:Object},methods:{prettifyTimestamp(e){let t=new Date(e),s=t.getFullYear(),r=(t.getMonth()+1<10?"0":"")+(t.getMonth()+1),a=(t.getDate()<10?"0":"")+t.getDate(),o=(t.getHours()<10?"0":"")+t.getHours(),n=(t.getMinutes()<10?"0":"")+t.getMinutes(),i=(t.getSeconds()<10?"0":"")+t.getSeconds();return s+"-"+r+"-"+a+" "+o+":"+n+":"+i},htmlEntities(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")},reposition(){if(this.event&&this.event.type)if("mouseenter"===this.event.type){let e=this.event.target.getBoundingClientRect().y+30,t=this.event.target.getBoundingClientRect().x,s=this.$refs.tooltip.getBoundingClientRect();t+window.scrollX+s.width+50>document.body.getBoundingClientRect().width&&(t=this.event.target.getBoundingClientRect().x-s.width+this.event.target.getBoundingClientRect().width,t<0&&(t+=-t)),e+window.scrollY+s.height+50>document.body.getBoundingClientRect().height&&e>=0&&(e=this.event.target.getBoundingClientRect().y-(s.height+10),e<0&&(e=this.event.target.getBoundingClientRect().y+30)),this.top=e,this.left=t}else"mouseleave"===this.event.type&&(this.hidden=!0)}},watch:{event:function(e){e&&e.type&&("mouseenter"===e.type?this.hidden=!1:"mouseleave"==