From 39ff53f2baf1c9f582cd99073d88c200ba318b9e Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Thu, 11 Jan 2024 20:00:44 +0100 Subject: [PATCH] Add a warning --- .../src/widgets/forms/NetNatConfiguration.tsx | 41 ++++++++++++------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/virtweb_frontend/src/widgets/forms/NetNatConfiguration.tsx b/virtweb_frontend/src/widgets/forms/NetNatConfiguration.tsx index a6aaa91..16f4122 100644 --- a/virtweb_frontend/src/widgets/forms/NetNatConfiguration.tsx +++ b/virtweb_frontend/src/widgets/forms/NetNatConfiguration.tsx @@ -1,5 +1,6 @@ import DeleteIcon from "@mui/icons-material/Delete"; import { + Alert, Button, Card, CardActions, @@ -156,21 +157,31 @@ function NatEntryForm(p: { )} {p.entry.host_ip.type === "interface" && ( - { - return { - value: n, - }; - })} - onValueChange={(v) => { - if (p.entry.host_ip.type === "interface") - p.entry.host_ip.name = v!; - p.onChange?.(); - }} - /> + <> + {p.editable && ( + + Warning! All IP addresses may not be inferred on reboot due + to the fact that the network hook might be executed before + the network interfaces are fully configured. This might lead + to incomplete ports exposition! + + )} + { + return { + value: n, + }; + })} + onValueChange={(v) => { + if (p.entry.host_ip.type === "interface") + p.entry.host_ip.name = v!; + p.onChange?.(); + }} + /> + )}