mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-10 15:28:47 +00:00
Add widget for Truenas
This commit is contained in:
parent
6d46647fc9
commit
3483fe1188
5 changed files with 66 additions and 0 deletions
21
src/widgets/truenas/widget.js
Normal file
21
src/widgets/truenas/widget.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
import { jsonArrayFilter } from "utils/proxy/api-helpers";
|
||||
import genericProxyHandler from "utils/proxy/handlers/generic";
|
||||
|
||||
const widget = {
|
||||
api: "{url}/api/v2.0/{endpoint}",
|
||||
proxyHandler: genericProxyHandler,
|
||||
|
||||
mappings: {
|
||||
alerts: {
|
||||
endpoint: "alert/list",
|
||||
map: (data) => ({
|
||||
pending: jsonArrayFilter(data, (item) => item?.dismissed === false).length,
|
||||
}),
|
||||
},
|
||||
status: {
|
||||
endpoint: "system/info",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default widget;
|
Loading…
Add table
Add a link
Reference in a new issue