From: psyborg55 Date: Sat, 24 Dec 2016 13:44:12 +0000 (+0100) Subject: mwan3-luci: update to 1.4-5 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=f86d2dece57132730f4c632931739e3d7581af36;p=feed%2Fpackages.git mwan3-luci: update to 1.4-5 Maintainer: @arfett Compile tested: ramips, xiaomi mini, r49946 Run tested: ramips, xiaomi mini, r49946 Description: Bump to 1.4-5. Added new page for wifi configuration edit, similar how the current network configuration page works. Also enabled collecting of wifi configuration in troubleshooting page. Signed-of-by: Tomislav Požega pozega.tomislav@gmail.com --- diff --git a/net/mwan3-luci/Makefile b/net/mwan3-luci/Makefile index b4b49ce00a..8c77394da2 100644 --- a/net/mwan3-luci/Makefile +++ b/net/mwan3-luci/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-mwan3 PKG_VERSION:=1.4 -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_MAINTAINER:=Aedan Renner PKG_LICENSE:=GPLv2 diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/controller/mwan3.lua b/net/mwan3-luci/files/usr/lib/lua/luci/controller/mwan3.lua index bd343608ea..3d5a23dd03 100644 --- a/net/mwan3-luci/files/usr/lib/lua/luci/controller/mwan3.lua +++ b/net/mwan3-luci/files/usr/lib/lua/luci/controller/mwan3.lua @@ -51,6 +51,8 @@ function index() form("mwan/advanced_mwanconfig")) entry({"admin", "network", "mwan", "advanced", "networkconfig"}, form("mwan/advanced_networkconfig")) + entry({"admin", "network", "mwan", "advanced", "wirelessconfig"}, + form("mwan/advanced_wirelessconfig")) entry({"admin", "network", "mwan", "advanced", "diagnostics"}, template("mwan/advanced_diagnostics")) entry({"admin", "network", "mwan", "advanced", "diagnostics_display"}, @@ -270,6 +272,13 @@ function troubleshootingData() end mArray.netconfig = { networkConfig } + -- wireless config + local wirelessConfig = ut.trim(sys.exec("cat /etc/config/wireless | sed -e 's/.*username.*/ USERNAME HIDDEN/' -e 's/.*password.*/ PASSWORD HIDDEN/' -e 's/.*key.*/ KEY HIDDEN/'")) + if wirelessConfig == "" then + wirelessConfig = "No data found" + end + mArray.wificonfig = { wirelessConfig } + -- ifconfig local ifconfig = ut.trim(sys.exec("ifconfig")) if ifconfig == "" then diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/advanced_wirelessconfig.lua b/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/advanced_wirelessconfig.lua new file mode 100644 index 0000000000..95e9f7c7e5 --- /dev/null +++ b/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/advanced_wirelessconfig.lua @@ -0,0 +1,32 @@ +-- ------ wireless configuration ------ -- + +ut = require "luci.util" + +wirelessConfig = "/etc/config/wireless" + + +m5 = SimpleForm("wirelessconf", nil) + m5:append(Template("mwan/advanced_wirelessconfig")) -- highlight current tab + + +f = m5:section(SimpleSection, nil, + translate("This section allows you to modify the contents of /etc/config/wireless")) + +t = f:option(TextValue, "lines") + t.rmempty = true + t.rows = 20 + + function t.cfgvalue() + return nixio.fs.readfile(wirelessConfig) or "" + end + + function t.write(self, section, data) -- format and write new data to script + return nixio.fs.writefile(wirelessConfig, "\n" .. ut.trim(data:gsub("\r\n", "\n")) .. "\n") + end + + function f.handle(self, state, data) + return true + end + + +return m5 diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_diagnostics.htm b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_diagnostics.htm index 19615695dd..14d404bc7c 100644 --- a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_diagnostics.htm +++ b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_diagnostics.htm @@ -4,6 +4,7 @@
  • "><%:Hotplug Script%>
  • "><%:MWAN Config%>
  • "><%:Network Config%>
  • +
  • "><%:Wireless Config%>
  • "><%:Diagnostics%>
  • "><%:Troubleshooting%>
  • diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_hotplugscript.htm b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_hotplugscript.htm index cbef94b00e..4c2a0dc208 100644 --- a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_hotplugscript.htm +++ b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_hotplugscript.htm @@ -2,6 +2,7 @@
  • "><%:Hotplug Script%>
  • "><%:MWAN Config%>
  • "><%:Network Config%>
  • +
  • "><%:Wireless Config%>
  • "><%:Diagnostics%>
  • "><%:Troubleshooting%>
  • diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_mwanconfig.htm b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_mwanconfig.htm index 5d83bdda43..fba3fa6940 100644 --- a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_mwanconfig.htm +++ b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_mwanconfig.htm @@ -2,6 +2,7 @@
  • "><%:Hotplug Script%>
  • "><%:MWAN Config%>
  • "><%:Network Config%>
  • +
  • "><%:Wireless Config%>
  • "><%:Diagnostics%>
  • "><%:Troubleshooting%>
  • diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_networkconfig.htm b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_networkconfig.htm index 5c06d362c9..cf90112078 100644 --- a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_networkconfig.htm +++ b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_networkconfig.htm @@ -2,6 +2,7 @@
  • "><%:Hotplug Script%>
  • "><%:MWAN Config%>
  • "><%:Network Config%>
  • +
  • "><%:Wireless Config%>
  • "><%:Diagnostics%>
  • "><%:Troubleshooting%>
  • diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_troubleshooting.htm b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_troubleshooting.htm index 514d91f912..0a12496899 100644 --- a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_troubleshooting.htm +++ b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_troubleshooting.htm @@ -4,6 +4,7 @@
  • "><%:Hotplug Script%>
  • "><%:MWAN Config%>
  • "><%:Network Config%>
  • +
  • "><%:Wireless Config%>
  • "><%:Diagnostics%>
  • "><%:Troubleshooting%>
  • @@ -19,6 +20,7 @@ var versions = 'Software versions :

    '; var mwanConfig = '

    Output of "cat /etc/config/mwan3" :

    '; var netConfig = '

    Output of "cat /etc/config/network" :

    '; + var wifiConfig = '

    Output of "cat /etc/config/wireless" :

    '; var ifconfig = '

    Output of "ifconfig" :

    '; var ipRoute = '

    Output of "route -n" :

    '; var ipRuleShow = '

    Output of "ip rule show" :

    '; @@ -26,10 +28,11 @@ var firewallOut = '

    Firewall default output policy (must be ACCEPT) :

    '; var iptables = '

    Output of "iptables -L -t mangle -v -n" :

    '; tshoot.innerHTML = String.format( - '
    %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s
    ', + '
    %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s
    ', versions, mArray.versions[0], mwanConfig, mArray.mwanconfig[0], netConfig, mArray.netconfig[0], - ifconfig, mArray.ifconfig[0], ipRoute, mArray.routeshow[0], ipRuleShow, mArray.iprule[0], - routeListTable, mArray.routelist[0], firewallOut, mArray.firewallout[0], iptables, mArray.iptables[0] + wifiConfig, mArray.wificonfig[0], ifconfig, mArray.ifconfig[0], ipRoute, mArray.routeshow[0], + ipRuleShow, mArray.iprule[0], routeListTable, mArray.routelist[0], firewallOut, mArray.firewallout[0], + iptables, mArray.iptables[0] ); } else diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_wirelessconfig.htm b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_wirelessconfig.htm new file mode 100644 index 0000000000..5077674185 --- /dev/null +++ b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_wirelessconfig.htm @@ -0,0 +1,24 @@ + + +