615b6b4336a24d31e0dae611448bd4150bc1a31f
[project/luci.git] / applications / luci-app-ddns / luasrc / view / ddns / system_status.htm
1 <!-- ++ BEGIN ++ Dynamic DNS ++ system_status.htm ++ -->
2 <script type="text/javascript">//<![CDATA[
3
4 //start polling data every 30 second, this doesn't change so much
5 XHR.poll(30, '<%=url([[admin]], [[services]], [[ddns]], [[status]])%>', null,
6 function(x, data) {
7 if (data) {
8 var tbl = document.getElementById('ddns_status_table');
9 // security check
10 if ( !(tbl) ) { return; }
11
12 var rows = [];
13
14 // DDNS Service disabled
15 if (data[0].enabled == 0) {
16 var ddns_legend = document.getElementById('ddns_status_legend');
17 ddns_legend.style.display='none';
18 rows.push([
19 '<strong><font color="red"><%:DDNS Autostart disabled%></font>',
20 '<a class="cbi-button cbi-button-action important" type="button" href="' + data[0].url_up + '"><%:enable here%></a></strong>'
21 ]);
22 } else {
23 for( j = 1; j < data.length; j++ )
24 {
25
26 rows.push([
27 '<strong>' + data[j].section + '</strong>', //configuration
28 data[j].datenextstat ? '<em>'+data[j].datenextstat+'</em>' : '<em>'+data[j].datenext+'</em>',
29 data[j].lookup ? data[j].lookup : '<em><%:config error%></em>',
30 data[j].reg_ip ? data[j].reg_ip : '<em><%:No data%></em>',
31 data[j].iface // monitored interface
32 ]);
33 }
34 }
35
36 cbi_update_table(tbl, rows, '<%:There is no service configured.%>');
37 }
38 }
39 );
40
41 //]]></script>
42
43 <fieldset class="cbi-section" id="ddns_status_section">
44 <legend><a href="<%=url([[admin]], [[services]], [[ddns]])%>"><%:Dynamic DNS%></a></legend>
45 <div class="cbi-section-node">
46 <div class="table" id="ddns_status_table">
47 <div class="tr table-titles" id="ddns_status_legend">
48 <div class="th"><%:Configuration%></div>
49 <div class="th"><%:Next Update%></div>
50 <div class="th"><%:Lookup Hostname%></div>
51 <div class="th"><%:Registered IP%></div>
52 <div class="th"><%:Network%></div>
53 </div>
54 <div class="tr">
55 <div class="td"><em><br /><%:Collecting data...%></em></div>
56 </div>
57 </div>
58 </div>
59 </fieldset>
60 <!-- ++ END ++ Dynamic DNS ++ system_status.htm ++ -->