summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-upnp/luasrc/view
diff options
context:
space:
mode:
authorAnsuel Smith <ansuelsmth@gmail.com>2020-01-07 19:31:04 +0100
committerAnsuel Smith <ansuelsmth@gmail.com>2020-01-08 21:45:31 +0100
commitcfa70932c3b80c116144fc95ecb93dd7ffed4366 (patch)
treefb0086cc87549f6111e35afb6b5caa987fa13e1c /applications/luci-app-upnp/luasrc/view
parent55dcc8ab5c60334becd783e1c01f8de8ae3a9977 (diff)
luci-app-upnp: convert to client side implementation
Implement luci.upnp ubus app. Convert lua page to js client side implementation. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Diffstat (limited to 'applications/luci-app-upnp/luasrc/view')
-rw-r--r--applications/luci-app-upnp/luasrc/view/admin_status/index/upnp.htm1
-rw-r--r--applications/luci-app-upnp/luasrc/view/upnp_status.htm54
2 files changed, 0 insertions, 55 deletions
diff --git a/applications/luci-app-upnp/luasrc/view/admin_status/index/upnp.htm b/applications/luci-app-upnp/luasrc/view/admin_status/index/upnp.htm
deleted file mode 100644
index d0c2e2ed50..0000000000
--- a/applications/luci-app-upnp/luasrc/view/admin_status/index/upnp.htm
+++ /dev/null
@@ -1 +0,0 @@
-<%+upnp_status%>
diff --git a/applications/luci-app-upnp/luasrc/view/upnp_status.htm b/applications/luci-app-upnp/luasrc/view/upnp_status.htm
deleted file mode 100644
index 7238a56802..0000000000
--- a/applications/luci-app-upnp/luasrc/view/upnp_status.htm
+++ /dev/null
@@ -1,54 +0,0 @@
-<script type="text/javascript">//<![CDATA[
- function upnp_delete_fwd(idx) {
- (new XHR()).post('<%=url('admin/services/upnp/delete')%>/' + idx, { token: '<%=token%>' },
- function(x)
- {
- var tb = document.getElementById('upnp_status_table');
- if (tb && (idx + 1 < tb.childNodes.length))
- tb.removeChild(tb.childNodes[idx + 1]);
- }
- );
- }
-
- XHR.poll(-1, '<%=url('admin/services/upnp/status')%>', null,
- function(x, st)
- {
- var tb = document.getElementById('upnp_status_table');
- if (st && tb)
- {
- var rows = [];
-
- for (var i = 0; i < st.length; i++)
- rows.push([
- st[i].proto,
- st[i].extport,
- st[i].intaddr,
- st[i].host_hint || "<%:Unknown%>",
- st[i].intport,
- st[i].descr,
- E('<div><input class="cbi-button cbi-button-remove" type="button" value="<%:Delete%>" onclick="upnp_delete_fwd(%d)" /></div>'.format(st[i].num))
- ]);
-
- cbi_update_table(tb, rows, '<em><%:There are no active redirects.%></em>');
- }
- }
- );
-//]]></script>
-
-<div class="cbi-section">
- <h3><%:Active UPnP Redirects%></h3>
- <div class="table" id="upnp_status_table">
- <div class="tr table-titles">
- <div class="th"><%:Protocol%></div>
- <div class="th"><%:External Port%></div>
- <div class="th"><%:Client Address%></div>
- <div class="th"><%:Host%></div>
- <div class="th"><%:Client Port%></div>
- <div class="th"><%:Description%></div>
- <div class="th cbi-section-actions">&#160;</div>
- </div>
- <div class="tr placeholder">
- <div class="td"><em><%:Collecting data...%></em></div>
- </div>
- </div>
-</div>