From 71e22bc32882cdc9ba095044b702b9b209855ce0 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Tue, 9 Jan 2024 18:28:26 +0100 Subject: [PATCH] Make DHCP hosts reservation be full width --- .../src/widgets/forms/EditSection.tsx | 8 +++-- .../widgets/forms/NetDHCPHostReservations.tsx | 34 +++++++++++-------- .../src/widgets/net/NetworkDetails.tsx | 2 +- 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/virtweb_frontend/src/widgets/forms/EditSection.tsx b/virtweb_frontend/src/widgets/forms/EditSection.tsx index 03ead13..b8a7d31 100644 --- a/virtweb_frontend/src/widgets/forms/EditSection.tsx +++ b/virtweb_frontend/src/widgets/forms/EditSection.tsx @@ -2,10 +2,14 @@ import { Grid, Paper, Typography } from "@mui/material"; import React, { PropsWithChildren } from "react"; export function EditSection( - p: { title?: string; actions?: React.ReactElement } & PropsWithChildren + p: { + title?: string; + actions?: React.ReactElement; + fullWidth?: boolean; + } & PropsWithChildren ): React.ReactElement { return ( - + {(p.title || p.actions) && ( - {p.dhcp.hosts.map((h, num) => ( - { - p.onChange?.(p.dhcp); - }} - host={h} - onRemove={() => { - p.dhcp.hosts.splice(num, 1); - p.onChange?.(p.dhcp); - }} - /> - ))} - + + {p.dhcp.hosts.map((h, num) => ( + + { + p.onChange?.(p.dhcp); + }} + host={h} + onRemove={() => { + p.dhcp.hosts.splice(num, 1); + p.onChange?.(p.dhcp); + }} + /> + + ))} + {p.editable && ( )} diff --git a/virtweb_frontend/src/widgets/net/NetworkDetails.tsx b/virtweb_frontend/src/widgets/net/NetworkDetails.tsx index 531fd6e..10fa087 100644 --- a/virtweb_frontend/src/widgets/net/NetworkDetails.tsx +++ b/virtweb_frontend/src/widgets/net/NetworkDetails.tsx @@ -373,7 +373,7 @@ function IPSection(p: { )} {p.config?.dhcp && (p.editable || p.config.dhcp.hosts.length > 0) && ( - +