summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-network/htdocs
diff options
context:
space:
mode:
authorVladislav Grigoryev <vg.aetera@gmail.com>2023-11-14 13:12:42 +0300
committerVladislav Grigoryev <vg.aetera@gmail.com>2023-11-14 13:21:35 +0300
commita84762e0c9cf5c838c5816890a6b051772905a95 (patch)
tree39fd81e5b5e2a67f1e4e336ae742001cab2edc68 /modules/luci-mod-network/htdocs
parent29c12cae59411423eeedb48b014c6d993be744d0 (diff)
luci-mod-network: fix route defaults
Routes inherit metric and table from the relevant interface. Display route metric and table as `auto` when unspecified. Consolidate modal view for unspecified options. Signed-off-by: Vladislav Grigoryev <vg.aetera@gmail.com>
Diffstat (limited to 'modules/luci-mod-network/htdocs')
-rw-r--r--modules/luci-mod-network/htdocs/luci-static/resources/view/network/routes.js5
1 files changed, 2 insertions, 3 deletions
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 6a08428457..4004be219a 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
@@ -82,7 +82,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'));
@@ -95,13 +95,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++)