mirror of
https://github.com/gethomepage/homepage.git
synced 2026-01-13 20:52:45 +08:00
Enhancement: multiple widgets per service (#4338)
This commit is contained in:
@@ -65,10 +65,10 @@ export async function sendJsonRpcRequest(url, method, params, widget) {
|
||||
}
|
||||
|
||||
export default async function jsonrpcProxyHandler(req, res) {
|
||||
const { group, service, endpoint: method } = req.query;
|
||||
const { group, service, endpoint: method, index } = req.query;
|
||||
|
||||
if (group && service) {
|
||||
const widget = await getServiceWidget(group, service);
|
||||
const widget = await getServiceWidget(group, service, index);
|
||||
const api = widgets?.[widget.type]?.api;
|
||||
|
||||
const [, mapping] = Object.entries(widgets?.[widget.type]?.mappings).find(([, value]) => value.endpoint === method);
|
||||
|
||||
Reference in New Issue
Block a user