Enhancement: multiple widgets per service (#4338)
Some checks are pending
Docker / Linting Checks (push) Waiting to run
Docker / Docker Build & Push (push) Blocked by required conditions

This commit is contained in:
shamoon
2024-11-27 02:33:40 -08:00
parent 385511f773
commit 907abee1aa
46 changed files with 210 additions and 169 deletions

View File

@@ -14,13 +14,13 @@ const prefixCacheKey = `${proxyName}__prefix`;
const logger = createLogger(proxyName);
async function getWidget(req) {
const { group, service } = req.query;
const { group, service, index } = req.query;
let widget = null;
if (group === "unifi_console" && service === "unifi_console") {
// info widget
const index = req.query?.query ? JSON.parse(req.query.query).index : undefined;
widget = await getPrivateWidgetOptions("unifi_console", index);
const infowidgetIndex = req.query?.query ? JSON.parse(req.query.query).index : undefined;
widget = await getPrivateWidgetOptions("unifi_console", infowidgetIndex);
if (!widget) {
logger.debug("Error retrieving settings for this Unifi widget");
return null;
@@ -32,7 +32,7 @@ async function getWidget(req) {
return null;
}
widget = await getServiceWidget(group, service);
widget = await getServiceWidget(group, service, index);
if (!widget) {
logger.debug("Invalid or missing widget for service '%s' in group '%s'", service, group);