From b6be0bd462f4157af32897d0c1c441ebc458b245 Mon Sep 17 00:00:00 2001 From: BennyKok Date: Tue, 16 Jan 2024 18:52:13 +0800 Subject: [PATCH] feat: refresh create new machine ui --- web/src/components/MachineList.tsx | 6 ++ .../custom-form/ModelPickerView.tsx | 59 +++++++++++++------ .../custom-form/SnapshotPickerView.tsx | 53 ++++++++++------- .../components/custom-form/model-picker.tsx | 10 ++-- .../custom-form/snapshot-picker.tsx | 10 ++-- 5 files changed, 91 insertions(+), 47 deletions(-) diff --git a/web/src/components/MachineList.tsx b/web/src/components/MachineList.tsx index c6c7148..ec8e72b 100644 --- a/web/src/components/MachineList.tsx +++ b/web/src/components/MachineList.tsx @@ -357,9 +357,15 @@ export function MachineList({ }, snapshot: { fieldType: "snapshot", + inputProps: { + showLabel: false, + }, }, models: { fieldType: "models", + inputProps: { + showLabel: false, + }, }, gpu: { fieldType: !userMetadata.betaFeaturesAccess diff --git a/web/src/components/custom-form/ModelPickerView.tsx b/web/src/components/custom-form/ModelPickerView.tsx index b8bb240..b4fca11 100644 --- a/web/src/components/custom-form/ModelPickerView.tsx +++ b/web/src/components/custom-form/ModelPickerView.tsx @@ -2,6 +2,12 @@ import type { AutoFormInputComponentProps } from "../ui/auto-form/types"; import { LoadingIcon } from "@/components/LoadingIcon"; +import { + Accordion, + AccordionContent, + AccordionItem, + AccordionTrigger, +} from "@/components/ui/accordion"; import { Button } from "@/components/ui/button"; import { Command, @@ -154,22 +160,31 @@ export function ModelPickerView({ field, }: Pick) { return ( -
- - - {/* {field.value.length} selected */} - {field.value && ( - -