summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-system/luasrc/view
diff options
context:
space:
mode:
authorFlorian Eckert <fe@dev.tdt.de>2019-04-30 08:22:50 +0200
committerGitHub <noreply@github.com>2019-04-30 08:22:50 +0200
commit18cde3535d0222065a4edd403fa0936b1709708f (patch)
treee800d7538dbb61c0738cacf885e258f6958072f6 /modules/luci-mod-system/luasrc/view
parent35ace20b25fd7fd4410485ee82283e6d41a99bc7 (diff)
parenta37296dda8b90739b73b0a0fdc3b271405dd2ec1 (diff)
Merge pull request #2620 from TDT-AG/pr/20190311-luci-mod-system
luci-mod-system: add button to sync with ntp server
Diffstat (limited to 'modules/luci-mod-system/luasrc/view')
-rw-r--r--modules/luci-mod-system/luasrc/view/admin_system/clock_status.htm20
1 files changed, 20 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
index 2c96eb418..796aa695c 100644
--- a/modules/luci-mod-system/luasrc/view/admin_system/clock_status.htm
+++ b/modules/luci-mod-system/luasrc/view/admin_system/clock_status.htm
@@ -28,9 +28,29 @@
return false;
}
+
+ function btn_action(action)
+ {
+ if (action.name === "do_ntp_restart")
+ {
+ new XHR.get('<%=luci.dispatcher.build_url("admin", "system", "ntp_restart")%>', null,
+ function(x)
+ {
+ if (!x)
+ {
+ return;
+ }
+ });
+ }
+ }
+
//]]></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)" />
+<% if require("nixio.fs").access("/etc/init.d/sysntpd") then %>
+<input type="button" class="cbi-button cbi-button-apply" name="do_ntp_restart" value="<%:Sync with NTP-Server%>" onclick="btn_action(this)" />
+<% end %>
+
<%+cbi/valuefooter%>