diff --git a/api/lib/schema.ts b/api/lib/schema.ts index 5c43bc30e..132981576 100644 --- a/api/lib/schema.ts +++ b/api/lib/schema.ts @@ -276,7 +276,7 @@ export const LayerAlert = pgTable('layer_alerts', { export const Setting = pgTable('settings', { key: text('key').primaryKey(), - value: text('value').notNull().default('') + value: json('value').notNull().default('') }); export const Server = pgTable('server', { diff --git a/api/routes/config.ts b/api/routes/config.ts index b164325ed..3bc70f194 100644 --- a/api/routes/config.ts +++ b/api/routes/config.ts @@ -42,7 +42,9 @@ export default async function router(schema: Schema, config: Config) { 'media::url': Type.Optional(Type.String()), 'media::username': Type.Optional(Type.String()), - 'media::password': Type.Optional(Type.String()) + 'media::password': Type.Optional(Type.String()), + + 'group::names': Type.Optional(Type.Record(Type.String(), Type.String())) }), res: Type.Any() }, async (req, res) => { diff --git a/api/web/src/components/Admin/AdminConfig.vue b/api/web/src/components/Admin/AdminConfig.vue index ea0b10c5d..c509773e6 100644 --- a/api/web/src/components/Admin/AdminConfig.vue +++ b/api/web/src/components/Admin/AdminConfig.vue @@ -99,10 +99,10 @@
-
+
@@ -181,11 +181,13 @@ export default { 'media::url': '', 'media::username': '', - 'media::password': '' + 'media::password': '', + + 'group::names': {} } for (const group of groups) { - config[`group::${group}`] = ''; + config['group::names'][group] = ''; } return {