Add snapshot host and path to Kopia widget

This commit is contained in:
Johan Steen 2023-07-24 12:28:03 +07:00
parent e265a7c645
commit 92ed6dc1cb
2 changed files with 12 additions and 1 deletions

View file

@ -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 (