diff --git a/docs/widgets/info/peanut.md b/docs/widgets/info/peanut.md new file mode 100644 index 00000000..8e90c084 --- /dev/null +++ b/docs/widgets/info/peanut.md @@ -0,0 +1,17 @@ +--- +title: PeaNUT +description: PeaNUT Information Widget Configuration +--- + +_(Find the PeaNUT service widget [here](../services/peanut.md))_ + +The PeaNUT widget allows you to monitor your UPS device and is designed to match the `resources` info widget. You can have multiple instances by adding another configuration block. + +```yaml +- peanut: + url: http://peanut.host.or.ip:port # the URL of the PeaNUT server + key: nameofyourups # the name of the device + refresh: 3000 # optional, in ms + label: My UPS # optional + expanded: false # show the expanded view +``` diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 2192a7de..17d90b9b 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -552,7 +552,9 @@ "ups_status": "UPS Status", "online": "Online", "on_battery": "On Battery", - "low_battery": "Low Battery" + "low_battery": "Low Battery", + "load": "Load", + "battery": "Battery" }, "nextdns": { "wait": "Please Wait", diff --git a/src/components/widgets/peanut/peanut.jsx b/src/components/widgets/peanut/peanut.jsx index fb446190..9b3b8d4f 100644 --- a/src/components/widgets/peanut/peanut.jsx +++ b/src/components/widgets/peanut/peanut.jsx @@ -4,6 +4,8 @@ import { useTranslation } from "next-i18next"; import Error from "../widget/error"; import Resource from "../widget/resource"; +import Raw from "../widget/raw"; +import Container from "../widget/container"; export default function Widget({ options }) { const { t } = useTranslation(); @@ -24,37 +26,52 @@ export default function Widget({ options }) { if (!data) { return ( - + + +
+ +
+
+
); } return ( - + + +
+ +
+ {options.label && ( +
{options.label}
+ )} +
+
); }