Files
Homarr/src/tools/config/getFrontendConfig.ts

28 lines
750 B
TypeScript
Raw Normal View History

import Consola from 'consola';
import { ConfigType } from '../../types/config';
import { getConfig } from './getConfig';
export const getFrontendConfig = (name: string): ConfigType => {
const config = getConfig(name);
Consola.info(`Requested frontend content of configuration '${name}'`);
return {
...config,
2022-12-23 17:17:57 +01:00
apps: config.apps.map((app) => ({
...app,
integration: {
2022-12-24 17:18:16 +09:00
...(app.integration ?? null),
2022-12-23 17:17:57 +01:00
type: app.integration?.type ?? null,
2022-12-24 17:18:16 +09:00
properties:
app.integration?.properties.map((property) => ({
...property,
2022-12-31 16:07:05 +01:00
value: property.type === 'private' ? null : property.value,
isDefined: property.value !== null,
2022-12-24 17:18:16 +09:00
})) ?? [],
2022-12-23 17:17:57 +01:00
},
})),
};
};