mirror of
https://github.com/TwiN/gatus.git
synced 2024-12-15 17:51:09 +00:00
1 line
No EOL
21 KiB
JavaScript
1 line
No EOL
21 KiB
JavaScript
(function(e){function t(t){for(var s,o,c=t[0],a=t[1],l=t[2],h=0,d=[];h<c.length;h++)o=c[h],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&d.push(r[o][0]),r[o]=0;for(s in a)Object.prototype.hasOwnProperty.call(a,s)&&(e[s]=a[s]);u&&u(t);while(d.length)d.shift()();return i.push.apply(i,l||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],s=!0,c=1;c<n.length;c++){var a=n[c];0!==r[a]&&(s=!1)}s&&(i.splice(t--,1),e=o(o.s=n[0]))}return e}var s={},r={app:0},i=[];function o(t){if(s[t])return s[t].exports;var n=s[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=s,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)o.d(n,s,function(t){return e[t]}.bind(null,s));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="/";var c=window["webpackJsonp"]=window["webpackJsonp"]||[],a=c.push.bind(c);c.push=t,c=c.slice();for(var l=0;l<c.length;l++)t(c[l]);var u=a;i.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("56d7")},"1cf9":function(e,t,n){"use strict";n("7e86")},"1e6f":function(e,t,n){"use strict";n("db7d")},"22c8":function(e,t,n){},"359c":function(e,t,n){e.exports=n.p+"img/github.png"},4810:function(e,t,n){},"49d2":function(e,t,n){"use strict";n("bca1")},"508b":function(e,t,n){"use strict";n("22c8")},"56d7":function(e,t,n){"use strict";n.r(t),n.d(t,"SERVER_URL",(function(){return nt}));n("e260"),n("e6cf"),n("cca6"),n("a79d");var s=n("7a23"),r=n("cf05"),i=n.n(r),o={class:"container container-xs relative mx-auto rounded shadow-xl border my-3 p-5 text-left",id:"global"},c=Object(s["h"])("div",{class:"mb-2"},[Object(s["h"])("div",{class:"flex flex-wrap"},[Object(s["h"])("div",{class:"w-3/4 text-left my-auto"},[Object(s["h"])("div",{class:"title text-5xl font-light"},"Health Status")]),Object(s["h"])("div",{class:"w-1/4 flex justify-end"},[Object(s["h"])("img",{src:i.a,alt:"Gatus",class:"object-scale-down",style:{"max-width":"100px","min-width":"50px","min-height":"50px"}})])])],-1);function a(e,t,n,r,i,a){var l=Object(s["y"])("router-view"),u=Object(s["y"])("Tooltip"),h=Object(s["y"])("Social");return Object(s["q"])(),Object(s["d"])(s["a"],null,[Object(s["h"])("div",o,[c,Object(s["h"])(l,{onShowTooltip:a.showTooltip},null,8,["onShowTooltip"])]),Object(s["h"])(u,{result:i.tooltip.result,event:i.tooltip.event},null,8,["result","event"]),Object(s["h"])(h)],64)}var l=n("359c"),u=n.n(l),h=Object(s["E"])("data-v-1cbbc992");Object(s["t"])("data-v-1cbbc992");var d={id:"social"},b=Object(s["h"])("a",{href:"https://github.com/TwinProduction/gatus",target:"_blank",title:"Gatus on GitHub"},[Object(s["h"])("img",{src:u.a,alt:"GitHub",width:"32",height:"auto"})],-1);Object(s["r"])();var p=h((function(e,t,n,r,i,o){return Object(s["q"])(),Object(s["d"])("div",d,[b])})),f={name:"Social"};n("508b");f.render=p,f.__scopeId="data-v-1cbbc992";var v=f,O=(n("b680"),Object(s["h"])("div",{class:"tooltip-title"},"Timestamp:",-1)),m={id:"tooltip-timestamp"},j=Object(s["h"])("div",{class:"tooltip-title"},"Response time:",-1),g={id:"tooltip-response-time"},x=Object(s["h"])("div",{class:"tooltip-title"},"Conditions:",-1),y={id:"tooltip-conditions"},w=Object(s["h"])("br",null,null,-1),T={key:0,id:"tooltip-errors-container"},S=Object(s["h"])("div",{class:"tooltip-title"},"Errors:",-1),R={id:"tooltip-errors"},k=Object(s["h"])("br",null,null,-1);function A(e,t,n,r,i,o){return Object(s["q"])(),Object(s["d"])("div",{id:"tooltip",ref:"tooltip",class:i.hidden?"invisible":"",style:"top:"+i.top+"px; left:"+i.left+"px"},[n.result?Object(s["x"])(e.$slots,"default",{key:0},(function(){return[O,Object(s["h"])("code",m,Object(s["A"])(o.prettifyTimestamp(n.result.timestamp)),1),j,Object(s["h"])("code",g,Object(s["A"])((n.result.duration/1e6).toFixed(0))+"ms",1),x,Object(s["h"])("code",y,[(Object(s["q"])(!0),Object(s["d"])(s["a"],null,Object(s["w"])(n.result.conditionResults,(function(t){return Object(s["x"])(e.$slots,"default",{key:t},(function(){return[Object(s["g"])(Object(s["A"])(t.success?"✓":"X")+" ~ "+Object(s["A"])(t.condition),1),w]}))})),128))]),n.result.errors&&n.result.errors.length?(Object(s["q"])(),Object(s["d"])("div",T,[S,Object(s["h"])("code",R,[(Object(s["q"])(!0),Object(s["d"])(s["a"],null,Object(s["w"])(n.result.errors,(function(t){return Object(s["x"])(e.$slots,"default",{key:t},(function(){return[Object(s["g"])(" - "+Object(s["A"])(t),1),k]}))})),128))])])):Object(s["e"])("",!0)]})):Object(s["e"])("",!0)],6)}n("ac1f"),n("5319");var D={name:"Services",props:{event:Event,result:Object},methods:{prettifyTimestamp:function(e){var t=new Date(e),n=t.getFullYear(),s=(t.getMonth()+1<10?"0":"")+(t.getMonth()+1),r=(t.getDate()<10?"0":"")+t.getDate(),i=(t.getHours()<10?"0":"")+t.getHours(),o=(t.getMinutes()<10?"0":"")+t.getMinutes(),c=(t.getSeconds()<10?"0":"")+t.getSeconds();return n+"-"+s+"-"+r+" "+i+":"+o+":"+c},htmlEntities:function(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},reposition:function(){if(this.event&&this.event.type)if("mouseenter"===this.event.type){var e=this.event.target.getBoundingClientRect().y+30,t=this.event.target.getBoundingClientRect().x,n=this.$refs.tooltip.getBoundingClientRect();t+window.scrollX+n.width+50>document.body.getBoundingClientRect().width&&(t=this.event.target.getBoundingClientRect().x-n.width+this.event.target.getBoundingClientRect().width,t<0&&(t+=-t)),e+window.scrollY+n.height+50>document.body.getBoundingClientRect().height&&e>=0&&(e=this.event.target.getBoundingClientRect().y-(n.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"===e.type&&(this.hidden=!0))}},updated:function(){this.reposition()},created:function(){this.reposition()},data:function(){return{hidden:!1,top:0,left:0}}};n("75d6");D.render=A;var q=D,H={name:"App",components:{Social:v,Tooltip:q},methods:{showTooltip:function(e,t){this.tooltip={result:e,event:t}}},data:function(){return{tooltip:{}}}};n("1cf9");H.render=a;var I=H,M=(n("a766"),n("6c02"));function C(e,t,n,r,i,o){var c=Object(s["y"])("Services"),a=Object(s["y"])("Settings");return Object(s["q"])(),Object(s["d"])(s["a"],null,[Object(s["h"])(c,{serviceStatuses:i.serviceStatuses,showStatusOnHover:!0,onShowTooltip:o.showTooltip},null,8,["serviceStatuses","onShowTooltip"]),Object(s["h"])(a,{onRefreshData:o.fetchData},null,8,["onRefreshData"])],64)}n("d3b7");var E=Object(s["E"])("data-v-31e7281e");Object(s["t"])("data-v-31e7281e");var $={id:"settings"},U={class:"flex bg-gray-200 rounded border border-gray-300 shadow"},_=Object(s["h"])("div",{class:"text-sm text-gray-600 rounded-xl py-1 px-2"}," ↻ ",-1),B=Object(s["f"])('<option value="10" data-v-31e7281e>10s</option><option value="30" selected data-v-31e7281e>30s</option><option value="60" data-v-31e7281e>1m</option><option value="120" data-v-31e7281e>2m</option><option value="300" data-v-31e7281e>5m</option><option value="600" data-v-31e7281e>10m</option>',6);Object(s["r"])();var P=E((function(e,t,n,r,i,o){return Object(s["q"])(),Object(s["d"])("div",$,[Object(s["h"])("div",U,[_,Object(s["h"])("select",{class:"text-center text-gray-500 text-sm",id:"refresh-rate",ref:"refreshInterval",onChange:t[1]||(t[1]=function(){return o.handleChangeRefreshInterval&&o.handleChangeRefreshInterval.apply(o,arguments)})},[B],544)])])})),G={name:"Settings",props:{},methods:{setRefreshInterval:function(e){var t=this;this.refreshIntervalHandler=setInterval((function(){t.refreshData()}),1e3*e)},refreshData:function(){this.$emit("refreshData")},handleChangeRefreshInterval:function(){this.refreshData(),clearInterval(this.refreshIntervalHandler),this.setRefreshInterval(this.$refs.refreshInterval.value)}},created:function(){this.setRefreshInterval(this.refreshInterval)},unmounted:function(){clearInterval(this.refreshIntervalHandler)},data:function(){return{refreshInterval:30,refreshIntervalHandler:0}}};n("49d2");G.render=P,G.__scopeId="data-v-31e7281e";var L=G,N=(n("b0c0"),{id:"results"});function F(e,t,n,r,i,o){var c=Object(s["y"])("ServiceGroup");return Object(s["q"])(),Object(s["d"])("div",N,[(Object(s["q"])(!0),Object(s["d"])(s["a"],null,Object(s["w"])(i.serviceGroups,(function(t){return Object(s["x"])(e.$slots,"default",{key:t},(function(){return[Object(s["h"])(c,{services:t.services,name:t.name,onShowTooltip:o.showTooltip},null,8,["services","name","onShowTooltip"])]}))})),128))])}var Y={class:"text-monospace text-gray-400 text-xl font-medium pb-2 px-3"},J={key:0,class:"text-green-600"},V={key:1,class:"text-yellow-400"},X={class:"float-right service-group-arrow"};function K(e,t,n,r,i,o){var c=Object(s["y"])("Service");return Object(s["q"])(),Object(s["d"])("div",{class:0===n.services.length?"mt-3":"mt-4"},["undefined"!==n.name?Object(s["x"])(e.$slots,"default",{key:0},(function(){return[Object(s["h"])("div",{class:"service-group container pt-2 border",onClick:t[1]||(t[1]=function(){return o.toggleGroup&&o.toggleGroup.apply(o,arguments)})},[Object(s["h"])("h5",Y,[i.healthy?(Object(s["q"])(),Object(s["d"])("span",J,"✓")):(Object(s["q"])(),Object(s["d"])("span",V,"~")),Object(s["g"])(" "+Object(s["A"])(n.name)+" ",1),Object(s["h"])("span",X,Object(s["A"])(i.collapsed?"▼":"▲"),1)])])]})):Object(s["e"])("",!0),i.collapsed?Object(s["e"])("",!0):(Object(s["q"])(),Object(s["d"])("div",{key:1,class:"undefined"===n.name?"":"service-group-content"},[(Object(s["q"])(!0),Object(s["d"])(s["a"],null,Object(s["w"])(n.services,(function(t){return Object(s["x"])(e.$slots,"default",{key:t},(function(){return[Object(s["h"])(c,{data:t,onShowTooltip:o.showTooltip,maximumNumberOfResults:20},null,8,["data","onShowTooltip"])]}))})),128))],2))],2)}var z={key:0,class:"service container px-3 py-3 border-l border-r border-t rounded-none"},Q={class:"flex flex-wrap mb-2"},W={class:"w-3/4"},Z=Object(s["g"])(),ee={class:"text-gray-500 font-light"},te={class:"w-1/4 text-right"},ne={class:"font-light status-min-max-ms"},se={class:"status-over-time flex flex-row"},re=Object(s["h"])("span",{class:"status rounded border border-dashed"},null,-1),ie={class:"flex flex-wrap status-time-ago"},oe={class:"w-1/2"},ce={class:"w-1/2 text-right"};function ae(e,t,n,r,i,o){var c=Object(s["y"])("router-link");return n.data&&n.data.results&&n.data.results.length?(Object(s["q"])(),Object(s["d"])("div",z,[Object(s["h"])("div",Q,[Object(s["h"])("div",W,[Object(s["h"])(c,{to:o.generatePath(),class:"inline-block font-bold transform hover:scale-110 transition duration-100 ease-in-out hover:text-blue-800",title:"View detailed service health"},{default:Object(s["D"])((function(){return[Object(s["g"])(Object(s["A"])(n.data.name),1)]})),_:1},8,["to"]),Z,Object(s["h"])("span",ee,"| "+Object(s["A"])(n.data.results[n.data.results.length-1].hostname),1)]),Object(s["h"])("div",te,[Object(s["h"])("span",ne,Object(s["A"])(i.minResponseTime===i.maxResponseTime?i.minResponseTime:i.minResponseTime+"-"+i.maxResponseTime)+"ms ",1)])]),Object(s["h"])("div",null,[Object(s["h"])("div",se,[(Object(s["q"])(!0),Object(s["d"])(s["a"],null,Object(s["w"])(n.maximumNumberOfResults-n.data.results.length,(function(t){return Object(s["x"])(e.$slots,"default",{key:t},(function(){return[re]}))})),128)),(Object(s["q"])(!0),Object(s["d"])(s["a"],null,Object(s["w"])(n.data.results,(function(n){return Object(s["x"])(e.$slots,"default",{key:n},(function(){return[n.success?(Object(s["q"])(),Object(s["d"])("span",{key:0,class:"status rounded bg-success",onMouseenter:function(e){return o.showTooltip(n,e)},onMouseleave:t[1]||(t[1]=function(e){return o.showTooltip(null,e)})},"✓",40,["onMouseenter"])):(Object(s["q"])(),Object(s["d"])("span",{key:1,class:"status rounded bg-red-600",onMouseenter:function(e){return o.showTooltip(n,e)},onMouseleave:t[2]||(t[2]=function(e){return o.showTooltip(null,e)})},"X",40,["onMouseenter"]))]}))})),128))])]),Object(s["h"])("div",ie,[Object(s["h"])("div",oe,Object(s["A"])(e.generatePrettyTimeAgo(n.data.results[0].timestamp)),1),Object(s["h"])("div",ce,Object(s["A"])(e.generatePrettyTimeAgo(n.data.results[n.data.results.length-1].timestamp)),1)])])):Object(s["e"])("",!0)}n("a9e3");var le={methods:{generatePrettyTimeAgo:function(e){var t=(new Date).getTime()-new Date(e).getTime();if(t>36e5){var n=(t/36e5).toFixed(0);return n+" hour"+("1"!==n?"s":"")+" ago"}if(t>6e4){var s=(t/6e4).toFixed(0);return s+" minute"+("1"!==s?"s":"")+" ago"}return(t/1e3).toFixed(0)+" seconds ago"}}},ue={name:"Service",props:{maximumNumberOfResults:Number,data:Object},emits:["showTooltip"],mixins:[le],methods:{updateMinAndMaxResponseTimes:function(){var e=null,t=null;for(var n in this.data.results){var s=parseInt(this.data.results[n].duration/1e6);(null==e||e>s)&&(e=s),(null==t||t<s)&&(t=s)}this.minResponseTime!==e&&(this.minResponseTime=e),this.maxResponseTime!==t&&(this.maxResponseTime=t)},generatePath:function(){return this.data?"/services/"+this.data.key:"/"},showTooltip:function(e,t){this.$emit("showTooltip",e,t)}},watch:{data:function(){this.updateMinAndMaxResponseTimes()}},created:function(){this.updateMinAndMaxResponseTimes()},data:function(){return{minResponseTime:0,maxResponseTime:0}}};n("1e6f");ue.render=ae;var he=ue,de={name:"ServiceGroup",components:{Service:he},props:{name:String,services:Array},emits:["showTooltip"],methods:{healthCheck:function(){if(this.services)for(var e in this.services)for(var t in this.services[e].results)if(!this.services[e].results[t].success)return void(this.healthy&&(this.healthy=!1));this.healthy||(this.healthy=!0)},toggleGroup:function(){this.collapsed=!this.collapsed},showTooltip:function(e,t){this.$emit("showTooltip",e,t)}},watch:{services:function(){this.healthCheck()}},created:function(){this.healthCheck()},data:function(){return{healthy:!0,collapsed:!1}}};n("5e6a");de.render=K;var be=de,pe={name:"Services",components:{ServiceGroup:be},props:{showStatusOnHover:Boolean,serviceStatuses:Object},emits:["showTooltip"],methods:{process:function(){var e={};for(var t in this.serviceStatuses){var n=this.serviceStatuses[t];e[n.group]&&0!==e[n.group].length||(e[n.group]=[]),e[n.group].push(n)}var s=[];for(var r in e)"undefined"!==r&&s.push({name:r,services:e[r]});e["undefined"]&&s.push({name:"undefined",services:e["undefined"]}),this.serviceGroups=s},showTooltip:function(e,t){this.$emit("showTooltip",e,t)}},watch:{serviceStatuses:function(){this.process()}},data:function(){return{userClickedStatus:!1,serviceGroups:[]}}};n("6da3");pe.render=F;var fe=pe,ve={name:"Home",components:{Services:fe,Settings:L},emits:["showTooltip"],methods:{fetchData:function(){var e=this;console.log("[Home][fetchData] Fetching data"),fetch("".concat(nt,"/api/v1/statuses")).then((function(e){return e.json()})).then((function(t){JSON.stringify(e.serviceStatuses)!==JSON.stringify(t)&&(console.log(t),e.serviceStatuses=t)}))},showTooltip:function(e,t){this.$emit("showTooltip",e,t)}},data:function(){return{serviceStatuses:{}}},created:function(){this.fetchData()}};ve.render=C;var Oe=ve,me=Object(s["E"])("data-v-db353300");Object(s["t"])("data-v-db353300");var je=Object(s["g"])(" ← "),ge={class:"container mx-auto"},xe=Object(s["h"])("h1",{class:"text-3xl text-monospace text-gray-400"},"RECENT CHECKS",-1),ye=Object(s["h"])("hr",{class:"mb-4"},null,-1),we={key:1,class:"mt-12"},Te=Object(s["h"])("h1",{class:"text-3xl text-monospace text-gray-400"},"UPTIME",-1),Se=Object(s["h"])("hr",null,null,-1),Re={class:"flex space-x-4 text-center text-2xl mt-5"},ke={class:"flex-1"},Ae=Object(s["h"])("h2",{class:"text-sm text-gray-400"},"Last 7 days",-1),De={class:"flex-1"},qe=Object(s["h"])("h2",{class:"text-sm text-gray-400"},"Last 24 hours",-1),He={class:"flex-1"},Ie=Object(s["h"])("h2",{class:"text-sm text-gray-400"},"Last hour",-1),Me=Object(s["h"])("hr",{class:"mt-1"},null,-1),Ce=Object(s["h"])("h3",{class:"text-xl text-monospace text-gray-400 mt-1 text-right"},"BADGES",-1),Ee={class:"flex space-x-4 text-center text-2xl mt-6 relative bottom-12"},$e={class:"flex-1"},Ue={class:"flex-1"},_e={class:"flex-1"},Be=Object(s["h"])("h1",{class:"text-3xl text-monospace text-gray-400 mt-4"},"EVENTS",-1),Pe=Object(s["h"])("hr",{class:"mb-4"},null,-1),Ge={class:"p-3 my-4"},Le={class:"text-lg"},Ne={key:0,class:"border border-green-600 rounded-full px-1 text-green-700 opacity-75 bg-green-100 mr-2"},Fe=Object(s["h"])("span",{class:"relative bottom-0.5"},"🡡",-1),Ye={key:1,class:"border border-red-500 rounded-full px-1 text-red-700 opacity-75 bg-red-100 mr-2"},Je={key:2,class:"mr-2"},Ve={class:"flex mt-1 text-sm text-gray-400"},Xe={class:"flex-1 text-left pl-10"},Ke={class:"flex-1 text-right"};Object(s["r"])();var ze=me((function(e,t,n,r,i,o){var c=Object(s["y"])("router-link"),a=Object(s["y"])("Service"),l=Object(s["y"])("Settings");return Object(s["q"])(),Object(s["d"])(s["a"],null,[Object(s["h"])(c,{to:"/",class:"absolute top-2 left-2 inline-block px-2 py-0 text-lg text-black transition bg-gray-100 rounded shadow ripple hover:shadow-lg hover:bg-gray-200 focus:outline-none"},{default:me((function(){return[je]})),_:1}),Object(s["h"])("div",ge,[i.serviceStatus?Object(s["x"])(e.$slots,"default",{key:0},(function(){return[xe,ye,Object(s["h"])(a,{data:i.serviceStatus,maximumNumberOfResults:20,onShowTooltip:o.showTooltip},null,8,["data","onShowTooltip"])]})):Object(s["e"])("",!0),i.serviceStatus.uptime?(Object(s["q"])(),Object(s["d"])("div",we,[Te,Se,Object(s["h"])("div",Re,[Object(s["h"])("div",ke,[Object(s["g"])(Object(s["A"])(o.prettifyUptime(i.serviceStatus.uptime["7d"]))+" ",1),Ae]),Object(s["h"])("div",De,[Object(s["g"])(Object(s["A"])(o.prettifyUptime(i.serviceStatus.uptime["24h"]))+" ",1),qe]),Object(s["h"])("div",He,[Object(s["g"])(Object(s["A"])(o.prettifyUptime(i.serviceStatus.uptime["1h"]))+" ",1),Ie])]),Me,Ce,Object(s["h"])("div",Ee,[Object(s["h"])("div",$e,[Object(s["h"])("img",{src:o.generateBadgeImageURL("7d"),alt:"7d uptime badge",class:"mx-auto"},null,8,["src"])]),Object(s["h"])("div",Ue,[Object(s["h"])("img",{src:o.generateBadgeImageURL("24h"),alt:"24h uptime badge",class:"mx-auto"},null,8,["src"])]),Object(s["h"])("div",_e,[Object(s["h"])("img",{src:o.generateBadgeImageURL("1h"),alt:"1h uptime badge",class:"mx-auto"},null,8,["src"])])])])):Object(s["e"])("",!0),Object(s["h"])("div",null,[Be,Pe,Object(s["h"])("div",null,[(Object(s["q"])(!0),Object(s["d"])(s["a"],null,Object(s["w"])(i.events,(function(t){return Object(s["x"])(e.$slots,"default",{key:t},(function(){return[Object(s["h"])("div",Ge,[Object(s["h"])("h2",Le,["HEALTHY"===t.type?(Object(s["q"])(),Object(s["d"])("span",Ne,[Fe])):"UNHEALTHY"===t.type?(Object(s["q"])(),Object(s["d"])("span",Ye,"🡣")):"START"===t.type?(Object(s["q"])(),Object(s["d"])("span",Je,"▶")):Object(s["e"])("",!0),Object(s["g"])(" "+Object(s["A"])(t.fancyText),1)]),Object(s["h"])("div",Ve,[Object(s["h"])("div",Xe,Object(s["A"])(new Date(t.timestamp).toISOString()),1),Object(s["h"])("div",Ke,Object(s["A"])(t.fancyTimeAgo),1)])])]}))})),128))])])]),Object(s["h"])(l,{onRefreshData:o.fetchData},null,8,["onRefreshData"])],64)})),Qe=(n("99af"),{name:"Details",components:{Service:he,Settings:L},emits:["showTooltip"],mixins:[le],methods:{fetchData:function(){var e=this;console.log("[Details][fetchData] Fetching data"),fetch("".concat(this.serverUrl,"/api/v1/statuses/").concat(this.$route.params.key)).then((function(e){return e.json()})).then((function(t){if(JSON.stringify(e.serviceStatus)!==JSON.stringify(t)){e.serviceStatus=t.serviceStatus;for(var n=[],s=t.events.length-1;s>=0;s--){var r=t.events[s];if(s===t.events.length-1)"UNHEALTHY"===r.type?r.fancyText="Service is unhealthy":"HEALTHY"===r.type?r.fancyText="Service is healthy":"START"===r.type&&(r.fancyText="Monitoring started");else{var i=t.events[s+1];"HEALTHY"===r.type?r.fancyText="Service became healthy again":"UNHEALTHY"===r.type?r.fancyText=i?"Service was unhealthy for "+e.prettifyTimeDifference(i.timestamp,r.timestamp):"Service became unhealthy":"START"===r.type&&(r.fancyText="Monitoring started")}r.fancyTimeAgo=e.generatePrettyTimeAgo(r.timestamp),n.push(r)}e.events=n}}))},generateBadgeImageURL:function(e){return"".concat(this.serverUrl,"/api/v1/badges/uptime/").concat(e,"/").concat(this.serviceStatus.key)},prettifyUptime:function(e){return e?(100*e).toFixed(2)+"%":"0%"},prettifyTimeDifference:function(e,t){var n=Math.ceil((new Date(e)-new Date(t))/1e3/60);return n+(1===n?" minute":" minutes")},showTooltip:function(e,t){this.$emit("showTooltip",e,t)}},data:function(){return{serviceStatus:{},events:[],serverUrl:"."===nt?"..":nt}},created:function(){this.fetchData()}});n("b883");Qe.render=ze,Qe.__scopeId="data-v-db353300";var We=Qe,Ze=[{path:"/",name:"Home",component:Oe},{path:"/services/:key",name:"Details",component:We}],et=Object(M["a"])({history:Object(M["b"])("/"),routes:Ze}),tt=et,nt=".";Object(s["c"])(I).use(tt).mount("#app")},"5e6a":function(e,t,n){"use strict";n("f00e")},"6da3":function(e,t,n){"use strict";n("b73a")},"75d6":function(e,t,n){"use strict";n("e52e")},"7e86":function(e,t,n){},a766:function(e,t,n){},b73a:function(e,t,n){},b883:function(e,t,n){"use strict";n("4810")},bca1:function(e,t,n){},cf05:function(e,t,n){e.exports=n.p+"img/logo.png"},db7d:function(e,t,n){},e52e:function(e,t,n){},f00e:function(e,t,n){}}); |