summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-system/luasrc/view/admin_system/clock_status.htm
diff options
context:
space:
mode:
Diffstat (limited to 'modules/luci-mod-system/luasrc/view/admin_system/clock_status.htm')
-rw-r--r--modules/luci-mod-system/luasrc/view/admin_system/clock_status.htm36
1 files changed, 36 insertions, 0 deletions
diff --git a/modules/luci-mod-system/luasrc/view/admin_system/clock_status.htm b/modules/luci-mod-system/luasrc/view/admin_system/clock_status.htm
new file mode 100644
index 000000000..37d8ae0e8
--- /dev/null
+++ b/modules/luci-mod-system/luasrc/view/admin_system/clock_status.htm
@@ -0,0 +1,36 @@
+<%+cbi/valueheader%>
+
+<script type="text/javascript">//<![CDATA[
+ XHR.poll(5, '<%=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...%>';
+
+ (new XHR()).post('<%=url('admin/system/clock_status')%>',
+ { token: '<%=token%>', 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%>