cleanup coinmarketcap widget

This commit is contained in:
Ben Phelps 2022-09-12 12:38:50 +03:00
parent ea55cde043
commit cc0b4be50c
3 changed files with 35 additions and 19 deletions

View file

@ -15,7 +15,7 @@ const formats = {
npm: `{url}/api/{endpoint}`,
readarr: `{url}/api/v1/{endpoint}?apikey={key}`,
sabnzbd: `{url}/api/?apikey={key}&output=json&mode={endpoint}`,
coinmarketcap: `{url}/{endpoint}`,
coinmarketcap: `https://pro-api.coinmarketcap.com/{endpoint}`,
gotify: `{url}/{endpoint}`,
};

View file

@ -110,10 +110,19 @@ export function cleanServiceGroups(groups) {
const cleanedService = { ...service };
if (cleanedService.widget) {
const { type, server, container } = cleanedService.widget;
// whitelisted set of keys to pass to the frontend
const {
type, // all widgets
server, // docker widget
container,
currency, // coinmarketcap widget
symbols,
} = cleanedService.widget;
cleanedService.widget = {
type,
currency,
symbols,
service_name: service.name,
service_group: serviceGroup.name,
};