From 111670245e04fc13ad99336df8c2627566ec4b2f Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 16 Apr 2020 15:39:54 +0200 Subject: [PATCH] luci-mod-system: system.js: disable timesync buttons on readonly map Signed-off-by: Jo-Philipp Wich --- .../htdocs/luci-static/resources/view/system/system.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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')) : '' ]) ]); -- 2.25.1