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
|
|
|
{
|
2018-06-19 15:18:02 +00:00
|
|
|
var rows = [];
|
2010-11-07 19:30:55 +00:00
|
|
|
|
2018-05-28 12:57:54 +00:00
|
|
|
for (var i = 0; i < st.length; i++)
|
2018-06-19 15:18:02 +00:00
|
|
|
rows.push([
|
|
|
|
st[i].proto,
|
|
|
|
st[i].extport,
|
|
|
|
st[i].intaddr,
|
|
|
|
st[i].intport,
|
|
|
|
st[i].descr,
|
|
|
|
E('<input class="cbi-button cbi-button-remove" type="button" value="<%:Delete%>" onclick="upnp_delete_fwd(%d)" />'.format(st[i].num))
|
|
|
|
]);
|
2010-11-07 19:30:55 +00:00
|
|
|
|
2018-06-19 15:18:02 +00:00
|
|
|
cbi_update_table(tb, rows, '<em><%:There are no active redirects.%></em>');
|
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
|
|
|
|
2018-06-19 15:18:02 +00:00
|
|
|
<div class="cbi-section">
|
2010-11-07 19:30:55 +00:00
|
|
|
<legend><%:Active UPnP Redirects%></legend>
|
2018-06-19 15:18:02 +00:00
|
|
|
<div class="cbi-section-node">
|
|
|
|
<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"><%:Client Port%></div>
|
|
|
|
<div class="th"><%:Description%></div>
|
|
|
|
<div class="th cbi-section-actions"> </div>
|
|
|
|
</div>
|
|
|
|
<div class="tr">
|
|
|
|
<div class="td" colspan="5"><em><%:Collecting data...%></em></div>
|
|
|
|
</div>
|
2018-05-28 12:57:54 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-06-19 15:18:02 +00:00
|
|
|
</div>
|