#77: Make page logo customizable

This commit is contained in:
TwinProduction committed 2021-09-11 04:33:14 -04:00
1 parent 7a68920889
commit db5fc8bc11
9 files changed
+32 -5

No files matched your search

+3
View File
@@ -175,6 +175,9 @@ If you want to test it locally, see [Docker](#docker).
| `web` | Web configuration. | `{}` |
| `web.address` | Address to listen on. | `0.0.0.0` |
| `web.port` | Port to listen on. | `8080` |
| `ui` | UI configuration. | `{}` |
| `ui.title` | Title of the page. | `Health Dashboard ǀ Gatus` |
| `ui.logo` | URL to the logo to display | `""` |
### Conditions
+6 -1
View File
@@ -5,17 +5,22 @@ import (
"html/template"
)
const defaultTitle = "Health Dashboard | Gatus"
const (
defaultTitle = "Health Dashboard | Gatus"
defaultLogo = ""
)
// UIConfig is the configuration for the UI of Gatus
type UIConfig struct {
Title string `yaml:"title"` // Title of the page
Logo string `yaml:"logo"` // Logo to display on the page
}
// GetDefaultUIConfig returns a UIConfig struct with the default values
func GetDefaultUIConfig() *UIConfig {
return &UIConfig{
Title: defaultTitle,
Logo: defaultLogo,
}
}
+3
View File
@@ -18,4 +18,7 @@ func TestGetDefaultUIConfig(t *testing.T) {
if defaultUIConfig.Title != defaultTitle {
t.Error("expected GetDefaultUIConfig() to return defaultTitle, got", defaultUIConfig.Title)
}
if defaultUIConfig.Logo != defaultLogo {
t.Error("expected GetDefaultUIConfig() to return defaultLogo, got", defaultUIConfig.Logo)
}
}
+5
View File
@@ -2,6 +2,11 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<script type="text/javascript">
window.config = {
logo: "{{ .Logo }}"
};
</script>
<title>{{ .Title }}</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
+7 -1
View File
@@ -6,7 +6,8 @@
<div class="text-3xl xl:text-5xl lg:text-4xl font-light">Health Status</div>
</div>
<div class="w-1/4 flex justify-end">
<img src="./assets/logo.png" alt="Gatus" class="object-scale-down" style="max-width: 100px; min-width: 50px; min-height:50px;"/>
<img v-if="getLogo" :src="getLogo" alt="Gatus" class="object-scale-down" style="max-width: 100px; min-width: 50px; min-height:50px;"/>
<img v-if="!getLogo" src="./assets/logo.png" alt="Gatus" class="object-scale-down" style="max-width: 100px; min-width: 50px; min-height:50px;"/>
</div>
</div>
</div>
@@ -32,6 +33,11 @@ export default {
this.tooltip = {result: result, event: event};
}
},
computed: {
getLogo() {
return window.config && window.config.logo && window.config.logo !== '{{ .Logo }}' ? window.config.logo : "";
}
},
data() {
return {
tooltip: {}
+3
View File
@@ -16,6 +16,9 @@
{{ (minResponseTime === maxResponseTime ? minResponseTime : (minResponseTime + '-' + maxResponseTime)) }}ms
</slot>
</span>
<!-- <span class="text-sm font-bold cursor-pointer">-->
<!-- ⋯-->
<!-- </span>-->
</div>
</div>
<div>
+3 -1
View File
@@ -1 +1,3 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><title>{{ .Title }}</title><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><script defer="defer" src="/js/chunk-vendors.js" type="module"></script><script defer="defer" src="/js/app.js" type="module"></script><link href="/css/app.css" rel="stylesheet"><script defer="defer" src="/js/chunk-vendors-legacy.js" nomodule></script><script defer="defer" src="/js/app-legacy.js" nomodule></script></head><body class="dark:bg-gray-900"><noscript><strong>Enable JavaScript to view this page.</strong></noscript><div id="app"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><script>window.config = {
logo: "{{ .Logo }}"
};</script><title>{{ .Title }}</title><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><script defer="defer" src="/js/chunk-vendors.js" type="module"></script><script defer="defer" src="/js/app.js" type="module"></script><link href="/css/app.css" rel="stylesheet"><script defer="defer" src="/js/chunk-vendors-legacy.js" nomodule></script><script defer="defer" src="/js/app-legacy.js" nomodule></script></head><body class="dark:bg-gray-900"><noscript><strong>Enable JavaScript to view this page.</strong></noscript><div id="app"></div></body></html>
+1 -1
View File
@@ -1 +1 @@
(function(){"use strict";var e={4910:function(e,t,s){s.d(t,{L:function(){return Rt}});s(6992),s(8674),s(9601),s(7727);var r=s(9963),n=s(6252),a=s.p+"img/logo.png",o={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,n._)("div",{class:"mb-2"},[(0,n._)("div",{class:"flex flex-wrap"},[(0,n._)("div",{class:"w-3/4 text-left my-auto"},[(0,n._)("div",{class:"text-3xl xl:text-5xl lg:text-4xl font-light"},"Health Status")]),(0,n._)("div",{class:"w-1/4 flex justify-end"},[(0,n._)("img",{src:a,alt:"Gatus",class:"object-scale-down",style:{"max-width":"100px","min-width":"50px","min-height":"50px"}})])])],-1);function l(e,t,s,r,a,l){var u=(0,n.up)("router-view"),g=(0,n.up)("Tooltip"),c=(0,n.up)("Social");return(0,n.wg)(),(0,n.iD)(n.HY,null,[(0,n._)("div",o,[i,(0,n.Wm)(u,{onShowTooltip:l.showTooltip},null,8,["onShowTooltip"])]),(0,n.Wm)(g,{result:a.tooltip.result,event:a.tooltip.event},null,8,["result","event"]),(0,n.Wm)(c)],64)}var u=s.p+"img/github.png";(0,n.dD)("data-v-1cbbc992");var g={id:"social"},c=(0,n._)("a",{href:"https://github.com/TwinProduction/gatus",target:"_blank",title:"Gatus on GitHub"},[(0,n._)("img",{src:u,alt:"GitHub",width:"32",height:"auto"})],-1),h=[c];function d(e,t,s,r,a,o){return(0,n.wg)(),(0,n.iD)("div",g,h)}(0,n.Cn)();var v={name:"Social"};v.render=d,v.__scopeId="data-v-1cbbc992";var m=v,p=(s(6977),s(3577)),f=(0,n._)("div",{class:"tooltip-title"},"Timestamp:",-1),A={id:"tooltip-timestamp"},w=(0,n._)("div",{class:"tooltip-title"},"Response time:",-1),y={id:"tooltip-response-time"},x=(0,n._)("div",{class:"tooltip-title"},"Conditions:",-1),T={id:"tooltip-conditions"},b=(0,n._)("br",null,null,-1),k={key:0,id:"tooltip-errors-container"},I=(0,n._)("div",{class:"tooltip-title"},"Errors:",-1),R={id:"tooltip-errors"},S=(0,n._)("br",null,null,-1);function D(e,t,s,r,a,o){return(0,n.wg)(),(0,n.iD)("div",{id:"tooltip",ref:"tooltip",class:(0,p.C_)(a.hidden?"invisible":""),style:(0,p.j5)("top:"+a.top+"px; left:"+a.left+"px")},[s.result?(0,n.WI)(e.$slots,"default",{key:0},(function(){return[f,(0,n._)("code",A,(0,p.zw)(o.prettifyTimestamp(s.result.timestamp)),1),w,(0,n._)("code",y,(0,p.zw)((s.result.duration/1e6).toFixed(0))+"ms",1),x,(0,n._)("code",T,[((0,n.wg)(!0),(0,n.iD)(n.HY,null,(0,n.Ko)(s.result.conditionResults,(function(t){return(0,n.WI)(e.$slots,"default",{key:t},(function(){return[(0,n.Uk)((0,p.zw)(t.success?"✓":"X")+" ~ "+(0,p.zw)(t.condition),1),b]}))})),128))]),s.result.errors&&s.result.errors.length?((0,n.wg)(),(0,n.iD)("div",k,[I,(0,n._)("code",R,[((0,n.wg)(!0),(0,n.iD)(n.HY,null,(0,n.Ko)(s.result.errors,(function(t){return(0,n.WI)(e.$slots,"default",{key:t},(function(){return[(0,n.Uk)(" - "+(0,p.zw)(t),1),S]}))})),128))])])):(0,n.kq)("",!0)]})):(0,n.kq)("",!0)],6)}s(4916),s(5306);var C={name:"Services",props:{event:Event,result:Object},methods:{prettifyTimestamp:function(e){var t=new Date(e),s=t.getFullYear(),r=(t.getMonth()+1<10?"0":"")+(t.getMonth()+1),n=(t.getDate()<10?"0":"")+t.getDate(),a=(t.getHours()<10?"0":"")+t.getHours(),o=(t.getMinutes()<10?"0":"")+t.getMinutes(),i=(t.getSeconds()<10?"0":"")+t.getSeconds();return s+"-"+r+"-"+n+" "+a+":"+o+":"+i},htmlEntities:function(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")},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,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"===e.type&&(this.hidden=!0))}},updated:function(){this.reposition()},created:function(){this.reposition()},data:function(){return{hidden:!0,top:0,left:0}}};C.render=D;var B=C,P={name:"App",components:{Social:m,Tooltip:B},methods:{showTooltip:function(e,t){this.tooltip={result:e,event:t}}},data:function(){return{tooltip:{}}}};P.render=l;var E=P,H=s(2119);function O(e,t,s,r,a,o){var i=(0,n.up)("Services"),l=(0,n.up)("Pagination"),u=(0,n.up)("Settings");return(0,n.wg)(),(0,n.iD)(n.HY,null,[(0,n.Wm)(i,{serviceStatuses:a.serviceStatuses,showStatusOnHover:!0,onShowTooltip:o.showTooltip,onToggleShowAverageResponseTime:o.toggleShowAverageResponseTime,showAverageResponseTime:a.showAverageResponseTime},null,8,["serviceStatuses","onShowTooltip","onToggleShowAverageResponseTime","showAveragLine truncated
(function(){"use strict";var e={8584:function(e,t,s){s.d(t,{L:function(){return Pt}});s(6992),s(8674),s(9601),s(7727);var r=s(9963),n=s(6252),o=s.p+"img/logo.png",a={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,n._)("div",{class:"w-3/4 text-left my-auto"},[(0,n._)("div",{class:"text-3xl xl:text-5xl lg:text-4xl font-light"},"Health Status")],-1),u={class:"w-1/4 flex justify-end"},c=["src"],h={key:1,src:o,alt:"Gatus",class:"object-scale-down",style:{"max-width":"100px","min-width":"50px","min-height":"50px"}};function d(e,t,s,r,o,d){var m=(0,n.up)("router-view"),v=(0,n.up)("Tooltip"),p=(0,n.up)("Social");return(0,n.wg)(),(0,n.iD)(n.HY,null,[(0,n._)("div",a,[(0,n._)("div",i,[(0,n._)("div",l,[g,(0,n._)("div",u,[d.getLogo?((0,n.wg)(),(0,n.iD)("img",{key:0,src:d.getLogo,alt:"Gatus",class:"object-scale-down",style:{"max-width":"100px","min-width":"50px","min-height":"50px"}},null,8,c)):(0,n.kq)("",!0),d.getLogo?(0,n.kq)("",!0):((0,n.wg)(),(0,n.iD)("img",h))])])]),(0,n.Wm)(m,{onShowTooltip:d.showTooltip},null,8,["onShowTooltip"])]),(0,n.Wm)(v,{result:o.tooltip.result,event:o.tooltip.event},null,8,["result","event"]),(0,n.Wm)(p)],64)}var m=s.p+"img/github.png";(0,n.dD)("data-v-1cbbc992");var v={id:"social"},p=(0,n._)("a",{href:"https://github.com/TwinProduction/gatus",target:"_blank",title:"Gatus on GitHub"},[(0,n._)("img",{src:m,alt:"GitHub",width:"32",height:"auto"})],-1),f=[p];function A(e,t,s,r,o,a){return(0,n.wg)(),(0,n.iD)("div",v,f)}(0,n.Cn)();var w={name:"Social"};w.render=A,w.__scopeId="data-v-1cbbc992";var y=w,x=(s(6977),s(3577)),T=(0,n._)("div",{class:"tooltip-title"},"Timestamp:",-1),k={id:"tooltip-timestamp"},b=(0,n._)("div",{class:"tooltip-title"},"Response time:",-1),I={id:"tooltip-response-time"},R=(0,n._)("div",{class:"tooltip-title"},"Conditions:",-1),S={id:"tooltip-conditions"},D=(0,n._)("br",null,null,-1),C={key:0,id:"tooltip-errors-container"},B=(0,n._)("div",{class:"tooltip-title"},"Errors:",-1),P={id:"tooltip-errors"},E=(0,n._)("br",null,null,-1);function H(e,t,s,r,o,a){return(0,n.wg)(),(0,n.iD)("div",{id:"tooltip",ref:"tooltip",class:(0,x.C_)(o.hidden?"invisible":""),style:(0,x.j5)("top:"+o.top+"px; left:"+o.left+"px")},[s.result?(0,n.WI)(e.$slots,"default",{key:0},(function(){return[T,(0,n._)("code",k,(0,x.zw)(a.prettifyTimestamp(s.result.timestamp)),1),b,(0,n._)("code",I,(0,x.zw)((s.result.duration/1e6).toFixed(0))+"ms",1),R,(0,n._)("code",S,[((0,n.wg)(!0),(0,n.iD)(n.HY,null,(0,n.Ko)(s.result.conditionResults,(function(t){return(0,n.WI)(e.$slots,"default",{key:t},(function(){return[(0,n.Uk)((0,x.zw)(t.success?"✓":"X")+" ~ "+(0,x.zw)(t.condition),1),D]}))})),128))]),s.result.errors&&s.result.errors.length?((0,n.wg)(),(0,n.iD)("div",C,[B,(0,n._)("code",P,[((0,n.wg)(!0),(0,n.iD)(n.HY,null,(0,n.Ko)(s.result.errors,(function(t){return(0,n.WI)(e.$slots,"default",{key:t},(function(){return[(0,n.Uk)(" - "+(0,x.zw)(t),1),E]}))})),128))])])):(0,n.kq)("",!0)]})):(0,n.kq)("",!0)],6)}s(4916),s(5306);var O={name:"Services",props:{event:Event,result:Object},methods:{prettifyTimestamp:function(e){var t=new Date(e),s=t.getFullYear(),r=(t.getMonth()+1<10?"0":"")+(t.getMonth()+1),n=(t.getDate()<10?"0":"")+t.getDate(),o=(t.getHours()<10?"0":"")+t.getHours(),a=(t.getMinutes()<10?"0":"")+t.getMinutes(),i=(t.getSeconds()<10?"0":"")+t.getSeconds();return s+"-"+r+"-"+n+" "+o+":"+a+":"+i},htmlEntities:function(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")},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,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"===e.type&&(this.hidden=!0))}},updated:function(){this.reposition()},created:function(){this.reposition()},data:function(){return{hidden:!0,top:0,left:0}}};O.render=H;var U=O,z={name:"App",components:{Social:y,Tooltip:U},methods:{showTooltip:function(e,t){this.tooltip={result:e,event:t}}},computed:{getLogo:function(){return window.config&&window.config.logo&&"{{ .Logo }}"!==window.config.logo?window.config.logo:""}},data:function(){return{tooltip:{}}}};z.render=d;var M=z,Q=s(2119);function W(e,t,s,r,o,a){var i=(0,n.up)("Line truncated
+1 -1
View File
@@ -1 +1 @@
(function(){"use strict";var e={910:function(e,t,s){s.d(t,{L:function(){return Rt}});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._)("div",{class:"mb-2"},[(0,a._)("div",{class:"flex flex-wrap"},[(0,a._)("div",{class:"w-3/4 text-left my-auto"},[(0,a._)("div",{class:"text-3xl xl:text-5xl lg:text-4xl font-light"},"Health Status")]),(0,a._)("div",{class:"w-1/4 flex justify-end"},[(0,a._)("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"),c=(0,a.up)("Social");return(0,a.wg)(),(0,a.iD)(a.HY,null,[(0,a._)("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)(c)],64)}var g=s.p+"img/github.png";(0,a.dD)("data-v-1cbbc992");const h={id:"social"},c=(0,a._)("a",{href:"https://github.com/TwinProduction/gatus",target:"_blank",title:"Gatus on GitHub"},[(0,a._)("img",{src:g,alt:"GitHub",width:"32",height:"auto"})],-1),u=[c];function d(e,t,s,r,o,n){return(0,a.wg)(),(0,a.iD)("div",h,u)}(0,a.Cn)();var m={name:"Social"};m.render=d,m.__scopeId="data-v-1cbbc992";var p=m,A=s(577);const v=(0,a._)("div",{class:"tooltip-title"},"Timestamp:",-1),f={id:"tooltip-timestamp"},w=(0,a._)("div",{class:"tooltip-title"},"Response time:",-1),y={id:"tooltip-response-time"},x=(0,a._)("div",{class:"tooltip-title"},"Conditions:",-1),T={id:"tooltip-conditions"},b=(0,a._)("br",null,null,-1),k={key:0,id:"tooltip-errors-container"},I=(0,a._)("div",{class:"tooltip-title"},"Errors:",-1),R={id:"tooltip-errors"},S=(0,a._)("br",null,null,-1);function D(e,t,s,r,o,n){return(0,a.wg)(),(0,a.iD)("div",{id:"tooltip",ref:"tooltip",class:(0,A.C_)(o.hidden?"invisible":""),style:(0,A.j5)("top:"+o.top+"px; left:"+o.left+"px")},[s.result?(0,a.WI)(e.$slots,"default",{key:0},(()=>[v,(0,a._)("code",f,(0,A.zw)(n.prettifyTimestamp(s.result.timestamp)),1),w,(0,a._)("code",y,(0,A.zw)((s.result.duration/1e6).toFixed(0))+"ms",1),x,(0,a._)("code",T,[((0,a.wg)(!0),(0,a.iD)(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),b])))),128))]),s.result.errors&&s.result.errors.length?((0,a.wg)(),(0,a.iD)("div",k,[I,(0,a._)("code",R,[((0,a.wg)(!0),(0,a.iD)(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.kq)("",!0)])):(0,a.kq)("",!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"===e.type&&(this.hidden=!0))}},updated(){this.reposition()},created(){this.reposition()},data(){return{hidden:!0,top:0,left:0}}};C.render=D;var B=C,P={name:"App",components:{Social:p,Tooltip:B},methods:{showTooltip(e,t){this.tooltip={result:e,event:t}}},data(){return{tooltip:{}}}};P.render=l;var E=P,H=s(119);function O(e,t,s,r,o,n){const i=(0,a.up)("Services"),l=(0,a.up)("Pagination"),g=(0,a.up)("Settings");return(0,a.wg)(),(0,a.iD)(a.HY,null,[(0,a.Wm)(i,{serviceStatuses:o.serviceStatuses,showStatusOnHover:!0,onShowTooltip:n.showTooltip,onToggleShowAverageResponseTime:n.toggleShowAverageResponseTime,showAverageResponseTime:o.showAverageResponseTime},null,8,["serviceStatuses","onShowTooltip","onToggleShowAverageResponseTime","showAverageResponseTime"]),(0,a.Wm)(l,{onPage:n.changePage},null,8,["onPage"]),(0,a.Wm)(g,{onRefreshData:n.fetchData},null,8,["onRefreshData"])],64)}const U={id:"settings",class:"flex bg-gray-200 bordeLine truncated
(function(){"use strict";var e={584:function(e,t,s){s.d(t,{L:function(){return Pt}});var r=s(963),a=s(252),o=s.p+"img/logo.png";const i={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"},n={class:"mb-2"},l={class:"flex flex-wrap"},g=(0,a._)("div",{class:"w-3/4 text-left my-auto"},[(0,a._)("div",{class:"text-3xl xl:text-5xl lg:text-4xl font-light"},"Health Status")],-1),h={class:"w-1/4 flex justify-end"},c=["src"],u={key:1,src:o,alt:"Gatus",class:"object-scale-down",style:{"max-width":"100px","min-width":"50px","min-height":"50px"}};function d(e,t,s,r,o,d){const m=(0,a.up)("router-view"),p=(0,a.up)("Tooltip"),A=(0,a.up)("Social");return(0,a.wg)(),(0,a.iD)(a.HY,null,[(0,a._)("div",i,[(0,a._)("div",n,[(0,a._)("div",l,[g,(0,a._)("div",h,[d.getLogo?((0,a.wg)(),(0,a.iD)("img",{key:0,src:d.getLogo,alt:"Gatus",class:"object-scale-down",style:{"max-width":"100px","min-width":"50px","min-height":"50px"}},null,8,c)):(0,a.kq)("",!0),d.getLogo?(0,a.kq)("",!0):((0,a.wg)(),(0,a.iD)("img",u))])])]),(0,a.Wm)(m,{onShowTooltip:d.showTooltip},null,8,["onShowTooltip"])]),(0,a.Wm)(p,{result:o.tooltip.result,event:o.tooltip.event},null,8,["result","event"]),(0,a.Wm)(A)],64)}var m=s.p+"img/github.png";(0,a.dD)("data-v-1cbbc992");const p={id:"social"},A=(0,a._)("a",{href:"https://github.com/TwinProduction/gatus",target:"_blank",title:"Gatus on GitHub"},[(0,a._)("img",{src:m,alt:"GitHub",width:"32",height:"auto"})],-1),v=[A];function f(e,t,s,r,o,i){return(0,a.wg)(),(0,a.iD)("div",p,v)}(0,a.Cn)();var w={name:"Social"};w.render=f,w.__scopeId="data-v-1cbbc992";var y=w,x=s(577);const T=(0,a._)("div",{class:"tooltip-title"},"Timestamp:",-1),k={id:"tooltip-timestamp"},b=(0,a._)("div",{class:"tooltip-title"},"Response time:",-1),I={id:"tooltip-response-time"},R=(0,a._)("div",{class:"tooltip-title"},"Conditions:",-1),S={id:"tooltip-conditions"},D=(0,a._)("br",null,null,-1),C={key:0,id:"tooltip-errors-container"},B=(0,a._)("div",{class:"tooltip-title"},"Errors:",-1),P={id:"tooltip-errors"},E=(0,a._)("br",null,null,-1);function H(e,t,s,r,o,i){return(0,a.wg)(),(0,a.iD)("div",{id:"tooltip",ref:"tooltip",class:(0,x.C_)(o.hidden?"invisible":""),style:(0,x.j5)("top:"+o.top+"px; left:"+o.left+"px")},[s.result?(0,a.WI)(e.$slots,"default",{key:0},(()=>[T,(0,a._)("code",k,(0,x.zw)(i.prettifyTimestamp(s.result.timestamp)),1),b,(0,a._)("code",I,(0,x.zw)((s.result.duration/1e6).toFixed(0))+"ms",1),R,(0,a._)("code",S,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)(s.result.conditionResults,(t=>(0,a.WI)(e.$slots,"default",{key:t},(()=>[(0,a.Uk)((0,x.zw)(t.success?"✓":"X")+" ~ "+(0,x.zw)(t.condition),1),D])))),128))]),s.result.errors&&s.result.errors.length?((0,a.wg)(),(0,a.iD)("div",C,[B,(0,a._)("code",P,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)(s.result.errors,(t=>(0,a.WI)(e.$slots,"default",{key:t},(()=>[(0,a.Uk)(" - "+(0,x.zw)(t),1),E])))),128))])])):(0,a.kq)("",!0)])):(0,a.kq)("",!0)],6)}var O={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(),i=(t.getMinutes()<10?"0":"")+t.getMinutes(),n=(t.getSeconds()<10?"0":"")+t.getSeconds();return s+"-"+r+"-"+a+" "+o+":"+i+":"+n},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"===e.type&&(this.hidden=!0))}},updated(){this.reposition()},created(){this.reposition()},data(){return{hidden:!0,top:0,left:0}}};O.render=H;var U=O,z={name:"App",components:{Social:y,Tooltip:U},methods:{showTooltip(e,t){this.tooltip={result:e,event:t}}},computed:{getLogo(){return window.config&&window.config.logo&&"{{ .Logo }}"!==window.config.logo?window.config.logo:""}},data(){return{tooltip:{}}}};z.render=d;var M=z,Q=s(119);function W(e,t,s,r,o,i){const n=(0,a.up)("Services"),l=(0,a.up)("Pagination"),g=(0,a.up)("Settings");return(0,a.wg)(),(0,a.iD)(a.HY,null,[(0,a.Wm)(n,{serviceStatuses:o.serviceStatuses,showStatusOnHover:!0,onShowTooltip:i.showTooltip,onToggleSLine truncated