luci-mod-admin-full: set 0 db DSL SNR offset by default
authorMathias Kresin <dev@kresin.me>
Sat, 13 Jan 2018 06:44:29 +0000 (07:44 +0100)
committerJo-Philipp Wich <jo@mein.io>
Fri, 20 Jul 2018 07:32:06 +0000 (09:32 +0200)
If no DSL SNR offset is set for the dsl line the first entry from the
dropdown list is pre-selected by default, which would apply a -10 db
offset by default.

Pre-select the 0 db option if nothing else is specified in the uci config
files.

Signed-off-by: Mathias Kresin <dev@kresin.me>
(backported from commit cfdeaa91fa6be17069eb215df73dd6fc840df122)

modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/network.lua

index 348379ac3ca65870d76f089c96e3b6cf27cace9c..a717fd4951caab08477572ef77702467c506fb47 100644 (file)
@@ -47,6 +47,7 @@ if fs.access("/etc/init.d/dsl_control") then
        line_mode:value("vdsl", translate("VDSL"))
 
        ds_snr = dsl:option(ListValue, "ds_snr_offset", translate("Downstream SNR offset"))
+       ds_snr.default = "0"
        for i = -100, 100, 5 do
                ds_snr:value(i, translatef("%.1f dB", i / 10))
        end