From: Jo-Philipp Wich Date: Sun, 19 Nov 2023 00:10:33 +0000 (+0100) Subject: Merge pull request #6698 from vgaetera/route-defaults-fix X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=d619a50d8faf3e3c6a37cf516df342520e6cb33d;p=project%2Fluci.git Merge pull request #6698 from vgaetera/route-defaults-fix luci-mod-network: fix route defaults (cherry picked from commit a9849edf23a2993737c9d5f2f6a95d79b03a2eda) --- diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/routes.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/routes.js index da1330aec8..e6d51005f0 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/routes.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/routes.js @@ -80,7 +80,7 @@ return view.extend({ o.datatype = 'uinteger'; o.placeholder = 0; o.textvalue = function(section_id) { - return this.cfgvalue(section_id) || 0; + return this.cfgvalue(section_id) || E('em', _('auto')); }; o = s.taboption('advanced', form.Value, 'mtu', _('MTU'), _('Defines a specific MTU for this route')); @@ -93,13 +93,12 @@ return view.extend({ for (var i = 0; i < rtTables.length; i++) o.value(rtTables[i][1], '%s (%d)'.format(rtTables[i][1], rtTables[i][0])); o.textvalue = function(section_id) { - return this.cfgvalue(section_id) || 'main'; + return this.cfgvalue(section_id) || E('em', _('auto')); }; o = s.taboption('advanced', form.Value, 'source', _('Source'), _('Specifies the preferred source address when sending to destinations covered by the target')); o.modalonly = true; o.datatype = (family == 6) ? 'ip6addr' : 'ip4addr'; - o.placeholder = E('em', _('auto')); for (var i = 0; i < netDevs.length; i++) { var addrs = (family == 6) ? netDevs[i].getIP6Addrs() : netDevs[i].getIPAddrs(); for (var j = 0; j < addrs.length; j++)