Fixes for RNodeMultiInterface

This commit is contained in:
RFNexus 2025-04-20 23:17:24 -04:00
parent 8e21c26c2f
commit a0d6b752a3
2 changed files with 5 additions and 10 deletions

View file

@ -1686,7 +1686,7 @@ class AddInterfaceView(urwid.WidgetWrap):
self.ifac_options_button = urwid.AttrMap(self.ifac_options_button, "button_normal", focus_map="button_focus") self.ifac_options_button = urwid.AttrMap(self.ifac_options_button, "button_normal", focus_map="button_focus")
self.ifac_options_widget = urwid.Pile([]) self.ifac_options_widget = urwid.Pile([])
if self.iface_type in ["RNodeInterface", "RNodeMultiInterface"]: if self.iface_type in ["RNodeInterface"]:
self.calculator_button = urwid.Button("Show On-Air Calculations", on_press=self.toggle_calculator) self.calculator_button = urwid.Button("Show On-Air Calculations", on_press=self.toggle_calculator)
self.calculator_button = urwid.AttrMap(self.calculator_button, "button_normal", focus_map="button_focus") self.calculator_button = urwid.AttrMap(self.calculator_button, "button_normal", focus_map="button_focus")
@ -1703,7 +1703,7 @@ class AddInterfaceView(urwid.WidgetWrap):
self.more_options_button, self.more_options_button,
self.more_options_widget, self.more_options_widget,
]) ])
if self.iface_type in ["RNodeInterface", "RNodeMultiInterface"]: if self.iface_type in ["RNodeInterface"]:
self.rnode_calculator = RNodeCalculator(self) self.rnode_calculator = RNodeCalculator(self)
self.calculator_visible = False self.calculator_visible = False
self.calculator_widget = urwid.Pile([]) self.calculator_widget = urwid.Pile([])
@ -2139,7 +2139,7 @@ class EditInterfaceView(AddInterfaceView):
} }
for field_key, field in self.fields.items(): for field_key, field in self.fields.items():
if field_key not in ["name", "custom_parameters", "type"]: if field_key not in ["name", "custom_parameters", "type", "subinterfaces"]:
widget = field["widget"] widget = field["widget"]
value = widget.get_value() value = widget.get_value()
if value is not None and value != "": if value is not None and value != "":
@ -2153,11 +2153,7 @@ class EditInterfaceView(AddInterfaceView):
elif self.iface_type == "RNodeMultiInterface" and "subinterfaces" in self.fields: elif self.iface_type == "RNodeMultiInterface" and "subinterfaces" in self.fields:
subinterfaces = self.fields["subinterfaces"]["widget"].get_value() subinterfaces = self.fields["subinterfaces"]["widget"].get_value()
for subname, subconfig in subinterfaces.items(): for subname, subconfig in subinterfaces.items():
if any(k.startswith('[[[') for k in self.interface_config.keys()):
updated_config[f"[[[{subname}]]]"] = subconfig
else:
updated_config[subname] = subconfig updated_config[subname] = subconfig
for field_key, field in self.additional_fields.items(): for field_key, field in self.additional_fields.items():

View file

@ -386,7 +386,6 @@ class FormMultiTable(urwid.Pile, FormField):
try: try:
value = transform(value) value = transform(value)
except (ValueError, TypeError): except (ValueError, TypeError):
pass
value = "" value = ""
if value: if value: