2010-11-18 01:32:30 +00:00
|
|
|
<script type="text/javascript">//<![CDATA[
|
2010-11-07 19:30:55 +00:00
|
|
|
function upnp_delete_fwd(idx) {
|
2015-10-20 22:11:28 +00:00
|
|
|
(new XHR()).post('<%=url('admin/services/upnp/delete')%>/' + idx, { token: '<%=token%>' },
|
2010-11-07 19:30:55 +00:00
|
|
|
function(x)
|
|
|
|
{
|
|
|
|
var tb = document.getElementById('upnp_status_table');
|
2018-05-28 12:57:54 +00:00
|
|
|
if (tb && (idx + 1 < tb.childNodes.length))
|
|
|
|
tb.removeChild(tb.childNodes[idx + 1]);
|
2010-11-07 19:30:55 +00:00
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2015-10-07 17:07:36 +00:00
|
|
|
XHR.poll(5, '<%=url('admin/services/upnp/status')%>', null,
|
2011-09-26 00:26:44 +00:00
|
|
|
function(x, st)
|
|
|
|
{
|
|
|
|
var tb = document.getElementById('upnp_status_table');
|
|
|
|
if (st && tb)
|
2010-11-07 19:30:55 +00:00
|
|
|
{
|
2011-09-26 00:26:44 +00:00
|
|
|
/* clear all rows */
|
2018-05-28 12:57:54 +00:00
|
|
|
while (tb.firstElementChild !== tb.lastElementChild)
|
|
|
|
tb.removeChild(tb.lastElementChild);
|
2010-11-07 19:30:55 +00:00
|
|
|
|
2018-05-28 12:57:54 +00:00
|
|
|
for (var i = 0; i < st.length; i++)
|
|
|
|
tb.appendChild(E('<div class="tr cbi-section-table-row cbi-rowstyle-%d">'.format((i % 2) + 1), [
|
|
|
|
E('<div class="td">', st[i].proto),
|
|
|
|
E('<div class="td">', st[i].extport),
|
|
|
|
E('<div class="td">', st[i].intaddr),
|
|
|
|
E('<div class="td">', st[i].intport),
|
|
|
|
E('<div class="td">', st[i].descr),
|
|
|
|
E('<input class="cbi-button cbi-input-remove" type="button" value="<%:Delete%>" onclick="upnp_delete_fwd(%d)" />'.format(st[i].num))
|
|
|
|
]));
|
2010-11-07 19:30:55 +00:00
|
|
|
|
2018-05-28 12:57:54 +00:00
|
|
|
if (tb.firstElementChild === tb.lastElementChild)
|
|
|
|
tb.appendChild(E('<div class="tr cbi-section-table-row"><div class="td"><em><br /><%:There are no active redirects.%></em></div></div>'));
|
2010-11-07 19:30:55 +00:00
|
|
|
}
|
2011-09-26 00:26:44 +00:00
|
|
|
}
|
|
|
|
);
|
2010-11-18 01:32:30 +00:00
|
|
|
//]]></script>
|
2010-11-07 19:30:55 +00:00
|
|
|
|
|
|
|
<fieldset class="cbi-section">
|
|
|
|
<legend><%:Active UPnP Redirects%></legend>
|
2018-05-28 12:57:54 +00:00
|
|
|
<div class="table cbi-section-table" id="upnp_status_table">
|
|
|
|
<div class="tr cbi-section-table-titles">
|
|
|
|
<div class="th cbi-section-table-cell"><%:Protocol%></div>
|
|
|
|
<div class="th cbi-section-table-cell"><%:External Port%></div>
|
|
|
|
<div class="th cbi-section-table-cell"><%:Client Address%></div>
|
|
|
|
<div class="th cbi-section-table-cell"><%:Client Port%></div>
|
|
|
|
<div class="th cbi-section-table-cell"><%:Description%></div>
|
|
|
|
<div class="th cbi-section-table-cell"> </div>
|
|
|
|
</div>
|
|
|
|
<div class="tr cbi-section-table-row">
|
|
|
|
<div class="td" colspan="5"><em><br /><%:Collecting data...%></em></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2010-11-07 19:30:55 +00:00
|
|
|
</fieldset>
|