From 8d9cfa98bdeb88445f2f33d630998ac9b1f0dcd7 Mon Sep 17 00:00:00 2001 From: Artur Bauer Date: Sun, 10 Oct 2021 22:14:33 +0200 Subject: Add Prometheus custom component --- src/components/services/Prometheus.vue | 167 +++++++++++++++++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 src/components/services/Prometheus.vue diff --git a/src/components/services/Prometheus.vue b/src/components/services/Prometheus.vue new file mode 100644 index 0000000..25e9ddd --- /dev/null +++ b/src/components/services/Prometheus.vue @@ -0,0 +1,167 @@ + + + + + -- cgit v1.2.3 From 277dafafa958c970af1a36783cb9e03da2944717 Mon Sep 17 00:00:00 2001 From: Artur Bauer Date: Sun, 10 Oct 2021 22:20:34 +0200 Subject: Update docs --- docs/customservices.md | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/docs/customservices.md b/docs/customservices.md index ef84948..548af96 100644 --- a/docs/customservices.md +++ b/docs/customservices.md @@ -6,16 +6,15 @@ within Homer. If you experiencing any issue, please have a look to the [troubleshooting](troubleshooting.md) page. - ## Common options ```yaml -- name: "My Service" - logo: "assets/tools/sample.png" - url: "http://my-service-link" - endpoint: "http://my-service-endpoint" # Optional: alternative base URL used to fetch service data is necessary. +- name: 'My Service' + logo: 'assets/tools/sample.png' + url: 'http://my-service-link' + endpoint: 'http://my-service-endpoint' # Optional: alternative base URL used to fetch service data is necessary. useCredentials: false # Optional: Override global proxy.useCredentials configuration. - type: "" + type: '' ``` ⚠️🚧 `endpoint` & `useCredentials` new options are not yet supported by all custom services (but will be very soon). @@ -93,3 +92,15 @@ For Ping you need to set the type to Ping and provide a url. subtitle: "Bookmark example" tag: "app" url: "https://www.reddit.com/r/selfhosted/" ``` + +## Prometheus + +For Prometheus you need to set the type to Prometheus and provide a url. + +```yaml +- name: "Prometheus" + type: Prometheus + logo: "assets/tools/sample.png" + url: "http://192.168.0.151/" + # subtitle: "Monitor data server" +``` -- cgit v1.2.3 From 80ba98cf661801956f773bdfd0b0ded1b2f80487 Mon Sep 17 00:00:00 2001 From: Artur Bauer Date: Mon, 11 Oct 2021 18:38:13 +0200 Subject: Code review fixes --- docs/customservices.md | 11 ++-- src/components/services/Prometheus.vue | 96 +++++++++++++--------------------- 2 files changed, 42 insertions(+), 65 deletions(-) diff --git a/docs/customservices.md b/docs/customservices.md index 548af96..7a151d1 100644 --- a/docs/customservices.md +++ b/docs/customservices.md @@ -6,15 +6,16 @@ within Homer. If you experiencing any issue, please have a look to the [troubleshooting](troubleshooting.md) page. + ## Common options ```yaml -- name: 'My Service' - logo: 'assets/tools/sample.png' - url: 'http://my-service-link' - endpoint: 'http://my-service-endpoint' # Optional: alternative base URL used to fetch service data is necessary. +- name: "My Service" + logo: "assets/tools/sample.png" + url: "http://my-service-link" + endpoint: "http://my-service-endpoint" # Optional: alternative base URL used to fetch service data is necessary. useCredentials: false # Optional: Override global proxy.useCredentials configuration. - type: '' + type: "" ``` ⚠️🚧 `endpoint` & `useCredentials` new options are not yet supported by all custom services (but will be very soon). diff --git a/src/components/services/Prometheus.vue b/src/components/services/Prometheus.vue index 25e9ddd..6efcb34 100644 --- a/src/components/services/Prometheus.vue +++ b/src/components/services/Prometheus.vue @@ -1,57 +1,41 @@