mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-07 09:35:54 -08:00
Compare commits
2 Commits
copilot/ad
...
96ac9046b3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96ac9046b3 | ||
|
|
6d5f35f07e |
@@ -165,22 +165,11 @@ You can optionally apply highlighting only to the value portion of a block (not
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- Sonarr:
|
- Sonarr:
|
||||||
icon: sonarr.png
|
...
|
||||||
href: http://sonarr.host.or.ip
|
|
||||||
widget:
|
|
||||||
type: sonarr
|
|
||||||
url: http://sonarr.host.or.ip
|
|
||||||
key: ${SONARR_API_KEY}
|
|
||||||
highlight:
|
highlight:
|
||||||
queued:
|
queued:
|
||||||
valueOnly: true
|
valueOnly: true
|
||||||
numeric:
|
...
|
||||||
- level: danger
|
|
||||||
when: gte
|
|
||||||
value: 20
|
|
||||||
- level: warn
|
|
||||||
when: gte
|
|
||||||
value: 5
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Descriptions
|
## Descriptions
|
||||||
|
|||||||
@@ -39,16 +39,18 @@ export default function Block({ value, label, field }) {
|
|||||||
className={classNames(
|
className={classNames(
|
||||||
"bg-theme-200/50 dark:bg-theme-900/20 rounded-sm m-1 flex-1 flex flex-col items-center justify-center text-center p-1",
|
"bg-theme-200/50 dark:bg-theme-900/20 rounded-sm m-1 flex-1 flex flex-col items-center justify-center text-center p-1",
|
||||||
value === undefined ? "animate-pulse" : "",
|
value === undefined ? "animate-pulse" : "",
|
||||||
!applyToValueOnly && highlightClass,
|
highlightClass,
|
||||||
"service-block",
|
"service-block",
|
||||||
)}
|
)}
|
||||||
data-highlight-level={highlight?.level}
|
data-highlight-level={highlight?.level}
|
||||||
data-highlight-source={highlight?.source}
|
data-highlight-source={highlight?.source}
|
||||||
>
|
>
|
||||||
<div className={classNames("font-thin text-sm", applyToValueOnly && highlightClass)}>
|
<div className="font-thin text-sm">{value === undefined || value === null ? "-" : value}</div>
|
||||||
{value === undefined || value === null ? "-" : value}
|
<div
|
||||||
|
className={classNames("font-bold text-xs uppercase", applyToValueOnly && "text-theme-700 dark:text-theme-200")}
|
||||||
|
>
|
||||||
|
{t(label)}
|
||||||
</div>
|
</div>
|
||||||
<div className="font-bold text-xs uppercase">{t(label)}</div>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ export async function servicesFromDocker() {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
let substitutedVal = substituteEnvironmentVars(containerLabels[label]);
|
let substitutedVal = substituteEnvironmentVars(containerLabels[label]);
|
||||||
if (value === "widget.version") {
|
if (value === "widget.version" || /^widgets\[\d+\]\.version$/.test(value)) {
|
||||||
substitutedVal = parseInt(substitutedVal, 10);
|
substitutedVal = parseInt(substitutedVal, 10);
|
||||||
}
|
}
|
||||||
shvl.set(constructedService, value, substitutedVal);
|
shvl.set(constructedService, value, substitutedVal);
|
||||||
|
|||||||
Reference in New Issue
Block a user