gatus/web/static/js/app.js

1 line
36 KiB
JavaScript
Raw Normal View History

(function(){"use strict";var e={2119:function(e,t,s){s.d(t,{L:function(){return Ft}});s(7727);var n=s(9963),o=s(6252),a=s.p+"img/logo.png";const r={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={class:"mb-2"},l={class:"flex flex-wrap"},g=(0,o._)("div",{class:"w-3/4 text-left my-auto"},[(0,o._)("div",{class:"text-3xl xl:text-5xl lg:text-4xl font-light"},"Health Status")],-1),d={class:"w-1/4 flex justify-end"},h=["src"],u={key:1,src:a,alt:"Gatus",class:"object-scale-down",style:{"max-width":"100px","min-width":"50px","min-height":"50px"}};function p(e,t,s,n,a,p){const c=(0,o.up)("router-view"),m=(0,o.up)("Tooltip"),A=(0,o.up)("Social");return(0,o.wg)(),(0,o.iD)(o.HY,null,[(0,o._)("div",r,[(0,o._)("div",i,[(0,o._)("div",l,[g,(0,o._)("div",d,[p.getLogo?((0,o.wg)(),(0,o.iD)("img",{key:0,src:p.getLogo,alt:"Gatus",class:"object-scale-down",style:{"max-width":"100px","min-width":"50px","min-height":"50px"}},null,8,h)):(0,o.kq)("",!0),p.getLogo?(0,o.kq)("",!0):((0,o.wg)(),(0,o.iD)("img",u))])])]),(0,o.Wm)(c,{onShowTooltip:p.showTooltip},null,8,["onShowTooltip"])]),(0,o.Wm)(m,{result:a.tooltip.result,event:a.tooltip.event},null,8,["result","event"]),(0,o.Wm)(A)],64)}var c=s.p+"img/github.png";const m=e=>((0,o.dD)("data-v-a88161aa"),e=e(),(0,o.Cn)(),e),A={id:"social"},f=m((()=>(0,o._)("a",{href:"https://github.com/TwiN/gatus",target:"_blank",title:"Gatus on GitHub"},[(0,o._)("img",{src:c,alt:"GitHub",width:"32",height:"auto"})],-1))),v=[f];function w(e,t,s,n,a,r){return(0,o.wg)(),(0,o.iD)("div",A,v)}var y={name:"Social"},x=s(3744);const T=(0,x.Z)(y,[["render",w],["__scopeId","data-v-a88161aa"]]);var k=T,I=s(3577);const b=(0,o._)("div",{class:"tooltip-title"},"Timestamp:",-1),R={id:"tooltip-timestamp"},D=(0,o._)("div",{class:"tooltip-title"},"Response time:",-1),S={id:"tooltip-response-time"},C=(0,o._)("div",{class:"tooltip-title"},"Conditions:",-1),B={id:"tooltip-conditions"},E=(0,o._)("br",null,null,-1),P={key:0,id:"tooltip-errors-container"},H=(0,o._)("div",{class:"tooltip-title"},"Errors:",-1),O={id:"tooltip-errors"},U=(0,o._)("br",null,null,-1);function z(e,t,s,n,a,r){return(0,o.wg)(),(0,o.iD)("div",{id:"tooltip",ref:"tooltip",class:(0,I.C_)(a.hidden?"invisible":""),style:(0,I.j5)("top:"+a.top+"px; left:"+a.left+"px")},[s.result?(0,o.WI)(e.$slots,"default",{key:0},(()=>[b,(0,o._)("code",R,(0,I.zw)(r.prettifyTimestamp(s.result.timestamp)),1),D,(0,o._)("code",S,(0,I.zw)((s.result.duration/1e6).toFixed(0))+"ms",1),C,(0,o._)("code",B,[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)(s.result.conditionResults,(t=>(0,o.WI)(e.$slots,"default",{key:t},(()=>[(0,o.Uk)((0,I.zw)(t.success?"✓":"X")+" ~ "+(0,I.zw)(t.condition),1),E])))),128))]),s.result.errors&&s.result.errors.length?((0,o.wg)(),(0,o.iD)("div",P,[H,(0,o._)("code",O,[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)(s.result.errors,(t=>(0,o.WI)(e.$slots,"default",{key:t},(()=>[(0,o.Uk)(" - "+(0,I.zw)(t),1),U])))),128))])])):(0,o.kq)("",!0)])):(0,o.kq)("",!0)],6)}s(5306);var M={name:"Endpoints",props:{event:Event,result:Object},methods:{prettifyTimestamp(e){let t=new Date(e),s=t.getFullYear(),n=(t.getMonth()+1<10?"0":"")+(t.getMonth()+1),o=(t.getDate()<10?"0":"")+t.getDate(),a=(t.getHours()<10?"0":"")+t.getHours(),r=(t.getMinutes()<10?"0":"")+t.getMinutes(),i=(t.getSeconds()<10?"0":"")+t.getSeconds();return s+"-"+n+"-"+o+" "+a+":"+r+":"+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.getBoundingClientRe