From: Jo-Philipp Wich Date: Thu, 16 Apr 2020 13:39:54 +0000 (+0200) Subject: luci-mod-system: system.js: disable timesync buttons on readonly map X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=111670245e04fc13ad99336df8c2627566ec4b2f;p=oweals%2Fluci.git luci-mod-system: system.js: disable timesync buttons on readonly map Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/system.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/system.js index ee97bd82f..2e087f5f4 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/system.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/system.js @@ -62,14 +62,16 @@ CBILocalTime = form.DummyValue.extend({ 'class': 'cbi-button cbi-button-apply', 'click': ui.createHandlerFn(this, function() { return callSetLocaltime(Math.floor(Date.now() / 1000)); - }) + }), + 'disabled': (this.readonly != null) ? this.readonly : this.map.readonly }, _('Sync with browser')), ' ', this.ntpd_support ? E('button', { 'class': 'cbi-button cbi-button-apply', 'click': ui.createHandlerFn(this, function() { return callInitAction('sysntpd', 'restart'); - }) + }), + 'disabled': (this.readonly != null) ? this.readonly : this.map.readonly }, _('Sync with NTP-Server')) : '' ]) ]);