From 111670245e04fc13ad99336df8c2627566ec4b2f Mon Sep 17 00:00:00 2001
From: Jo-Philipp Wich <jo@mein.io>
Date: Thu, 16 Apr 2020 15:39:54 +0200
Subject: luci-mod-system: system.js: disable timesync buttons on readonly map

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
---
 .../htdocs/luci-static/resources/view/system/system.js              | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'modules/luci-mod-system/htdocs/luci-static/resources/view')

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 ee97bd82f9..2e087f5f4c 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')) : ''
 			])
 		]);
-- 
cgit v1.2.3