1 <script type="text/javascript"><![CDATA[
4 function upnp_delete_fwd(idx) {
7 dlxhr.get('<%=luci.dispatcher.build_url("admin", "services", "upnp", "delete")%>/' + idx, null,
10 var tb = document.getElementById('upnp_status_table');
11 if (tb && (idx < tb.rows.length))
12 tb.rows[0].parentNode.removeChild(tb.rows[idx]);
17 var stxhr = new XHR();
19 stxhr.get('<%=luci.dispatcher.build_url("admin", "services", "upnp", "status")%>', null,
22 var st = x.responseText ? eval('(' + x.responseText + ')') : null;
23 var tb = document.getElementById('upnp_status_table');
28 while( tb.rows.length > 1 )
29 tb.rows[1].parentNode.removeChild(tb.rows[1]);
31 for( var i = 0; i < st.length; i++ )
33 var tr = document.createElement('tr');
34 tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1);
36 tr.innerHTML = String.format(
37 '<td class="cbi-section-table-cell">%s</td>' +
38 '<td class="cbi-section-table-cell">%d</td>' +
39 '<td class="cbi-section-table-cell">%s</td>' +
40 '<td class="cbi-section-table-cell">%d</td>' +
41 '<td class="cbi-section-table-cell">' +
42 '<input class="cbi-input-remove" type="button" value="<%:Delete Redirect%>" onclick="upnp_delete_fwd(%d)" />' +
51 tb.rows[0].parentNode.appendChild(tr);
54 if( tb.rows.length == 1 )
56 var tr = document.createElement('tr');
57 tr.className = 'cbi-section-table-row';
58 tr.innerHTML = '<td colspan="5"><em><br /><%:There are no active redirects.%></em></td>';
60 tb.rows[0].parentNode.appendChild(tr);
66 window.setTimeout(arguments.callee, 5000);
70 <fieldset class="cbi-section">
71 <legend><%:Active UPnP Redirects%></legend>
72 <table class="cbi-section-table" id="upnp_status_table">
73 <tr class="cbi-section-table-titles">
74 <th class="cbi-section-table-cell"><%:Protocol%></th>
75 <th class="cbi-section-table-cell"><%:External Port%></th>
76 <th class="cbi-section-table-cell"><%:Client Address%></th>
77 <th class="cbi-section-table-cell"><%:Client Port%></th>
78 <th class="cbi-section-table-cell"> </th>
80 <tr class="cbi-section-table-row">
81 <td colspan="5"><em><br /><%:Collecting data...%></em></td>