mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 04:46:05 +00:00
added aws lambda adapter + improvements to handle concurrency
This commit is contained in:
@@ -47,19 +47,29 @@ export function BkndProvider({
|
||||
const api = useApi();
|
||||
|
||||
async function reloadSchema() {
|
||||
await fetchSchema(includeSecrets, true);
|
||||
await fetchSchema(includeSecrets, {
|
||||
force: true,
|
||||
fresh: true,
|
||||
});
|
||||
}
|
||||
|
||||
async function fetchSchema(_includeSecrets: boolean = false, force?: boolean) {
|
||||
async function fetchSchema(
|
||||
_includeSecrets: boolean = false,
|
||||
opts?: {
|
||||
force?: boolean;
|
||||
fresh?: boolean;
|
||||
},
|
||||
) {
|
||||
const requesting = withSecrets ? Fetching.Secrets : Fetching.Schema;
|
||||
if (fetching.current === requesting) return;
|
||||
|
||||
if (withSecrets && !force) return;
|
||||
if (withSecrets && opts?.force !== true) return;
|
||||
fetching.current = requesting;
|
||||
|
||||
const res = await api.system.readSchema({
|
||||
config: true,
|
||||
secrets: _includeSecrets,
|
||||
fresh: opts?.fresh,
|
||||
});
|
||||
|
||||
if (!res.ok) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IconSettings } from "@tabler/icons-react";
|
||||
import { IconRefresh, IconSettings } from "@tabler/icons-react";
|
||||
import { ucFirst } from "core/utils";
|
||||
import { useBknd } from "ui/client/bknd";
|
||||
import { Empty } from "ui/components/display/Empty";
|
||||
@@ -12,11 +12,16 @@ import { AuthSettings } from "./routes/auth.settings";
|
||||
import { DataSettings } from "./routes/data.settings";
|
||||
import { FlowsSettings } from "./routes/flows.settings";
|
||||
import { ServerSettings } from "./routes/server.settings";
|
||||
import { IconButton } from "ui/components/buttons/IconButton";
|
||||
|
||||
function SettingsSidebar() {
|
||||
const { version, schema } = useBknd();
|
||||
const { version, schema, actions } = useBknd();
|
||||
useBrowserTitle(["Settings"]);
|
||||
|
||||
async function handleRefresh() {
|
||||
await actions.reload();
|
||||
}
|
||||
|
||||
const modules = Object.keys(schema).map((key) => {
|
||||
return {
|
||||
title: schema[key].title ?? ucFirst(key),
|
||||
@@ -26,7 +31,14 @@ function SettingsSidebar() {
|
||||
|
||||
return (
|
||||
<AppShell.Sidebar>
|
||||
<AppShell.SectionHeader right={<span className="font-mono">v{version}</span>}>
|
||||
<AppShell.SectionHeader
|
||||
right={
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="font-mono leading-none">v{version}</span>
|
||||
<IconButton Icon={IconRefresh} onClick={handleRefresh} />
|
||||
</div>
|
||||
}
|
||||
>
|
||||
Settings
|
||||
</AppShell.SectionHeader>
|
||||
<AppShell.Scrollable initialOffset={96}>
|
||||
|
||||
Reference in New Issue
Block a user