Merge pull request #1587 from TDT-AG/pr/20180123-mwan3-fixes
authorHannu Nyman <hannu.nyman@iki.fi>
Tue, 23 Jan 2018 15:31:36 +0000 (17:31 +0200)
committerGitHub <noreply@github.com>
Tue, 23 Jan 2018 15:31:36 +0000 (17:31 +0200)
luci-app-mwan3: refactoring continue 3

16 files changed:
applications/luci-app-mwan3/luasrc/controller/mwan3.lua
applications/luci-app-mwan3/luasrc/model/cbi/mwan/globalsconfig.lua
applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua
applications/luci-app-mwan3/luasrc/model/cbi/mwan/interfaceconfig.lua
applications/luci-app-mwan3/luasrc/model/cbi/mwan/member.lua
applications/luci-app-mwan3/luasrc/model/cbi/mwan/memberconfig.lua
applications/luci-app-mwan3/luasrc/model/cbi/mwan/notify.lua
applications/luci-app-mwan3/luasrc/model/cbi/mwan/policy.lua
applications/luci-app-mwan3/luasrc/model/cbi/mwan/policyconfig.lua
applications/luci-app-mwan3/luasrc/model/cbi/mwan/rule.lua
applications/luci-app-mwan3/luasrc/model/cbi/mwan/ruleconfig.lua
applications/luci-app-mwan3/luasrc/view/mwan/overview_status_interface.htm
applications/luci-app-mwan3/luasrc/view/mwan/status_detail.htm
applications/luci-app-mwan3/luasrc/view/mwan/status_diagnostics.htm
applications/luci-app-mwan3/luasrc/view/mwan/status_interface.htm
applications/luci-app-mwan3/luasrc/view/mwan/status_troubleshooting.htm

index cf57080..64ee9f5 100644 (file)
@@ -1,3 +1,7 @@
+-- Copyright 2014 Aedan Renner <chipdankly@gmail.com>
+-- Copyright 2018 Florian Eckert <fe@dev.tdt.de>
+-- Licensed to the public under the GNU General Public License v2.
+
 module("luci.controller.mwan3", package.seeall)
 
 sys = require "luci.sys"
@@ -111,11 +115,11 @@ function diagnosticsData(interface, task)
        function get_gateway(inteface)
                local dump = require("luci.util").ubus("network.interface.%s" % interface, "status", {})
                local gateway
-               if dump then
+               if dump and dump.route then
                        local _, route
                        for _, route in ipairs(dump.route) do
                                if dump.route[_].target == "0.0.0.0" then
-                                       gateway =  dump.route[_].nexthop
+                                       gateway = dump.route[_].nexthop
                                end
                        end
                end
index b53d288..d8f90e1 100644 (file)
@@ -1,16 +1,5 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2017 Florian Eckert <fe@dev.tdt.de>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-        http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
+-- Copyright 2017 Florian Eckert <fe@dev.tdt.de>
+-- Licensed to the public under the GNU General Public License v2.
 
 local net = require "luci.model.network".init()
 
index 166f077..920dc6a 100644 (file)
@@ -1,3 +1,7 @@
+-- Copyright 2014 Aedan Renner <chipdankly@gmail.com
+-- Copyright 2018 Florian Eckert <fe@dev.tdt.de>
+-- Licensed to the public under the GNU General Public License v2.
+
 dsp = require "luci.dispatcher"
 
 
@@ -77,7 +81,7 @@ function configCheck()
 
                                local dump = require("luci.util").ubus("network.interface.%s" % iface, "status", {})
                                overview[iface]["default_route"] = false
-                               if dump then
+                               if dump and dump.route then
                                        local _, route
                                        for _, route in ipairs(dump.route) do
                                                if dump.route[_].target == "0.0.0.0" then
index 9f1db08..3a896d3 100644 (file)
@@ -1,3 +1,7 @@
+-- Copyright 2014 Aedan Renner <chipdankly@gmail.com>
+-- Copyright 2018 Florian Eckert <fe@dev.tdt.de>
+-- Licensed to the public under the GNU General Public License v2.
+
 dsp = require "luci.dispatcher"
 arg[1] = arg[1] or ""
 
index ebe1162..9b4ab10 100644 (file)
@@ -1,3 +1,7 @@
+-- Copyright 2014 Aedan Renner <chipdankly@gmail.com>
+-- Copyright 2018 Florian Eckert <fe@dev.tdt.de>
+-- Licensed to the public under the GNU General Public License v2.
+
 dsp = require "luci.dispatcher"
 
 
index ade357f..27d9a3e 100644 (file)
@@ -1,3 +1,7 @@
+-- Copyright 2014 Aedan Renner <chipdankly@gmail.com>
+-- Copyright 2018 Florian Eckert <fe@dev.tdt.de>
+-- Licensed to the public under the GNU General Public License v2.
+
 dsp = require "luci.dispatcher"
 arg[1] = arg[1] or ""
 
index 1019302..6f87a3d 100644 (file)
@@ -1,3 +1,7 @@
+-- Copyright 2014 Aedan Renner <chipdankly@gmail.com>
+-- Copyright 2018 Florian Eckert <fe@dev.tdt.de>
+-- Licensed to the public under the GNU General Public License v2.
+
 local fs = require "nixio.fs"
 local ut = require "luci.util"
 script = "/etc/mwan3.user"
index 6d2ce71..7f12782 100644 (file)
@@ -1,3 +1,7 @@
+-- Copyright 2014 Aedan Renner <chipdankly@gmail.com>
+-- Copyright 2018 Florian Eckert <fe@dev.tdt.de>
+-- Licensed to the public under the GNU General Public License v2.
+
 dsp = require "luci.dispatcher"
 
 
index 1f8da0f..d1a063d 100644 (file)
@@ -1,3 +1,7 @@
+-- Copyright 2014 Aedan Renner <chipdankly@gmail.com>
+-- Copyright 2018 Florian Eckert <fe@dev.tdt.de>
+-- Licensed to the public under the GNU General Public License v2.
+
 dsp = require "luci.dispatcher"
 arg[1] = arg[1] or ""
 
index 5b19693..cb2a995 100644 (file)
@@ -1,3 +1,7 @@
+-- Copyright 2014 Aedan Renner <chipdankly@gmail.com>
+-- Copyright 2018 Florian Eckert <fe@dev.tdt.de>
+-- Licensed to the public under the GNU General Public License v2.
+
 dsp = require "luci.dispatcher"
 
 
index 712ada0..84adfcf 100644 (file)
@@ -1,3 +1,7 @@
+-- Copyright 2014 Aedan Renner <chipdankly@gmail.com>
+-- Copyright 2018 Florian Eckert <fe@dev.tdt.de>
+-- Licensed to the public under the GNU General Public License v2.
+
 dsp = require "luci.dispatcher"
 arg[1] = arg[1] or ""
 
index 279f140..6dc3d12 100644 (file)
@@ -1,3 +1,9 @@
+<%#
+ Copyright 2014 Aedan Renner <chipdankly@gmail.com>
+ Copyright 2018 Florian Eckert <fe@dev.tdt.de>
+ Licensed to the public under the GNU General Public License v2.
+-%>
+
 <script type="text/javascript">//<![CDATA[
 XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "interface_status")%>', null,
                function(x, status)
index 708479c..b7bb6de 100644 (file)
@@ -1,3 +1,9 @@
+<%#
+ Copyright 2014 Aedan Renner <chipdankly@gmail.com>
+ Copyright 2018 Florian Eckert <fe@dev.tdt.de>
+ Licensed to the public under the GNU General Public License v2.
+-%>
+
 <%+header%>
 
 <ul class="cbi-tabmenu">
index d524e10..f9a0fa2 100644 (file)
@@ -1,3 +1,9 @@
+<%#
+ Copyright 2014 Aedan Renner <chipdankly@gmail.com>
+ Copyright 2018 Florian Eckert <fe@dev.tdt.de>
+ Licensed to the public under the GNU General Public License v2.
+-%>
+
 <%+header%>
 
 <ul class="cbi-tabmenu">
@@ -67,7 +73,7 @@
                                        <option value="ping_trackips"><%:Ping tracking IP%></option>
                                        <option value="check_rules"><%:Check IP rules%></option>
                                        <option value="check_routes"><%:Check routing table%></option>
-                                       <option value="hotplug_ifup"><%:Hotplug ifup%>"</option>
+                                       <option value="hotplug_ifup"><%:Hotplug ifup%></option>
                                        <option value="hotplug_ifdown"><%:Hotplug ifdown%></option>
                                </select>
                        </div>
index 1c9123c..2fb5ea4 100644 (file)
@@ -1,3 +1,9 @@
+<%#
+ Copyright 2014 Aedan Renner <chipdankly@gmail.com>
+ Copyright 2018 Florian Eckert <fe@dev.tdt.de>
+ Licensed to the public under the GNU General Public License v2.
+-%>
+
 <%+header%>
 
 <ul class="cbi-tabmenu">
index 348bf94..b812e5b 100644 (file)
@@ -1,3 +1,9 @@
+<%#
+ Copyright 2014 Aedan Renner <chipdankly@gmail.com>
+ Copyright 2018 Florian Eckert <fe@dev.tdt.de>
+ Licensed to the public under the GNU General Public License v2.
+-%>
+
 <%+header%>
 
 <ul class="cbi-tabmenu">