Compare commits

...
8 Commits
Author SHA1 Message Date
TwiN 08b31ba263 chore: Update frontend dependencies 2022-04-25 20:47:01 -04:00
TwiN 9ede992e4e feat(ui): Add support for buttons below header (#106) 2022-04-25 20:20:32 -04:00
TwiN dcb997f501 docs: Fix table format 2022-04-25 19:55:17 -04:00
TwiN c8efdac23a chore(ci): Update actions/setup-go to v3 2022-04-15 14:32:48 -04:00
Bo-Yi WuandTwiN e307d1ab35 feat(alerting): Add group-specific WebHook URL for Discord (#271)
* feat(alerting): Add group-specific webhook URL for discord

Add group-specific webhook URL for discord alert

Provides support for paging multiple Discords based on the group selector while keeping backward compatibility to the old Discords configuration manifest

integration per team can be specified in the overrides sections in an array form.

ref: #96

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* docs: update

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* Update README.md

* Update README.md

* Update alerting/provider/discord/discord.go

Co-authored-by: TwiN <twin@linux.com>

* Update README.md

Co-authored-by: TwiN <twin@linux.com>

* test: revert testing name

* Update alerting/provider/discord/discord_test.go

Co-authored-by: TwiN <twin@linux.com>

Co-authored-by: TwiN <twin@linux.com>
2022-04-11 20:30:21 -04:00
TwiN e6c6b4e06f chore: Update TwiN/health to v1.4.0 2022-04-11 01:39:47 -04:00
TwiN 5843c58a36 chore: Update Go to 1.18 2022-03-26 02:15:32 -04:00
Bo-Yi Wu 5281f8068d feat(alerting): Add group-specific webhook URL for teams (#266)
* feat(alert): Add group-specific webhook URL for teams

Add group-specific webhook URL for teams alert

ref: https://github.com/TwiN/gatus/issues/96

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* Update README.md

* Update README.md
2022-03-23 20:31:10 -04:00
26 changed files with 1603 additions and 1979 deletions

No files matched your search

+2 -2
View File
@@ -15,9 +15,9 @@ jobs:
timeout-minutes: 5 timeout-minutes: 5
steps: steps:
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v2 uses: actions/setup-go@v3
with: with:
go-version: 1.17 go-version: 1.18
- name: Check out code into the Go module directory - name: Check out code into the Go module directory
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Build binary to make sure it works - name: Build binary to make sure it works
+90 -62
View File
@@ -145,48 +145,51 @@ If you want to test it locally, see [Docker](#docker).
## Configuration ## Configuration
| Parameter | Description | Default | | Parameter | Description | Default |
|:------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------| |:------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------|
| `debug` | Whether to enable debug logs. | `false` | | `debug` | Whether to enable debug logs. | `false` |
| `metrics` | Whether to expose metrics at /metrics. | `false` | | `metrics` | Whether to expose metrics at /metrics. | `false` |
| `storage` | [Storage configuration](#storage) | `{}` | | `storage` | [Storage configuration](#storage) | `{}` |
| `endpoints` | List of endpoints to monitor. | Required `[]` | | `endpoints` | List of endpoints to monitor. | Required `[]` |
| `endpoints[].enabled` | Whether to monitor the endpoint. | `true` | | `endpoints[].enabled` | Whether to monitor the endpoint. | `true` |
| `endpoints[].name` | Name of the endpoint. Can be anything. | Required `""` | | `endpoints[].name` | Name of the endpoint. Can be anything. | Required `""` |
| `endpoints[].group` | Group name. Used to group multiple endpoints together on the dashboard. <br />See [Endpoint groups](#endpoint-groups). | `""` | | `endpoints[].group` | Group name. Used to group multiple endpoints together on the dashboard. <br />See [Endpoint groups](#endpoint-groups). | `""` |
| `endpoints[].url` | URL to send the request to. | Required `""` | | `endpoints[].url` | URL to send the request to. | Required `""` |
| `endpoints[].method` | Request method. | `GET` | | `endpoints[].method` | Request method. | `GET` |
| `endpoints[].conditions` | Conditions used to determine the health of the endpoint. <br />See [Conditions](#conditions). | `[]` | | `endpoints[].conditions` | Conditions used to determine the health of the endpoint. <br />See [Conditions](#conditions). | `[]` |
| `endpoints[].interval` | Duration to wait between every status check. | `60s` | | `endpoints[].interval` | Duration to wait between every status check. | `60s` |
| `endpoints[].graphql` | Whether to wrap the body in a query param (`{"query":"$body"}`). | `false` | | `endpoints[].graphql` | Whether to wrap the body in a query param (`{"query":"$body"}`). | `false` |
| `endpoints[].body` | Request body. | `""` | | `endpoints[].body` | Request body. | `""` |
| `endpoints[].headers` | Request headers. | `{}` | | `endpoints[].headers` | Request headers. | `{}` |
| `endpoints[].dns` | Configuration for an endpoint of type DNS. <br />See [Monitoring an endpoint using DNS queries](#monitoring-an-endpoint-using-dns-queries). | `""` | | `endpoints[].dns` | Configuration for an endpoint of type DNS. <br />See [Monitoring an endpoint using DNS queries](#monitoring-an-endpoint-using-dns-queries). | `""` |
| `endpoints[].dns.query-type` | Query type (e.g. MX) | `""` | | `endpoints[].dns.query-type` | Query type (e.g. MX) | `""` |
| `endpoints[].dns.query-name` | Query name (e.g. example.com) | `""` | | `endpoints[].dns.query-name` | Query name (e.g. example.com) | `""` |
| `endpoints[].alerts[].type` | Type of alert. <br />Valid types: `slack`, `discord`, `email`, `googlechat`, `pagerduty`, `twilio`, `mattermost`, `messagebird`, `teams` `custom`. | Required `""` | | `endpoints[].alerts[].type` | Type of alert. <br />Valid types: `slack`, `discord`, `email`, `googlechat`, `pagerduty`, `twilio`, `mattermost`, `messagebird`, `teams` `custom`. | Required `""` |
| `endpoints[].alerts[].enabled` | Whether to enable the alert. | `false` | | `endpoints[].alerts[].enabled` | Whether to enable the alert. | `false` |
| `endpoints[].alerts[].failure-threshold` | Number of failures in a row needed before triggering the alert. | `3` | | `endpoints[].alerts[].failure-threshold` | Number of failures in a row needed before triggering the alert. | `3` |
| `endpoints[].alerts[].success-threshold` | Number of successes in a row before an ongoing incident is marked as resolved. | `2` | | `endpoints[].alerts[].success-threshold` | Number of successes in a row before an ongoing incident is marked as resolved. | `2` |
| `endpoints[].alerts[].send-on-resolved` | Whether to send a notification once a triggered alert is marked as resolved. | `false` | | `endpoints[].alerts[].send-on-resolved` | Whether to send a notification once a triggered alert is marked as resolved. | `false` |
| `endpoints[].alerts[].description` | Description of the alert. Will be included in the alert sent. | `""` | | `endpoints[].alerts[].description` | Description of the alert. Will be included in the alert sent. | `""` |
| `endpoints[].client` | [Client configuration](#client-configuration). | `{}` | | `endpoints[].client` | [Client configuration](#client-configuration). | `{}` |
| `endpoints[].ui` | UI configuration at the endpoint level. | `{}` | | `endpoints[].ui` | UI configuration at the endpoint level. | `{}` |
| `endpoints[].ui.hide-hostname` | Whether to include the hostname in the result. | `false` | | `endpoints[].ui.hide-hostname` | Whether to include the hostname in the result. | `false` |
| `endpoints[].ui.dont-resolve-failed-conditions` | Whether to resolve failed conditions for the UI. | `false` | | `endpoints[].ui.dont-resolve-failed-conditions` | Whether to resolve failed conditions for the UI. | `false` |
| `alerting` | [Alerting configuration](#alerting). | `{}` | | `alerting` | [Alerting configuration](#alerting). | `{}` |
| `security` | [Security configuration](#security). | `{}` | | `security` | [Security configuration](#security). | `{}` |
| `disable-monitoring-lock` | Whether to [disable the monitoring lock](#disable-monitoring-lock). | `false` | | `disable-monitoring-lock` | Whether to [disable the monitoring lock](#disable-monitoring-lock). | `false` |
| `skip-invalid-config-update` | Whether to ignore invalid configuration update. <br />See [Reloading configuration on the fly](#reloading-configuration-on-the-fly). | `false` | | `skip-invalid-config-update` | Whether to ignore invalid configuration update. <br />See [Reloading configuration on the fly](#reloading-configuration-on-the-fly). | `false` |
| `web` | Web configuration. | `{}` | | `web` | Web configuration. | `{}` |
| `web.address` | Address to listen on. | `0.0.0.0` | | `web.address` | Address to listen on. | `0.0.0.0` |
| `web.port` | Port to listen on. | `8080` | | `web.port` | Port to listen on. | `8080` |
| `ui` | UI configuration. | `{}` | | `ui` | UI configuration. | `{}` |
| `ui.title` | [Title of the document](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title). | `Health Dashboard ǀ Gatus` | | `ui.title` | [Title of the document](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title). | `Health Dashboard ǀ Gatus` |
| `ui.header` | Header at the top of the dashboard. | `Health Status` | | `ui.header` | Header at the top of the dashboard. | `Health Status` |
| `ui.logo` | URL to the logo to display. | `""` | | `ui.logo` | URL to the logo to display. | `""` |
| `ui.link` | Link to open when the logo is clicked. | `""` | | `ui.link` | Link to open when the logo is clicked. | `""` |
| `maintenance` | [Maintenance configuration](#maintenance). | `{}` | | `ui.buttons` | List of buttons to display below the header. | `[]` |
| `ui.buttons[].name` | Text to display on the button. | Required `""` |
| `ui.buttons[].link` | Link to open when the button is clicked. | Required `""` |
| `maintenance` | [Maintenance configuration](#maintenance). | `{}` |
### Conditions ### Conditions
@@ -346,13 +349,16 @@ ignored.
| `alerting.twilio` | Settings for alerts of type `twilio`. <br />See [Configuring Twilio alerts](#configuring-twilio-alerts). | `{}` | | `alerting.twilio` | Settings for alerts of type `twilio`. <br />See [Configuring Twilio alerts](#configuring-twilio-alerts). | `{}` |
| `alerting.custom` | Configuration for custom actions on failure or alerts. <br />See [Configuring Custom alerts](#configuring-custom-alerts). | `{}` | | `alerting.custom` | Configuration for custom actions on failure or alerts. <br />See [Configuring Custom alerts](#configuring-custom-alerts). | `{}` |
#### Configuring Discord alerts #### Configuring Discord alerts
| Parameter | Description | Default |
|:---------------------------------|:-------------------------------------------------------------------------------------------|:--------------| | Parameter | Description | Default |
| `alerting.discord` | Configuration for alerts of type `discord` | `{}` | |:-------------------------------------------|:-------------------------------------------------------------------------------------------|:--------------|
| `alerting.discord.webhook-url` | Discord Webhook URL | Required `""` | | `alerting.discord` | Configuration for alerts of type `discord` | `{}` |
| `alerting.discord.default-alert` | Default alert configuration. <br />See [Setting a default alert](#setting-a-default-alert) | N/A | | `alerting.discord.webhook-url` | Discord Webhook URL | Required `""` |
| `alerting.discord.default-alert` | Default alert configuration. <br />See [Setting a default alert](#setting-a-default-alert) | N/A |
| `alerting.discord.overrides` | List of overrides that may be prioritized over the default configuration | `[]` |
| `alerting.discord.overrides[].group` | Endpoint group for which the configuration will be overridden by this configuration | `""` |
| `alerting.discord.overrides[].webhook-url` | Discord Webhook URL | `""` |
```yaml ```yaml
alerting: alerting:
@@ -374,10 +380,10 @@ endpoints:
send-on-resolved: true send-on-resolved: true
``` ```
#### Configuring Email alerts #### Configuring Email alerts
| Parameter | Description | Default | | Parameter | Description | Default |
|:---------------------------------- |:------------------------------------------------------------------------------------------ |:------------- | |:-----------------------------------|:-------------------------------------------------------------------------------------------|:--------------|
| `alerting.email` | Configuration for alerts of type `email` | `{}` | | `alerting.email` | Configuration for alerts of type `email` | `{}` |
| `alerting.email.from` | Email used to send the alert | Required `""` | | `alerting.email.from` | Email used to send the alert | Required `""` |
| `alerting.email.username` | Username of the SMTP server used to send the alert. If empty, uses `alerting.email.from`. | `""` | | `alerting.email.username` | Username of the SMTP server used to send the alert. If empty, uses `alerting.email.from`. | `""` |
@@ -652,16 +658,25 @@ Here's an example of what the notifications look like:
#### Configuring Teams alerts #### Configuring Teams alerts
| Parameter | Description | Default |
|:-------------------------------|:-------------------------------------------------------------------------------------------|:--------------| | Parameter | Description | Default |
| `alerting.teams` | Configuration for alerts of type `teams` | `{}` | |:-----------------------------------------|:-------------------------------------------------------------------------------------------|:--------------|
| `alerting.teams.webhook-url` | Teams Webhook URL | Required `""` | | `alerting.teams` | Configuration for alerts of type `teams` | `{}` |
| `alerting.teams.default-alert` | Default alert configuration. <br />See [Setting a default alert](#setting-a-default-alert) | N/A | | `alerting.teams.webhook-url` | Teams Webhook URL | Required `""` |
| `alerting.teams.default-alert` | Default alert configuration. <br />See [Setting a default alert](#setting-a-default-alert) | N/A |
| `alerting.teams.overrides` | List of overrides that may be prioritized over the default configuration | `[]` |
| `alerting.teams.overrides[].group` | Endpoint group for which the configuration will be overridden by this configuration | `""` |
| `alerting.teams.overrides[].webhook-url` | Teams Webhook URL | `""` |
```yaml ```yaml
alerting: alerting:
teams: teams:
webhook-url: "https://********.webhook.office.com/webhookb2/************" webhook-url: "https://********.webhook.office.com/webhookb2/************"
# You can also add group-specific to keys, which will
# override the to key above for the specified groups
overrides:
- group: "core"
webhook-url: "https://********.webhook.office.com/webhookb3/************"
endpoints: endpoints:
- name: website - name: website
@@ -676,6 +691,19 @@ endpoints:
enabled: true enabled: true
description: "healthcheck failed" description: "healthcheck failed"
send-on-resolved: true send-on-resolved: true
- name: back-end
group: core
url: "https://example.org/"
interval: 5m
conditions:
- "[STATUS] == 200"
- "[CERTIFICATE_EXPIRATION] > 48h"
alerts:
- type: teams
enabled: true
description: "healthcheck failed"
send-on-resolved: true
``` ```
Here's an example of what the notifications look like: Here's an example of what the notifications look like:
@@ -1108,11 +1136,11 @@ simple health checks used for alerting (PagerDuty/Twilio) to `30s`.
### Default timeouts ### Default timeouts
| Endpoint type | Timeout | | Endpoint type | Timeout |
|:------------- |:------- | |:---------------|:--------|
| HTTP | 10s | HTTP | 10s |
| TCP | 10s | TCP | 10s |
| ICMP | 10s | ICMP | 10s |
To modify the timeout, see [Client configuration](#client-configuration). To modify the timeout, see [Client configuration](#client-configuration).
@@ -1303,7 +1331,7 @@ web:
``` ```
### Badges ### Badges
### Uptime #### Uptime
![Uptime 1h](https://status.twin.sh/api/v1/endpoints/core_blog-external/uptimes/1h/badge.svg) ![Uptime 1h](https://status.twin.sh/api/v1/endpoints/core_blog-external/uptimes/1h/badge.svg)
![Uptime 24h](https://status.twin.sh/api/v1/endpoints/core_blog-external/uptimes/24h/badge.svg) ![Uptime 24h](https://status.twin.sh/api/v1/endpoints/core_blog-external/uptimes/24h/badge.svg)
![Uptime 7d](https://status.twin.sh/api/v1/endpoints/core_blog-external/uptimes/7d/badge.svg) ![Uptime 7d](https://status.twin.sh/api/v1/endpoints/core_blog-external/uptimes/7d/badge.svg)
@@ -1336,7 +1364,7 @@ Example:
If you'd like to see a visual example of each badge available, you can simply navigate to the endpoint's detail page. If you'd like to see a visual example of each badge available, you can simply navigate to the endpoint's detail page.
### Response time #### Response time
![Response time 1h](https://status.twin.sh/api/v1/endpoints/core_blog-external/response-times/1h/badge.svg) ![Response time 1h](https://status.twin.sh/api/v1/endpoints/core_blog-external/response-times/1h/badge.svg)
![Response time 24h](https://status.twin.sh/api/v1/endpoints/core_blog-external/response-times/24h/badge.svg) ![Response time 24h](https://status.twin.sh/api/v1/endpoints/core_blog-external/response-times/24h/badge.svg)
![Response time 7d](https://status.twin.sh/api/v1/endpoints/core_blog-external/response-times/7d/badge.svg) ![Response time 7d](https://status.twin.sh/api/v1/endpoints/core_blog-external/response-times/7d/badge.svg)
+31 -1
View File
@@ -17,17 +17,35 @@ type AlertProvider struct {
// DefaultAlert is the default alert configuration to use for endpoints with an alert of the appropriate type // DefaultAlert is the default alert configuration to use for endpoints with an alert of the appropriate type
DefaultAlert *alert.Alert `yaml:"default-alert,omitempty"` DefaultAlert *alert.Alert `yaml:"default-alert,omitempty"`
// Overrides is a list of Override that may be prioritized over the default configuration
Overrides []Override `yaml:"overrides,omitempty"`
}
// Override is a case under which the default integration is overridden
type Override struct {
Group string `yaml:"group"`
WebhookURL string `yaml:"webhook-url"`
} }
// IsValid returns whether the provider's configuration is valid // IsValid returns whether the provider's configuration is valid
func (provider *AlertProvider) IsValid() bool { func (provider *AlertProvider) IsValid() bool {
registeredGroups := make(map[string]bool)
if provider.Overrides != nil {
for _, override := range provider.Overrides {
if isAlreadyRegistered := registeredGroups[override.Group]; isAlreadyRegistered || override.Group == "" || len(override.WebhookURL) == 0 {
return false
}
registeredGroups[override.Group] = true
}
}
return len(provider.WebhookURL) > 0 return len(provider.WebhookURL) > 0
} }
// Send an alert using the provider // Send an alert using the provider
func (provider *AlertProvider) Send(endpoint *core.Endpoint, alert *alert.Alert, result *core.Result, resolved bool) error { func (provider *AlertProvider) Send(endpoint *core.Endpoint, alert *alert.Alert, result *core.Result, resolved bool) error {
buffer := bytes.NewBuffer([]byte(provider.buildRequestBody(endpoint, alert, result, resolved))) buffer := bytes.NewBuffer([]byte(provider.buildRequestBody(endpoint, alert, result, resolved)))
request, err := http.NewRequest(http.MethodPost, provider.WebhookURL, buffer) request, err := http.NewRequest(http.MethodPost, provider.getWebhookURLForGroup(endpoint.Group), buffer)
if err != nil { if err != nil {
return err return err
} }
@@ -86,6 +104,18 @@ func (provider *AlertProvider) buildRequestBody(endpoint *core.Endpoint, alert *
}`, message, description, colorCode, results) }`, message, description, colorCode, results)
} }
// getWebhookURLForGroup returns the appropriate Webhook URL integration to for a given group
func (provider *AlertProvider) getWebhookURLForGroup(group string) string {
if provider.Overrides != nil {
for _, override := range provider.Overrides {
if group == override.Group {
return override.WebhookURL
}
}
}
return provider.WebhookURL
}
// GetDefaultAlert returns the provider's default alert configuration // GetDefaultAlert returns the provider's default alert configuration
func (provider AlertProvider) GetDefaultAlert() *alert.Alert { func (provider AlertProvider) GetDefaultAlert() *alert.Alert {
return provider.DefaultAlert return provider.DefaultAlert
+100
View File
@@ -22,6 +22,43 @@ func TestAlertProvider_IsValid(t *testing.T) {
} }
} }
func TestAlertProvider_IsValidWithOverride(t *testing.T) {
providerWithInvalidOverrideGroup := AlertProvider{
Overrides: []Override{
{
WebhookURL: "http://example.com",
Group: "",
},
},
}
if providerWithInvalidOverrideGroup.IsValid() {
t.Error("provider Group shouldn't have been valid")
}
providerWithInvalidOverrideTo := AlertProvider{
Overrides: []Override{
{
WebhookURL: "",
Group: "group",
},
},
}
if providerWithInvalidOverrideTo.IsValid() {
t.Error("provider integration key shouldn't have been valid")
}
providerWithValidOverride := AlertProvider{
WebhookURL: "http://example.com",
Overrides: []Override{
{
WebhookURL: "http://example.com",
Group: "group",
},
},
}
if !providerWithValidOverride.IsValid() {
t.Error("provider should've been valid")
}
}
func TestAlertProvider_Send(t *testing.T) { func TestAlertProvider_Send(t *testing.T) {
defer client.InjectHTTPClient(nil) defer client.InjectHTTPClient(nil)
firstDescription := "description-1" firstDescription := "description-1"
@@ -156,3 +193,66 @@ func TestAlertProvider_GetDefaultAlert(t *testing.T) {
t.Error("expected default alert to be nil") t.Error("expected default alert to be nil")
} }
} }
func TestAlertProvider_getWebhookURLForGroup(t *testing.T) {
tests := []struct {
Name string
Provider AlertProvider
InputGroup string
ExpectedOutput string
}{
{
Name: "provider-no-override-specify-no-group-should-default",
Provider: AlertProvider{
WebhookURL: "http://example.com",
Overrides: nil,
},
InputGroup: "",
ExpectedOutput: "http://example.com",
},
{
Name: "provider-no-override-specify-group-should-default",
Provider: AlertProvider{
WebhookURL: "http://example.com",
Overrides: nil,
},
InputGroup: "group",
ExpectedOutput: "http://example.com",
},
{
Name: "provider-with-override-specify-no-group-should-default",
Provider: AlertProvider{
WebhookURL: "http://example.com",
Overrides: []Override{
{
Group: "group",
WebhookURL: "http://example01.com",
},
},
},
InputGroup: "",
ExpectedOutput: "http://example.com",
},
{
Name: "provider-with-override-specify-group-should-override",
Provider: AlertProvider{
WebhookURL: "http://example.com",
Overrides: []Override{
{
Group: "group",
WebhookURL: "http://example01.com",
},
},
},
InputGroup: "group",
ExpectedOutput: "http://example01.com",
},
}
for _, tt := range tests {
t.Run(tt.Name, func(t *testing.T) {
if got := tt.Provider.getWebhookURLForGroup(tt.InputGroup); got != tt.ExpectedOutput {
t.Errorf("AlertProvider.getWebhookURLForGroup() = %v, want %v", got, tt.ExpectedOutput)
}
})
}
}
+31 -1
View File
@@ -17,17 +17,35 @@ type AlertProvider struct {
// DefaultAlert is the default alert configuration to use for endpoints with an alert of the appropriate type // DefaultAlert is the default alert configuration to use for endpoints with an alert of the appropriate type
DefaultAlert *alert.Alert `yaml:"default-alert,omitempty"` DefaultAlert *alert.Alert `yaml:"default-alert,omitempty"`
// Overrides is a list of Override that may be prioritized over the default configuration
Overrides []Override `yaml:"overrides,omitempty"`
}
// Override is a case under which the default integration is overridden
type Override struct {
Group string `yaml:"group"`
WebhookURL string `yaml:"webhook-url"`
} }
// IsValid returns whether the provider's configuration is valid // IsValid returns whether the provider's configuration is valid
func (provider *AlertProvider) IsValid() bool { func (provider *AlertProvider) IsValid() bool {
registeredGroups := make(map[string]bool)
if provider.Overrides != nil {
for _, override := range provider.Overrides {
if isAlreadyRegistered := registeredGroups[override.Group]; isAlreadyRegistered || override.Group == "" || len(override.WebhookURL) == 0 {
return false
}
registeredGroups[override.Group] = true
}
}
return len(provider.WebhookURL) > 0 return len(provider.WebhookURL) > 0
} }
// Send an alert using the provider // Send an alert using the provider
func (provider *AlertProvider) Send(endpoint *core.Endpoint, alert *alert.Alert, result *core.Result, resolved bool) error { func (provider *AlertProvider) Send(endpoint *core.Endpoint, alert *alert.Alert, result *core.Result, resolved bool) error {
buffer := bytes.NewBuffer([]byte(provider.buildRequestBody(endpoint, alert, result, resolved))) buffer := bytes.NewBuffer([]byte(provider.buildRequestBody(endpoint, alert, result, resolved)))
request, err := http.NewRequest(http.MethodPost, provider.WebhookURL, buffer) request, err := http.NewRequest(http.MethodPost, provider.getWebhookURLForGroup(endpoint.Group), buffer)
if err != nil { if err != nil {
return err return err
} }
@@ -86,6 +104,18 @@ func (provider *AlertProvider) buildRequestBody(endpoint *core.Endpoint, alert *
}`, color, message, description, endpoint.URL, results) }`, color, message, description, endpoint.URL, results)
} }
// getWebhookURLForGroup returns the appropriate Webhook URL integration to for a given group
func (provider *AlertProvider) getWebhookURLForGroup(group string) string {
if provider.Overrides != nil {
for _, override := range provider.Overrides {
if group == override.Group {
return override.WebhookURL
}
}
}
return provider.WebhookURL
}
// GetDefaultAlert returns the provider's default alert configuration // GetDefaultAlert returns the provider's default alert configuration
func (provider AlertProvider) GetDefaultAlert() *alert.Alert { func (provider AlertProvider) GetDefaultAlert() *alert.Alert {
return provider.DefaultAlert return provider.DefaultAlert
+101 -1
View File
@@ -11,7 +11,7 @@ import (
"github.com/TwiN/gatus/v3/test" "github.com/TwiN/gatus/v3/test"
) )
func TestAlertProvider_IsValid(t *testing.T) { func TestAlertDefaultProvider_IsValid(t *testing.T) {
invalidProvider := AlertProvider{WebhookURL: ""} invalidProvider := AlertProvider{WebhookURL: ""}
if invalidProvider.IsValid() { if invalidProvider.IsValid() {
t.Error("provider shouldn't have been valid") t.Error("provider shouldn't have been valid")
@@ -22,6 +22,43 @@ func TestAlertProvider_IsValid(t *testing.T) {
} }
} }
func TestAlertProvider_IsValidWithOverride(t *testing.T) {
providerWithInvalidOverrideGroup := AlertProvider{
Overrides: []Override{
{
WebhookURL: "http://example.com",
Group: "",
},
},
}
if providerWithInvalidOverrideGroup.IsValid() {
t.Error("provider Group shouldn't have been valid")
}
providerWithInvalidOverrideTo := AlertProvider{
Overrides: []Override{
{
WebhookURL: "",
Group: "group",
},
},
}
if providerWithInvalidOverrideTo.IsValid() {
t.Error("provider integration key shouldn't have been valid")
}
providerWithValidOverride := AlertProvider{
WebhookURL: "http://example.com",
Overrides: []Override{
{
WebhookURL: "http://example.com",
Group: "group",
},
},
}
if !providerWithValidOverride.IsValid() {
t.Error("provider should've been valid")
}
}
func TestAlertProvider_Send(t *testing.T) { func TestAlertProvider_Send(t *testing.T) {
defer client.InjectHTTPClient(nil) defer client.InjectHTTPClient(nil)
firstDescription := "description-1" firstDescription := "description-1"
@@ -156,3 +193,66 @@ func TestAlertProvider_GetDefaultAlert(t *testing.T) {
t.Error("expected default alert to be nil") t.Error("expected default alert to be nil")
} }
} }
func TestAlertProvider_getWebhookURLForGroup(t *testing.T) {
tests := []struct {
Name string
Provider AlertProvider
InputGroup string
ExpectedOutput string
}{
{
Name: "provider-no-override-specify-no-group-should-default",
Provider: AlertProvider{
WebhookURL: "http://example.com",
Overrides: nil,
},
InputGroup: "",
ExpectedOutput: "http://example.com",
},
{
Name: "provider-no-override-specify-group-should-default",
Provider: AlertProvider{
WebhookURL: "http://example.com",
Overrides: nil,
},
InputGroup: "group",
ExpectedOutput: "http://example.com",
},
{
Name: "provider-with-override-specify-no-group-should-default",
Provider: AlertProvider{
WebhookURL: "http://example.com",
Overrides: []Override{
{
Group: "group",
WebhookURL: "http://example01.com",
},
},
},
InputGroup: "",
ExpectedOutput: "http://example.com",
},
{
Name: "provider-with-override-specify-group-should-override",
Provider: AlertProvider{
WebhookURL: "http://example.com",
Overrides: []Override{
{
Group: "group",
WebhookURL: "http://example01.com",
},
},
},
InputGroup: "group",
ExpectedOutput: "http://example01.com",
},
}
for _, tt := range tests {
t.Run(tt.Name, func(t *testing.T) {
if got := tt.Provider.getWebhookURLForGroup(tt.InputGroup); got != tt.ExpectedOutput {
t.Errorf("AlertProvider.getToForGroup() = %v, want %v", got, tt.ExpectedOutput)
}
})
}
}
+10 -3
View File
@@ -53,7 +53,14 @@ maintenance:
duration: 4h duration: 4h
every: [Monday, Thursday] every: [Monday, Thursday]
ui: ui:
title: Test title: T
header: H
link: https://example.org
buttons:
- name: "Home"
link: "https://example.org"
- name: "Status page"
link: "https://status.example.org"
endpoints: endpoints:
- name: website - name: website
url: https://twin.sh/health url: https://twin.sh/health
@@ -88,8 +95,8 @@ endpoints:
if config.Storage == nil || config.Storage.Path != file || config.Storage.Type != storage.TypeSQLite { if config.Storage == nil || config.Storage.Path != file || config.Storage.Type != storage.TypeSQLite {
t.Error("expected storage to be set to sqlite, got", config.Storage) t.Error("expected storage to be set to sqlite, got", config.Storage)
} }
if config.UI == nil || config.UI.Title != "Test" { if config.UI == nil || config.UI.Title != "T" || config.UI.Header != "H" || config.UI.Link != "https://example.org" || len(config.UI.Buttons) != 2 || config.UI.Buttons[0].Name != "Home" || config.UI.Buttons[0].Link != "https://example.org" || config.UI.Buttons[1].Name != "Status page" || config.UI.Buttons[1].Link != "https://status.example.org" {
t.Error("Expected Config.UI.Title to be Test") t.Error("expected ui to be set to T, H, https://example.org, 2 buttons, Home and Status page, got", config.UI)
} }
if mc := config.Maintenance; mc == nil || mc.Start != "00:00" || !mc.IsEnabled() || mc.Duration != 4*time.Hour || len(mc.Every) != 2 { if mc := config.Maintenance; mc == nil || mc.Start != "00:00" || !mc.IsEnabled() || mc.Duration != 4*time.Hour || len(mc.Every) != 2 {
t.Error("Expected Config.Maintenance to be configured properly") t.Error("Expected Config.Maintenance to be configured properly")
+28 -4
View File
@@ -2,6 +2,7 @@ package ui
import ( import (
"bytes" "bytes"
"errors"
"html/template" "html/template"
) )
@@ -16,14 +17,31 @@ var (
// StaticFolder is the path to the location of the static folder from the root path of the project // StaticFolder is the path to the location of the static folder from the root path of the project
// The only reason this is exposed is to allow running tests from a different path than the root path of the project // The only reason this is exposed is to allow running tests from a different path than the root path of the project
StaticFolder = "./web/static" StaticFolder = "./web/static"
ErrButtonValidationFailed = errors.New("invalid button configuration: missing required name or link")
) )
// Config is the configuration for the UI of Gatus // Config is the configuration for the UI of Gatus
type Config struct { type Config struct {
Title string `yaml:"title,omitempty"` // Title of the page Title string `yaml:"title,omitempty"` // Title of the page
Header string `yaml:"header,omitempty"` // Header is the text at the top of the page Header string `yaml:"header,omitempty"` // Header is the text at the top of the page
Logo string `yaml:"logo,omitempty"` // Logo to display on the page Logo string `yaml:"logo,omitempty"` // Logo to display on the page
Link string `yaml:"link,omitempty"` // Link to open when clicking on the logo Link string `yaml:"link,omitempty"` // Link to open when clicking on the logo
Buttons []Button `yaml:"buttons,omitempty"` // Buttons to display below the header
}
// Button is the configuration for a button on the UI
type Button struct {
Name string `yaml:"name,omitempty"` // Name is the text to display on the button
Link string `yaml:"link,omitempty"` // Link to open when the button is clicked.
}
// Validate validates the button configuration
func (btn *Button) Validate() error {
if len(btn.Name) == 0 || len(btn.Link) == 0 {
return ErrButtonValidationFailed
}
return nil
} }
// GetDefaultConfig returns a Config struct with the default values // GetDefaultConfig returns a Config struct with the default values
@@ -47,6 +65,12 @@ func (cfg *Config) ValidateAndSetDefaults() error {
if len(cfg.Header) == 0 { if len(cfg.Header) == 0 {
cfg.Header = defaultLink cfg.Header = defaultLink
} }
for _, btn := range cfg.Buttons {
if err := btn.Validate(); err != nil {
return err
}
}
// Validate that the template works
t, err := template.ParseFiles(StaticFolder + "/index.html") t, err := template.ParseFiles(StaticFolder + "/index.html")
if err != nil { if err != nil {
return err return err
+40
View File
@@ -1,6 +1,7 @@
package ui package ui
import ( import (
"strconv"
"testing" "testing"
) )
@@ -26,6 +27,45 @@ func TestConfig_ValidateAndSetDefaults(t *testing.T) {
} }
} }
func TestButton_Validate(t *testing.T) {
scenarios := []struct {
Name, Link string
ExpectedError error
}{
{
Name: "",
Link: "",
ExpectedError: ErrButtonValidationFailed,
},
{
Name: "",
Link: "link",
ExpectedError: ErrButtonValidationFailed,
},
{
Name: "name",
Link: "",
ExpectedError: ErrButtonValidationFailed,
},
{
Name: "name",
Link: "link",
ExpectedError: nil,
},
}
for i, scenario := range scenarios {
t.Run(strconv.Itoa(i)+"_"+scenario.Name+"_"+scenario.Link, func(t *testing.T) {
button := &Button{
Name: scenario.Name,
Link: scenario.Link,
}
if err := button.Validate(); err != scenario.ExpectedError {
t.Errorf("expected error %v, got %v", scenario.ExpectedError, err)
}
})
}
}
func TestGetDefaultConfig(t *testing.T) { func TestGetDefaultConfig(t *testing.T) {
defaultConfig := GetDefaultConfig() defaultConfig := GetDefaultConfig()
if defaultConfig.Title != defaultTitle { if defaultConfig.Title != defaultTitle {
+2 -2
View File
@@ -1,12 +1,12 @@
module github.com/TwiN/gatus/v3 module github.com/TwiN/gatus/v3
go 1.17 go 1.18
require ( require (
github.com/TwiN/g8 v1.3.0 github.com/TwiN/g8 v1.3.0
github.com/TwiN/gocache v1.2.4 github.com/TwiN/gocache v1.2.4
github.com/TwiN/gocache/v2 v2.0.0 github.com/TwiN/gocache/v2 v2.0.0
github.com/TwiN/health v1.3.0 github.com/TwiN/health v1.4.0
github.com/coreos/go-oidc/v3 v3.1.0 github.com/coreos/go-oidc/v3 v3.1.0
github.com/go-ping/ping v0.0.0-20210911151512-381826476871 github.com/go-ping/ping v0.0.0-20210911151512-381826476871
github.com/google/uuid v1.3.0 github.com/google/uuid v1.3.0
+2 -6
View File
@@ -39,8 +39,8 @@ github.com/TwiN/gocache v1.2.4 h1:AfJ1YRcxtQ/zZEN61URDwk/dwFG7LSRenU5qIm9dQzo=
github.com/TwiN/gocache v1.2.4/go.mod h1:BjabsQQy6z5uHDorHa4LJVPEzFeitLIDbCtdv3gc1gA= github.com/TwiN/gocache v1.2.4/go.mod h1:BjabsQQy6z5uHDorHa4LJVPEzFeitLIDbCtdv3gc1gA=
github.com/TwiN/gocache/v2 v2.0.0 h1:CPbDNKdSJpmBkh7aWcO7D3KK1yWaMlwX+3dsBPE8/so= github.com/TwiN/gocache/v2 v2.0.0 h1:CPbDNKdSJpmBkh7aWcO7D3KK1yWaMlwX+3dsBPE8/so=
github.com/TwiN/gocache/v2 v2.0.0/go.mod h1:j4MABVaia2Tp53ERWc/3l4YxkswtPjB2hQzmL/kD/VQ= github.com/TwiN/gocache/v2 v2.0.0/go.mod h1:j4MABVaia2Tp53ERWc/3l4YxkswtPjB2hQzmL/kD/VQ=
github.com/TwiN/health v1.3.0 h1:xw90rZqg0NH5MRkVHzlgtDdP+EQd43v3yMqQVtYlGHg= github.com/TwiN/health v1.4.0 h1:Ts7lb4ihYDpVEbFSGAhSEZTSwuDOADnwJLFngFl4xzw=
github.com/TwiN/health v1.3.0/go.mod h1:Bt+lEvSi6C/9NWb7OoGmUmgtS4dfPeMM9EINnURv5dE= github.com/TwiN/health v1.4.0/go.mod h1:CSUh+ryfD2POS2vKtc/yO4IxgR58lKvQ0/8qnoPqPqs=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
@@ -240,7 +240,6 @@ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU=
go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4=
@@ -289,7 +288,6 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38= golang.org/x/mod v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38=
golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -327,7 +325,6 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211209124913-491a49abca63 h1:iocB37TsdFuN6IBRZ+ry36wrkoV51/tl5vOWqkcPGvY= golang.org/x/net v0.0.0-20211209124913-491a49abca63 h1:iocB37TsdFuN6IBRZ+ry36wrkoV51/tl5vOWqkcPGvY=
golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
@@ -396,7 +393,6 @@ golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210902050250-f475640dd07b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210902050250-f475640dd07b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211003122950-b1ebd4e1001c h1:EyJTLQbOxvk8V6oDdD8ILR1BOs3nEJXThD6aqsiPNkM= golang.org/x/sys v0.0.0-20211003122950-b1ebd4e1001c h1:EyJTLQbOxvk8V6oDdD8ILR1BOs3nEJXThD6aqsiPNkM=
golang.org/x/sys v0.0.0-20211003122950-b1ebd4e1001c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211003122950-b1ebd4e1001c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2021 TwiN Copyright (c) 2022 TwiN
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+3
View File
@@ -1,2 +1,5 @@
bench: bench:
go test -bench . -race go test -bench . -race
test:
go test . -race
+10 -3
View File
@@ -1,5 +1,5 @@
# health # health
![build](https://github.com/TwiN/health/workflows/build/badge.svg?branch=master) ![test](https://github.com/TwiN/health/workflows/test/badge.svg?branch=master)
[![Go Report Card](https://goreportcard.com/badge/github.com/TwiN/health)](https://goreportcard.com/report/github.com/TwiN/health) [![Go Report Card](https://goreportcard.com/badge/github.com/TwiN/health)](https://goreportcard.com/report/github.com/TwiN/health)
[![codecov](https://codecov.io/gh/TwiN/health/branch/master/graph/badge.svg)](https://codecov.io/gh/TwiN/health) [![codecov](https://codecov.io/gh/TwiN/health/branch/master/graph/badge.svg)](https://codecov.io/gh/TwiN/health)
[![Go version](https://img.shields.io/github/go-mod/go-version/TwiN/health.svg)](https://github.com/TwiN/health) [![Go version](https://img.shields.io/github/go-mod/go-version/TwiN/health.svg)](https://github.com/TwiN/health)
@@ -12,7 +12,7 @@ it over and over again.
## Installation ## Installation
``` ```console
go get -u github.com/TwiN/health go get -u github.com/TwiN/health
``` ```
@@ -37,7 +37,11 @@ The above will cause the response body to become `{"status":"UP"}` and `{"status
unless there is a reason, in which case a reason set to `because` would return `{"status":"UP", "reason":"because"}` unless there is a reason, in which case a reason set to `because` would return `{"status":"UP", "reason":"because"}`
and `{"status":"DOWN", "reason":"because"}` respectively. and `{"status":"DOWN", "reason":"because"}` respectively.
To change the health of the application, you can use `health.SetStatus(<status>)` where `<status>` is one `health.Up` To set the health status to `DOWN`, you may use `health.SetUnhealthy("<enter reason here>`)` -- the
string passed will be automatically set as the reason. In a similar fashion, to set the health status to `UP`,
you may use `health.SetHealthy()`.
Alternatively, to change the health of the application, you can use `health.SetStatus(<status>)` where `<status>` is `health.Up`
or `health.Down`: or `health.Down`:
```go ```go
health.SetStatus(health.Up) health.SetStatus(health.Up)
@@ -51,6 +55,9 @@ health.SetReason("database is unreachable")
Generally speaking, you'd only want to include a reason if the status is `Down`, but you can do as you desire. Generally speaking, you'd only want to include a reason if the status is `Down`, but you can do as you desire.
For the sake of convenience, you can also use `health.SetStatusAndReason(<status>, <reason>)` instead of doing
`health.SetStatus(<status>)` and `health.SetReason(<reason>)` separately.
### Complete example ### Complete example
```go ```go
+21 -2
View File
@@ -13,6 +13,7 @@ var (
} }
) )
// responseBody is the body of the response returned by the health handler.
type responseBody struct { type responseBody struct {
Status string `json:"status"` Status string `json:"status"`
Reason string `json:"reason,omitempty"` Reason string `json:"reason,omitempty"`
@@ -20,8 +21,7 @@ type responseBody struct {
// healthHandler is the HTTP handler for serving the health endpoint // healthHandler is the HTTP handler for serving the health endpoint
type healthHandler struct { type healthHandler struct {
useJSON bool useJSON bool
resetReasonOnUp bool
status Status status Status
reason string reason string
@@ -104,3 +104,22 @@ func SetStatusAndReason(status Status, reason string) {
handler.reason = reason handler.reason = reason
handler.mutex.Unlock() handler.mutex.Unlock()
} }
// SetHealthy sets the status to Up and the reason to a blank string
func SetHealthy() {
handler.mutex.Lock()
handler.status = Up
handler.reason = ""
handler.mutex.Unlock()
}
// SetUnhealthy sets the status to Down and the reason to the string passed as parameter
//
// Unlike SetHealthy, this function enforces setting a reason, because it's good practice to give at least a bit
// of information as to why an application is unhealthy, and this library attempts to promote good practices.
func SetUnhealthy(reason string) {
handler.mutex.Lock()
handler.status = Down
handler.reason = reason
handler.mutex.Unlock()
}
+2 -2
View File
@@ -7,8 +7,8 @@ github.com/TwiN/gocache
# github.com/TwiN/gocache/v2 v2.0.0 # github.com/TwiN/gocache/v2 v2.0.0
## explicit; go 1.17 ## explicit; go 1.17
github.com/TwiN/gocache/v2 github.com/TwiN/gocache/v2
# github.com/TwiN/health v1.3.0 # github.com/TwiN/health v1.4.0
## explicit; go 1.17 ## explicit; go 1.18
github.com/TwiN/health github.com/TwiN/health
# github.com/beorn7/perks v1.0.1 # github.com/beorn7/perks v1.0.1
## explicit; go 1.11 ## explicit; go 1.11
+1095 -1863
View File
File diff suppressed because it is too large. Load diff
+12 -12
View File
@@ -1,6 +1,6 @@
{ {
"name": "gatus", "name": "gatus",
"version": "3.6.0", "version": "3.7.0",
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "vue-cli-service serve --mode development", "serve": "vue-cli-service serve --mode development",
@@ -8,22 +8,22 @@
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"
}, },
"dependencies": { "dependencies": {
"core-js": "3.21.0", "core-js": "3.22.2",
"vue": "3.2.21", "vue": "3.2.33",
"vue-router": "4.0.12" "vue-router": "4.0.14"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "5.0.0-rc.2", "@vue/cli-plugin-babel": "5.0.4",
"@vue/cli-plugin-eslint": "5.0.0-rc.2", "@vue/cli-plugin-eslint": "5.0.4",
"@vue/cli-plugin-router": "5.0.0-rc.2", "@vue/cli-plugin-router": "5.0.4",
"@vue/cli-service": "5.0.0-rc.2", "@vue/cli-service": "5.0.4",
"@vue/compiler-sfc": "3.2.29", "@vue/compiler-sfc": "3.2.33",
"autoprefixer": "10.4.2", "autoprefixer": "10.4.5",
"babel-eslint": "10.1.0", "babel-eslint": "10.1.0",
"eslint": "7.32.0", "eslint": "7.32.0",
"eslint-plugin-vue": "7.20.0", "eslint-plugin-vue": "7.20.0",
"postcss": "8.4.6", "postcss": "8.4.12",
"tailwindcss": "3.0.18" "tailwindcss": "3.0.24"
}, },
"eslintConfig": { "eslintConfig": {
"root": true, "root": true,
+1 -1
View File
@@ -3,7 +3,7 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<script type="text/javascript"> <script type="text/javascript">
window.config = {logo: "{{ .Logo }}", header: "{{ .Header }}", link: "{{ .Link }}"}; window.config = {logo: "{{ .Logo }}", header: "{{ .Header }}", link: "{{ .Link }}", buttons: []};{{- range .Buttons}}window.config.buttons.push({name:"{{ .Name }}",link:"{{ .Link }}"});{{end}}
</script> </script>
<title>{{ .Title }}</title> <title>{{ .Title }}</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
+8
View File
@@ -13,6 +13,11 @@
</a> </a>
</div> </div>
</div> </div>
<div v-if="buttons" class="flex flex-wrap">
<a v-for="button in buttons" :key="button.name" :href="button.link" target="_blank" class="px-2 py-0.5 font-medium select-none text-gray-600 hover:text-gray-500 dark:text-gray-300 dark:hover:text-gray-400 hover:underline">
{{ button.name }}
</a>
</div>
</div> </div>
<router-view @showTooltip="showTooltip" /> <router-view @showTooltip="showTooltip" />
</div> </div>
@@ -85,6 +90,9 @@ export default {
}, },
link() { link() {
return window.config && window.config.link && window.config.link !== '{{ .Link }}' ? window.config.link : null; return window.config && window.config.link && window.config.link !== '{{ .Link }}' ? window.config.link : null;
},
buttons() {
return window.config && window.config.buttons ? window.config.buttons : [];
} }
}, },
data() { data() {
+2 -2
View File
@@ -1,5 +1,5 @@
#social[data-v-a4b3d200]{position:fixed;right:5px;bottom:5px;padding:5px;margin:0;z-index:100}#social img[data-v-a4b3d200]{opacity:.3}#social img[data-v-a4b3d200]:hover{opacity:1}#tooltip{position:fixed;background-color:#fff;border:1px solid #d3d3d3;border-radius:4px;padding:6px;font-size:13px}#tooltip code{color:#212529;line-height:1}#tooltip .tooltip-title{font-weight:700;margin-bottom:0;display:block;margin-top:8px}#tooltip>.tooltip-title:first-child{margin-top:0} #social[data-v-a4b3d200]{position:fixed;right:5px;bottom:5px;padding:5px;margin:0;z-index:100}#social img[data-v-a4b3d200]{opacity:.3}#social img[data-v-a4b3d200]:hover{opacity:1}#tooltip{position:fixed;background-color:#fff;border:1px solid #d3d3d3;border-radius:4px;padding:6px;font-size:13px}#tooltip code{color:#212529;line-height:1}#tooltip .tooltip-title{font-weight:700;margin-bottom:0;display:block;margin-top:8px}#tooltip>.tooltip-title:first-child{margin-top:0}
/* /*
! tailwindcss v3.0.18 | MIT License | https://tailwindcss.com ! tailwindcss v3.0.24 | MIT License | https://tailwindcss.com
*/*,:after,:before{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:after,:before{--tw-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:Consolas,Monaco,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input:-ms-input-placeholder,textarea:-ms-input-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:after,:before{--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.invisible{visibility:hidden}.absolute{position:absolute}.relative{position:relative}.top-2{top:.5rem}.left-2{left:.5rem}.bottom-2{bottom:.5rem}.float-right{float:right}.mx-auto{margin-left:auto;margin-right:auto}.my-auto{margin-top:auto;margin-bottom:auto}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.mb-2{margin-bottom:.5rem}.mt-4{margin-top:1rem}.mt-8{margin-top:2rem}.mb-4{margin-bottom:1rem}.mt-3{margin-top:.75rem}.mt-12{margin-top:3rem}.mt-6{margin-top:1.5rem}.mb-10{margin-bottom:2.5rem}.mb-1{margin-bottom:.25rem}.mt-2{margin-top:.5rem}.mr-2{margin-right:.5rem}.mt-1{margin-top:.25rem}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.hidden{display:none}.h-64{height:16rem}.w-64{width:16rem}.w-3\/4{width:75%}.w-1\/4{width:25%}.w-full{width:100%}.w-1\/2{width:50%}.max-w-md{max-width:28rem}.max-w-lg{max-width:32rem}.flex-1{flex:1 1 0%}@-webkit-keyframes spin{to{transform:rotate(1turn)}}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1rem*var(--tw-space-x-reverse));margin-left:calc(1rem*(1 - var(--tw-space-x-reverse))Line truncated */*,:after,:before{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:after,:before{--tw-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:Consolas,Monaco,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input:-ms-input-placeholder,textarea:-ms-input-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:after,:before{--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.invisible{visibility:hidden}.absolute{position:absolute}.relative{position:relative}.top-2{top:.5rem}.left-2{left:.5rem}.bottom-2{bottom:.5rem}.float-right{float:right}.mx-auto{margin-left:auto;margin-right:auto}.my-auto{margin-top:auto;margin-bottom:auto}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.mb-2{margin-bottom:.5rem}.mt-4{margin-top:1rem}.mt-8{margin-top:2rem}.mb-4{margin-bottom:1rem}.mt-3{margin-top:.75rem}.mt-12{margin-top:3rem}.mt-6{margin-top:1.5rem}.mb-10{margin-bottom:2.5rem}.mb-1{margin-bottom:.25rem}.mt-2{margin-top:.5rem}.mr-2{margin-right:.5rem}.mt-1{margin-top:.25rem}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.hidden{display:none}.h-64{height:16rem}.w-64{width:16rem}.w-3\/4{width:75%}.w-1\/4{width:25%}.w-full{width:100%}.w-1\/2{width:50%}.max-w-md{max-width:28rem}.max-w-lg{max-width:32rem}.flex-1{flex:1 1 0%}@-webkit-keyframes spin{to{transform:rotate(1turn)}}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1rem*var(--tw-space-x-reverse));margin-left:calc(1rem*(1 - var(--tw-space-x-reverse))Line truncated
+1 -1
View File
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><script>window.config = {logo: "{{ .Logo }}", header: "{{ .Header }}", link: "{{ .Link }}"};</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" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="shortcut icon" href="/favicon.ico"/><meta property="description" content="Gatus is an advanced automated status page that lets you monitor your applications and configure alerts to notify you if there's an issue"/><script defer="defer" type="module" src="/js/chunk-vendors.js"></script><script defer="defer" type="module" src="/js/app.js"></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 }}", header: "{{ .Header }}", link: "{{ .Link }}", buttons: []};{{- range .Buttons}}window.config.buttons.push({name:"{{ .Name }}",link:"{{ .Link }}"});{{end}}</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" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="shortcut icon" href="/favicon.ico"/><meta property="description" content="Gatus is an advanced automated status page that lets you monitor your applications and configure alerts to notify you if there's an issue"/><script defer="defer" type="module" src="/js/chunk-vendors.js"></script><script defer="defer" type="module" src="/js/app.js"></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={9219:function(e,t,n){n.d(t,{L:function(){return ln}});n(6992),n(8674),n(9601),n(7727);var s=n(8061),o=(n(9254),n(6252)),r=n(6612),a=n(9574),i={class:"mb-2"},l={class:"flex flex-wrap"},u={class:"w-3/4 text-left my-auto"},g={class:"text-3xl xl:text-5xl lg:text-4xl font-light"},c={class:"w-1/4 flex justify-end"},d=["href"],h=["src"],p={key:1,src:a,alt:"Gatus",class:"object-scale-down",style:{"max-width":"100px","min-width":"50px","min-height":"50px"}},f={key:2,class:"mx-auto max-w-md pt-12"},m=(0,o._)("img",{src:a,alt:"Gatus",class:"mx-auto",style:{"max-width":"160px","min-width":"50px","min-height":"50px"}},null,-1),A=(0,o._)("h2",{class:"mt-4 text-center text-4xl font-extrabold text-gray-800 dark:text-gray-200"}," Gatus ",-1),v={class:"mt-8 py-7 px-4 rounded-sm sm:bg-gray-100 sm:border sm:border-gray-300 sm:shadow-2xl sm:px-10"},w=(0,o._)("div",{class:"sm:mx-auto sm:w-full"},[(0,o._)("h2",{class:"mb-4 text-center text-xl font-bold text-gray-600 dark:text-gray-200 dark:sm:text-gray-600"}," Sign in ")],-1),y={key:0,class:"text-red-500 text-center my-2"},x={class:"text-xl"},T={key:0,class:"text-red-500"},k={key:1,class:"text-red-500"},b=["href"];function R(e,t,n,s,a,R){var I=(0,o.up)("Loading"),D=(0,o.up)("router-view"),C=(0,o.up)("Tooltip"),S=(0,o.up)("Social");return(0,o.wg)(),(0,o.iD)(o.HY,null,[a.retrievedConfig?((0,o.wg)(),(0,o.iD)("div",{key:1,class:(0,r.C_)([a.config&&a.config.oidc&&!a.config.authenticated?"hidden":"","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"},[(0,o._)("div",i,[(0,o._)("div",l,[(0,o._)("div",u,[(0,o._)("div",g,(0,r.zw)(R.header),1)]),(0,o._)("div",c,[(0,o._)("a",{href:R.link,target:"_blank",style:{width:"100px"}},[R.logo?((0,o.wg)(),(0,o.iD)("img",{key:0,src:R.logo,alt:"Gatus",class:"object-scale-down",style:{"max-width":"100px","min-width":"50px","min-height":"50px"}},null,8,h)):((0,o.wg)(),(0,o.iD)("img",p))],8,d)])])]),(0,o.Wm)(D,{onShowTooltip:R.showTooltip},null,8,["onShowTooltip"])],2)):((0,o.wg)(),(0,o.j4)(I,{key:0,class:"h-64 w-64 px-4"})),a.config&&a.config.oidc&&!a.config.authenticated?((0,o.wg)(),(0,o.iD)("div",f,[m,A,(0,o._)("div",v,[w,e.$route&&e.$route.query.error?((0,o.wg)(),(0,o.iD)("div",y,[(0,o._)("div",x,["access_denied"===e.$route.query.error?((0,o.wg)(),(0,o.iD)("span",T,"You do not have access to this status page")):((0,o.wg)(),(0,o.iD)("span",k,(0,r.zw)(e.$route.query.error),1))])])):(0,o.kq)("",!0),(0,o._)("div",null,[(0,o._)("a",{href:"".concat(a.SERVER_URL,"/oidc/login"),class:"max-w-lg mx-auto w-full flex justify-center py-3 px-4 border border-green-800 rounded-md shadow-lg text-sm text-white bg-green-700 hover:bg-green-800"}," Login with OIDC ",8,b)])])])):(0,o.kq)("",!0),(0,o.Wm)(C,{result:a.tooltip.result,event:a.tooltip.event},null,8,["result","event"]),(0,o.Wm)(S)],64)}n(1539);var I=function(e){return(0,o.dD)("data-v-a4b3d200"),e=e(),(0,o.Cn)(),e},D={id:"social"},C=I((function(){return(0,o._)("a",{href:"https://github.com/TwiN/gatus",target:"_blank",title:"Gatus on GitHub"},[(0,o._)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 16 16",class:"hover:scale-110"},[(0,o._)("path",{fill:"gray",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})])],-1)})),S=[C];function E(e,t,n,s,r,a){return(0,o.wg)(),(0,o.iD)("div",D,S)}var B={name:"Social"},P=n(3744);const H=(0,P.Z)(B,[["render",E],["__scopeId","data-v-a4b3d200"]]);var U=H,O=(n(6977),(0,o._)("div",{class:"tooltip-title"},"Timestamp:",-1)),z={id:"tooltip-timestamp"},M=(0,o._)("div",{class:"tooltip-title"},"Response time:",-1),Q={id:"tooltip-response-time"},W=(0,o._)("div",{class:"tooltip-title"},"Conditions:",-1),X={id:"tooltip-conditions"},q=(0,o._)("br",null,null,-1),Y={key:0,id:"tooltip-errors-container"},K=(0,o._)("div",{class:"tooltip-title"},"Errors:",-1),G={id:"tooltip-errors"},F=(0,o._)("br",null,null,-1);function Z(e,t,n,s,a,i){return(0,o.wg)(),(0,o.iD)("div",{id:"tooltip",ref:"tooltip",class:(0,r.C_)(a.hidden?"invisible":""),style:(0,r.j5)("top:"+a.top+"px; left:"+a.left+"px")},[n.result?(0,o.WI)(e.$slots,"default",{key:0},(function(){return[O,(0,o._)("code",z,(0,r.zw)(e.prettifyTimestamp(n.result.timestamp)),1),M,(0,o._)("code",Q,(0,r.zw)((n.result.duration/1e6).toFixed(0))+"ms",1),W,(0,o._)("code",X,[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)(n.result.conditionResults,(function(t){returLine truncated (function(){"use strict";var e={3059:function(e,t,n){n.d(t,{L:function(){return gn}});n(6992),n(8674),n(9601),n(7727);var o=n(9963),s=(n(9254),n(8309),n(6252)),r=n(3577),a=n(9574),i={class:"mb-2"},l={class:"flex flex-wrap"},u={class:"w-3/4 text-left my-auto"},g={class:"text-3xl xl:text-5xl lg:text-4xl font-light"},c={class:"w-1/4 flex justify-end"},d=["href"],h=["src"],p={key:1,src:a,alt:"Gatus",class:"object-scale-down",style:{"max-width":"100px","min-width":"50px","min-height":"50px"}},f={key:0,class:"flex flex-wrap"},m=["href"],A={key:2,class:"mx-auto max-w-md pt-12"},v=(0,s._)("img",{src:a,alt:"Gatus",class:"mx-auto",style:{"max-width":"160px","min-width":"50px","min-height":"50px"}},null,-1),w=(0,s._)("h2",{class:"mt-4 text-center text-4xl font-extrabold text-gray-800 dark:text-gray-200"}," Gatus ",-1),y={class:"mt-8 py-7 px-4 rounded-sm sm:bg-gray-100 sm:border sm:border-gray-300 sm:shadow-2xl sm:px-10"},x=(0,s._)("div",{class:"sm:mx-auto sm:w-full"},[(0,s._)("h2",{class:"mb-4 text-center text-xl font-bold text-gray-600 dark:text-gray-200 dark:sm:text-gray-600"}," Sign in ")],-1),T={key:0,class:"text-red-500 text-center my-2"},k={class:"text-xl"},b={key:0,class:"text-red-500"},R={key:1,class:"text-red-500"},I=["href"];function D(e,t,n,o,a,D){var C=(0,s.up)("Loading"),S=(0,s.up)("router-view"),E=(0,s.up)("Tooltip"),B=(0,s.up)("Social");return(0,s.wg)(),(0,s.iD)(s.HY,null,[a.retrievedConfig?((0,s.wg)(),(0,s.iD)("div",{key:1,class:(0,r.C_)([a.config&&a.config.oidc&&!a.config.authenticated?"hidden":"","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"},[(0,s._)("div",i,[(0,s._)("div",l,[(0,s._)("div",u,[(0,s._)("div",g,(0,r.zw)(D.header),1)]),(0,s._)("div",c,[(0,s._)("a",{href:D.link,target:"_blank",style:{width:"100px"}},[D.logo?((0,s.wg)(),(0,s.iD)("img",{key:0,src:D.logo,alt:"Gatus",class:"object-scale-down",style:{"max-width":"100px","min-width":"50px","min-height":"50px"}},null,8,h)):((0,s.wg)(),(0,s.iD)("img",p))],8,d)])]),D.buttons?((0,s.wg)(),(0,s.iD)("div",f,[((0,s.wg)(!0),(0,s.iD)(s.HY,null,(0,s.Ko)(D.buttons,(function(e){return(0,s.wg)(),(0,s.iD)("a",{key:e.name,href:e.link,target:"_blank",class:"px-2 py-0.5 font-medium select-none text-gray-600 hover:text-gray-500 dark:text-gray-300 dark:hover:text-gray-400 hover:underline"},(0,r.zw)(e.name),9,m)})),128))])):(0,s.kq)("",!0)]),(0,s.Wm)(S,{onShowTooltip:D.showTooltip},null,8,["onShowTooltip"])],2)):((0,s.wg)(),(0,s.j4)(C,{key:0,class:"h-64 w-64 px-4"})),a.config&&a.config.oidc&&!a.config.authenticated?((0,s.wg)(),(0,s.iD)("div",A,[v,w,(0,s._)("div",y,[x,e.$route&&e.$route.query.error?((0,s.wg)(),(0,s.iD)("div",T,[(0,s._)("div",k,["access_denied"===e.$route.query.error?((0,s.wg)(),(0,s.iD)("span",b,"You do not have access to this status page")):((0,s.wg)(),(0,s.iD)("span",R,(0,r.zw)(e.$route.query.error),1))])])):(0,s.kq)("",!0),(0,s._)("div",null,[(0,s._)("a",{href:"".concat(a.SERVER_URL,"/oidc/login"),class:"max-w-lg mx-auto w-full flex justify-center py-3 px-4 border border-green-800 rounded-md shadow-lg text-sm text-white bg-green-700 hover:bg-green-800"}," Login with OIDC ",8,I)])])])):(0,s.kq)("",!0),(0,s.Wm)(E,{result:a.tooltip.result,event:a.tooltip.event},null,8,["result","event"]),(0,s.Wm)(B)],64)}n(1539);var C=function(e){return(0,s.dD)("data-v-a4b3d200"),e=e(),(0,s.Cn)(),e},S={id:"social"},E=C((function(){return(0,s._)("a",{href:"https://github.com/TwiN/gatus",target:"_blank",title:"Gatus on GitHub"},[(0,s._)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 16 16",class:"hover:scale-110"},[(0,s._)("path",{fill:"gray",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})])],-1)})),B=[E];function P(e,t,n,o,r,a){return(0,s.wg)(),(0,s.iD)("div",S,B)}var H={name:"Social"},U=n(3744);const O=(0,U.Z)(H,[["render",P],["__scopeId","data-v-a4b3d200"]]);var z=O,M=(n(6977),(0,s._)("div",{class:"tooltip-title"},"Timestamp:",-1)),Q={id:"tooltip-timestamp"},W=(0,s._)("div",{class:"tooltip-title"},"Response time:",-1),q={id:"tooltip-response-time"},X=(0,s._)("div",{class:"tooltip-title"},"Conditions:",-1),Y={id:"tooltip-conditions"},K=(0,s._)("br",null,null,-1),G={key:0,id:"tooltip-errors-container"},F=(0,s._)("div",{class:"tooltip-title"},"Errors:",-1),Z={id:"tooltip-errors"},j=(0,s._)("br",null,null,-1);function L(e,t,n,o,a,i){return(0,s.wg)(),(0,s.iD)("div",{id:"tooltip",ref:"toLine truncated
+1 -1
View File
@@ -1 +1 @@
(function(){"use strict";var e={9219:function(e,t,s){s.d(t,{L:function(){return is}});s(7727);var n=s(8061),o=s(6252),a=s(6612),r=s(9574);const i={class:"mb-2"},l={class:"flex flex-wrap"},g={class:"w-3/4 text-left my-auto"},d={class:"text-3xl xl:text-5xl lg:text-4xl font-light"},h={class:"w-1/4 flex justify-end"},u=["href"],c=["src"],p={key:1,src:r,alt:"Gatus",class:"object-scale-down",style:{"max-width":"100px","min-width":"50px","min-height":"50px"}},m={key:2,class:"mx-auto max-w-md pt-12"},A=(0,o._)("img",{src:r,alt:"Gatus",class:"mx-auto",style:{"max-width":"160px","min-width":"50px","min-height":"50px"}},null,-1),f=(0,o._)("h2",{class:"mt-4 text-center text-4xl font-extrabold text-gray-800 dark:text-gray-200"}," Gatus ",-1),v={class:"mt-8 py-7 px-4 rounded-sm sm:bg-gray-100 sm:border sm:border-gray-300 sm:shadow-2xl sm:px-10"},w=(0,o._)("div",{class:"sm:mx-auto sm:w-full"},[(0,o._)("h2",{class:"mb-4 text-center text-xl font-bold text-gray-600 dark:text-gray-200 dark:sm:text-gray-600"}," Sign in ")],-1),y={key:0,class:"text-red-500 text-center my-2"},x={class:"text-xl"},T={key:0,class:"text-red-500"},k={key:1,class:"text-red-500"},b=["href"];function R(e,t,s,n,r,R){const I=(0,o.up)("Loading"),D=(0,o.up)("router-view"),C=(0,o.up)("Tooltip"),S=(0,o.up)("Social");return(0,o.wg)(),(0,o.iD)(o.HY,null,[r.retrievedConfig?((0,o.wg)(),(0,o.iD)("div",{key:1,class:(0,a.C_)([r.config&&r.config.oidc&&!r.config.authenticated?"hidden":"","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"},[(0,o._)("div",i,[(0,o._)("div",l,[(0,o._)("div",g,[(0,o._)("div",d,(0,a.zw)(R.header),1)]),(0,o._)("div",h,[(0,o._)("a",{href:R.link,target:"_blank",style:{width:"100px"}},[R.logo?((0,o.wg)(),(0,o.iD)("img",{key:0,src:R.logo,alt:"Gatus",class:"object-scale-down",style:{"max-width":"100px","min-width":"50px","min-height":"50px"}},null,8,c)):((0,o.wg)(),(0,o.iD)("img",p))],8,u)])])]),(0,o.Wm)(D,{onShowTooltip:R.showTooltip},null,8,["onShowTooltip"])],2)):((0,o.wg)(),(0,o.j4)(I,{key:0,class:"h-64 w-64 px-4"})),r.config&&r.config.oidc&&!r.config.authenticated?((0,o.wg)(),(0,o.iD)("div",m,[A,f,(0,o._)("div",v,[w,e.$route&&e.$route.query.error?((0,o.wg)(),(0,o.iD)("div",y,[(0,o._)("div",x,["access_denied"===e.$route.query.error?((0,o.wg)(),(0,o.iD)("span",T,"You do not have access to this status page")):((0,o.wg)(),(0,o.iD)("span",k,(0,a.zw)(e.$route.query.error),1))])])):(0,o.kq)("",!0),(0,o._)("div",null,[(0,o._)("a",{href:`${r.SERVER_URL}/oidc/login`,class:"max-w-lg mx-auto w-full flex justify-center py-3 px-4 border border-green-800 rounded-md shadow-lg text-sm text-white bg-green-700 hover:bg-green-800"}," Login with OIDC ",8,b)])])])):(0,o.kq)("",!0),(0,o.Wm)(C,{result:r.tooltip.result,event:r.tooltip.event},null,8,["result","event"]),(0,o.Wm)(S)],64)}const I=e=>((0,o.dD)("data-v-a4b3d200"),e=e(),(0,o.Cn)(),e),D={id:"social"},C=I((()=>(0,o._)("a",{href:"https://github.com/TwiN/gatus",target:"_blank",title:"Gatus on GitHub"},[(0,o._)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 16 16",class:"hover:scale-110"},[(0,o._)("path",{fill:"gray",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})])],-1))),S=[C];function E(e,t,s,n,a,r){return(0,o.wg)(),(0,o.iD)("div",D,S)}var B={name:"Social"},P=s(3744);const H=(0,P.Z)(B,[["render",E],["__scopeId","data-v-a4b3d200"]]);var U=H;const O=(0,o._)("div",{class:"tooltip-title"},"Timestamp:",-1),z={id:"tooltip-timestamp"},M=(0,o._)("div",{class:"tooltip-title"},"Response time:",-1),Q={id:"tooltip-response-time"},W=(0,o._)("div",{class:"tooltip-title"},"Conditions:",-1),X={id:"tooltip-conditions"},q=(0,o._)("br",null,null,-1),Y={key:0,id:"tooltip-errors-container"},K=(0,o._)("div",{class:"tooltip-title"},"Errors:",-1),G={id:"tooltip-errors"},F=(0,o._)("br",null,null,-1);function Z(e,t,s,n,r,i){return(0,o.wg)(),(0,o.iD)("div",{id:"tooltip",ref:"tooltip",class:(0,a.C_)(r.hidden?"invisible":""),style:(0,a.j5)("top:"+r.top+"px; left:"+r.left+"px")},[s.result?(0,o.WI)(e.$slots,"default",{key:0},(()=>[O,(0,o._)("code",z,(0,a.zw)(e.prettifyTimestamp(s.result.timestamp)),1),M,(0,o._)("code",Q,(0,a.zw)((s.result.duration/1e6).toFixed(0))+"ms",1),W,(0,o._)("code",X,[((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,a.zw)(t.success?"✓":"X")+" ~ "+(0,a.zw)(t.coLine truncated (function(){"use strict";var e={3059:function(e,t,s){s.d(t,{L:function(){return gs}});s(7727);var n=s(9963),o=s(6252),a=s(3577),r=s(9574);const i={class:"mb-2"},l={class:"flex flex-wrap"},g={class:"w-3/4 text-left my-auto"},d={class:"text-3xl xl:text-5xl lg:text-4xl font-light"},h={class:"w-1/4 flex justify-end"},u=["href"],c=["src"],p={key:1,src:r,alt:"Gatus",class:"object-scale-down",style:{"max-width":"100px","min-width":"50px","min-height":"50px"}},m={key:0,class:"flex flex-wrap"},A=["href"],f={key:2,class:"mx-auto max-w-md pt-12"},v=(0,o._)("img",{src:r,alt:"Gatus",class:"mx-auto",style:{"max-width":"160px","min-width":"50px","min-height":"50px"}},null,-1),w=(0,o._)("h2",{class:"mt-4 text-center text-4xl font-extrabold text-gray-800 dark:text-gray-200"}," Gatus ",-1),y={class:"mt-8 py-7 px-4 rounded-sm sm:bg-gray-100 sm:border sm:border-gray-300 sm:shadow-2xl sm:px-10"},x=(0,o._)("div",{class:"sm:mx-auto sm:w-full"},[(0,o._)("h2",{class:"mb-4 text-center text-xl font-bold text-gray-600 dark:text-gray-200 dark:sm:text-gray-600"}," Sign in ")],-1),T={key:0,class:"text-red-500 text-center my-2"},k={class:"text-xl"},b={key:0,class:"text-red-500"},R={key:1,class:"text-red-500"},I=["href"];function D(e,t,s,n,r,D){const C=(0,o.up)("Loading"),S=(0,o.up)("router-view"),E=(0,o.up)("Tooltip"),B=(0,o.up)("Social");return(0,o.wg)(),(0,o.iD)(o.HY,null,[r.retrievedConfig?((0,o.wg)(),(0,o.iD)("div",{key:1,class:(0,a.C_)([r.config&&r.config.oidc&&!r.config.authenticated?"hidden":"","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"},[(0,o._)("div",i,[(0,o._)("div",l,[(0,o._)("div",g,[(0,o._)("div",d,(0,a.zw)(D.header),1)]),(0,o._)("div",h,[(0,o._)("a",{href:D.link,target:"_blank",style:{width:"100px"}},[D.logo?((0,o.wg)(),(0,o.iD)("img",{key:0,src:D.logo,alt:"Gatus",class:"object-scale-down",style:{"max-width":"100px","min-width":"50px","min-height":"50px"}},null,8,c)):((0,o.wg)(),(0,o.iD)("img",p))],8,u)])]),D.buttons?((0,o.wg)(),(0,o.iD)("div",m,[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)(D.buttons,(e=>((0,o.wg)(),(0,o.iD)("a",{key:e.name,href:e.link,target:"_blank",class:"px-2 py-0.5 font-medium select-none text-gray-600 hover:text-gray-500 dark:text-gray-300 dark:hover:text-gray-400 hover:underline"},(0,a.zw)(e.name),9,A)))),128))])):(0,o.kq)("",!0)]),(0,o.Wm)(S,{onShowTooltip:D.showTooltip},null,8,["onShowTooltip"])],2)):((0,o.wg)(),(0,o.j4)(C,{key:0,class:"h-64 w-64 px-4"})),r.config&&r.config.oidc&&!r.config.authenticated?((0,o.wg)(),(0,o.iD)("div",f,[v,w,(0,o._)("div",y,[x,e.$route&&e.$route.query.error?((0,o.wg)(),(0,o.iD)("div",T,[(0,o._)("div",k,["access_denied"===e.$route.query.error?((0,o.wg)(),(0,o.iD)("span",b,"You do not have access to this status page")):((0,o.wg)(),(0,o.iD)("span",R,(0,a.zw)(e.$route.query.error),1))])])):(0,o.kq)("",!0),(0,o._)("div",null,[(0,o._)("a",{href:`${r.SERVER_URL}/oidc/login`,class:"max-w-lg mx-auto w-full flex justify-center py-3 px-4 border border-green-800 rounded-md shadow-lg text-sm text-white bg-green-700 hover:bg-green-800"}," Login with OIDC ",8,I)])])])):(0,o.kq)("",!0),(0,o.Wm)(E,{result:r.tooltip.result,event:r.tooltip.event},null,8,["result","event"]),(0,o.Wm)(B)],64)}const C=e=>((0,o.dD)("data-v-a4b3d200"),e=e(),(0,o.Cn)(),e),S={id:"social"},E=C((()=>(0,o._)("a",{href:"https://github.com/TwiN/gatus",target:"_blank",title:"Gatus on GitHub"},[(0,o._)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 16 16",class:"hover:scale-110"},[(0,o._)("path",{fill:"gray",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})])],-1))),B=[E];function P(e,t,s,n,a,r){return(0,o.wg)(),(0,o.iD)("div",S,B)}var H={name:"Social"},U=s(3744);const O=(0,U.Z)(H,[["render",P],["__scopeId","data-v-a4b3d200"]]);var z=O;const M=(0,o._)("div",{class:"tooltip-title"},"Timestamp:",-1),Q={id:"tooltip-timestamp"},W=(0,o._)("div",{class:"tooltip-title"},"Response time:",-1),q={id:"tooltip-response-time"},X=(0,o._)("div",{class:"tooltip-title"},"Conditions:",-1),Y={id:"tooltip-conditions"},K=(0,o._)("br",null,null,-1),G={key:0,id:"tooltip-errors-container"},F=(0,o._)("div",{class:"tooltip-title"},"Errors:",-1),Z={id:"tooltip-errors"},j=(0,o._)("br",null,null,-1);function L(e,t,s,n,r,i){return(0,o.wg)(),(0,o.iD)("div",{id:"tooltip",ref:"tooltip",class:(0,a.C_)(r.hidden?"invisible":""),style:(0,a.j5)("top:"+r.top+"px; left:"+r.left+"Line truncated
+4 -4
View File
@@ -1,7 +1,7 @@
(self["webpackChunkgatus"]=self["webpackChunkgatus"]||[]).push([[998],{2931:function(t,e,n){"use strict";function r(t,e){const n=Object.create(null),r=t.split(",");for(let o=0;o<r.length;o++)n[r[o]]=!0;return e?t=>!!n[t.toLowerCase()]:t=>!!n[t]}n.d(e,{Bj:function(){return k},qq:function(){return D},Fl:function(){return fe},X3:function(){return Kt},PG:function(){return Ht},dq:function(){return ne},Xl:function(){return Yt},Jd:function(){return V},WL:function(){return ae},qj:function(){return Jt},iH:function(){return re},lk:function(){return H},Um:function(){return qt},XI:function(){return oe},IU:function(){return Xt},j:function(){return z},X$:function(){return Y},SU:function(){return se}});const o=()=>{},i=Object.assign,c=Object.prototype.hasOwnProperty,s=(t,e)=>c.call(t,e),u=Array.isArray,a=t=>"[object Map]"===v(t),l=t=>"function"===typeof t,f=t=>"string"===typeof t,p=t=>"symbol"===typeof t,d=t=>null!==t&&"object"===typeof t,h=Object.prototype.toString,v=t=>h.call(t),g=t=>v(t).slice(8,-1),m=t=>f(t)&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,y=t=>{const e=Object.create(null);return n=>{const r=e[n];return r||(e[n]=t(n))}},b=/-(\w)/g,x=(y((t=>t.replace(b,((t,e)=>e?e.toUpperCase():"")))),/\B([A-Z])/g),w=(y((t=>t.replace(x,"-$1").toLowerCase())),y((t=>t.charAt(0).toUpperCase()+t.slice(1)))),_=(y((t=>t?`on${w(t)}`:"")),(t,e)=>!Object.is(t,e)),E=(t,e,n)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n})};let S;const O=[];class k{constructor(t=!1){this.active=!0,this.effects=[],this.cleanups=[],!t&&S&&(this.parent=S,this.index=(S.scopes||(S.scopes=[])).push(this)-1)}run(t){if(this.active)try{return this.on(),t()}finally{this.off()}else 0}on(){this.active&&(O.push(this),S=this)}off(){this.active&&(O.pop(),S=O[O.length-1])}stop(t){if(this.active){if(this.effects.forEach((t=>t.stop())),this.cleanups.forEach((t=>t())),this.scopes&&this.scopes.forEach((t=>t.stop(!0))),this.parent&&!t){const t=this.parent.scopes.pop();t&&t!==this&&(this.parent.scopes[this.index]=t,t.index=this.index)}this.active=!1}}}function C(t,e){e=e||S,e&&e.active&&e.effects.push(t)}const A=t=>{const e=new Set(t);return e.w=0,e.n=0,e},j=t=>(t.w&$)>0,R=t=>(t.n&$)>0,I=({deps:t})=>{if(t.length)for(let e=0;e<t.length;e++)t[e].w|=$},T=t=>{const{deps:e}=t;if(e.length){let n=0;for(let r=0;r<e.length;r++){const o=e[r];j(o)&&!R(o)?o.delete(t):e[n++]=o,o.w&=~$,o.n&=~$}e.length=n}},P=new WeakMap;let F=0,$=1;const M=30,N=[];let L;const U=Symbol(""),B=Symbol("");class D{constructor(t,e=null,n){this.fn=t,this.scheduler=e,this.active=!0,this.deps=[],C(this,n)}run(){if(!this.active)return this.fn();if(!N.includes(this))try{return N.push(L=this),W(),$=1<<++F,F<=M?I(this):G(this),this.fn()}finally{F<=M&&T(this),$=1<<--F,H(),N.pop();const t=N.length;L=t>0?N[t-1]:void 0}}stop(){this.active&&(G(this),this.onStop&&this.onStop(),this.active=!1)}}function G(t){const{deps:e}=t;if(e.length){for(let n=0;n<e.length;n++)e[n].delete(t);e.length=0}}let J=!0;const q=[];function V(){q.push(J),J=!1}function W(){q.push(J),J=!0}function H(){const t=q.pop();J=void 0===t||t}function z(t,e,n){if(!K())return;let r=P.get(t);r||P.set(t,r=new Map);let o=r.get(n);o||r.set(n,o=A());const i=void 0;X(o,i)}function K(){return J&&void 0!==L}function X(t,e){let n=!1;F<=M?R(t)||(t.n|=$,n=!j(t)):n=!t.has(L),n&&(t.add(L),L.deps.push(t))}function Y(t,e,n,r,o,i){const c=P.get(t);if(!c)return;let s=[];if("clear"===e)s=[...c.values()];else if("length"===n&&u(t))c.forEach(((t,e)=>{("length"===e||e>=r)&&s.push(t)}));else switch(void 0!==n&&s.push(c.get(n)),e){case"add":u(t)?m(n)&&s.push(c.get("length")):(s.push(c.get(U)),a(t)&&s.push(c.get(B)));break;case"delete":u(t)||(s.push(c.get(U)),a(t)&&s.push(c.get(B)));break;case"set":a(t)&&s.push(c.get(U));break}if(1===s.length)s[0]&&Z(s[0]);else{const t=[];for(const e of s)e&&t.push(...e);Z(A(t))}}function Z(t,e){for(const n of u(t)?t:[...t])(n!==L||n.allowRecurse)&&(n.scheduler?n.scheduler():n.run())}const Q=r("__proto__,__v_isRef,__isVue"),tt=new Set(Object.getOwnPropertyNames(Symbol).map((t=>Symbol[t])).filter(p)),et=ct(),nt=ct(!1,!0),rt=ct(!0),ot=it();function it(){const t={};return["includes","indexOf","lastIndexOf"].forEach((e=>{t[e]=function(...t){const n=Xt(this);for(let e=0,o=this.length;e<o;e++)z(n,"get",e+"");const r=n[e](...t);return-1===r||!1===r?n[e](...t.map(Xt)):r}})),["push","pop","shift","unshift","splice"].forEach((e=>{t[e]=function(...t){V();const n=Xt(this)[e].apply(this,t);return H(),n}})),t}function ct(t=!1,e=!1){return function(n,r,o){if("__v_isReactive"===r)return!t;if("__v_isReadonly"===r)return t;if("__v_raw"===r&&o===(t?e?Bt:Ut:e?Lt:Nt).get(n))return n;const i=u(n);if(!t&&i&&s(ot,r))return Reflect.get(ot,r,o);const c=Reflect.get(n,r,o);if(p(r)?tt.has(r):Q(r))return c;if(t||z(n,"get",r),e)return c;if(ne(c)){const t=!i||!m(r);return t?c.value:c}return d(c)?t?Vt(c):Jt(c):c}}const st=at(),ut=at(!0);function at(t=!1){return function(e,n,r,o){let i=e[n];if(!t&&(r=Xt(r),i=Xt(i),!u(e)&&ne(i)&&!ne(r)))return i.value=r,!0;conLine truncated (self["webpackChunkgatus"]=self["webpackChunkgatus"]||[]).push([[998],{2262:function(t,e,n){"use strict";n.d(e,{Bj:function(){return i},qq:function(){return b},Fl:function(){return Bt},X3:function(){return Ot},PG:function(){return kt},dq:function(){return Pt},yT:function(){return Et},Xl:function(){return Rt},Jd:function(){return k},WL:function(){return Dt},qj:function(){return bt},iH:function(){return Ft},lk:function(){return S},Um:function(){return xt},XI:function(){return Nt},IU:function(){return Ct},j:function(){return E},X$:function(){return C},SU:function(){return Ut}});var r=n(3577);let o;class i{constructor(t=!1){this.active=!0,this.effects=[],this.cleanups=[],!t&&o&&(this.parent=o,this.index=(o.scopes||(o.scopes=[])).push(this)-1)}run(t){if(this.active){const e=o;try{return o=this,t()}finally{o=e}}else 0}on(){o=this}off(){o=this.parent}stop(t){if(this.active){let e,n;for(e=0,n=this.effects.length;e<n;e++)this.effects[e].stop();for(e=0,n=this.cleanups.length;e<n;e++)this.cleanups[e]();if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].stop(!0);if(this.parent&&!t){const t=this.parent.scopes.pop();t&&t!==this&&(this.parent.scopes[this.index]=t,t.index=this.index)}this.active=!1}}}function c(t,e=o){e&&e.active&&e.effects.push(t)}const s=t=>{const e=new Set(t);return e.w=0,e.n=0,e},u=t=>(t.w&h)>0,a=t=>(t.n&h)>0,l=({deps:t})=>{if(t.length)for(let e=0;e<t.length;e++)t[e].w|=h},f=t=>{const{deps:e}=t;if(e.length){let n=0;for(let r=0;r<e.length;r++){const o=e[r];u(o)&&!a(o)?o.delete(t):e[n++]=o,o.w&=~h,o.n&=~h}e.length=n}},p=new WeakMap;let d=0,h=1;const v=30;let g;const m=Symbol(""),y=Symbol("");class b{constructor(t,e=null,n){this.fn=t,this.scheduler=e,this.active=!0,this.deps=[],this.parent=void 0,c(this,n)}run(){if(!this.active)return this.fn();let t=g,e=w;while(t){if(t===this)return;t=t.parent}try{return this.parent=g,g=this,w=!0,h=1<<++d,d<=v?l(this):x(this),this.fn()}finally{d<=v&&f(this),h=1<<--d,g=this.parent,w=e,this.parent=void 0,this.deferStop&&this.stop()}}stop(){g===this?this.deferStop=!0:this.active&&(x(this),this.onStop&&this.onStop(),this.active=!1)}}function x(t){const{deps:e}=t;if(e.length){for(let n=0;n<e.length;n++)e[n].delete(t);e.length=0}}let w=!0;const _=[];function k(){_.push(w),w=!1}function S(){const t=_.pop();w=void 0===t||t}function E(t,e,n){if(w&&g){let e=p.get(t);e||p.set(t,e=new Map);let r=e.get(n);r||e.set(n,r=s());const o=void 0;O(r,o)}}function O(t,e){let n=!1;d<=v?a(t)||(t.n|=h,n=!u(t)):n=!t.has(g),n&&(t.add(g),g.deps.push(t))}function C(t,e,n,o,i,c){const u=p.get(t);if(!u)return;let a=[];if("clear"===e)a=[...u.values()];else if("length"===n&&(0,r.kJ)(t))u.forEach(((t,e)=>{("length"===e||e>=o)&&a.push(t)}));else switch(void 0!==n&&a.push(u.get(n)),e){case"add":(0,r.kJ)(t)?(0,r.S0)(n)&&a.push(u.get("length")):(a.push(u.get(m)),(0,r._N)(t)&&a.push(u.get(y)));break;case"delete":(0,r.kJ)(t)||(a.push(u.get(m)),(0,r._N)(t)&&a.push(u.get(y)));break;case"set":(0,r._N)(t)&&a.push(u.get(m));break}if(1===a.length)a[0]&&R(a[0]);else{const t=[];for(const e of a)e&&t.push(...e);R(s(t))}}function R(t,e){for(const n of(0,r.kJ)(t)?t:[...t])(n!==g||n.allowRecurse)&&(n.scheduler?n.scheduler():n.run())}const A=(0,r.fY)("__proto__,__v_isRef,__isVue"),I=new Set(Object.getOwnPropertyNames(Symbol).map((t=>Symbol[t])).filter(r.yk)),j=M(),T=M(!1,!0),P=M(!0),F=N();function N(){const t={};return["includes","indexOf","lastIndexOf"].forEach((e=>{t[e]=function(...t){const n=Ct(this);for(let e=0,o=this.length;e<o;e++)E(n,"get",e+"");const r=n[e](...t);return-1===r||!1===r?n[e](...t.map(Ct)):r}})),["push","pop","shift","unshift","splice"].forEach((e=>{t[e]=function(...t){k();const n=Ct(this)[e].apply(this,t);return S(),n}})),t}function M(t=!1,e=!1){return function(n,o,i){if("__v_isReactive"===o)return!t;if("__v_isReadonly"===o)return t;if("__v_isShallow"===o)return e;if("__v_raw"===o&&i===(t?e?gt:vt:e?ht:dt).get(n))return n;const c=(0,r.kJ)(n);if(!t&&c&&(0,r.RI)(F,o))return Reflect.get(F,o,i);const s=Reflect.get(n,o,i);if((0,r.yk)(o)?I.has(o):A(o))return s;if(t||E(n,"get",o),e)return s;if(Pt(s)){const t=!c||!(0,r.S0)(o);return t?s.value:s}return(0,r.Kn)(s)?t?wt(s):bt(s):s}}const $=L(),U=L(!0);function L(t=!1){return function(e,n,o,i){let c=e[n];if(St(c)&&Pt(c)&&!Pt(o))return!1;if(!t&&!St(o)&&(Et(o)||(o=Ct(o),c=Ct(c)),!(0,r.kJ)(e)&&Pt(c)&&!Pt(o)))return c.value=o,!0;const s=(0,r.kJ)(e)&&(0,r.S0)(n)?Number(n)<e.length:(0,r.RI)(e,n),u=Reflect.set(e,n,o,i);return e===Ct(i)&&(s?(0,r.aU)(o,c)&&C(e,"set",n,o,c):C(e,"add",n,o)),u}}function D(t,e){const n=(0,r.RI)(t,e),o=t[e],i=Reflect.deleteProperty(t,e);return i&&n&&C(t,"delete",e,void 0,o),i}function J(t,e){const n=Reflect.has(t,e);return(0,r.yk)(e)&&I.has(e)||E(t,"has",e),n}function B(t){return E(t,"iterate",(0,r.kJ)(t)?"length":m),Reflect.ownKeys(t)}const G={get:j,set:$,deleteProperty:D,has:J,ownKeys:B},q={get:P,set(t,e){return!0},deleteProperty(t,e){return!0}},V=(0,r.l7)({},G,{get:T,set:U}),W=t=>t,H=t=>Reflect.getPrototypeOf(t);function K(t,Line truncated
/*! /*!
* vue-router v4.0.12 * vue-router v4.0.14
* (c) 2021 Eduardo San Martin Morote * (c) 2022 Eduardo San Martin Morote
* @license MIT * @license MIT
*/ */
const i="function"===typeof Symbol&&"symbol"===typeof Symbol.toStringTag,c=t=>i?Symbol(t):"_vr_"+t,s=c("rvlm"),u=c("rvd"),a=c("r"),l=c("rl"),f=c("rvl"),p="undefined"!==typeof window;function d(t){return t.__esModule||i&&"Module"===t[Symbol.toStringTag]}const h=Object.assign;function v(t,e){const n={};for(const r in e){const o=e[r];n[r]=Array.isArray(o)?o.map(t):t(o)}return n}const g=()=>{};const m=/\/$/,y=t=>t.replace(m,"");function b(t,e,n="/"){let r,o={},i="",c="";const s=e.indexOf("?"),u=e.indexOf("#",s>-1?s:0);return s>-1&&(r=e.slice(0,s),i=e.slice(s+1,u>-1?u:e.length),o=t(i)),u>-1&&(r=r||e.slice(0,u),c=e.slice(u,e.length)),r=C(null!=r?r:e,n),{fullPath:r+(i&&"?")+i+c,path:r,query:o,hash:c}}function x(t,e){const n=e.query?t(e.query):"";return e.path+(n&&"?")+n+(e.hash||"")}function w(t,e){return e&&t.toLowerCase().startsWith(e.toLowerCase())?t.slice(e.length)||"/":t}function _(t,e,n){const r=e.matched.length-1,o=n.matched.length-1;return r>-1&&r===o&&E(e.matched[r],n.matched[o])&&S(e.params,n.params)&&t(e.query)===t(n.query)&&e.hash===n.hash}function E(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function S(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(!O(t[n],e[n]))return!1;return!0}function O(t,e){return Array.isArray(t)?k(t,e):Array.isArray(e)?k(e,t):t===e}function k(t,e){return Array.isArray(e)?t.length===e.length&&t.every(((t,n)=>t===e[n])):1===t.length&&t[0]===e}function C(t,e){if(t.startsWith("/"))return t;if(!t)return e;const n=e.split("/"),r=t.split("/");let o,i,c=n.length-1;for(o=0;o<r.length;o++)if(i=r[o],1!==c&&"."!==i){if(".."!==i)break;c--}return n.slice(0,c).join("/")+"/"+r.slice(o-(o===r.length?1:0)).join("/")}var A,j;(function(t){t["pop"]="pop",t["push"]="push"})(A||(A={})),function(t){t["back"]="back",t["forward"]="forward",t["unknown"]=""}(j||(j={}));function R(t){if(!t)if(p){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return"/"!==t[0]&&"#"!==t[0]&&(t="/"+t),y(t)}const I=/^[^#]+#/;function T(t,e){return t.replace(I,"#")+e}function P(t,e){const n=document.documentElement.getBoundingClientRect(),r=t.getBoundingClientRect();return{behavior:e.behavior,left:r.left-n.left-(e.left||0),top:r.top-n.top-(e.top||0)}}const F=()=>({left:window.pageXOffset,top:window.pageYOffset});function $(t){let e;if("el"in t){const n=t.el,r="string"===typeof n&&n.startsWith("#");0;const o="string"===typeof n?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o)return;e=P(o,t)}else e=t;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(null!=e.left?e.left:window.pageXOffset,null!=e.top?e.top:window.pageYOffset)}function M(t,e){const n=history.state?history.state.position-e:-1;return n+t}const N=new Map;function L(t,e){N.set(t,e)}function U(t){const e=N.get(t);return N.delete(t),e}let B=()=>location.protocol+"//"+location.host;function D(t,e){const{pathname:n,search:r,hash:o}=e,i=t.indexOf("#");if(i>-1){let e=o.includes(t.slice(i))?t.slice(i).length:1,n=o.slice(e);return"/"!==n[0]&&(n="/"+n),w(n,"")}const c=w(n,t);return c+r+o}function G(t,e,n,r){let o=[],i=[],c=null;const s=({state:i})=>{const s=D(t,location),u=n.value,a=e.value;let l=0;if(i){if(n.value=s,e.value=i,c&&c===u)return void(c=null);l=a?i.position-a.position:0}else r(s);o.forEach((t=>{t(n.value,u,{delta:l,type:A.pop,direction:l?l>0?j.forward:j.back:j.unknown})}))};function u(){c=n.value}function a(t){o.push(t);const e=()=>{const e=o.indexOf(t);e>-1&&o.splice(e,1)};return i.push(e),e}function l(){const{history:t}=window;t.state&&t.replaceState(h({},t.state,{scroll:F()}),"")}function f(){for(const t of i)t();i=[],window.removeEventListener("popstate",s),window.removeEventListener("beforeunload",l)}return window.addEventListener("popstate",s),window.addEventListener("beforeunload",l),{pauseListeners:u,listen:a,destroy:f}}function J(t,e,n,r=!1,o=!1){return{back:t,current:e,forward:n,replaced:r,position:window.history.length,scroll:o?F():null}}function q(t){const{history:e,location:n}=window,r={value:D(t,n)},o={value:e.state};function i(r,i,c){const s=t.indexOf("#"),u=s>-1?(n.host&&document.querySelector("base")?t:t.slice(s))+r:B()+t+r;try{e[c?"replaceState":"pushState"](i,"",u),o.value=i}catch(a){console.error(a),n[c?"replace":"assign"](u)}}function c(t,n){const c=h({},e.state,J(o.value.back,t,o.value.forward,!0),n,{position:o.value.position});i(t,c,!0),r.value=t}function s(t,n){const c=h({},o.value,e.state,{forward:t,scroll:F()});i(c.current,c,!0);const s=h({},J(r.value,t,null),{position:c.position+1},n);i(t,s,!1),r.value=t}return o.value||i(r.value,{back:null,current:r.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0),{location:r,state:o,push:s,replace:c}}function V(t){t=R(t);const e=q(t),n=G(t,e.state,e.location,e.replace);function r(t,e=!0){e||n.pauseListeners(),history.go(t)}const o=h({location:"",base:t,go:r,createHref:T.bind(null,t)},e,n);return Object.defineProperty(o,"loLine truncated const i="function"===typeof Symbol&&"symbol"===typeof Symbol.toStringTag,c=t=>i?Symbol(t):"_vr_"+t,s=c("rvlm"),u=c("rvd"),a=c("r"),l=c("rl"),f=c("rvl"),p="undefined"!==typeof window;function d(t){return t.__esModule||i&&"Module"===t[Symbol.toStringTag]}const h=Object.assign;function v(t,e){const n={};for(const r in e){const o=e[r];n[r]=Array.isArray(o)?o.map(t):t(o)}return n}const g=()=>{};const m=/\/$/,y=t=>t.replace(m,"");function b(t,e,n="/"){let r,o={},i="",c="";const s=e.indexOf("?"),u=e.indexOf("#",s>-1?s:0);return s>-1&&(r=e.slice(0,s),i=e.slice(s+1,u>-1?u:e.length),o=t(i)),u>-1&&(r=r||e.slice(0,u),c=e.slice(u,e.length)),r=C(null!=r?r:e,n),{fullPath:r+(i&&"?")+i+c,path:r,query:o,hash:c}}function x(t,e){const n=e.query?t(e.query):"";return e.path+(n&&"?")+n+(e.hash||"")}function w(t,e){return e&&t.toLowerCase().startsWith(e.toLowerCase())?t.slice(e.length)||"/":t}function _(t,e,n){const r=e.matched.length-1,o=n.matched.length-1;return r>-1&&r===o&&k(e.matched[r],n.matched[o])&&S(e.params,n.params)&&t(e.query)===t(n.query)&&e.hash===n.hash}function k(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function S(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(!E(t[n],e[n]))return!1;return!0}function E(t,e){return Array.isArray(t)?O(t,e):Array.isArray(e)?O(e,t):t===e}function O(t,e){return Array.isArray(e)?t.length===e.length&&t.every(((t,n)=>t===e[n])):1===t.length&&t[0]===e}function C(t,e){if(t.startsWith("/"))return t;if(!t)return e;const n=e.split("/"),r=t.split("/");let o,i,c=n.length-1;for(o=0;o<r.length;o++)if(i=r[o],1!==c&&"."!==i){if(".."!==i)break;c--}return n.slice(0,c).join("/")+"/"+r.slice(o-(o===r.length?1:0)).join("/")}var R,A;(function(t){t["pop"]="pop",t["push"]="push"})(R||(R={})),function(t){t["back"]="back",t["forward"]="forward",t["unknown"]=""}(A||(A={}));function I(t){if(!t)if(p){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return"/"!==t[0]&&"#"!==t[0]&&(t="/"+t),y(t)}const j=/^[^#]+#/;function T(t,e){return t.replace(j,"#")+e}function P(t,e){const n=document.documentElement.getBoundingClientRect(),r=t.getBoundingClientRect();return{behavior:e.behavior,left:r.left-n.left-(e.left||0),top:r.top-n.top-(e.top||0)}}const F=()=>({left:window.pageXOffset,top:window.pageYOffset});function N(t){let e;if("el"in t){const n=t.el,r="string"===typeof n&&n.startsWith("#");0;const o="string"===typeof n?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o)return;e=P(o,t)}else e=t;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(null!=e.left?e.left:window.pageXOffset,null!=e.top?e.top:window.pageYOffset)}function M(t,e){const n=history.state?history.state.position-e:-1;return n+t}const $=new Map;function U(t,e){$.set(t,e)}function L(t){const e=$.get(t);return $.delete(t),e}let D=()=>location.protocol+"//"+location.host;function J(t,e){const{pathname:n,search:r,hash:o}=e,i=t.indexOf("#");if(i>-1){let e=o.includes(t.slice(i))?t.slice(i).length:1,n=o.slice(e);return"/"!==n[0]&&(n="/"+n),w(n,"")}const c=w(n,t);return c+r+o}function B(t,e,n,r){let o=[],i=[],c=null;const s=({state:i})=>{const s=J(t,location),u=n.value,a=e.value;let l=0;if(i){if(n.value=s,e.value=i,c&&c===u)return void(c=null);l=a?i.position-a.position:0}else r(s);o.forEach((t=>{t(n.value,u,{delta:l,type:R.pop,direction:l?l>0?A.forward:A.back:A.unknown})}))};function u(){c=n.value}function a(t){o.push(t);const e=()=>{const e=o.indexOf(t);e>-1&&o.splice(e,1)};return i.push(e),e}function l(){const{history:t}=window;t.state&&t.replaceState(h({},t.state,{scroll:F()}),"")}function f(){for(const t of i)t();i=[],window.removeEventListener("popstate",s),window.removeEventListener("beforeunload",l)}return window.addEventListener("popstate",s),window.addEventListener("beforeunload",l),{pauseListeners:u,listen:a,destroy:f}}function G(t,e,n,r=!1,o=!1){return{back:t,current:e,forward:n,replaced:r,position:window.history.length,scroll:o?F():null}}function q(t){const{history:e,location:n}=window,r={value:J(t,n)},o={value:e.state};function i(r,i,c){const s=t.indexOf("#"),u=s>-1?(n.host&&document.querySelector("base")?t:t.slice(s))+r:D()+t+r;try{e[c?"replaceState":"pushState"](i,"",u),o.value=i}catch(a){console.error(a),n[c?"replace":"assign"](u)}}function c(t,n){const c=h({},e.state,G(o.value.back,t,o.value.forward,!0),n,{position:o.value.position});i(t,c,!0),r.value=t}function s(t,n){const c=h({},o.value,e.state,{forward:t,scroll:F()});i(c.current,c,!0);const s=h({},G(r.value,t,null),{position:c.position+1},n);i(t,s,!1),r.value=t}return o.value||i(r.value,{back:null,current:r.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0),{location:r,state:o,push:s,replace:c}}function V(t){t=I(t);const e=q(t),n=B(t,e.state,e.location,e.replace);function r(t,e=!0){e||n.pauseListeners(),history.go(t)}const o=h({location:"",base:t,go:r,createHref:T.bind(null,t)},e,n);return Object.defineProperty(o,"loLine truncated
+4 -4
View File
@@ -1,7 +1,7 @@
(self["webpackChunkgatus"]=self["webpackChunkgatus"]||[]).push([[998],{2931:function(e,t,n){"use strict";function r(e,t){const n=Object.create(null),r=e.split(",");for(let o=0;o<r.length;o++)n[r[o]]=!0;return t?e=>!!n[e.toLowerCase()]:e=>!!n[e]}n.d(t,{Bj:function(){return O},qq:function(){return D},Fl:function(){return ft},X3:function(){return Ke},PG:function(){return We},dq:function(){return nt},Xl:function(){return Ze},Jd:function(){return q},WL:function(){return lt},qj:function(){return Ve},iH:function(){return rt},lk:function(){return W},Um:function(){return Je},XI:function(){return ot},IU:function(){return Xe},j:function(){return z},X$:function(){return Z},SU:function(){return ct}});const o=()=>{},i=Object.assign,s=Object.prototype.hasOwnProperty,c=(e,t)=>s.call(e,t),u=Array.isArray,l=e=>"[object Map]"===v(e),a=e=>"function"===typeof e,f=e=>"string"===typeof e,p=e=>"symbol"===typeof e,d=e=>null!==e&&"object"===typeof e,h=Object.prototype.toString,v=e=>h.call(e),g=e=>v(e).slice(8,-1),m=e=>f(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,y=e=>{const t=Object.create(null);return n=>{const r=t[n];return r||(t[n]=e(n))}},b=/-(\w)/g,x=(y((e=>e.replace(b,((e,t)=>t?t.toUpperCase():"")))),/\B([A-Z])/g),_=(y((e=>e.replace(x,"-$1").toLowerCase())),y((e=>e.charAt(0).toUpperCase()+e.slice(1)))),w=(y((e=>e?`on${_(e)}`:"")),(e,t)=>!Object.is(e,t)),S=(e,t,n)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})};let C;const k=[];class O{constructor(e=!1){this.active=!0,this.effects=[],this.cleanups=[],!e&&C&&(this.parent=C,this.index=(C.scopes||(C.scopes=[])).push(this)-1)}run(e){if(this.active)try{return this.on(),e()}finally{this.off()}else 0}on(){this.active&&(k.push(this),C=this)}off(){this.active&&(k.pop(),C=k[k.length-1])}stop(e){if(this.active){if(this.effects.forEach((e=>e.stop())),this.cleanups.forEach((e=>e())),this.scopes&&this.scopes.forEach((e=>e.stop(!0))),this.parent&&!e){const e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.active=!1}}}function E(e,t){t=t||C,t&&t.active&&t.effects.push(e)}const A=e=>{const t=new Set(e);return t.w=0,t.n=0,t},R=e=>(e.w&L)>0,j=e=>(e.n&L)>0,P=({deps:e})=>{if(e.length)for(let t=0;t<e.length;t++)e[t].w|=L},T=e=>{const{deps:t}=e;if(t.length){let n=0;for(let r=0;r<t.length;r++){const o=t[r];R(o)&&!j(o)?o.delete(e):t[n++]=o,o.w&=~L,o.n&=~L}t.length=n}},I=new WeakMap;let F=0,L=1;const $=30,M=[];let U;const N=Symbol(""),B=Symbol("");class D{constructor(e,t=null,n){this.fn=e,this.scheduler=t,this.active=!0,this.deps=[],E(this,n)}run(){if(!this.active)return this.fn();if(!M.includes(this))try{return M.push(U=this),H(),L=1<<++F,F<=$?P(this):G(this),this.fn()}finally{F<=$&&T(this),L=1<<--F,W(),M.pop();const e=M.length;U=e>0?M[e-1]:void 0}}stop(){this.active&&(G(this),this.onStop&&this.onStop(),this.active=!1)}}function G(e){const{deps:t}=e;if(t.length){for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}}let V=!0;const J=[];function q(){J.push(V),V=!1}function H(){J.push(V),V=!0}function W(){const e=J.pop();V=void 0===e||e}function z(e,t,n){if(!K())return;let r=I.get(e);r||I.set(e,r=new Map);let o=r.get(n);o||r.set(n,o=A());const i=void 0;X(o,i)}function K(){return V&&void 0!==U}function X(e,t){let n=!1;F<=$?j(e)||(e.n|=L,n=!R(e)):n=!e.has(U),n&&(e.add(U),U.deps.push(e))}function Z(e,t,n,r,o,i){const s=I.get(e);if(!s)return;let c=[];if("clear"===t)c=[...s.values()];else if("length"===n&&u(e))s.forEach(((e,t)=>{("length"===t||t>=r)&&c.push(e)}));else switch(void 0!==n&&c.push(s.get(n)),t){case"add":u(e)?m(n)&&c.push(s.get("length")):(c.push(s.get(N)),l(e)&&c.push(s.get(B)));break;case"delete":u(e)||(c.push(s.get(N)),l(e)&&c.push(s.get(B)));break;case"set":l(e)&&c.push(s.get(N));break}if(1===c.length)c[0]&&Y(c[0]);else{const e=[];for(const t of c)t&&e.push(...t);Y(A(e))}}function Y(e,t){for(const n of u(e)?e:[...e])(n!==U||n.allowRecurse)&&(n.scheduler?n.scheduler():n.run())}const Q=r("__proto__,__v_isRef,__isVue"),ee=new Set(Object.getOwnPropertyNames(Symbol).map((e=>Symbol[e])).filter(p)),te=se(),ne=se(!1,!0),re=se(!0),oe=ie();function ie(){const e={};return["includes","indexOf","lastIndexOf"].forEach((t=>{e[t]=function(...e){const n=Xe(this);for(let t=0,o=this.length;t<o;t++)z(n,"get",t+"");const r=n[t](...e);return-1===r||!1===r?n[t](...e.map(Xe)):r}})),["push","pop","shift","unshift","splice"].forEach((t=>{e[t]=function(...e){q();const n=Xe(this)[t].apply(this,e);return W(),n}})),e}function se(e=!1,t=!1){return function(n,r,o){if("__v_isReactive"===r)return!e;if("__v_isReadonly"===r)return e;if("__v_raw"===r&&o===(e?t?Be:Ne:t?Ue:Me).get(n))return n;const i=u(n);if(!e&&i&&c(oe,r))return Reflect.get(oe,r,o);const s=Reflect.get(n,r,o);if(p(r)?ee.has(r):Q(r))return s;if(e||z(n,"get",r),t)return s;if(nt(s)){const e=!i||!m(r);return e?s.value:s}return d(s)?e?qe(s):Ve(s):s}}const ce=le(),ue=le(!0);function le(e=!1){return function(t,n,r,o){let i=t[n];if(!e&&(r=Xe(r),i=Xe(i),!u(t)&&nt(i)&&!nt(r)))return i.value=r,!0;conLine truncated (self["webpackChunkgatus"]=self["webpackChunkgatus"]||[]).push([[998],{2262:function(e,t,n){"use strict";n.d(t,{Bj:function(){return i},qq:function(){return b},Fl:function(){return Be},X3:function(){return Oe},PG:function(){return ke},dq:function(){return je},yT:function(){return Ce},Xl:function(){return Re},Jd:function(){return k},WL:function(){return De},qj:function(){return be},iH:function(){return Fe},lk:function(){return S},Um:function(){return _e},XI:function(){return Le},IU:function(){return Ee},j:function(){return C},X$:function(){return E},SU:function(){return Ne}});var r=n(3577);let o;class i{constructor(e=!1){this.active=!0,this.effects=[],this.cleanups=[],!e&&o&&(this.parent=o,this.index=(o.scopes||(o.scopes=[])).push(this)-1)}run(e){if(this.active){const t=o;try{return o=this,e()}finally{o=t}}else 0}on(){o=this}off(){o=this.parent}stop(e){if(this.active){let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);if(this.parent&&!e){const e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.active=!1}}}function s(e,t=o){t&&t.active&&t.effects.push(e)}const c=e=>{const t=new Set(e);return t.w=0,t.n=0,t},u=e=>(e.w&h)>0,l=e=>(e.n&h)>0,a=({deps:e})=>{if(e.length)for(let t=0;t<e.length;t++)e[t].w|=h},f=e=>{const{deps:t}=e;if(t.length){let n=0;for(let r=0;r<t.length;r++){const o=t[r];u(o)&&!l(o)?o.delete(e):t[n++]=o,o.w&=~h,o.n&=~h}t.length=n}},p=new WeakMap;let d=0,h=1;const v=30;let g;const m=Symbol(""),y=Symbol("");class b{constructor(e,t=null,n){this.fn=e,this.scheduler=t,this.active=!0,this.deps=[],this.parent=void 0,s(this,n)}run(){if(!this.active)return this.fn();let e=g,t=x;while(e){if(e===this)return;e=e.parent}try{return this.parent=g,g=this,x=!0,h=1<<++d,d<=v?a(this):_(this),this.fn()}finally{d<=v&&f(this),h=1<<--d,g=this.parent,x=t,this.parent=void 0,this.deferStop&&this.stop()}}stop(){g===this?this.deferStop=!0:this.active&&(_(this),this.onStop&&this.onStop(),this.active=!1)}}function _(e){const{deps:t}=e;if(t.length){for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}}let x=!0;const w=[];function k(){w.push(x),x=!1}function S(){const e=w.pop();x=void 0===e||e}function C(e,t,n){if(x&&g){let t=p.get(e);t||p.set(e,t=new Map);let r=t.get(n);r||t.set(n,r=c());const o=void 0;O(r,o)}}function O(e,t){let n=!1;d<=v?l(e)||(e.n|=h,n=!u(e)):n=!e.has(g),n&&(e.add(g),g.deps.push(e))}function E(e,t,n,o,i,s){const u=p.get(e);if(!u)return;let l=[];if("clear"===t)l=[...u.values()];else if("length"===n&&(0,r.kJ)(e))u.forEach(((e,t)=>{("length"===t||t>=o)&&l.push(e)}));else switch(void 0!==n&&l.push(u.get(n)),t){case"add":(0,r.kJ)(e)?(0,r.S0)(n)&&l.push(u.get("length")):(l.push(u.get(m)),(0,r._N)(e)&&l.push(u.get(y)));break;case"delete":(0,r.kJ)(e)||(l.push(u.get(m)),(0,r._N)(e)&&l.push(u.get(y)));break;case"set":(0,r._N)(e)&&l.push(u.get(m));break}if(1===l.length)l[0]&&R(l[0]);else{const e=[];for(const t of l)t&&e.push(...t);R(c(e))}}function R(e,t){for(const n of(0,r.kJ)(e)?e:[...e])(n!==g||n.allowRecurse)&&(n.scheduler?n.scheduler():n.run())}const A=(0,r.fY)("__proto__,__v_isRef,__isVue"),I=new Set(Object.getOwnPropertyNames(Symbol).map((e=>Symbol[e])).filter(r.yk)),T=M(),P=M(!1,!0),j=M(!0),F=L();function L(){const e={};return["includes","indexOf","lastIndexOf"].forEach((t=>{e[t]=function(...e){const n=Ee(this);for(let t=0,o=this.length;t<o;t++)C(n,"get",t+"");const r=n[t](...e);return-1===r||!1===r?n[t](...e.map(Ee)):r}})),["push","pop","shift","unshift","splice"].forEach((t=>{e[t]=function(...e){k();const n=Ee(this)[t].apply(this,e);return S(),n}})),e}function M(e=!1,t=!1){return function(n,o,i){if("__v_isReactive"===o)return!e;if("__v_isReadonly"===o)return e;if("__v_isShallow"===o)return t;if("__v_raw"===o&&i===(e?t?ge:ve:t?he:de).get(n))return n;const s=(0,r.kJ)(n);if(!e&&s&&(0,r.RI)(F,o))return Reflect.get(F,o,i);const c=Reflect.get(n,o,i);if((0,r.yk)(o)?I.has(o):A(o))return c;if(e||C(n,"get",o),t)return c;if(je(c)){const e=!s||!(0,r.S0)(o);return e?c.value:c}return(0,r.Kn)(c)?e?xe(c):be(c):c}}const $=U(),N=U(!0);function U(e=!1){return function(t,n,o,i){let s=t[n];if(Se(s)&&je(s)&&!je(o))return!1;if(!e&&!Se(o)&&(Ce(o)||(o=Ee(o),s=Ee(s)),!(0,r.kJ)(t)&&je(s)&&!je(o)))return s.value=o,!0;const c=(0,r.kJ)(t)&&(0,r.S0)(n)?Number(n)<t.length:(0,r.RI)(t,n),u=Reflect.set(t,n,o,i);return t===Ee(i)&&(c?(0,r.aU)(o,s)&&E(t,"set",n,o,s):E(t,"add",n,o)),u}}function D(e,t){const n=(0,r.RI)(e,t),o=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&E(e,"delete",t,void 0,o),i}function J(e,t){const n=Reflect.has(e,t);return(0,r.yk)(t)&&I.has(t)||C(e,"has",t),n}function B(e){return C(e,"iterate",(0,r.kJ)(e)?"length":m),Reflect.ownKeys(e)}const G={get:T,set:$,deleteProperty:D,has:J,ownKeys:B},q={get:j,set(e,t){return!0},deleteProperty(e,t){return!0}},V=(0,r.l7)({},G,{get:P,set:N}),H=e=>e,W=e=>Reflect.getPrototypeOf(e);function K(e,Line truncated
/*! /*!
* vue-router v4.0.12 * vue-router v4.0.14
* (c) 2021 Eduardo San Martin Morote * (c) 2022 Eduardo San Martin Morote
* @license MIT * @license MIT
*/ */
const i="function"===typeof Symbol&&"symbol"===typeof Symbol.toStringTag,s=e=>i?Symbol(e):"_vr_"+e,c=s("rvlm"),u=s("rvd"),l=s("r"),a=s("rl"),f=s("rvl"),p="undefined"!==typeof window;function d(e){return e.__esModule||i&&"Module"===e[Symbol.toStringTag]}const h=Object.assign;function v(e,t){const n={};for(const r in t){const o=t[r];n[r]=Array.isArray(o)?o.map(e):e(o)}return n}const g=()=>{};const m=/\/$/,y=e=>e.replace(m,"");function b(e,t,n="/"){let r,o={},i="",s="";const c=t.indexOf("?"),u=t.indexOf("#",c>-1?c:0);return c>-1&&(r=t.slice(0,c),i=t.slice(c+1,u>-1?u:t.length),o=e(i)),u>-1&&(r=r||t.slice(0,u),s=t.slice(u,t.length)),r=E(null!=r?r:t,n),{fullPath:r+(i&&"?")+i+s,path:r,query:o,hash:s}}function x(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function _(e,t){return t&&e.toLowerCase().startsWith(t.toLowerCase())?e.slice(t.length)||"/":e}function w(e,t,n){const r=t.matched.length-1,o=n.matched.length-1;return r>-1&&r===o&&S(t.matched[r],n.matched[o])&&C(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function S(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function C(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!k(e[n],t[n]))return!1;return!0}function k(e,t){return Array.isArray(e)?O(e,t):Array.isArray(t)?O(t,e):e===t}function O(e,t){return Array.isArray(t)?e.length===t.length&&e.every(((e,n)=>e===t[n])):1===e.length&&e[0]===t}function E(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/");let o,i,s=n.length-1;for(o=0;o<r.length;o++)if(i=r[o],1!==s&&"."!==i){if(".."!==i)break;s--}return n.slice(0,s).join("/")+"/"+r.slice(o-(o===r.length?1:0)).join("/")}var A,R;(function(e){e["pop"]="pop",e["push"]="push"})(A||(A={})),function(e){e["back"]="back",e["forward"]="forward",e["unknown"]=""}(R||(R={}));function j(e){if(!e)if(p){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return"/"!==e[0]&&"#"!==e[0]&&(e="/"+e),y(e)}const P=/^[^#]+#/;function T(e,t){return e.replace(P,"#")+t}function I(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const F=()=>({left:window.pageXOffset,top:window.pageYOffset});function L(e){let t;if("el"in e){const n=e.el,r="string"===typeof n&&n.startsWith("#");0;const o="string"===typeof n?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o)return;t=I(o,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(null!=t.left?t.left:window.pageXOffset,null!=t.top?t.top:window.pageYOffset)}function $(e,t){const n=history.state?history.state.position-t:-1;return n+e}const M=new Map;function U(e,t){M.set(e,t)}function N(e){const t=M.get(e);return M.delete(e),t}let B=()=>location.protocol+"//"+location.host;function D(e,t){const{pathname:n,search:r,hash:o}=t,i=e.indexOf("#");if(i>-1){let t=o.includes(e.slice(i))?e.slice(i).length:1,n=o.slice(t);return"/"!==n[0]&&(n="/"+n),_(n,"")}const s=_(n,e);return s+r+o}function G(e,t,n,r){let o=[],i=[],s=null;const c=({state:i})=>{const c=D(e,location),u=n.value,l=t.value;let a=0;if(i){if(n.value=c,t.value=i,s&&s===u)return void(s=null);a=l?i.position-l.position:0}else r(c);o.forEach((e=>{e(n.value,u,{delta:a,type:A.pop,direction:a?a>0?R.forward:R.back:R.unknown})}))};function u(){s=n.value}function l(e){o.push(e);const t=()=>{const t=o.indexOf(e);t>-1&&o.splice(t,1)};return i.push(t),t}function a(){const{history:e}=window;e.state&&e.replaceState(h({},e.state,{scroll:F()}),"")}function f(){for(const e of i)e();i=[],window.removeEventListener("popstate",c),window.removeEventListener("beforeunload",a)}return window.addEventListener("popstate",c),window.addEventListener("beforeunload",a),{pauseListeners:u,listen:l,destroy:f}}function V(e,t,n,r=!1,o=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:o?F():null}}function J(e){const{history:t,location:n}=window,r={value:D(e,n)},o={value:t.state};function i(r,i,s){const c=e.indexOf("#"),u=c>-1?(n.host&&document.querySelector("base")?e:e.slice(c))+r:B()+e+r;try{t[s?"replaceState":"pushState"](i,"",u),o.value=i}catch(l){console.error(l),n[s?"replace":"assign"](u)}}function s(e,n){const s=h({},t.state,V(o.value.back,e,o.value.forward,!0),n,{position:o.value.position});i(e,s,!0),r.value=e}function c(e,n){const s=h({},o.value,t.state,{forward:e,scroll:F()});i(s.current,s,!0);const c=h({},V(r.value,e,null),{position:s.position+1},n);i(e,c,!1),r.value=e}return o.value||i(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0),{location:r,state:o,push:c,replace:s}}function q(e){e=j(e);const t=J(e),n=G(e,t.state,t.location,t.replace);function r(e,t=!0){t||n.pauseListeners(),history.go(e)}const o=h({location:"",base:e,go:r,createHref:T.bind(null,e)},t,n);return Object.defineProperty(o,"loLine truncated const i="function"===typeof Symbol&&"symbol"===typeof Symbol.toStringTag,s=e=>i?Symbol(e):"_vr_"+e,c=s("rvlm"),u=s("rvd"),l=s("r"),a=s("rl"),f=s("rvl"),p="undefined"!==typeof window;function d(e){return e.__esModule||i&&"Module"===e[Symbol.toStringTag]}const h=Object.assign;function v(e,t){const n={};for(const r in t){const o=t[r];n[r]=Array.isArray(o)?o.map(e):e(o)}return n}const g=()=>{};const m=/\/$/,y=e=>e.replace(m,"");function b(e,t,n="/"){let r,o={},i="",s="";const c=t.indexOf("?"),u=t.indexOf("#",c>-1?c:0);return c>-1&&(r=t.slice(0,c),i=t.slice(c+1,u>-1?u:t.length),o=e(i)),u>-1&&(r=r||t.slice(0,u),s=t.slice(u,t.length)),r=E(null!=r?r:t,n),{fullPath:r+(i&&"?")+i+s,path:r,query:o,hash:s}}function _(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function x(e,t){return t&&e.toLowerCase().startsWith(t.toLowerCase())?e.slice(t.length)||"/":e}function w(e,t,n){const r=t.matched.length-1,o=n.matched.length-1;return r>-1&&r===o&&k(t.matched[r],n.matched[o])&&S(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function k(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function S(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!C(e[n],t[n]))return!1;return!0}function C(e,t){return Array.isArray(e)?O(e,t):Array.isArray(t)?O(t,e):e===t}function O(e,t){return Array.isArray(t)?e.length===t.length&&e.every(((e,n)=>e===t[n])):1===e.length&&e[0]===t}function E(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/");let o,i,s=n.length-1;for(o=0;o<r.length;o++)if(i=r[o],1!==s&&"."!==i){if(".."!==i)break;s--}return n.slice(0,s).join("/")+"/"+r.slice(o-(o===r.length?1:0)).join("/")}var R,A;(function(e){e["pop"]="pop",e["push"]="push"})(R||(R={})),function(e){e["back"]="back",e["forward"]="forward",e["unknown"]=""}(A||(A={}));function I(e){if(!e)if(p){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return"/"!==e[0]&&"#"!==e[0]&&(e="/"+e),y(e)}const T=/^[^#]+#/;function P(e,t){return e.replace(T,"#")+t}function j(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const F=()=>({left:window.pageXOffset,top:window.pageYOffset});function L(e){let t;if("el"in e){const n=e.el,r="string"===typeof n&&n.startsWith("#");0;const o="string"===typeof n?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o)return;t=j(o,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(null!=t.left?t.left:window.pageXOffset,null!=t.top?t.top:window.pageYOffset)}function M(e,t){const n=history.state?history.state.position-t:-1;return n+e}const $=new Map;function N(e,t){$.set(e,t)}function U(e){const t=$.get(e);return $.delete(e),t}let D=()=>location.protocol+"//"+location.host;function J(e,t){const{pathname:n,search:r,hash:o}=t,i=e.indexOf("#");if(i>-1){let t=o.includes(e.slice(i))?e.slice(i).length:1,n=o.slice(t);return"/"!==n[0]&&(n="/"+n),x(n,"")}const s=x(n,e);return s+r+o}function B(e,t,n,r){let o=[],i=[],s=null;const c=({state:i})=>{const c=J(e,location),u=n.value,l=t.value;let a=0;if(i){if(n.value=c,t.value=i,s&&s===u)return void(s=null);a=l?i.position-l.position:0}else r(c);o.forEach((e=>{e(n.value,u,{delta:a,type:R.pop,direction:a?a>0?A.forward:A.back:A.unknown})}))};function u(){s=n.value}function l(e){o.push(e);const t=()=>{const t=o.indexOf(e);t>-1&&o.splice(t,1)};return i.push(t),t}function a(){const{history:e}=window;e.state&&e.replaceState(h({},e.state,{scroll:F()}),"")}function f(){for(const e of i)e();i=[],window.removeEventListener("popstate",c),window.removeEventListener("beforeunload",a)}return window.addEventListener("popstate",c),window.addEventListener("beforeunload",a),{pauseListeners:u,listen:l,destroy:f}}function G(e,t,n,r=!1,o=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:o?F():null}}function q(e){const{history:t,location:n}=window,r={value:J(e,n)},o={value:t.state};function i(r,i,s){const c=e.indexOf("#"),u=c>-1?(n.host&&document.querySelector("base")?e:e.slice(c))+r:D()+e+r;try{t[s?"replaceState":"pushState"](i,"",u),o.value=i}catch(l){console.error(l),n[s?"replace":"assign"](u)}}function s(e,n){const s=h({},t.state,G(o.value.back,e,o.value.forward,!0),n,{position:o.value.position});i(e,s,!0),r.value=e}function c(e,n){const s=h({},o.value,t.state,{forward:e,scroll:F()});i(s.current,s,!0);const c=h({},G(r.value,e,null),{position:s.position+1},n);i(e,c,!1),r.value=e}return o.value||i(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0),{location:r,state:o,push:c,replace:s}}function V(e){e=I(e);const t=q(e),n=B(e,t.state,t.location,t.replace);function r(e,t=!0){t||n.pauseListeners(),history.go(e)}const o=h({location:"",base:e,go:r,createHref:P.bind(null,e)},t,n);return Object.defineProperty(o,"loLine truncated