Skip to content

Commit

Permalink
Merge branch 'benphelps:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
fredodiable authored Jul 25, 2023
2 parents f380b4e + e23dc8f commit 47d6bd1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/components/widgets/logo/logo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ export default function Logo({ options }) {
<Container options={options}>
<Raw>
{options.icon ?
<ResolvedIcon icon={options.icon} width={48} height={48} /> :
<div className="mr-3">
<ResolvedIcon icon={options.icon} width={48} height={48} />
</div> :
// fallback to homepage logo
<div className="w-12 h-12">
<svg
Expand Down
6 changes: 6 additions & 0 deletions src/utils/config/service-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,8 @@ export function cleanServiceGroups(groups) {
volume, // diskstation widget,
enableQueue, // sonarr/radarr
node, // Proxmox
snapshotHost, // kopia
snapshotPath,
} = cleanedService.widget;

let fieldsList = fields;
Expand Down Expand Up @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion src/widgets/kopia/component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit 47d6bd1

Please sign in to comment.