import { modals } from "@mantine/modals";
import { IconSettings } from "@tabler/icons-react";
import { ucFirst } from "core/utils";
import { Route, Switch } from "wouter";
import { useBknd } from "../../client";
import { Empty } from "../../components/display/Empty";
import { Link } from "../../components/wouter/Link";
import { useBrowserTitle } from "../../hooks/use-browser-title";
import * as AppShell from "../../layouts/AppShell/AppShell";
import { bkndModals } from "../../modals";
import { Setting } 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() {
useBknd({ withSecrets: true });
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 }) => {
const { app } = useBknd();
const basepath = app.getAdminConfig();
const prefix = `~/${basepath}/settings`.replace(/\/+/g, "/");
return (
(
)}
nest
/>
);
};