From 92ed6dc1cb03f1a86eb1152e1a46b577d4b75243 Mon Sep 17 00:00:00 2001 From: Johan Steen Date: Mon, 24 Jul 2023 12:28:03 +0700 Subject: [PATCH 1/2] Add snapshot host and path to Kopia widget --- src/utils/config/service-helpers.js | 6 ++++++ src/widgets/kopia/component.jsx | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/utils/config/service-helpers.js b/src/utils/config/service-helpers.js index e99582b2..dc625f2e 100644 --- a/src/utils/config/service-helpers.js +++ b/src/utils/config/service-helpers.js @@ -291,6 +291,8 @@ export function cleanServiceGroups(groups) { volume, // diskstation widget, enableQueue, // sonarr/radarr node, // Proxmox + snapshotHost, // kopia + snapshotPath, } = cleanedService.widget; let fieldsList = fields; @@ -345,6 +347,10 @@ export function cleanServiceGroups(groups) { if (["diskstation", "qnap"].includes(type)) { if (volume) cleanedService.widget.volume = volume; } + if (type === "kopia") { + if (snapshotHost) cleanedService.widget.snapshotHost = snapshotHost; + if (snapshotPath) cleanedService.widget.snapshotPath = snapshotPath; + } } return cleanedService; diff --git a/src/widgets/kopia/component.jsx b/src/widgets/kopia/component.jsx index 46690990..9a7a76ac 100755 --- a/src/widgets/kopia/component.jsx +++ b/src/widgets/kopia/component.jsx @@ -41,7 +41,12 @@ export default function Component({ service }) { return ; } - const source = statusData?.sources[0]; + const snapshotHost = service.widget?.snapshotHost; + const snapshotPath = service.widget?.snapshotPath; + + const source = statusData?.sources + .filter(el => snapshotHost ? el.source.host === snapshotHost : true) + .filter(el => snapshotPath ? el.source.path === snapshotPath : true)[0]; if (!statusData || !source) { return ( From 115bb432ff5f3d11f662bf1820089decbb1a9cb4 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Tue, 25 Jul 2023 12:02:13 -0700 Subject: [PATCH 2/2] Ensure spacing with custom logo --- src/components/widgets/logo/logo.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/widgets/logo/logo.jsx b/src/components/widgets/logo/logo.jsx index bb58a765..83432561 100644 --- a/src/components/widgets/logo/logo.jsx +++ b/src/components/widgets/logo/logo.jsx @@ -8,7 +8,9 @@ export default function Logo({ options }) { {options.icon ? - : +
+ +
: // fallback to homepage logo