luci-app-upnp: change leasefile location hint
[project/luci.git] / applications / luci-app-upnp / luasrc / view / upnp_status.htm
1 <script type="text/javascript">//<![CDATA[
2         function upnp_delete_fwd(idx) {
3                 (new XHR()).post('<%=url('admin/services/upnp/delete')%>/' + idx, { token: '<%=token%>' },
4                         function(x)
5                         {
6                                 var tb = document.getElementById('upnp_status_table');
7                                 if (tb && (idx < tb.rows.length))
8                                         tb.rows[0].parentNode.removeChild(tb.rows[idx]);
9                         }
10                 );
11         }
12
13         XHR.poll(5, '<%=url('admin/services/upnp/status')%>', null,
14                 function(x, st)
15                 {
16                         var tb = document.getElementById('upnp_status_table');
17                         if (st && tb)
18                         {
19                                 /* clear all rows */
20                                 while( tb.rows.length > 1 )
21                                         tb.deleteRow(1);
22
23                                 for( var i = 0; i < st.length; i++ )
24                                 {
25                                         var tr = tb.insertRow(-1);
26                                                 tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1);
27
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;
33
34                                         tr.insertCell(-1).innerHTML = String.format(
35                                                 '<input class="cbi-button cbi-input-remove" type="button" value="<%:Delete%>" onclick="upnp_delete_fwd(%d)" />',
36                                                         st[i].num
37                                         );
38                                 }
39
40                                 if( tb.rows.length == 1 )
41                                 {
42                                         var tr = tb.insertRow(-1);
43                                                 tr.className = 'cbi-section-table-row';
44
45                                         var td = tr.insertCell(-1);
46                                                 td.colSpan = 5;
47                                                 td.innerHTML = '<em><br /><%:There are no active redirects.%></em>';
48                                 }
49                         }
50                 }
51         );
52 //]]></script>
53
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">&#160;</th>
64                 </tr>
65                 <tr class="cbi-section-table-row">
66                         <td colspan="5"><em><br /><%:Collecting data...%></em></td>
67                 </tr>
68         </table>
69 </fieldset>