From 9a15fb4f60671eeb7c8337d9a39d9f0cd5ec5063 Mon Sep 17 00:00:00 2001 From: Pierre Hubert Date: Thu, 26 Oct 2023 12:15:49 +0200 Subject: [PATCH] Fix issues with the handling of VM creation --- virtweb_frontend/src/routes/EditVMRoute.tsx | 1 + virtweb_frontend/src/widgets/vms/VMDetails.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/virtweb_frontend/src/routes/EditVMRoute.tsx b/virtweb_frontend/src/routes/EditVMRoute.tsx index ceeb079..2f409a7 100644 --- a/virtweb_frontend/src/routes/EditVMRoute.tsx +++ b/virtweb_frontend/src/routes/EditVMRoute.tsx @@ -10,6 +10,7 @@ import { VMDetails } from "../widgets/vms/VMDetails"; export function CreateVMRoute(): React.ReactElement { const snackbar = useSnackbar(); + const alert = useAlert(); const navigate = useNavigate(); const [vm] = React.useState(VMInfo.NewEmpty); diff --git a/virtweb_frontend/src/widgets/vms/VMDetails.tsx b/virtweb_frontend/src/widgets/vms/VMDetails.tsx index 068f3b7..6356552 100644 --- a/virtweb_frontend/src/widgets/vms/VMDetails.tsx +++ b/virtweb_frontend/src/widgets/vms/VMDetails.tsx @@ -60,6 +60,7 @@ function VMDetailsInner( p.vm.name = v ?? ""; p.onChange?.(); }} + checkValue={(v) => /^[a-zA-Z0-9]+$/.test(v)} size={ServerApi.Config.constraints.name_size} />