mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-08 06:38:46 +00:00
Private widget options API
This commit is contained in:
parent
8e2ff61f1c
commit
7c39cd8960
3 changed files with 39 additions and 4 deletions
|
@ -4,7 +4,7 @@ import path from "path";
|
|||
|
||||
import yaml from "js-yaml";
|
||||
|
||||
import checkAndCopyConfig from "utils/config/config";
|
||||
import checkAndCopyConfig, { sanitizePrivateOptions } from "utils/config/config";
|
||||
import { servicesFromConfig, servicesFromDocker, cleanServiceGroups } from "utils/config/service-helpers";
|
||||
|
||||
export async function bookmarksResponse() {
|
||||
|
@ -38,9 +38,12 @@ export async function widgetsResponse() {
|
|||
if (!widgets) return [];
|
||||
|
||||
// map easy to write YAML objects into easy to consume JS arrays
|
||||
const widgetsArray = widgets.map((group) => ({
|
||||
const widgetsArray = widgets.map((group, index) => ({
|
||||
type: Object.keys(group)[0],
|
||||
options: { ...group[Object.keys(group)[0]] },
|
||||
options: {
|
||||
index,
|
||||
...sanitizePrivateOptions(group[Object.keys(group)[0]])
|
||||
},
|
||||
}));
|
||||
|
||||
return widgetsArray;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue