from controllers.fw import add_fw_option, del_fw_option, fetch_fw_options from services.state import set_state def on_fw_add_btn_click(url: str): add_fw_option(url) # Fetch new options return fetch_fw_options(), "" def on_del_btn_click(url: str): # Fetch options options = fetch_fw_options() # Delete option del_fw_option(list(options.keys()).index(url)) # Remove from options options.pop(url) # Return new options return options, "" def on_fw_radio_change(option: str): set_state('fw_option', option)