mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-07 14:18:47 +00:00
Add Docker, Emby, Gotify, Jackett, and JellySeerr widgets
This commit is contained in:
parent
035dd25ece
commit
808e79e2ac
15 changed files with 510 additions and 9 deletions
|
@ -1,3 +1,4 @@
|
|||
import { formatApiCall } from "utils/api-helpers";
|
||||
import createLogger from "utils/logger";
|
||||
import genericProxyHandler from "utils/proxies/generic";
|
||||
import widgets from "widgets/widgets";
|
||||
|
@ -31,12 +32,15 @@ export default async function handler(req, res) {
|
|||
return res.status(403).json({ error: "Unsupported service endpoint" });
|
||||
}
|
||||
|
||||
if (req.query.params) {
|
||||
const queryParams = JSON.parse(req.query.params);
|
||||
req.query.endpoint = endpoint;
|
||||
if (req.query.segments) {
|
||||
const segments = JSON.parse(req.query.segments);
|
||||
req.query.endpoint = formatApiCall(endpoint, segments);
|
||||
}
|
||||
if (req.query.query) {
|
||||
const queryParams = JSON.parse(req.query.query);
|
||||
const query = new URLSearchParams(mappingParams.map((p) => [p, queryParams[p]]));
|
||||
req.query.endpoint = `${endpoint}?${query}`;
|
||||
} else {
|
||||
req.query.endpoint = endpoint;
|
||||
req.query.endpoint = `${req.query.endpoint}?${query}`;
|
||||
}
|
||||
|
||||
if (endpointProxy instanceof Function) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue