mirror of
https://github.com/karl0ss/homepage.git
synced 2025-05-01 13:09:31 +01:00
Merge pull request #1718 from artstorm/kopia-source
Add snapshot host and path to Kopia widget
This commit is contained in:
commit
f4fa098f6b
@ -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;
|
||||
|
@ -41,7 +41,12 @@ export default function Component({ service }) {
|
||||
return <Container service={service} error={statusError} />;
|
||||
}
|
||||
|
||||
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 (
|
||||
|
Loading…
x
Reference in New Issue
Block a user