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();
18 var update_status = function() {
19 stxhr.get('<%=luci.dispatcher.build_url("admin", "services", "upnp", "status")%>', null,
22 var tb = document.getElementById('upnp_status_table');
26 while( tb.rows.length > 1 )
27 tb.rows[1].parentNode.removeChild(tb.rows[1]);
29 for( var i = 0; i < st.length; i++ )
31 var tr = document.createElement('tr');
32 tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1);
34 tr.innerHTML = String.format(
35 '<td class="cbi-section-table-cell">%s</td>' +
36 '<td class="cbi-section-table-cell">%d</td>' +
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">' +
40 '<input class="cbi-input-remove" type="button" value="<%:Delete Redirect%>" onclick="upnp_delete_fwd(%d)" />' +
49 tb.rows[0].parentNode.appendChild(tr);
52 if( tb.rows.length == 1 )
54 var tr = document.createElement('tr');
55 tr.className = 'cbi-section-table-row';
56 tr.innerHTML = '<td colspan="5"><em><br /><%:There are no active redirects.%></em></td>';
58 tb.rows[0].parentNode.appendChild(tr);
62 window.setTimeout(update_status, 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>