From 7d39d49b302469b157fadcb5e158ad43fa49e37a Mon Sep 17 00:00:00 2001 From: Timo Date: Tue, 6 May 2025 14:33:38 +0200 Subject: [PATCH] flash install: fixes form layout --- .../webview-ui/app/src/Form/fields/Select.tsx | 154 +++++++------- .../webview-ui/app/src/Form/fields/layout.tsx | 2 +- .../app/src/components/accordion/index.tsx | 4 +- pkgs/webview-ui/app/src/routes/flash/view.tsx | 197 ++++++------------ .../app/src/routes/machines/create.tsx | 1 - .../app/src/routes/machines/details.tsx | 52 ++--- 6 files changed, 169 insertions(+), 241 deletions(-) diff --git a/pkgs/webview-ui/app/src/Form/fields/Select.tsx b/pkgs/webview-ui/app/src/Form/fields/Select.tsx index dc8a5339e..fe09de191 100644 --- a/pkgs/webview-ui/app/src/Form/fields/Select.tsx +++ b/pkgs/webview-ui/app/src/Form/fields/Select.tsx @@ -142,91 +142,87 @@ export function SelectInput(props: SelectInputpProps) { } field={ - <> - { - const popover = document.getElementById(_id); - if (popover) { - popover.togglePopover(); // Show or hide the popover - } - }} - type="button" - class="flex w-full items-center gap-2" - formnovalidate - // TODO: Use native popover once Webkit supports it within
- // popovertarget={_id} - // popovertargetaction="toggle" + { + const popover = document.getElementById(_id); + if (popover) { + popover.togglePopover(); // Show or hide the popover + } + }} + type="button" + class="flex w-full items-center gap-2" + formnovalidate + // TODO: Use native popover once Webkit supports it within + // popovertarget={_id} + // popovertargetaction="toggle" + > + + {props.adornment?.content} + + {props.inlineLabel} +
- {props.adornment?.content} + + {(item) => ( +
+ {item} + + + +
+ )} +
- {props.inlineLabel} -
- - - {(item) => ( -
- {item} - - - -
- )} -
-
-
- - {props.adornment?.content} - - - - } - /> - +
+ + {props.adornment?.content} + + + + } + /> } /> diff --git a/pkgs/webview-ui/app/src/Form/fields/layout.tsx b/pkgs/webview-ui/app/src/Form/fields/layout.tsx index 1a30e3f57..32d4a8888 100644 --- a/pkgs/webview-ui/app/src/Form/fields/layout.tsx +++ b/pkgs/webview-ui/app/src/Form/fields/layout.tsx @@ -18,7 +18,7 @@ export const FieldLayout = (props: LayoutProps) => { class={cx("grid grid-cols-10 items-center", intern.class)} {...divProps} > - +
{props.label}
{props.field}
{props.error && {props.error}} diff --git a/pkgs/webview-ui/app/src/components/accordion/index.tsx b/pkgs/webview-ui/app/src/components/accordion/index.tsx index ddfd445bb..8d4ba9bb1 100644 --- a/pkgs/webview-ui/app/src/components/accordion/index.tsx +++ b/pkgs/webview-ui/app/src/components/accordion/index.tsx @@ -21,7 +21,7 @@ export default function Accordion(props: AccordionProps) { fallback={ - + } /> - - {(network, index) => ( -
-
- - {(field, props) => ( - - )} - - - {(field, props) => ( - - // togglePasswordVisibility(index()) - // } - // startIcon={ - // passwordVisibility()[index()] ? ( - // - // ) : ( - // - // ) - // } - // > - // ), - // }} - required - /> - )} - -
- -
- )} -
- + -
- -
- Advanced -
-
+ +
{ )} -
-
- -
+ +
@@ -559,7 +560,7 @@ const MachineForm = (props: MachineDetailsProps) => { class="w-full" size="s" onClick={() => handleUpdate()} - endIcon={} + endIcon={} > Update @@ -636,6 +637,7 @@ const MachineForm = (props: MachineDetailsProps) => { /> )} +
{(field, props) => ( <> @@ -646,27 +648,25 @@ const MachineForm = (props: MachineDetailsProps) => { )} - -
- -
Connection Settings
-
- - {(field, props) => ( - - )} - -
-
+ +
+ + {(field, props) => ( + + )} + +
+
+ {