From e097d3f734d25b31fe511a0d344d913a6d411c87 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 19 Jun 2018 16:58:39 +0200 Subject: luci-app-firewall: cleanup template markup Rework the cbi section add template markup to properly render with the latest responsive design changes. Signed-off-by: Jo-Philipp Wich --- .../luasrc/view/firewall/cbi_addforward.htm | 162 +++++++++--------- .../luasrc/view/firewall/cbi_addrule.htm | 181 ++++++++++----------- .../luasrc/view/firewall/cbi_addsnat.htm | 87 +++++----- 3 files changed, 207 insertions(+), 223 deletions(-) (limited to 'applications') diff --git a/applications/luci-app-firewall/luasrc/view/firewall/cbi_addforward.htm b/applications/luci-app-firewall/luasrc/view/firewall/cbi_addforward.htm index 279b6e06d6..f48599b505 100644 --- a/applications/luci-app-firewall/luasrc/view/firewall/cbi_addforward.htm +++ b/applications/luci-app-firewall/luasrc/view/firewall/cbi_addforward.htm @@ -18,95 +18,91 @@ vals[#vals+1] = '%s (%s)' %{ ip, name } end) -%> -
-
-
-
-
<%:New port forward%>:
+ +

<%:New port forward%>

+
+
+
<%:Name%>
+
<%:Protocol%>
+
<%:External zone%>
+
<%:External port%>
+
<%:Internal zone%>
+
<%:Internal IP address%>
+
<%:Internal port%>
+
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ 0, "data-choices", {keys, vals}) + %>/>
-
-
<%:Name%>
-
<%:Protocol%>
-
<%:External zone%>
-
<%:External port%>
-
<%:Internal zone%>
-
<%:Internal IP address%>
-
<%:Internal port%>
-
+
+
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- 0, "data-choices", {keys, vals}) - %>/> -
-
- -
-
- -
+
+
+
- -
+ else if (!n.value) + { + n.value = 'Forward' + this.value; + } + } + }); +//]]> diff --git a/applications/luci-app-firewall/luasrc/view/firewall/cbi_addrule.htm b/applications/luci-app-firewall/luasrc/view/firewall/cbi_addrule.htm index c99ecaca37..273675cd30 100644 --- a/applications/luci-app-firewall/luasrc/view/firewall/cbi_addrule.htm +++ b/applications/luci-app-firewall/luasrc/view/firewall/cbi_addrule.htm @@ -5,112 +5,105 @@ local zones = fw:get_zones() %> -
- <% if wz then %> -
-
-
-
<%:Open ports on router%>:
+<% if wz then %> +

<%:Open ports on router%>

+
+
+
<%:Name%>
+
<%:Protocol%>
+
<%:External port%>
+
+
+
+
+ +
+
+
-
-
<%:Name%>
-
<%:Protocol%>
-
<%:External port%>
-
+
+
-
-
- -
-
- -
-
- -
-
- -
+
+
- <% end %> - <% if #zones > 1 then %> -
-
-

<%:New forward rule%>:
+
+<% end %> +<% if #zones > 1 then %> +

<%:New forward rule%>

+
+
+
<%:Name%>
+
<%:Source zone%>
+
<%:Destination zone%>
+
+
+
+
+
-
-
<%:Name%>
-
<%:Source zone%>
-
<%:Destination zone%>
-
+
+
-
-
- -
-
- -
-
- -
-
- -
+
+ +
+
+
- <% else %> - - <% end %> +
+<% else %> + +<% end %> - <% if wz then %> - - <% end %> -
+ cbi_validate_field('cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>', true, 'uciname'); + //]]> +<% end %> diff --git a/applications/luci-app-firewall/luasrc/view/firewall/cbi_addsnat.htm b/applications/luci-app-firewall/luasrc/view/firewall/cbi_addsnat.htm index b2775cf694..0b4774ccc0 100644 --- a/applications/luci-app-firewall/luasrc/view/firewall/cbi_addsnat.htm +++ b/applications/luci-app-firewall/luasrc/view/firewall/cbi_addsnat.htm @@ -12,53 +12,48 @@ end %> -
- <% if #zones > 1 then %> -
-
-
-
<%:New source NAT%>:
+<% if #zones > 1 then %> +

<%:New source NAT%>

+
+
+
<%:Name%>
+
<%:Source zone%>
+
<%:Destination zone%>
+
<%:To source IP%>
+
<%:To source port%>
+
+
+
+
+ +
+
+ +
+
+ +
+
+ 0, "data-choices", { keys, vals }) + %> />
-
-
<%:Name%>
-
<%:Source zone%>
-
<%:Destination zone%>
-
<%:To source IP%>
-
<%:To source port%>
-
+
+
-
-
- -
-
- -
-
- -
-
- 0, "data-choices", { keys, vals }) - %> /> -
-
- -
-
- -
+
+
- <% else %> - - <% end %> -
+
+<% else %> + +<% end %> -- cgit v1.2.3 From ce8101ae75fa8767bf84f692c5424e2cf3441f34 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 19 Jun 2018 17:18:02 +0200 Subject: luci-app-upnp: rework lease status indicator Turn the dynamic lease status table into responsive table by using the cbi_update_table() helper in conjunction with title annotation attributes. Signed-off-by: Jo-Philipp Wich --- .../luci-app-upnp/luasrc/view/upnp_status.htm | 51 +++++++++++----------- 1 file changed, 25 insertions(+), 26 deletions(-) (limited to 'applications') diff --git a/applications/luci-app-upnp/luasrc/view/upnp_status.htm b/applications/luci-app-upnp/luasrc/view/upnp_status.htm index 1e09225793..459c63c1d7 100644 --- a/applications/luci-app-upnp/luasrc/view/upnp_status.htm +++ b/applications/luci-app-upnp/luasrc/view/upnp_status.htm @@ -16,40 +16,39 @@ var tb = document.getElementById('upnp_status_table'); if (st && tb) { - /* clear all rows */ - while (tb.firstElementChild !== tb.lastElementChild) - tb.removeChild(tb.lastElementChild); + var rows = []; for (var i = 0; i < st.length; i++) - tb.appendChild(E('
'.format((i % 2) + 1), [ - E('
', st[i].proto), - E('
', st[i].extport), - E('
', st[i].intaddr), - E('
', st[i].intport), - E('
', st[i].descr), - E(''.format(st[i].num)) - ])); + rows.push([ + st[i].proto, + st[i].extport, + st[i].intaddr, + st[i].intport, + st[i].descr, + E(''.format(st[i].num)) + ]); - if (tb.firstElementChild === tb.lastElementChild) - tb.appendChild(E('

<%:There are no active redirects.%>
')); + cbi_update_table(tb, rows, '<%:There are no active redirects.%>'); } } ); //]]> -
+
<%:Active UPnP Redirects%> -
-
-
<%:Protocol%>
-
<%:External Port%>
-
<%:Client Address%>
-
<%:Client Port%>
-
<%:Description%>
-
 
-
-
-

<%:Collecting data...%>
+
+
+
+
<%:Protocol%>
+
<%:External Port%>
+
<%:Client Address%>
+
<%:Client Port%>
+
<%:Description%>
+
 
+
+
+
<%:Collecting data...%>
+
-
+
-- cgit v1.2.3 From db4139b1491a0ca7ba7897208d49be126c368ae9 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 19 Jun 2018 17:18:36 +0200 Subject: luci-app-travelmate: consolidate markup Rework the various application view templates to properly render with the latest responsive design changes. Signed-off-by: Jo-Philipp Wich --- .../luasrc/view/travelmate/logread.htm | 4 +-- .../luasrc/view/travelmate/stations.htm | 28 +++++++++---------- .../luasrc/view/travelmate/wifi_scan.htm | 32 ++++++++++++---------- 3 files changed, 33 insertions(+), 31 deletions(-) (limited to 'applications') diff --git a/applications/luci-app-travelmate/luasrc/view/travelmate/logread.htm b/applications/luci-app-travelmate/luasrc/view/travelmate/logread.htm index 6cbeaffde6..c40bdeeb59 100644 --- a/applications/luci-app-travelmate/luasrc/view/travelmate/logread.htm +++ b/applications/luci-app-travelmate/luasrc/view/travelmate/logread.htm @@ -6,10 +6,10 @@ This is free software, licensed under the Apache License, Version 2.0 <%+header%>
-
+
<%:This form shows the syslog output, pre-filtered for travelmate related messages only.%>
-
+
+
<%=translatef("Provides an overview of all configured uplinks for the travelmate interface (%s). You can edit, delete or re-order existing uplinks or scan for a new one. The currently used uplink is emphasized in blue.", trmiface)%>
-
-
+
+
-
<%:Device%>
-
<%:SSID%>
-
<%:BSSID%>
-
<%:Encryption%>
-
<%:Actions%>
+
<%:Device%>
+
<%:SSID%>
+
<%:BSSID%>
+
<%:Encryption%>
+
 
<% uci:foreach("wireless", "wifi-iface", function(s) @@ -45,11 +47,9 @@ This is free software, licensed under the Apache License, Version 2.0
<%=ssid%>
<%=bssid%>
<%=encryption%>
-
- - -
-
+
+ +
@@ -59,7 +59,7 @@ This is free software, licensed under the Apache License, Version 2.0 end) %>
-
+
<% uci:foreach("wireless", "wifi-device", function(s) @@ -68,7 +68,7 @@ This is free software, licensed under the Apache License, Version 2.0
- +
<% end) diff --git a/applications/luci-app-travelmate/luasrc/view/travelmate/wifi_scan.htm b/applications/luci-app-travelmate/luasrc/view/travelmate/wifi_scan.htm index 81182b99b4..57efd97376 100644 --- a/applications/luci-app-travelmate/luasrc/view/travelmate/wifi_scan.htm +++ b/applications/luci-app-travelmate/luasrc/view/travelmate/wifi_scan.htm @@ -39,31 +39,33 @@ This is free software, licensed under the Apache License, Version 2.0 <%+header%> + +

<%:Wireless Scan%>

-
-
+
+
-
<%:Uplink SSID%>
-
<%:Uplink BSSID%>
-
<%:Encryption%>
-
<%:Signal strength%>
+
<%:Uplink SSID%>
+
<%:Uplink BSSID%>
+
<%:Encryption%>
+
<%:Signal strength%>
<% for i, net in ipairs(iw.scanlist or { }) do %>
-
+
<%=net.ssid and utl.pcdata(net.ssid) or "%s" % translate("hidden")%>
-
+
<%=net.bssid and utl.pcdata(net.bssid)%>
-
+
<%=format_wifi_encryption(net.encryption)%>
-
+
<%=percent_wifi_signal(net)%> %
-
+
@@ -80,16 +82,16 @@ This is free software, licensed under the Apache License, Version 2.0
<% end %>
-
+
+ + +
-
- -
-- cgit v1.2.3 From c7ee1ffcf114e11a81f2fdb707c705b5cb5064e3 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 20 Jun 2018 14:00:00 +0200 Subject: luci-app-shadowsocks-libev: cleanup section add markup Signed-off-by: Jo-Philipp Wich --- .../luasrc/view/shadowsocks-libev/add_instance.htm | 31 +++++++++------------- 1 file changed, 12 insertions(+), 19 deletions(-) (limited to 'applications') diff --git a/applications/luci-app-shadowsocks-libev/luasrc/view/shadowsocks-libev/add_instance.htm b/applications/luci-app-shadowsocks-libev/luasrc/view/shadowsocks-libev/add_instance.htm index 80b95564dd..f016dd47e6 100644 --- a/applications/luci-app-shadowsocks-libev/luasrc/view/shadowsocks-libev/add_instance.htm +++ b/applications/luci-app-shadowsocks-libev/luasrc/view/shadowsocks-libev/add_instance.htm @@ -1,24 +1,17 @@
-
-
-
-
- -
-
- -
-
- -
-
+
+
+
+ +
+