summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-admin-full/luasrc/view/admin_system/clock_status.htm
blob: 84e151075f0ebe2a55b2e1af2b0be39a704d6e5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<%+cbi/valueheader%>

<script type="text/javascript">//<![CDATA[
	XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "system", "clock_status")%>', null,
		function(x, rv)
		{
			var s = document.getElementById('<%=self.option%>-clock-status');
			if (s)
			{
				s.innerHTML = rv.timestring || '?';
			}
		}
	);

	function sync_clock(btn)
	{
		btn.disabled = true;
		btn.value    = '<%:Synchronizing...%>';

		XHR.get('<%=luci.dispatcher.build_url("admin", "system", "clock_status")%>',
			{ set: Math.floor((new Date()).getTime() / 1000) },
			function()
			{
				btn.disabled = false;
				btn.value    = '<%:Sync with browser%>';
			}
		);

		return false;
	}
//]]></script>

<span id="<%=self.option%>-clock-status"><em><%:Collecting data...%></em></span>
<input type="button" class="cbi-button cbi-button-apply" value="<%:Sync with browser%>" onclick="return sync_clock(this)" />

<%+cbi/valuefooter%>