1 <script type="text/javascript">//<![CDATA[
2 function upnp_delete_fwd(idx) {
3 (new XHR()).post('<%=url('admin/services/upnp/delete')%>/' + idx, { token: '<%=token%>' },
6 var tb = document.getElementById('upnp_status_table');
7 if (tb && (idx < tb.rows.length))
8 tb.rows[0].parentNode.removeChild(tb.rows[idx]);
13 XHR.poll(5, '<%=url('admin/services/upnp/status')%>', null,
16 var tb = document.getElementById('upnp_status_table');
20 while( tb.rows.length > 1 )
23 for( var i = 0; i < st.length; i++ )
25 var tr = tb.insertRow(-1);
26 tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1);
28 tr.insertCell(-1).innerHTML = st[i].proto;
29 tr.insertCell(-1).innerHTML = st[i].extport;
30 tr.insertCell(-1).innerHTML = st[i].intaddr;
31 tr.insertCell(-1).innerHTML = st[i].intport;
32 tr.insertCell(-1).innerHTML = st[i].descr;
34 tr.insertCell(-1).innerHTML = String.format(
35 '<input class="cbi-button cbi-input-remove" type="button" value="<%:Delete%>" onclick="upnp_delete_fwd(%d)" />',
40 if( tb.rows.length == 1 )
42 var tr = tb.insertRow(-1);
43 tr.className = 'cbi-section-table-row';
45 var td = tr.insertCell(-1);
47 td.innerHTML = '<em><br /><%:There are no active redirects.%></em>';
54 <fieldset class="cbi-section">
55 <legend><%:Active UPnP Redirects%></legend>
56 <table class="cbi-section-table" id="upnp_status_table">
57 <tr class="cbi-section-table-titles">
58 <th class="cbi-section-table-cell"><%:Protocol%></th>
59 <th class="cbi-section-table-cell"><%:External Port%></th>
60 <th class="cbi-section-table-cell"><%:Client Address%></th>
61 <th class="cbi-section-table-cell"><%:Client Port%></th>
62 <th class="cbi-section-table-cell"><%:Description%></th>
63 <th class="cbi-section-table-cell"> </th>
65 <tr class="cbi-section-table-row">
66 <td colspan="5"><em><br /><%:Collecting data...%></em></td>