37d8ae0e854622d2d69b147752cae47f549621f5
[project/luci.git] / modules / luci-mod-system / luasrc / view / admin_system / clock_status.htm
1 <%+cbi/valueheader%>
2
3 <script type="text/javascript">//<![CDATA[
4 XHR.poll(5, '<%=url('admin/system/clock_status')%>', null,
5 function(x, rv)
6 {
7 var s = document.getElementById('<%=self.option%>-clock-status');
8 if (s)
9 {
10 s.innerHTML = rv.timestring || '?';
11 }
12 }
13 );
14
15 function sync_clock(btn)
16 {
17 btn.disabled = true;
18 btn.value = '<%:Synchronizing...%>';
19
20 (new XHR()).post('<%=url('admin/system/clock_status')%>',
21 { token: '<%=token%>', set: Math.floor((new Date()).getTime() / 1000) },
22 function()
23 {
24 btn.disabled = false;
25 btn.value = '<%:Sync with browser%>';
26 }
27 );
28
29 return false;
30 }
31 //]]></script>
32
33 <span id="<%=self.option%>-clock-status"><em><%:Collecting data...%></em></span>
34 <input type="button" class="cbi-button cbi-button-apply" value="<%:Sync with browser%>" onclick="return sync_clock(this)" />
35
36 <%+cbi/valuefooter%>