luci-app-usteer: Fix no wireless defined setup
authorMiguel Angel Mulero Martinez <migmul@gmail.com>
Tue, 13 Feb 2024 11:25:48 +0000 (12:25 +0100)
committerPaul Donald <newtwen@gmail.com>
Wed, 14 Feb 2024 22:23:08 +0000 (23:23 +0100)
Some users use the usteer app in a "non wireless" device. With the current code it crashes because there is no SSID defined. Making the ui element a DynamicList fixes the issue because it allows free text input.

Signed-off-by: Miguel Angel Mulero Martinez <migmul@gmail.com>
(cherry picked from commit ac8cf93a015a3eeb960ef216e59dde643bf059ed)

applications/luci-app-usteer/htdocs/luci-static/resources/view/usteer/usteer.js

index ce245a4dc7352ab1508a5b6cfd01ef962836df55..5cbc8c7a404df64798dfc28ae1fb497bf1211dd2 100644 (file)
@@ -609,7 +609,7 @@ return view.extend({
                o.optional = true;
                o.datatype = 'list(string)';
 
-               o = s.taboption('settings', form.MultiValue, 'ssid_list', _('SSID list'), _('List of SSIDs to enable steering on'));
+               o = s.taboption('settings', form.DynamicList, 'ssid_list', _('SSID list'), _('List of SSIDs to enable steering on'));
                WifiNetworks.forEach(function (wifiNetwork) {
                        if (wifiNetwork.getSSID()) {
                                o.value(wifiNetwork.getSSID())