84e151075f0ebe2a55b2e1af2b0be39a704d6e5f
[project/luci.git] / modules / luci-mod-admin-full / luasrc / view / admin_system / clock_status.htm
1 <%+cbi/valueheader%>
2
3 <script type="text/javascript">//<![CDATA[
4         XHR.poll(5, '<%=luci.dispatcher.build_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                 XHR.get('<%=luci.dispatcher.build_url("admin", "system", "clock_status")%>',
21                         { 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%>