mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-07 22:28:48 +00:00
allow pihole requests to be proxied
This commit is contained in:
parent
d4908d34fb
commit
8cbead1703
1 changed files with 7 additions and 1 deletions
|
@ -7,7 +7,13 @@ export default function Pihole({ service }) {
|
||||||
const config = service.widget;
|
const config = service.widget;
|
||||||
|
|
||||||
function buildApiUrl(endpoint) {
|
function buildApiUrl(endpoint) {
|
||||||
const { url } = config;
|
const { url, proxy } = config;
|
||||||
|
|
||||||
|
if (proxy) {
|
||||||
|
const fullUrl = `${url}/admin/${endpoint}`;
|
||||||
|
return "/api/proxy?url=" + encodeURIComponent(fullUrl);
|
||||||
|
}
|
||||||
|
|
||||||
return `${url}/admin/${endpoint}`;
|
return `${url}/admin/${endpoint}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue