import { IconSettings } from "@tabler/icons-react"; import { ucFirst } from "core/utils"; import { useBknd } from "ui/client/bknd"; import { Empty } from "ui/components/display/Empty"; import { Message } from "ui/components/display/Message"; import { Link } from "ui/components/wouter/Link"; import { useBrowserTitle } from "ui/hooks/use-browser-title"; import * as AppShell from "ui/layouts/AppShell/AppShell"; import { Route, Switch } from "wouter"; import { Setting, type SettingProps } from "./components/Setting"; import { AuthSettings } from "./routes/auth.settings"; import { DataSettings } from "./routes/data.settings"; import { FlowsSettings } from "./routes/flows.settings"; import { ServerSettings } from "./routes/server.settings"; function SettingsSidebar() { const { version, schema } = useBknd(); useBrowserTitle(["Settings"]); const modules = Object.keys(schema).map((key) => { return { title: schema[key].title ?? ucFirst(key), key, }; }); return ( v{version}}> Settings
); } export default function SettingsRoutes() { const b = useBknd({ withSecrets: true }); if (!b.hasSecrets) return ; return ( <> ( )} /> ( )} /> ); } const uiSchema = { server: { cors: { allow_methods: { "ui:widget": "checkboxes", }, allow_headers: { "ui:options": { orderable: false, }, }, }, }, media: { adapter: { "ui:options": { label: false, }, /*type: { "ui:widget": "hidden" }*/ }, }, }; const SettingRoutesRoutes = () => { const { schema, config } = useBknd(); console.log("flows", { schema: schema.flows, config: config.flows, }); return ( <> ); }; const FallbackRoutes = ({ module, schema, config, ...settingProps }: SettingProps & { module: string }) => { const { app } = useBknd(); const basepath = app.getAdminConfig(); const prefix = `~/${basepath}/settings`.replace(/\/+/g, "/"); return ( ( )} nest /> ); };