admin: added "system" theme option, check user pref

This commit is contained in:
dswbx
2025-02-18 08:20:41 +01:00
parent bd362607ae
commit 0823b182f6
9 changed files with 32 additions and 23 deletions

View File

@@ -4,12 +4,15 @@ import { cors } from "hono/cors";
import { Module } from "modules/Module";
const serverMethods = ["GET", "POST", "PATCH", "PUT", "DELETE"];
const appThemes = ["dark", "light", "system"] as const;
export type AppTheme = (typeof appThemes)[number];
export const serverConfigSchema = Type.Object(
{
admin: Type.Object(
{
basepath: Type.Optional(Type.String({ default: "", pattern: "^(/.+)?$" })),
color_scheme: Type.Optional(StringEnum(["dark", "light"], { default: "light" })),
color_scheme: Type.Optional(StringEnum(["dark", "light", "system"])),
logo_return_path: Type.Optional(
Type.String({
default: "/",