Merge pull request #1587 from TDT-AG/pr/20180123-mwan3-fixes

luci-app-mwan3: refactoring continue 3
This commit is contained in:
Hannu Nyman 2018-01-23 17:31:36 +02:00 committed by GitHub
commit 8f5be58a56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 76 additions and 17 deletions

View 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

View 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()

View 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

View 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 ""

View 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"

View 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 ""

View 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"

View 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"

View 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 ""

View 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"

View 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 ""

View 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)

View 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">

View 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>

View 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">

View 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">