mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-09 06:48: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
|
@ -32,15 +32,28 @@ export function formatApiCall(url, args) {
|
|||
return url.replace(find, replace);
|
||||
}
|
||||
|
||||
export function formatProxyUrl(widget, endpoint, endpointParams) {
|
||||
function getURLSearchParams(widget, endpoint) {
|
||||
const params = new URLSearchParams({
|
||||
type: widget.type,
|
||||
group: widget.service_group,
|
||||
service: widget.service_name,
|
||||
endpoint,
|
||||
});
|
||||
if (endpointParams) {
|
||||
params.append("params", JSON.stringify(endpointParams));
|
||||
return params;
|
||||
}
|
||||
|
||||
export function formatProxyUrlWithSegments(widget, endpoint, segments) {
|
||||
const params = getURLSearchParams(widget, endpoint);
|
||||
if (segments) {
|
||||
params.append("segments", JSON.stringify(segments))
|
||||
}
|
||||
return `/api/services/proxy?${params.toString()}`;
|
||||
}
|
||||
|
||||
export function formatProxyUrl(widget, endpoint, queryParams) {
|
||||
const params = getURLSearchParams(widget, endpoint);
|
||||
if (queryParams) {
|
||||
params.append("query", JSON.stringify(queryParams));
|
||||
}
|
||||
return `/api/services/proxy?${params.toString()}`;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue