It seems like most of the logic in this function belongs to the `HotspotWifiSettings` dialog. And since the dialog does not bring any result back to the panel, we can move them to hotspot_wifi_settings.js.