Merge branch 'main' into kubernetes

This commit is contained in:
James Wynn
2023-01-09 08:34:43 -06:00
10 changed files with 700 additions and 250 deletions

View File

@@ -30,6 +30,8 @@ export default async function credentialedProxyHandler(req, res, map) {
headers["X-gotify-Key"] = `${widget.key}`;
} else if (widget.type === "authentik") {
headers.Authorization = `Bearer ${widget.key}`;
} else if (widget.type === "truenas") {
headers.Authorization = `Bearer ${widget.key}`;
} else if (widget.type === "proxmox") {
headers.Authorization = `PVEAPIToken=${widget.username}=${widget.password}`;
} else if (widget.type === "autobrr") {

View File

@@ -4,8 +4,8 @@ import { formatProxyUrl } from "./api-helpers";
export default function useWidgetAPI(widget, ...options) {
const config = {};
if (options?.refreshInterval) {
config.refreshInterval = options.refreshInterval;
if (options && options[1]?.refreshInterval) {
config.refreshInterval = options[1].refreshInterval;
}
const { data, error } = useSWR(formatProxyUrl(widget, ...options), config);
// make the data error the top-level error