mirror of
https://github.com/karl0ss/homepage.git
synced 2025-04-29 12:03:41 +01:00
linting fixes
This commit is contained in:
parent
e6b1901c4c
commit
b26e07cf26
@ -33,9 +33,9 @@ async function loginToWGEasy(endpoint, widget) {
|
||||
return [403, null];
|
||||
}
|
||||
// Create new session on WgEasy
|
||||
let url = new URL(formatApiCall(api, { endpoint, ...widget }));
|
||||
const url = new URL(formatApiCall(api, { endpoint, ...widget }));
|
||||
|
||||
let [status, contentType, data, responseHeaders] = await httpProxy(url, {
|
||||
const [status, data, , responseHeaders] = await httpProxy(url, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@ -50,7 +50,7 @@ async function loginToWGEasy(endpoint, widget) {
|
||||
return [status, data, responseHeaders];
|
||||
}
|
||||
try {
|
||||
globalSid = responseHeaders["set-cookie"][0]
|
||||
[ globalSid ] = responseHeaders["set-cookie"]
|
||||
} catch (e) {
|
||||
logger.error("Error decoding NextPVR API data. Data: %s", data.toString());
|
||||
return [status, null];
|
||||
@ -99,14 +99,14 @@ export default async function WGeasyProxyHandler(req, res) {
|
||||
|
||||
logger.debug("Getting data from WGeasy API");
|
||||
// Calculate the number of clients
|
||||
let [status, apiData] = await fetchDataFromWGeasy('wireguard/client', widget, globalSid);
|
||||
const [status, apiData] = await fetchDataFromWGeasy('wireguard/client', widget, globalSid);
|
||||
|
||||
if (status !== 200) {
|
||||
return res.status(status).json({ error: { message: "HTTP error communicating with WGeasy API", data: Buffer.from(apiData).toString() } });
|
||||
}
|
||||
let clientCount;
|
||||
let clientCount = 0;
|
||||
clientCount = apiData.length;
|
||||
|
||||
|
||||
const data = {
|
||||
clientCount
|
||||
};
|
||||
@ -115,4 +115,3 @@ export default async function WGeasyProxyHandler(req, res) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user