luci-mod-system: system.js: disable timesync buttons on readonly map
authorJo-Philipp Wich <jo@mein.io>
Thu, 16 Apr 2020 13:39:54 +0000 (15:39 +0200)
committerJo-Philipp Wich <jo@mein.io>
Thu, 16 Apr 2020 13:39:54 +0000 (15:39 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-mod-system/htdocs/luci-static/resources/view/system/system.js

index ee97bd82f9523607d65eff3900dd3a0a313d51d5..2e087f5f4cc761f5ade3bfdb0ab4fe1f6d2069c3 100644 (file)
@@ -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')) : ''
                        ])
                ]);