Enhancement: multiple widgets per service (#4338)

This commit is contained in:
shamoon 2024-11-27 02:33:40 -08:00
parent 385511f773
commit 907abee1aa
No known key found for this signature in database
46 changed files with 210 additions and 169 deletions

View file

@ -33,7 +33,7 @@ async function login(widget, service) {
}
export default async function piholeProxyHandler(req, res) {
const { group, service } = req.query;
const { group, service, index } = req.query;
let endpoint = "stats/summary";
if (!group || !service) {
@ -41,7 +41,7 @@ export default async function piholeProxyHandler(req, res) {
return res.status(400).json({ error: "Invalid proxy service type" });
}
const widget = await getServiceWidget(group, service);
const widget = await getServiceWidget(group, service, index);
if (!widget) {
logger.error("Invalid or missing widget for service '%s' in group '%s'", service, group);
return res.status(400).json({ error: "Invalid widget configuration" });