From 055a437707b4a5b4b5ba3877653a0cdb7d082ee3 Mon Sep 17 00:00:00 2001 From: Reiko Kaps Date: Sat, 14 Jun 2025 10:39:21 +0200 Subject: [PATCH 1/3] new service Miniflux (copied from Wallabag) --- src/components/services/Miniflux.vue | 88 ++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 src/components/services/Miniflux.vue diff --git a/src/components/services/Miniflux.vue b/src/components/services/Miniflux.vue new file mode 100644 index 0000000..cfce700 --- /dev/null +++ b/src/components/services/Miniflux.vue @@ -0,0 +1,88 @@ + + + + + From 89ec89cb2fc5f943bbb54c7a2ce78c4cd3aed2d7 Mon Sep 17 00:00:00 2001 From: Reiko Kaps Date: Sat, 14 Jun 2025 12:11:27 +0200 Subject: [PATCH 2/3] Add ducumentation for service Miniflux --- docs/customservices.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/customservices.md b/docs/customservices.md index c1f0812..1fb9331 100644 --- a/docs/customservices.md +++ b/docs/customservices.md @@ -30,6 +30,7 @@ within Homer: - [Matrix](#matrix) - [Mealie](#mealie) - [Medusa](#medusa) +- [Miniflux](#miniflux) - [Nextcloud](#nextcloud) - [OctoPrint / Moonraker](#octoprintmoonraker) - [Olivetin](#olivetin) @@ -350,6 +351,21 @@ Two lines are needed in the config.yml : 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. +## Miniflux + +This service displays a version string instead of a subtitle. The indicator +shows if Miniflux is online or offline. + +Example configuration: + +```yaml +- name: "Miniflux" + type: "Miniflux" + logo: "assets/tools/sample.png" + url: "http://miniflux.example.com" + apikey: "<---insert-api-key-here--->" +``` + ## Nextcloud This service displays a version string instead of a subtitle. The indicator From e2ca5d58195f55be07bcae7c170accbe8c251f04 Mon Sep 17 00:00:00 2001 From: Reiko Kaps Date: Sun, 15 Jun 2025 21:38:16 +0200 Subject: [PATCH 3/3] Subtitle shows now the unreads sum --- src/components/services/Miniflux.vue | 49 ++++++++++++++++++---------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/src/components/services/Miniflux.vue b/src/components/services/Miniflux.vue index cfce700..b4bf149 100644 --- a/src/components/services/Miniflux.vue +++ b/src/components/services/Miniflux.vue @@ -7,7 +7,7 @@ {{ item.subtitle }}

@@ -34,24 +34,39 @@ export default { }), created() { this.fetchStatus(); + this.fetchUnreads(); }, methods: { - fetchStatus: async function () { - const headers = { - 'X-Auth-Token': this.item.apikey, - }; - this.fetch("/v1/version", { headers }) - .then((response) => { - - - this.status = "online"; - this.versionstring = response.version; - }) - .catch((e) => { - this.status = "offline"; - console.log(e); - }); - }, + fetchStatus: async function () { + const headers = { + 'X-Auth-Token': this.item.apikey, + }; + this.fetch("/v1/version", { headers }) + .then((response) => { + this.status = "online"; + // this.versionstring = response.version; + }) + .catch((e) => { + this.status = "offline"; + console.log(e); + }); + }, + fetchUnreads: async function() { + const headers = { + 'X-Auth-Token': this.item.apikey, + }; + this.fetch("/v1/feeds/counters", { headers }) + .then((response) => { + this.versionstring = this.countUnreads(response.unreads); + }) + .catch((e) => { + console.log(e); + }); + }, + countUnreads: function (unreads) { + // count all values on the array + return Object.values(unreads).reduce((a, b) => a + b, 0); + }, }, };