mirror of
https://github.com/gethomepage/homepage.git
synced 2026-01-05 23:12:08 +08:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b1080ad43 | ||
|
|
52a4f1a423 |
@@ -14,11 +14,11 @@ export async function sendJsonRpcRequest(url, method, params, widget) {
|
|||||||
accept: "application/json",
|
accept: "application/json",
|
||||||
};
|
};
|
||||||
|
|
||||||
if (widget.username && widget.password) {
|
if (widget?.username && widget?.password) {
|
||||||
headers.Authorization = `Basic ${Buffer.from(`${widget.username}:${widget.password}`).toString("base64")}`;
|
headers.Authorization = `Basic ${Buffer.from(`${widget.username}:${widget.password}`).toString("base64")}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (widget.key) {
|
if (widget?.key) {
|
||||||
headers.Authorization = `Bearer ${widget.key}`;
|
headers.Authorization = `Bearer ${widget.key}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,12 @@ const widget = {
|
|||||||
api: "{url}/jsonrpc",
|
api: "{url}/jsonrpc",
|
||||||
proxyHandler: jsonrpcProxyHandler,
|
proxyHandler: jsonrpcProxyHandler,
|
||||||
allowedEndpoints: /status/,
|
allowedEndpoints: /status/,
|
||||||
|
|
||||||
|
mappings: {
|
||||||
|
status: {
|
||||||
|
endpoint: "status",
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default widget;
|
export default widget;
|
||||||
|
|||||||
Reference in New Issue
Block a user