Merge pull request #1587 from TDT-AG/pr/20180123-mwan3-fixes
luci-app-mwan3: refactoring continue 3
This commit is contained in:
commit
8f5be58a56
16 changed files with 76 additions and 17 deletions
|
@ -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)
|
module("luci.controller.mwan3", package.seeall)
|
||||||
|
|
||||||
sys = require "luci.sys"
|
sys = require "luci.sys"
|
||||||
|
@ -111,7 +115,7 @@ function diagnosticsData(interface, task)
|
||||||
function get_gateway(inteface)
|
function get_gateway(inteface)
|
||||||
local dump = require("luci.util").ubus("network.interface.%s" % interface, "status", {})
|
local dump = require("luci.util").ubus("network.interface.%s" % interface, "status", {})
|
||||||
local gateway
|
local gateway
|
||||||
if dump then
|
if dump and dump.route then
|
||||||
local _, route
|
local _, route
|
||||||
for _, route in ipairs(dump.route) do
|
for _, route in ipairs(dump.route) do
|
||||||
if dump.route[_].target == "0.0.0.0" then
|
if dump.route[_].target == "0.0.0.0" then
|
||||||
|
|
|
@ -1,16 +1,5 @@
|
||||||
--[[
|
-- Copyright 2017 Florian Eckert <fe@dev.tdt.de>
|
||||||
LuCI - Lua Configuration Interface
|
-- Licensed to the public under the GNU General Public License v2.
|
||||||
|
|
||||||
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$
|
|
||||||
]]--
|
|
||||||
|
|
||||||
local net = require "luci.model.network".init()
|
local net = require "luci.model.network".init()
|
||||||
|
|
||||||
|
|
|
@ -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"
|
dsp = require "luci.dispatcher"
|
||||||
|
|
||||||
|
|
||||||
|
@ -77,7 +81,7 @@ function configCheck()
|
||||||
|
|
||||||
local dump = require("luci.util").ubus("network.interface.%s" % iface, "status", {})
|
local dump = require("luci.util").ubus("network.interface.%s" % iface, "status", {})
|
||||||
overview[iface]["default_route"] = false
|
overview[iface]["default_route"] = false
|
||||||
if dump then
|
if dump and dump.route then
|
||||||
local _, route
|
local _, route
|
||||||
for _, route in ipairs(dump.route) do
|
for _, route in ipairs(dump.route) do
|
||||||
if dump.route[_].target == "0.0.0.0" then
|
if dump.route[_].target == "0.0.0.0" then
|
||||||
|
|
|
@ -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"
|
dsp = require "luci.dispatcher"
|
||||||
arg[1] = arg[1] or ""
|
arg[1] = arg[1] or ""
|
||||||
|
|
||||||
|
|
|
@ -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"
|
dsp = require "luci.dispatcher"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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"
|
dsp = require "luci.dispatcher"
|
||||||
arg[1] = arg[1] or ""
|
arg[1] = arg[1] or ""
|
||||||
|
|
||||||
|
|
|
@ -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 fs = require "nixio.fs"
|
||||||
local ut = require "luci.util"
|
local ut = require "luci.util"
|
||||||
script = "/etc/mwan3.user"
|
script = "/etc/mwan3.user"
|
||||||
|
|
|
@ -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"
|
dsp = require "luci.dispatcher"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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"
|
dsp = require "luci.dispatcher"
|
||||||
arg[1] = arg[1] or ""
|
arg[1] = arg[1] or ""
|
||||||
|
|
||||||
|
|
|
@ -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"
|
dsp = require "luci.dispatcher"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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"
|
dsp = require "luci.dispatcher"
|
||||||
arg[1] = arg[1] or ""
|
arg[1] = arg[1] or ""
|
||||||
|
|
||||||
|
|
|
@ -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[
|
<script type="text/javascript">//<![CDATA[
|
||||||
XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "interface_status")%>', null,
|
XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "status", "mwan", "interface_status")%>', null,
|
||||||
function(x, status)
|
function(x, status)
|
||||||
|
|
|
@ -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%>
|
<%+header%>
|
||||||
|
|
||||||
<ul class="cbi-tabmenu">
|
<ul class="cbi-tabmenu">
|
||||||
|
|
|
@ -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%>
|
<%+header%>
|
||||||
|
|
||||||
<ul class="cbi-tabmenu">
|
<ul class="cbi-tabmenu">
|
||||||
|
@ -67,7 +73,7 @@
|
||||||
<option value="ping_trackips"><%:Ping tracking IP%></option>
|
<option value="ping_trackips"><%:Ping tracking IP%></option>
|
||||||
<option value="check_rules"><%:Check IP rules%></option>
|
<option value="check_rules"><%:Check IP rules%></option>
|
||||||
<option value="check_routes"><%:Check routing table%></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>
|
<option value="hotplug_ifdown"><%:Hotplug ifdown%></option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -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%>
|
<%+header%>
|
||||||
|
|
||||||
<ul class="cbi-tabmenu">
|
<ul class="cbi-tabmenu">
|
||||||
|
|
|
@ -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%>
|
<%+header%>
|
||||||
|
|
||||||
<ul class="cbi-tabmenu">
|
<ul class="cbi-tabmenu">
|
||||||
|
|
Loading…
Reference in a new issue