From 6d29bc27e78bc549479cbbc203c683137ace9d48 Mon Sep 17 00:00:00 2001 From: luixal Date: Mon, 4 Jan 2021 09:43:58 +0100 Subject: Adds mapping remote field to Homer expected ones when loading message from url --- docs/configuration.md | 9 ++++++++ docs/tips-and-tricks.md | 58 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) (limited to 'docs') diff --git a/docs/configuration.md b/docs/configuration.md index a43d7f1..93fa898 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -66,6 +66,15 @@ colors: # Optional message message: # url: "https://" # Can fetch information from an endpoint to override value below. + # mapping: # allows to map fields from the remote format to the one expected by Homer + # title: 'id' # use value from field 'id' as title + # content: 'value' # value from field 'value' as content + # + # Real example using chucknorris.io for showing Chuck Norris facts as messages: + # url: https://api.chucknorris.io/jokes/random + # mapping: + # title: 'id' + # content: 'value' style: "is-warning" title: "Optional message!" icon: "fa fa-exclamation-triangle" diff --git a/docs/tips-and-tricks.md b/docs/tips-and-tricks.md index 2719fc5..63eeeaf 100644 --- a/docs/tips-and-tricks.md +++ b/docs/tips-and-tricks.md @@ -113,6 +113,64 @@ docker create \ ## Get the news headlines in Homer + +### Mapping Fields +Most times, the url you're getting headlines from follows a different schema than the one expected by Homer. + +For example, if you would like to show jokes from ChuckNorris.io, you'll find that the url https://api.chucknorris.io/jokes/random is giving you info like this: + +```json +{ + "categories": [], + "created_at": "2020-01-05 13:42:22.089095", + "icon_url": "https://assets.chucknorris.host/img/avatar/chuck-norris.png", + "id": "MR2-BnMBR667xSpQBIleUg", + "updated_at": "2020-01-05 13:42:22.089095", + "url": "https://api.chucknorris.io/jokes/MR2-BnMBR667xSpQBIleUg", + "value": "Chuck Norris can quitely sneak up on himself" +} +``` + +but... you need that info to be transformed to something like this: + +```json +{ + "title": "MR2-BnMBR667xSpQBIleUg", + "content": "Chuck Norris can quitely sneak up on himself" +} +``` + +Now, you can do that using the `mapping` field in your `message` configuration. This example would be something like this: + +```yml +message: + url: https://api.chucknorris.io/jokes/random + mapping: + title: 'id' + content: 'value' +``` + +As you would see, using the ID as a title doesn't seem nice, that's why when a field is empty it would keep the default values, like this: + +```yml +message: + url: https://api.chucknorris.io/jokes/random + mapping: + content: 'value' + title: "Chuck Norris Facts!" +``` + +and even an error message in case the `url` didn't respond or threw an error: + +```yml +message: + url: https://api.chucknorris.io/jokes/random + mapping: + content: 'value' + title: "Chuck Norris Facts!" + content: "Message could not be loaded" +``` + #### `by @JamiePhonic` Homer allows you to set a "message" that will appear at the top of the page, however, you can also supply a `url:`. -- cgit v1.2.3 From e3bd2ecc2ca874270282c3c42813b8053d67dcbd Mon Sep 17 00:00:00 2001 From: luixal Date: Thu, 7 Jan 2021 09:39:58 +0100 Subject: Adds multiple pages based on different config files --- docs/configuration.md | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'docs') diff --git a/docs/configuration.md b/docs/configuration.md index a43d7f1..81de590 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -81,6 +81,11 @@ links: - name: "link 2" icon: "fas fa-book" url: "https://github.com/bastienwirtz/homer" + # this will link to a second homer page that will load config from page2.yml and keep default config values as in config.yml file + # see url field and assets/page.yml used in this example: + - name: "Second Page" + icon: "fas fa-file-alt" + url: "/page2" # Services # First level array represents a group. -- cgit v1.2.3 From 1ddf394176ffe7e1c4118ead46b9fa76c6f3c614 Mon Sep 17 00:00:00 2001 From: luixal Date: Thu, 7 Jan 2021 21:23:13 +0100 Subject: Refactors created function (splits logic for getting message) and adds timeout according to refreshInterval field --- docs/configuration.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs') diff --git a/docs/configuration.md b/docs/configuration.md index 93fa898..8bff54f 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -69,12 +69,14 @@ message: # mapping: # allows to map fields from the remote format to the one expected by Homer # title: 'id' # use value from field 'id' as title # content: 'value' # value from field 'value' as content + # refreshInterval: 10000 # time interval to refresh message # # Real example using chucknorris.io for showing Chuck Norris facts as messages: # url: https://api.chucknorris.io/jokes/random # mapping: # title: 'id' # content: 'value' + # refreshInterval: 10000 style: "is-warning" title: "Optional message!" icon: "fa fa-exclamation-triangle" -- cgit v1.2.3 From 9542de6eb25bfa20b376920b607db864c9e20a7a Mon Sep 17 00:00:00 2001 From: luixal Date: Tue, 23 Feb 2021 20:17:51 +0100 Subject: Fixes identations and link docs. --- docs/configuration.md | 4 ++-- docs/tips-and-tricks.md | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'docs') diff --git a/docs/configuration.md b/docs/configuration.md index 8bff54f..5785e56 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -69,7 +69,7 @@ message: # mapping: # allows to map fields from the remote format to the one expected by Homer # title: 'id' # use value from field 'id' as title # content: 'value' # value from field 'value' as content - # refreshInterval: 10000 # time interval to refresh message + # refreshInterval: 10000 # Optional: time interval to refresh message # # Real example using chucknorris.io for showing Chuck Norris facts as messages: # url: https://api.chucknorris.io/jokes/random @@ -129,7 +129,7 @@ services: # background: red # optional color for card to set color directly without custom stylesheet ``` -If you choose to fetch message information from an endpoint, the output format should be: +If you choose to fetch message information from an endpoint, the output format should be as follows (or you can [custom map fields as shown in tips-and-tricks](./tips-and-tricks.md#mapping-fields)): ```json { diff --git a/docs/tips-and-tricks.md b/docs/tips-and-tricks.md index 63eeeaf..94167fb 100644 --- a/docs/tips-and-tricks.md +++ b/docs/tips-and-tricks.md @@ -145,9 +145,9 @@ Now, you can do that using the `mapping` field in your `message` configuration. ```yml message: url: https://api.chucknorris.io/jokes/random - mapping: - title: 'id' - content: 'value' + mapping: + title: 'id' + content: 'value' ``` As you would see, using the ID as a title doesn't seem nice, that's why when a field is empty it would keep the default values, like this: @@ -155,8 +155,8 @@ As you would see, using the ID as a title doesn't seem nice, that's why when a f ```yml message: url: https://api.chucknorris.io/jokes/random - mapping: - content: 'value' + mapping: + content: 'value' title: "Chuck Norris Facts!" ``` @@ -165,8 +165,8 @@ and even an error message in case the `url` didn't respond or threw an error: ```yml message: url: https://api.chucknorris.io/jokes/random - mapping: - content: 'value' + mapping: + content: 'value' title: "Chuck Norris Facts!" content: "Message could not be loaded" ``` -- cgit v1.2.3 From c6267296ec03db24ff40959ef58eedcec904c39b Mon Sep 17 00:00:00 2001 From: luixal Date: Tue, 23 Feb 2021 20:50:32 +0100 Subject: Changes relative paths to hash. Avoids problems with #8 --- docs/configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/configuration.md b/docs/configuration.md index 81de590..3c16b25 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -85,7 +85,7 @@ links: # see url field and assets/page.yml used in this example: - name: "Second Page" icon: "fas fa-file-alt" - url: "/page2" + url: "#page2" # Services # First level array represents a group. -- cgit v1.2.3 From 8e0933137919ef7703a6e82fe17f7a258587e18c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Caillaut?= Date: Sat, 6 Mar 2021 14:03:40 +0100 Subject: documenting logo in groups --- docs/configuration.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs') diff --git a/docs/configuration.md b/docs/configuration.md index 5785e56..3ff49fa 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -99,6 +99,8 @@ links: services: - name: "Application" icon: "fas fa-code-branch" + # A path to an image can also be provided. Note that icon take precedence if both icon and logo are set. + # logo: "path/to/logo" items: - name: "Awesome app" logo: "assets/tools/sample.png" -- cgit v1.2.3 From 4399f5fadec678c37fa417e24faf4343615338b3 Mon Sep 17 00:00:00 2001 From: twolaw Date: Thu, 11 Mar 2021 15:03:56 +0100 Subject: pihole, medusa, radarr/sonarr services help --- docs/customservices.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 docs/customservices.md (limited to 'docs') diff --git a/docs/customservices.md b/docs/customservices.md new file mode 100644 index 0000000..d2deff4 --- /dev/null +++ b/docs/customservices.md @@ -0,0 +1,41 @@ +# Custom Services + +Here is an overview of all custom services that are available within Homer. + +## PiHole + +Using the PiHole service you can display info about your local PiHole instance right on your Homer dashboard. + +The following configuration is available for the PiHole service. + +``` + items: + - name: "Pi-hole" + logo: "assets/tools/sample.png" + # subtitle: "Network-wide Ad Blocking" # optional, if no subtitle is defined, PiHole statistics will be shown + url: "http://192.168.0.151/admin" + type: "PiHole" +``` + +## Medusa + +This service displays News (grey), Warning (orange) or Error (red) notifications bubbles from the Medusa application. +Two lines are needed in the config.yml : +``` +type: "Medusa" +apikey: "01234deb70424befb1f4ef6a23456789" +``` +The url must be the root url of Medusa application. +The Medusa API key can be found in General configuration > Interface. It is needed to access Medusa API. + + +## Sonarr/Radarr + +This service displays Activity (blue), Warning (orange) or Error (red) notifications bubbles from the Radarr/Sonarr application. +Two lines are needed in the config.yml : +``` +type: "Radarr" or "Sonarr" +apikey: "01234deb70424befb1f4ef6a23456789" +``` +The url must be the root url of Radarr/Sonarr application. +The Radarr/Sonarr API key can be found in Settings > General. It is needed to access the API. -- cgit v1.2.3 From 24229b541181c8ef0813b015c5589e9a34269cb0 Mon Sep 17 00:00:00 2001 From: boerniee Date: Wed, 23 Jun 2021 17:06:19 +0200 Subject: Added paperless service with documentation --- docs/configuration.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'docs') diff --git a/docs/configuration.md b/docs/configuration.md index a472b41..ce36c51 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -167,3 +167,16 @@ In order to easily generate all required icon preset for the PWA to work, a tool ```bash npx vue-pwa-asset-generator -a {your_512x512_source_png} -o {your_output_folder} ``` + +### Supported services + +Currently the following services are supported for showing quick infos on the card. They can be used by setting the type to one of the following values at the item. + +- PiHole +- AdGuardHome +- PaperlessNG + +### Additional configuration + +#### Paperless +For Paperless you need an API-Key which you have to store at the item in the field `apikey`. \ No newline at end of file -- cgit v1.2.3 From 92d899bd4809183f1cd1cec302d66fa32461aac5 Mon Sep 17 00:00:00 2001 From: Bastien Wirtz Date: Wed, 14 Jul 2021 15:48:57 +0200 Subject: regroup service documentation --- docs/configuration.md | 13 ------------- docs/customservices.md | 14 +++++++++++++- 2 files changed, 13 insertions(+), 14 deletions(-) (limited to 'docs') diff --git a/docs/configuration.md b/docs/configuration.md index ce36c51..a472b41 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -167,16 +167,3 @@ In order to easily generate all required icon preset for the PWA to work, a tool ```bash npx vue-pwa-asset-generator -a {your_512x512_source_png} -o {your_output_folder} ``` - -### Supported services - -Currently the following services are supported for showing quick infos on the card. They can be used by setting the type to one of the following values at the item. - -- PiHole -- AdGuardHome -- PaperlessNG - -### Additional configuration - -#### Paperless -For Paperless you need an API-Key which you have to store at the item in the field `apikey`. \ No newline at end of file diff --git a/docs/customservices.md b/docs/customservices.md index d2deff4..43f45f4 100644 --- a/docs/customservices.md +++ b/docs/customservices.md @@ -1,6 +1,8 @@ # Custom Services -Here is an overview of all custom services that are available within Homer. +Some service can use a specific a component that provides some extra features by adding a `type` key to the service yaml +configuration. Available services are in `src/components/`. Here is an overview of all custom services that are available +within Homer. ## PiHole @@ -39,3 +41,13 @@ apikey: "01234deb70424befb1f4ef6a23456789" ``` The url must be the root url of Radarr/Sonarr application. The Radarr/Sonarr API key can be found in Settings > General. It is needed to access the API. + + +## PaperlessNG + +For Paperless you need an API-Key which you have to store at the item in the field `apikey`. + + +## Ping + +For Paperless you need an API-Key which you have to store at the item in the field `apikey`. -- cgit v1.2.3 From cb325bd58adcebeb106ccbfdf18b37fd19c8dcca Mon Sep 17 00:00:00 2001 From: Jeremy Meyers Date: Thu, 26 Aug 2021 21:54:59 -0400 Subject: typo --- docs/customservices.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/customservices.md b/docs/customservices.md index 43f45f4..5778fad 100644 --- a/docs/customservices.md +++ b/docs/customservices.md @@ -50,4 +50,4 @@ For Paperless you need an API-Key which you have to store at the item in the fie ## Ping -For Paperless you need an API-Key which you have to store at the item in the field `apikey`. +For Ping you need an API-Key which you have to store at the item in the field `apikey`. -- cgit v1.2.3