1 <script type=
"text/javascript">//<![CDATA[
2 function upnp_delete_fwd(idx) {
3 XHR.get('<%=luci.dispatcher.build_url(
"admin",
"services",
"upnp",
"delete")%
>/' + idx, null,
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, '<%=luci.dispatcher.build_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;
33 tr.insertCell(-
1).innerHTML = String.format(
34 '
<input class=
"cbi-button cbi-input-remove" type=
"button" value=
"<%:Delete Redirect%>" onclick=
"upnp_delete_fwd(%d)" />',
39 if( tb.rows.length ==
1 )
41 var tr = tb.insertRow(-
1);
42 tr.className = 'cbi-section-table-row';
44 var td = tr.insertCell(-
1);
46 td.innerHTML = '
<em><br /><%:There are no active redirects.%
></em>';
53 <fieldset class=
"cbi-section">
54 <legend><%:Active UPnP Redirects%
></legend>
55 <table class=
"cbi-section-table" id=
"upnp_status_table">
56 <tr class=
"cbi-section-table-titles">
57 <th class=
"cbi-section-table-cell"><%:Protocol%
></th>
58 <th class=
"cbi-section-table-cell"><%:External Port%
></th>
59 <th class=
"cbi-section-table-cell"><%:Client Address%
></th>
60 <th class=
"cbi-section-table-cell"><%:Client Port%
></th>
61 <th class=
"cbi-section-table-cell"> </th>
63 <tr class=
"cbi-section-table-row">
64 <td colspan=
"5"><em><br /><%:Collecting data...%
></em></td>