mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-18 18:49:50 +00:00
Feature: stock market service and info widget (#3617)
--------- Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
parent
810c321881
commit
231e2408c3
14 changed files with 424 additions and 1 deletions
|
@ -457,6 +457,10 @@ export function cleanServiceGroups(groups) {
|
|||
// sonarr, radarr
|
||||
enableQueue,
|
||||
|
||||
// stocks
|
||||
watchlist,
|
||||
showUSMarketStatus,
|
||||
|
||||
// truenas
|
||||
enablePools,
|
||||
nasType,
|
||||
|
@ -600,6 +604,10 @@ export function cleanServiceGroups(groups) {
|
|||
cleanedService.widget.bitratePrecision = parseInt(bitratePrecision, 10);
|
||||
}
|
||||
}
|
||||
if (type === "stocks") {
|
||||
if (watchlist) cleanedService.widget.watchlist = watchlist;
|
||||
if (showUSMarketStatus) cleanedService.widget.showUSMarketStatus = showUSMarketStatus;
|
||||
}
|
||||
if (type === "wgeasy") {
|
||||
if (threshold !== undefined) cleanedService.widget.threshold = parseInt(threshold, 10);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ import { formatApiCall, sanitizeErrorURL } from "utils/proxy/api-helpers";
|
|||
import validateWidgetData from "utils/proxy/validate-widget-data";
|
||||
import { httpProxy } from "utils/proxy/http";
|
||||
import createLogger from "utils/logger";
|
||||
import { getSettings } from "utils/config/config";
|
||||
import widgets from "widgets/widgets";
|
||||
|
||||
const logger = createLogger("credentialedProxyHandler");
|
||||
|
@ -24,7 +25,12 @@ export default async function credentialedProxyHandler(req, res, map) {
|
|||
"Content-Type": "application/json",
|
||||
};
|
||||
|
||||
if (widget.type === "coinmarketcap") {
|
||||
if (widget.type === "stocks") {
|
||||
const { providers } = getSettings();
|
||||
if (widget.provider === "finnhub" && providers?.finnhub) {
|
||||
headers["X-Finnhub-Token"] = `${providers?.finnhub}`;
|
||||
}
|
||||
} else if (widget.type === "coinmarketcap") {
|
||||
headers["X-CMC_PRO_API_KEY"] = `${widget.key}`;
|
||||
} else if (widget.type === "gotify") {
|
||||
headers["X-gotify-Key"] = `${widget.key}`;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue