feat(settings): add settings route and API updates\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This commit is contained in:
2026-05-16 20:19:35 +02:00
parent 9b63d981b0
commit 0ee89cf052
38 changed files with 1426 additions and 562 deletions
-15
View File
@@ -1,19 +1,4 @@
import type { LoaderFunction } from '@remix-run/node';
import { json } from '@remix-run/node';
import React, { useEffect, useState } from 'react';
import { requireAdmin } from '~/lib/auth.server';
import { settingsService } from '~/lib/settings.server';
export const loader: LoaderFunction = async ({ request }) => {
await requireAdmin(request);
await settingsService.init?.();
const entries: any[] = [];
// @ts-ignore
for (const key of (settingsService as any).cache.keys()) {
entries.push({ key, value: await settingsService.get(key) });
}
return json({ entries });
};
export default function SettingsPage() {
const [items, setItems] = useState<Array<{ key: string; value: any }>>([]);