mirror of
https://github.com/gethomepage/homepage.git
synced 2026-01-12 12:02:09 +08:00
Setup for custom proxy
This commit is contained in:
@@ -1,23 +1,26 @@
|
||||
import { asJson, jsonArrayFilter } from "utils/proxy/api-helpers";
|
||||
import credentialedProxyHandler from "utils/proxy/handlers/credentialed";
|
||||
import truenasProxyHandler from "./proxy";
|
||||
|
||||
const widget = {
|
||||
api: "{url}/api/v2.0/{endpoint}",
|
||||
proxyHandler: credentialedProxyHandler,
|
||||
proxyHandler: truenasProxyHandler,
|
||||
|
||||
mappings: {
|
||||
alerts: {
|
||||
endpoint: "alert/list",
|
||||
wsMethod: "alert.list",
|
||||
map: (data) => ({
|
||||
pending: jsonArrayFilter(data, (item) => item?.dismissed === false).length,
|
||||
}),
|
||||
},
|
||||
status: {
|
||||
endpoint: "system/info",
|
||||
wsMethod: "system.info",
|
||||
validate: ["loadavg", "uptime_seconds"],
|
||||
},
|
||||
pools: {
|
||||
endpoint: "pool",
|
||||
wsMethod: "pool.query",
|
||||
map: (data) =>
|
||||
asJson(data).map((entry) => ({
|
||||
id: entry.name,
|
||||
@@ -27,6 +30,7 @@ const widget = {
|
||||
},
|
||||
dataset: {
|
||||
endpoint: "pool/dataset",
|
||||
wsMethod: "pool.dataset.query",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user