Procházet zdrojové kódy

Merge pull request #381 from arfett/master

mwan-luci: update to 1.3-2
sbyx před 10 roky
rodič
revize
56c5187af1

+ 5
- 4
net/mwan3-luci/Makefile Zobrazit soubor

9
 
9
 
10
 PKG_NAME:=luci-app-mwan3
10
 PKG_NAME:=luci-app-mwan3
11
 PKG_VERSION:=1.3
11
 PKG_VERSION:=1.3
12
-PKG_RELEASE:=1
12
+PKG_RELEASE:=2
13
 PKG_MAINTAINER:=Aedan Renner <chipdankly@gmail.com>
13
 PKG_MAINTAINER:=Aedan Renner <chipdankly@gmail.com>
14
 PKG_LICENSE:=GPLv2
14
 PKG_LICENSE:=GPLv2
15
 
15
 
20
   CATEGORY:=LuCI
20
   CATEGORY:=LuCI
21
   SUBMENU:=3. Applications
21
   SUBMENU:=3. Applications
22
   TITLE:=LuCI support for the MWAN3 multiwan hotplug script
22
   TITLE:=LuCI support for the MWAN3 multiwan hotplug script
23
-  DEPENDS:=+mwan3
23
+  DEPENDS:=+mwan3 +luci-mod-admin-full +luci-lib-nixio
24
   PKGARCH:=all
24
   PKGARCH:=all
25
   MAINTAINER:=Aedan Renner <chipdankly@gmail.com>
25
   MAINTAINER:=Aedan Renner <chipdankly@gmail.com>
26
 endef
26
 endef
27
 
27
 
28
 define Package/luci-app-mwan3/description
28
 define Package/luci-app-mwan3/description
29
-Hotplug script which makes configuration of multiple WAN interfaces simple and manageable
30
-With loadbalancing/failover support for up to 250 WAN interfaces, connection tracking and an easy to manage traffic ruleset
29
+Hotplug script which makes configuration of multiple WAN interfaces simple and
30
+manageable with loadbalancing/failover support for up to 250 physical or logical
31
+WAN interfaces, connection tracking and an easy to manage traffic ruleset
31
 endef
32
 endef
32
 
33
 
33
 define Build/Compile
34
 define Build/Compile

+ 5
- 6
net/mwan3-luci/files/etc/hotplug.d/iface/16-mwan3custombak Zobrazit soubor

1
 #!/bin/sh
1
 #!/bin/sh
2
 
2
 
3
 # to enable this script uncomment the case loop at the bottom
3
 # to enable this script uncomment the case loop at the bottom
4
-# to report MWAN3 status on interface up/down events modify the lines in the send_reportdata function
4
+# to report mwan3 status on interface hotplug ifup/ifdown events modify the lines in the send_alert function
5
 
5
 
6
 send_alert()
6
 send_alert()
7
 {
7
 {
8
-	# $1 stores the mwan3 status information
9
-	# insert your code here to send the contents of $1
10
-	echo "$1"
8
+	# variable "$1" stores the mwan3 status information
9
+	# insert your code here to send the contents of "$1"
11
 }
10
 }
12
 
11
 
13
 gather_event_info()
12
 gather_event_info()
14
 {
13
 {
15
 	# create event information message
14
 	# create event information message
16
-	local EVENT_INFO="Interface [ "$INTERFACE" ($DEVICE) ] on router [ "$(uci get -p /var/state system.@system[0].hostname)" ] has triggered an [ "$ACTION" ] hotplug event on "$(date)""
15
+	local EVENT_INFO="Interface [ "$INTERFACE" ($DEVICE) ] on router [ "$(uci get -p /var/state system.@system[0].hostname)" ] has triggered a hotplug [ "$ACTION" ] event on "$(date +"%a %b %d %Y %T %Z")""
17
 
16
 
18
 	# get current interface, policy and rule status
17
 	# get current interface, policy and rule status
19
-	local CURRENT_STATUS="$(mwan3 status)"
18
+	local CURRENT_STATUS="$(/usr/sbin/mwan3 status)"
20
 
19
 
21
 	# get last 50 mwan3 systemlog messages
20
 	# get last 50 mwan3 systemlog messages
22
 	local MWAN3_LOG="$(echo -e "Last 50 MWAN3 systemlog entries. Newest entries sorted at the top:\n$(logread | grep mwan3 | tail -n 50 | sed 'x;1!H;$!d;x')")"
21
 	local MWAN3_LOG="$(echo -e "Last 50 MWAN3 systemlog entries. Newest entries sorted at the top:\n$(logread | grep mwan3 | tail -n 50 | sed 'x;1!H;$!d;x')")"

+ 0
- 14
net/mwan3-luci/files/etc/uci-defaults/mwan3 Zobrazit soubor

1
-#!/bin/sh
2
-
3
-# delete existing mwan3 ucitrack entry and add new entry
4
-uci -q batch <<-EOF >/dev/null
5
-	del ucitrack.@mwan3[-1]
6
-	add ucitrack mwan3
7
-	set ucitrack.@mwan3[-1].exec="/etc/init.d/mwan3 restart"
8
-	commit ucitrack
9
-EOF
10
-
11
-# make controller file addition take effect without system restart
12
-rm -rf /tmp/luci-indexcache /tmp/luci-modulecache
13
-
14
-exit 0

+ 14
- 0
net/mwan3-luci/files/etc/uci-defaults/mwan3-luci Zobrazit soubor

1
+#!/bin/sh
2
+
3
+# replace existing mwan3-luci ucitrack entry
4
+uci -q batch <<-EOF >/dev/null
5
+	del ucitrack.@mwan3[-1]
6
+	add ucitrack mwan3
7
+	set ucitrack.@mwan3[-1].exec="/usr/sbin/mwan3 restart"
8
+	commit ucitrack
9
+EOF
10
+
11
+# remove LuCI cache
12
+rm -rf /tmp/luci-indexcache /tmp/luci-modulecache
13
+
14
+exit 0

+ 6
- 6
net/mwan3-luci/files/usr/lib/lua/luci/controller/mwan3.lua Zobrazit soubor

168
 		local ifdev = ut.trim(sys.exec("uci get -p /var/state network." .. iface .. ".ifname"))
168
 		local ifdev = ut.trim(sys.exec("uci get -p /var/state network." .. iface .. ".ifname"))
169
 		if ifdev ~= "" then
169
 		if ifdev ~= "" then
170
 			if tool == "ping" then
170
 			if tool == "ping" then
171
-				local gateway = ut.trim(sys.exec("route -n | awk -F' ' '{ if ($8 == \"" .. ifdev .. "\" && $1 == \"0.0.0.0\") print $2 }'"))
171
+				local gateway = ut.trim(sys.exec("route -n | awk '{ if ($8 == \"" .. ifdev .. "\" && $1 == \"0.0.0.0\" && $3 == \"0.0.0.0\") print $2 }'"))
172
 				if gateway ~= "" then
172
 				if gateway ~= "" then
173
 					if alt == "gateway" then
173
 					if alt == "gateway" then
174
 						local cmd = "ping -c 3 -W 2 -I " .. ifdev .. " " .. gateway
174
 						local cmd = "ping -c 3 -W 2 -I " .. ifdev .. " " .. gateway
247
 		else
247
 		else
248
 			lucirelease = "\nLuCI - unknown"
248
 			lucirelease = "\nLuCI - unknown"
249
 		end
249
 		end
250
-	local mwan3version = ut.trim(sys.exec("opkg info mwan3 | grep Version | awk -F' ' '{ print $2 }'"))
250
+	local mwan3version = ut.trim(sys.exec("opkg info mwan3 | grep Version | awk '{ print $2 }'"))
251
 		if mwan3version ~= "" then
251
 		if mwan3version ~= "" then
252
 			mwan3version = "\n\nmwan3 - " .. mwan3version
252
 			mwan3version = "\n\nmwan3 - " .. mwan3version
253
 		else
253
 		else
254
 			mwan3version = "\nmwan3 - unknown"
254
 			mwan3version = "\nmwan3 - unknown"
255
 		end
255
 		end
256
-	local mwan3lversion = ut.trim(sys.exec("opkg info luci-app-mwan3 | grep Version | awk -F' ' '{ print $2 }'"))
256
+	local mwan3lversion = ut.trim(sys.exec("opkg info luci-app-mwan3 | grep Version | awk '{ print $2 }'"))
257
 		if mwan3lversion ~= "" then
257
 		if mwan3lversion ~= "" then
258
-			mwan3lversion = "\nluci-app-mwan3 - " .. mwan3lversion
258
+			mwan3lversion = "\nmwan3-luci - " .. mwan3lversion
259
 		else
259
 		else
260
-			mwan3lversion = "\nluci-app-mwan3 - unknown"
260
+			mwan3lversion = "\nmwan3-luci - unknown"
261
 		end
261
 		end
262
 	local softrev = wrtrelease .. lucirelease .. mwan3version .. mwan3lversion
262
 	local softrev = wrtrelease .. lucirelease .. mwan3version .. mwan3lversion
263
 	rv.mw3ver = { }
263
 	rv.mw3ver = { }
316
 	rv.iprule[ipruleid[ipr]] = { rule = ipr }
316
 	rv.iprule[ipruleid[ipr]] = { rule = ipr }
317
 
317
 
318
 	-- ip route list table 1-250
318
 	-- ip route list table 1-250
319
-	local routelisting, rlstr = ut.trim(sys.exec("ip rule | sed 's/://g' | awk -F' ' '$1>=2001 && $1<=2250' | awk -F' ' '{ print $NF }'")), ""
319
+	local routelisting, rlstr = ut.trim(sys.exec("ip rule | sed 's/://g' | awk '$1>=2001 && $1<=2250' | awk '{ print $NF }'")), ""
320
 		if routelisting ~= "" then
320
 		if routelisting ~= "" then
321
 			for line in routelisting:gmatch("[^\r\n]+") do
321
 			for line in routelisting:gmatch("[^\r\n]+") do
322
 				rlstr = rlstr .. line .. "\n" .. sys.exec("ip route list table " .. line)
322
 				rlstr = rlstr .. line .. "\n" .. sys.exec("ip route list table " .. line)

+ 3
- 3
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_interface.lua Zobrazit soubor

30
 					err_netcfg_list = err_netcfg_list .. ifname .. " "
30
 					err_netcfg_list = err_netcfg_list .. ifname .. " "
31
 					err_route_list = err_route_list .. ifname .. " "
31
 					err_route_list = err_route_list .. ifname .. " "
32
 				else
32
 				else
33
-					local rtcheck = ut.trim(sys.exec("route -n | awk -F' ' '{ if ($8 == \"" .. ifdev .. "\" && $1 == \"0.0.0.0\") print $1 }'"))
33
+					local rtcheck = ut.trim(sys.exec("route -n | awk '{ if ($8 == \"" .. ifdev .. "\" && $1 == \"0.0.0.0\" && $3 == \"0.0.0.0\") print $1 }'"))
34
 					if rtcheck == "" then
34
 					if rtcheck == "" then
35
 						err_found = 1
35
 						err_found = 1
36
 						err_route_list = err_route_list .. ifname .. " "
36
 						err_route_list = err_route_list .. ifname .. " "
44
 		end
44
 		end
45
 	)
45
 	)
46
 	-- check if any interfaces have duplicate metrics
46
 	-- check if any interfaces have duplicate metrics
47
-	local metric_dupnums = sys.exec("echo '" .. metric_list .. "' | awk -F' ' '{ print $2 }' | uniq -d")
47
+	local metric_dupnums = sys.exec("echo '" .. metric_list .. "' | awk '{ print $2 }' | uniq -d")
48
 	if metric_dupnums ~= "" then
48
 	if metric_dupnums ~= "" then
49
 		err_found = 1
49
 		err_found = 1
50
 		local metric_dupes = ""
50
 		local metric_dupes = ""
51
 		for line in metric_dupnums:gmatch("[^\r\n]+") do
51
 		for line in metric_dupnums:gmatch("[^\r\n]+") do
52
-			metric_dupes = sys.exec("echo '" .. metric_list .. "' | grep '" .. line .. "' | awk -F' ' '{ print $1 }'")
52
+			metric_dupes = sys.exec("echo '" .. metric_list .. "' | grep '" .. line .. "' | awk '{ print $1 }'")
53
 			err_dupmet_list = err_dupmet_list .. metric_dupes
53
 			err_dupmet_list = err_dupmet_list .. metric_dupes
54
 		end
54
 		end
55
 		err_dupmet_list = sys.exec("echo '" .. err_dupmet_list .. "' | tr '\n' ' '")
55
 		err_dupmet_list = sys.exec("echo '" .. err_dupmet_list .. "' | tr '\n' ' '")

+ 3
- 3
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_interfaceconfig.lua Zobrazit soubor

12
 			end
12
 			end
13
 		)
13
 		)
14
 		-- compare metric against list
14
 		-- compare metric against list
15
-		local metric_dupnums, metric_dupes = sys.exec("echo '" .. metric_list .. "' | awk -F' ' '{ print $2 }' | uniq -d"), ""
15
+		local metric_dupnums, metric_dupes = sys.exec("echo '" .. metric_list .. "' | awk '{ print $2 }' | uniq -d"), ""
16
 		for line in metric_dupnums:gmatch("[^\r\n]+") do
16
 		for line in metric_dupnums:gmatch("[^\r\n]+") do
17
-			metric_dupes = sys.exec("echo '" .. metric_list .. "' | grep '" .. line .. "' | awk -F' ' '{ print $1 }'")
17
+			metric_dupes = sys.exec("echo '" .. metric_list .. "' | grep '" .. line .. "' | awk '{ print $1 }'")
18
 			err_dupmet_list = err_dupmet_list .. metric_dupes
18
 			err_dupmet_list = err_dupmet_list .. metric_dupes
19
 		end
19
 		end
20
 		if sys.exec("echo '" .. err_dupmet_list .. "' | grep -w " .. arg[1]) ~= "" then
20
 		if sys.exec("echo '" .. err_dupmet_list .. "' | grep -w " .. arg[1]) ~= "" then
36
 			err_netcfg = 1
36
 			err_netcfg = 1
37
 			err_route = 1
37
 			err_route = 1
38
 		else
38
 		else
39
-			local rtcheck = ut.trim(sys.exec("route -n | awk -F' ' '{ if ($8 == \"" .. ifdev .. "\" && $1 == \"0.0.0.0\") print $1 }'"))
39
+			local rtcheck = ut.trim(sys.exec("route -n | awk '{ if ($8 == \"" .. ifdev .. "\" && $1 == \"0.0.0.0\" && $3 == \"0.0.0.0\") print $1 }'"))
40
 			if rtcheck == "" then
40
 			if rtcheck == "" then
41
 				err_route = 1
41
 				err_route = 1
42
 			end
42
 			end

+ 13
- 0
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_policy.lua Zobrazit soubor

68
 		
68
 		
69
 	end
69
 	end
70
 
70
 
71
+last_resort = mwan_policy:option(DummyValue, "last_resort", translate("Last resort"))
72
+	last_resort.rawhtml = true
73
+	function last_resort.cfgvalue(self, s)
74
+		local str = self.map:get(s, "last_resort")
75
+		if str == "unreachable" or str == "" or str == null then
76
+			return "unreachable (reject)"
77
+		elseif str == "blackhole" then
78
+			return "blackhole (drop)"
79
+		elseif str == "main" then
80
+			return "main (use main routing table)"
81
+		end
82
+	end
83
+
71
 errors = mwan_policy:option(DummyValue, "errors", translate("Errors"))
84
 errors = mwan_policy:option(DummyValue, "errors", translate("Errors"))
72
 	errors.rawhtml = true
85
 	errors.rawhtml = true
73
 	function errors.cfgvalue(self, s)
86
 	function errors.cfgvalue(self, s)

+ 7
- 0
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_policyconfig.lua Zobrazit soubor

45
 use_member = mwan_policy:option(DynamicList, "use_member", translate("Member used"))
45
 use_member = mwan_policy:option(DynamicList, "use_member", translate("Member used"))
46
 	cbi_add_member(use_member)
46
 	cbi_add_member(use_member)
47
 
47
 
48
+last_resort = mwan_policy:option(ListValue, "last_resort", translate("Last resort"),
49
+	translate("When all policy members are offline use this behavior for matched traffic"))
50
+	last_resort.default = "unreachable"
51
+	last_resort:value("unreachable", translate("unreachable (reject)"))
52
+	last_resort:value("blackhole", translate("blackhole (drop)"))
53
+	last_resort:value("main", translate("main (use main routing table)"))
54
+
48
 
55
 
49
 -- ------ currently configured members ------ --
56
 -- ------ currently configured members ------ --
50
 
57
 

+ 1
- 1
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_ruleconfig.lua Zobrazit soubor

28
 end
28
 end
29
 
29
 
30
 function cbi_add_protocol(field)
30
 function cbi_add_protocol(field)
31
-	local protos = ut.trim(sys.exec("cat /etc/protocols | grep '	# ' | awk -F' ' '{print $1}' | grep -vw -e 'ip' -e 'tcp' -e 'udp' -e 'icmp' -e 'esp' | grep -v 'ipv6' | sort | tr '\n' ' '"))
31
+	local protos = ut.trim(sys.exec("cat /etc/protocols | grep '	# ' | awk '{print $1}' | grep -vw -e 'ip' -e 'tcp' -e 'udp' -e 'icmp' -e 'esp' | grep -v 'ipv6' | sort | tr '\n' ' '"))
32
 	for p in string.gmatch(protos, "%S+") do
32
 	for p in string.gmatch(protos, "%S+") do
33
 		field:value(p)
33
 		field:value(p)
34
 	end
34
 	end

+ 1
- 4
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_adv_diagnostics.htm Zobrazit soubor

57
 				{
57
 				{
58
 					var temp = '';
58
 					var temp = '';
59
 					var ncint = 'No diagnostic results returned';
59
 					var ncint = 'No diagnostic results returned';
60
-					temp = String.format(
61
-						'<pre id="diag_output_css"><strong>%s</strong></pre>',
62
-							ncint
63
-					);
60
+					temp = String.format('<pre id="diag_output_css"><strong>%s</strong></pre>', ncint);
64
 					output.innerHTML = temp;
61
 					output.innerHTML = temp;
65
 				}
62
 				}
66
 			}
63
 			}

+ 3
- 5
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_adv_troubleshoot.htm Zobrazit soubor

29
 
29
 
30
 				temp = String.format(
30
 				temp = String.format(
31
 					'<pre><span class="tsht">%s</span>%s<span class="tsht">%s</span>%s<span class="tsht">%s</span>%s<span class="tsht">%s</span>%s<span class="tsht">%s</span>%s<span class="tsht">%s</span>%s<span class="tsht">%s</span>%s<span class="tsht">%s</span>%s<span class="tsht">%s</span>%s</pre>',
31
 					'<pre><span class="tsht">%s</span>%s<span class="tsht">%s</span>%s<span class="tsht">%s</span>%s<span class="tsht">%s</span>%s<span class="tsht">%s</span>%s<span class="tsht">%s</span>%s<span class="tsht">%s</span>%s<span class="tsht">%s</span>%s<span class="tsht">%s</span>%s</pre>',
32
-						mwanvers, st.mw3ver[0].mwan3v, mwan3cnfg, st.mwan3config[0].mwn3cfg, netcnfg, st.netconfig[0].netcfg, ifcnfg, st.ifconfig[0].ifcfg, iproute, st.rtshow[0].iprtshow, iprulesh, st.iprule[0].rule, routelisttbl, st.routelist[0].iprtlist, firewalldef, st.fidef[0].firedef, iptable, st.iptables[0].iptbls
32
+					mwanvers, st.mw3ver[0].mwan3v, mwan3cnfg, st.mwan3config[0].mwn3cfg, netcnfg, st.netconfig[0].netcfg, ifcnfg, st.ifconfig[0].ifcfg, iproute, st.rtshow[0].iprtshow, iprulesh, st.iprule[0].rule, routelisttbl, st.routelist[0].iprtlist, firewalldef, st.fidef[0].firedef, iptable, st.iptables[0].iptbls
33
 				);
33
 				);
34
 				tx.innerHTML = temp;
34
 				tx.innerHTML = temp;
35
 			}
35
 			}
37
 			{
37
 			{
38
 				var temp = '';
38
 				var temp = '';
39
 				var terror = 'Error collecting troubleshooting information';
39
 				var terror = 'Error collecting troubleshooting information';
40
-				temp = String.format(
41
-					'<strong>%s</strong>',
42
-						terror
43
-				);
40
+				temp = String.format('<strong>%s</strong>', terror);
44
 				tx.innerHTML = temp;
41
 				tx.innerHTML = temp;
45
 			}
42
 			}
46
 		}
43
 		}
53
 		<div id="mwan3_tshoot_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> Collecting data...</div>
50
 		<div id="mwan3_tshoot_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> Collecting data...</div>
54
 	</fieldset>
51
 	</fieldset>
55
 </div>
52
 </div>
53
+
56
 <style type="text/css">
54
 <style type="text/css">
57
   .container {  /*container for entire page. fixes bootstrap theme's ridiculously small page width*/
55
   .container {  /*container for entire page. fixes bootstrap theme's ridiculously small page width*/
58
 	max-width: none;
56
 	max-width: none;

+ 2
- 8
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_over_detail.htm Zobrazit soubor

14
 			if (st.mwan3dst)
14
 			if (st.mwan3dst)
15
 			{
15
 			{
16
 				var temp = '';
16
 				var temp = '';
17
-				temp = String.format(
18
-					'<pre>%s</pre>',
19
-						st.mwan3dst[0].detailstat
20
-				);
17
+				temp = String.format('<pre>%s</pre>', st.mwan3dst[0].detailstat);
21
 				tx.innerHTML = temp;
18
 				tx.innerHTML = temp;
22
 			}
19
 			}
23
 			else
20
 			else
24
 			{
21
 			{
25
 				var temp = '';
22
 				var temp = '';
26
 				var nslg = 'No detailed status information available';
23
 				var nslg = 'No detailed status information available';
27
-				temp = String.format(
28
-					'<strong>%s</strong>',
29
-						nslg
30
-				);
24
+				temp = String.format('<strong>%s</strong>', nslg);
31
 				tx.innerHTML = temp;
25
 				tx.innerHTML = temp;
32
 			}
26
 			}
33
 		}
27
 		}

+ 4
- 14
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_over_interface.htm Zobrazit soubor

45
 
45
 
46
 					temp += String.format(
46
 					temp += String.format(
47
 						'<span class="%s"><strong>%s (<a href="%q">%s</a>)</strong><br />%s</span>',
47
 						'<span class="%s"><strong>%s (<a href="%q">%s</a>)</strong><br />%s</span>',
48
-							cssc, st.wans[i].name, st.wans[i].link, st.wans[i].ifname, stat
48
+						cssc, st.wans[i].name, st.wans[i].link, st.wans[i].ifname, stat
49
 					);
49
 					);
50
 				}
50
 				}
51
 				tx.innerHTML = temp;
51
 				tx.innerHTML = temp;
54
 			{
54
 			{
55
 				var temp = '';
55
 				var temp = '';
56
 				var ncint = 'No MWAN3 interfaces found';
56
 				var ncint = 'No MWAN3 interfaces found';
57
-				temp = String.format(
58
-					'<strong>%s</strong>',
59
-						ncint
60
-				);
57
+				temp = String.format('<strong>%s</strong>', ncint);
61
 				tx.innerHTML = temp;
58
 				tx.innerHTML = temp;
62
 			}
59
 			}
63
 
60
 
66
 			{
63
 			{
67
 				var temp = '';
64
 				var temp = '';
68
 				var mwan3lg = 'Last 50 MWAN3 systemlog entries. Newest entries sorted at the top :';
65
 				var mwan3lg = 'Last 50 MWAN3 systemlog entries. Newest entries sorted at the top :';
69
-
70
-				temp = String.format(
71
-					'<pre>%s<br /><br />%s</pre>',
72
-						mwan3lg, st.mwan3log[0].mwanlog
73
-				);
66
+				temp = String.format('<pre>%s<br /><br />%s</pre>', mwan3lg, st.mwan3log[0].mwanlog);
74
 				tx.innerHTML = temp;
67
 				tx.innerHTML = temp;
75
 			}
68
 			}
76
 			else
69
 			else
77
 			{
70
 			{
78
 				var temp = '';
71
 				var temp = '';
79
 				var nslg = 'No MWAN3 systemlog history found';
72
 				var nslg = 'No MWAN3 systemlog history found';
80
-				temp = String.format(
81
-					'<strong>%s</strong>',
82
-						nslg
83
-				);
73
+				temp = String.format('<strong>%s</strong>', nslg);
84
 				tx.innerHTML = temp;
74
 				tx.innerHTML = temp;
85
 			}
75
 			}
86
 		}
76
 		}

+ 2
- 5
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_status.htm Zobrazit soubor

37
 
37
 
38
 					temp += String.format(
38
 					temp += String.format(
39
 						'<span class="%s"><strong>%s (<a href="%q">%s</a>)</strong><br />%s</span>',
39
 						'<span class="%s"><strong>%s (<a href="%q">%s</a>)</strong><br />%s</span>',
40
-							cssc, st.wans[i].name, st.wans[i].link, st.wans[i].ifname, stat
40
+						cssc, st.wans[i].name, st.wans[i].link, st.wans[i].ifname, stat
41
 					);
41
 					);
42
 				}
42
 				}
43
 				tx.innerHTML = temp;
43
 				tx.innerHTML = temp;
46
 			{
46
 			{
47
 				var temp = '';
47
 				var temp = '';
48
 				var ncint = 'No MWAN3 interfaces found';
48
 				var ncint = 'No MWAN3 interfaces found';
49
-				temp += String.format(
50
-					'<strong>%s</strong>',
51
-						ncint
52
-				);
49
+				temp += String.format('<strong>%s</strong>', ncint );
53
 				tx.innerHTML = temp;
50
 				tx.innerHTML = temp;
54
 			}
51
 			}
55
 		}
52
 		}