mirror of
https://github.com/karl0ss/homepage.git
synced 2025-05-07 15:53:39 +01:00
linting fixes
This commit is contained in:
parent
4447f44337
commit
84acccba83
@ -65,7 +65,7 @@ export default async function JDRssProxyHandler(req, res) {
|
|||||||
if (status !== 200) {
|
if (status !== 200) {
|
||||||
return res.status(status).json({ error: { message: "HTTP error communicating with WGeasy API", data: Buffer.from(apiData).toString() } });
|
return res.status(status).json({ error: { message: "HTTP error communicating with WGeasy API", data: Buffer.from(apiData).toString() } });
|
||||||
}
|
}
|
||||||
let showCount;
|
let showCount = 0;
|
||||||
showCount = apiData.length;
|
showCount = apiData.length;
|
||||||
|
|
||||||
// Calculate the number of items in the retry cache
|
// Calculate the number of items in the retry cache
|
||||||
@ -73,7 +73,7 @@ export default async function JDRssProxyHandler(req, res) {
|
|||||||
if (status !== 200) {
|
if (status !== 200) {
|
||||||
return res.status(status).json({ error: { message: "HTTP error communicating with WGeasy API", data: Buffer.from(apiData).toString() } });
|
return res.status(status).json({ error: { message: "HTTP error communicating with WGeasy API", data: Buffer.from(apiData).toString() } });
|
||||||
}
|
}
|
||||||
let retryCache;
|
let retryCache = 0;
|
||||||
retryCache = apiData.length;
|
retryCache = apiData.length;
|
||||||
|
|
||||||
// Calculate the number of items in the feed cache
|
// Calculate the number of items in the feed cache
|
||||||
@ -81,13 +81,13 @@ export default async function JDRssProxyHandler(req, res) {
|
|||||||
if (status !== 200) {
|
if (status !== 200) {
|
||||||
return res.status(status).json({ error: { message: "HTTP error communicating with WGeasy API", data: Buffer.from(apiData).toString() } });
|
return res.status(status).json({ error: { message: "HTTP error communicating with WGeasy API", data: Buffer.from(apiData).toString() } });
|
||||||
}
|
}
|
||||||
let feedCache;
|
let feedCache = 0;
|
||||||
feedCache = apiData.length;
|
feedCache = apiData.length;
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
showCount:showCount,
|
showCount,
|
||||||
retryCache:retryCache,
|
retryCache,
|
||||||
feedCache:feedCache
|
feedCache
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -33,9 +33,9 @@ async function loginToWGEasy(endpoint, widget) {
|
|||||||
return [403, null];
|
return [403, null];
|
||||||
}
|
}
|
||||||
// Create new session on WgEasy
|
// 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',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
@ -50,7 +50,7 @@ async function loginToWGEasy(endpoint, widget) {
|
|||||||
return [status, data, responseHeaders];
|
return [status, data, responseHeaders];
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
globalSid = responseHeaders["set-cookie"][0]
|
[ globalSid ] = responseHeaders["set-cookie"]
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.error("Error decoding NextPVR API data. Data: %s", data.toString());
|
logger.error("Error decoding NextPVR API data. Data: %s", data.toString());
|
||||||
return [status, null];
|
return [status, null];
|
||||||
@ -99,12 +99,12 @@ export default async function WGeasyProxyHandler(req, res) {
|
|||||||
|
|
||||||
logger.debug("Getting data from WGeasy API");
|
logger.debug("Getting data from WGeasy API");
|
||||||
// Calculate the number of clients
|
// 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) {
|
if (status !== 200) {
|
||||||
return res.status(status).json({ error: { message: "HTTP error communicating with WGeasy API", data: Buffer.from(apiData).toString() } });
|
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;
|
clientCount = apiData.length;
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user