From 9b716a2f32ccecfce8e62de33d904ad8a3cbf8df Mon Sep 17 00:00:00 2001 From: futuretea Date: Wed, 9 Nov 2022 15:32:27 +0800 Subject: [PATCH] Fix vlan id save bug Signed-off-by: futuretea --- pkg/console/install_panels.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/console/install_panels.go b/pkg/console/install_panels.go index ef3787ac7..1cd3437fc 100644 --- a/pkg/console/install_panels.go +++ b/pkg/console/install_panels.go @@ -1131,6 +1131,8 @@ func addNetworkPanel(c *Console) error { c.Gui.Cursor = true if mgmtNetwork.VlanID != 0 { askVlanIDV.Value = strconv.Itoa(mgmtNetwork.VlanID) + } else { + askVlanIDV.Value = "" } return nil } @@ -1157,7 +1159,7 @@ func addNetworkPanel(c *Console) error { } askVlanIDVConfirm := gotoNextPanel(c, []string{askBondModePanel}, validateVlanID) askVlanIDV.KeyBindings = map[gocui.Key]func(*gocui.Gui, *gocui.View) error{ - gocui.KeyArrowUp: gotoNextPanel(c, []string{askInterfacePanel}), + gocui.KeyArrowUp: gotoNextPanel(c, []string{askInterfacePanel}, validateVlanID), gocui.KeyArrowDown: askVlanIDVConfirm, gocui.KeyEnter: askVlanIDVConfirm, gocui.KeyEsc: gotoPrevPage,