From bea3879009c5c309b59e7f0972fbed9d1487a529 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Wed, 29 Aug 2018 15:14:27 +0200 Subject: luci-base: add is_auto function Add missing is_auto getter function. Signed-off-by: Florian Eckert --- modules/luci-base/luasrc/model/network.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/luci-base/luasrc/model/network.lua b/modules/luci-base/luasrc/model/network.lua index 49e1657aa..dec25a5d0 100644 --- a/modules/luci-base/luasrc/model/network.lua +++ b/modules/luci-base/luasrc/model/network.lua @@ -1159,6 +1159,16 @@ function protocol.is_dynamic(self) return (self:_ubus("dynamic") == true) end +function protocol.is_auto(self) + local auto = self:_get("auto") + + if auto == "0" then + return false + else + return true + end +end + function protocol.is_alias(self) local ifn, parent = nil, nil -- cgit v1.2.3 From 3ff15a22d5d7687d5e64b72210bf72ae7bd39793 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Wed, 29 Aug 2018 15:15:10 +0200 Subject: luci-mod-network: add is_auto option to iface_status Make interface information is_auto available. Signed-off-by: Florian Eckert --- modules/luci-mod-network/luasrc/controller/admin/network.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/luci-mod-network/luasrc/controller/admin/network.lua b/modules/luci-mod-network/luasrc/controller/admin/network.lua index 1da5eac46..2312dcf6e 100644 --- a/modules/luci-mod-network/luasrc/controller/admin/network.lua +++ b/modules/luci-mod-network/luasrc/controller/admin/network.lua @@ -212,6 +212,7 @@ function iface_status(ifaces) is_up = net:is_up() and device:is_up(), is_alias = net:is_alias(), is_dynamic = net:is_dynamic(), + is_auto = net:is_auto(), rx_bytes = device:rx_bytes(), tx_bytes = device:tx_bytes(), rx_packets = device:rx_packets(), -- cgit v1.2.3 From 2b94060c605335c48a44afaa47b7e6ba3b243354 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Mon, 11 Mar 2019 10:07:34 +0100 Subject: luci-mod-network: add auto start hint Make the information if the interface is started on boot visible on the interface overview page. Signed-off-by: Florian Eckert --- .../htdocs/luci-static/resources/view/network/network.js | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/network.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/network.js index fe1ff19fe..bab23cc3c 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/network.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/network.js @@ -102,6 +102,7 @@ L.poll(5, L.url('admin/network/iface_status', networks.join(',')), null, _('IPv6'), ifc.ip6addrs ? ifc.ip6addrs[8] : null, _('IPv6'), ifc.ip6addrs ? ifc.ip6addrs[9] : null, _('IPv6-PD'), ifc.ip6prefix, + _('Information'), ifc.is_auto ? null : _('Not started on boot'), _('Error'), ifc.errors ? ifc.errors[0] : null, _('Error'), ifc.errors ? ifc.errors[1] : null, _('Error'), ifc.errors ? ifc.errors[2] : null, -- cgit v1.2.3