mirror of
https://github.com/glanceapp/glance.git
synced 2025-06-22 02:41:23 +02:00
Merge pull request #177 from MrExplode/monitor-urls
Different monitor urls
This commit is contained in:
commit
233b905492
@ -997,6 +997,7 @@ Properties for each site:
|
|||||||
| ---- | ---- | -------- | ------- |
|
| ---- | ---- | -------- | ------- |
|
||||||
| title | string | yes | |
|
| title | string | yes | |
|
||||||
| url | string | yes | |
|
| url | string | yes | |
|
||||||
|
| check-url | string | no | |
|
||||||
| icon | string | no | |
|
| icon | string | no | |
|
||||||
| allow-insecure | boolean | no | false |
|
| allow-insecure | boolean | no | false |
|
||||||
| same-tab | boolean | no | false |
|
| same-tab | boolean | no | false |
|
||||||
@ -1007,7 +1008,11 @@ The title used to indicate the site.
|
|||||||
|
|
||||||
`url`
|
`url`
|
||||||
|
|
||||||
The URL which will be requested and its response will determine the status of the site. Optionally, you can specify this using an environment variable with the syntax `${VARIABLE_NAME}`.
|
The public facing URL of a monitored service, the user will be redirected here. If `check-url` is not specified, this is used as the status check.
|
||||||
|
|
||||||
|
`check-url`
|
||||||
|
|
||||||
|
The URL which will be requested and its response will determine the status of the site. If not specified, the `url` property is used.
|
||||||
|
|
||||||
`icon`
|
`icon`
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ import (
|
|||||||
|
|
||||||
type SiteStatusRequest struct {
|
type SiteStatusRequest struct {
|
||||||
URL string `yaml:"url"`
|
URL string `yaml:"url"`
|
||||||
|
CheckURL string `yaml:"check-url"`
|
||||||
AllowInsecure bool `yaml:"allow-insecure"`
|
AllowInsecure bool `yaml:"allow-insecure"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -20,7 +21,13 @@ type SiteStatus struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getSiteStatusTask(statusRequest *SiteStatusRequest) (SiteStatus, error) {
|
func getSiteStatusTask(statusRequest *SiteStatusRequest) (SiteStatus, error) {
|
||||||
request, err := http.NewRequest(http.MethodGet, statusRequest.URL, nil)
|
var url string
|
||||||
|
if statusRequest.CheckURL != "" {
|
||||||
|
url = statusRequest.CheckURL
|
||||||
|
} else {
|
||||||
|
url = statusRequest.URL
|
||||||
|
}
|
||||||
|
request, err := http.NewRequest(http.MethodGet, url, nil)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return SiteStatus{
|
return SiteStatus{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user