mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-08 06:38:46 +00:00
Glances widget use settings for URL
This commit is contained in:
parent
080bc44a6f
commit
802fe0f721
1 changed files with 8 additions and 1 deletions
|
@ -1,12 +1,19 @@
|
|||
import { httpProxy } from "utils/proxy/http";
|
||||
import createLogger from "utils/logger";
|
||||
import { getSettings } from "utils/config/config";
|
||||
|
||||
const logger = createLogger("glances");
|
||||
|
||||
export default async function handler(req, res) {
|
||||
const { url } = req.query;
|
||||
const settings = getSettings()?.glances;
|
||||
if (!settings) {
|
||||
logger.error("There is no glances section in settings.yaml");
|
||||
return res.status(400).json({ error: "There is no glances section in settings.yaml" });
|
||||
}
|
||||
|
||||
const url = settings?.url;
|
||||
if (!url) {
|
||||
logger.error("Missing Glances URL");
|
||||
return res.status(400).json({ error: "Missing Glances URL" });
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue