mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-06 21:57:48 +01:00
Enhancement: beszel widget compatibility with v0.9.0 (#4439)
This commit is contained in:
@@ -428,7 +428,7 @@ export function cleanServiceGroups(groups) {
|
||||
// frigate
|
||||
enableRecentEvents,
|
||||
|
||||
// glances, immich, mealie, pihole, pfsense
|
||||
// beszel, glances, immich, mealie, pihole, pfsense
|
||||
version,
|
||||
|
||||
// glances
|
||||
@@ -606,7 +606,7 @@ export function cleanServiceGroups(groups) {
|
||||
if (snapshotHost) widget.snapshotHost = snapshotHost;
|
||||
if (snapshotPath) widget.snapshotPath = snapshotPath;
|
||||
}
|
||||
if (["glances", "immich", "mealie", "pfsense", "pihole"].includes(type)) {
|
||||
if (["beszel", "glances", "immich", "mealie", "pfsense", "pihole"].includes(type)) {
|
||||
if (version) widget.version = parseInt(version, 10);
|
||||
}
|
||||
if (type === "glances") {
|
||||
|
||||
@@ -45,7 +45,12 @@ export default async function beszelProxyHandler(req, res) {
|
||||
|
||||
if (widget) {
|
||||
const url = new URL(formatApiCall(widgets[widget.type].api, { endpoint, ...widget }));
|
||||
const loginUrl = formatApiCall(widgets[widget.type].api, { endpoint: "admins/auth-with-password", ...widget });
|
||||
let authEndpointVersion = "authv1";
|
||||
if (widget.version === 2) authEndpointVersion = "authv2";
|
||||
const loginUrl = formatApiCall(widgets[widget.type].api, {
|
||||
endpoint: widgets[widget.type].mappings[authEndpointVersion].endpoint,
|
||||
...widget,
|
||||
});
|
||||
|
||||
let status;
|
||||
let data;
|
||||
|
||||
@@ -5,6 +5,12 @@ const widget = {
|
||||
proxyHandler: beszelProxyHandler,
|
||||
|
||||
mappings: {
|
||||
authv1: {
|
||||
endpoint: "admins/auth-with-password",
|
||||
},
|
||||
authv2: {
|
||||
endpoint: "collections/_superusers/auth-with-password",
|
||||
},
|
||||
systems: {
|
||||
endpoint: "collections/systems/records?page=1&perPage=500&sort=%2Bcreated",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user