From e5455f98fcc2c0a7e0ccdcc39d33bda494289dba Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Sat, 28 Oct 2023 18:31:39 +0200 Subject: [PATCH] fix frontend --- pkgs/ui/nix/pdefs.nix | 2 +- pkgs/ui/src/app/machines/layout.tsx | 7 ++++- pkgs/ui/src/app/machines/page.tsx | 5 +--- .../createMachineForm/customConfig.tsx | 11 +++++--- .../components/createMachineForm/index.tsx | 2 +- .../ui/src/components/hooks/useAppContext.tsx | 4 +-- pkgs/ui/src/components/hooks/useDebounce.tsx | 6 ++--- pkgs/ui/src/components/hooks/useMachines.tsx | 4 +-- pkgs/ui/src/components/table/nodeTable.tsx | 2 +- pkgs/ui/src/components/table/searchBar.tsx | 12 ++++----- pkgs/ui/src/data/nodeData.tsx | 26 +++++++++++-------- pkgs/ui/src/views/joinPrequel.tsx | 7 ++--- 12 files changed, 49 insertions(+), 39 deletions(-) diff --git a/pkgs/ui/nix/pdefs.nix b/pkgs/ui/nix/pdefs.nix index 9bae9397d..c7a2b7481 100644 --- a/pkgs/ui/nix/pdefs.nix +++ b/pkgs/ui/nix/pdefs.nix @@ -18438,4 +18438,4 @@ }; }; }; -} \ No newline at end of file +} diff --git a/pkgs/ui/src/app/machines/layout.tsx b/pkgs/ui/src/app/machines/layout.tsx index eace0be37..e9db5e3fe 100644 --- a/pkgs/ui/src/app/machines/layout.tsx +++ b/pkgs/ui/src/app/machines/layout.tsx @@ -1,5 +1,10 @@ import { MachineContextProvider } from "@/components/hooks/useMachines"; export default function Layout({ children }: { children: React.ReactNode }) { - return {children}; + return ( + // TODO: select flake? + + {children} + + ); } diff --git a/pkgs/ui/src/app/machines/page.tsx b/pkgs/ui/src/app/machines/page.tsx index 9c89d605e..b1d7b4429 100644 --- a/pkgs/ui/src/app/machines/page.tsx +++ b/pkgs/ui/src/app/machines/page.tsx @@ -2,9 +2,6 @@ import { NodeTable } from "@/components/table"; - export default function Page() { - return ( - - ); + return ; } diff --git a/pkgs/ui/src/components/createMachineForm/customConfig.tsx b/pkgs/ui/src/components/createMachineForm/customConfig.tsx index acd9441d9..cc14a9537 100644 --- a/pkgs/ui/src/components/createMachineForm/customConfig.tsx +++ b/pkgs/ui/src/components/createMachineForm/customConfig.tsx @@ -33,7 +33,10 @@ interface PureCustomConfigProps extends FormStepContentProps { } export function CustomConfig(props: FormStepContentProps) { const { formHooks } = props; - const { data, isLoading, error } = useGetMachineSchema("mama"); + const { data, isLoading, error } = useGetMachineSchema( + "defaultFlake", + "mama", + ); // const { data, isLoading, error } = { data: {data:{schema: { // title: 'Test form', // type: 'object', @@ -53,11 +56,11 @@ export function CustomConfig(props: FormStepContentProps) { return {}; }, [data, isLoading, error]); + type ValueType = { default: any }; const initialValues = useMemo( () => Object.entries(schema?.properties || {}).reduce((acc, [key, value]) => { - /*@ts-ignore*/ - const init: any = value?.default; + const init: any = (value as ValueType)?.default; if (init) { return { ...acc, @@ -157,7 +160,7 @@ function PureCustomConfig(props: PureCustomConfigProps) { // ObjectFieldTemplate: ErrorListTemplate: ErrorList, ButtonTemplates: { - SubmitButton: (props) => ( + SubmitButton: () => (