1 <script type=
"text/javascript">//<![CDATA[
2 function upnp_delete_fwd(idx) {
5 dlxhr.get('<%=luci.dispatcher.build_url(
"admin",
"services",
"upnp",
"delete")%
>/' + idx, null,
8 var tb = document.getElementById('upnp_status_table');
9 if (tb && (idx < tb.rows.length))
10 tb.rows[
0].parentNode.removeChild(tb.rows[idx]);
15 var stxhr = new XHR();
16 var update_status = function() {
17 stxhr.get('<%=luci.dispatcher.build_url(
"admin",
"services",
"upnp",
"status")%
>', null,
20 var tb = document.getElementById('upnp_status_table');
24 while( tb.rows.length
> 1 )
27 for( var i =
0; i < st.length; i++ )
29 var tr = tb.insertRow(-
1);
30 tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i %
2) +
1);
32 tr.insertCell(-
1).innerHTML = st[i].proto;
33 tr.insertCell(-
1).innerHTML = st[i].extport;
34 tr.insertCell(-
1).innerHTML = st[i].intaddr;
35 tr.insertCell(-
1).innerHTML = st[i].intport;
37 tr.insertCell(-
1).innerHTML = String.format(
38 '
<input class=
"cbi-input-remove" type=
"button" value=
"<%:Delete Redirect%>" onclick=
"upnp_delete_fwd(%d)" />',
43 if( tb.rows.length ==
1 )
45 var tr = tb.insertRow(-
1);
46 tr.className = 'cbi-section-table-row';
48 var td = tr.insertCell(-
1);
50 td.innerHTML = '
<em><br /><%:There are no active redirects.%
></em>';
54 window.setTimeout(update_status,
5000);
62 <fieldset class=
"cbi-section">
63 <legend><%:Active UPnP Redirects%
></legend>
64 <table class=
"cbi-section-table" id=
"upnp_status_table">
65 <tr class=
"cbi-section-table-titles">
66 <th class=
"cbi-section-table-cell"><%:Protocol%
></th>
67 <th class=
"cbi-section-table-cell"><%:External Port%
></th>
68 <th class=
"cbi-section-table-cell"><%:Client Address%
></th>
69 <th class=
"cbi-section-table-cell"><%:Client Port%
></th>
70 <th class=
"cbi-section-table-cell"> </th>
72 <tr class=
"cbi-section-table-row">
73 <td colspan=
"5"><em><br /><%:Collecting data...%
></em></td>