luci-mod-system: mounts.js: disable umount button in readonly map
authorJo-Philipp Wich <jo@mein.io>
Thu, 16 Apr 2020 13:35:51 +0000 (15:35 +0200)
committerJo-Philipp Wich <jo@mein.io>
Thu, 16 Apr 2020 13:35:51 +0000 (15:35 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-mod-system/htdocs/luci-static/resources/view/system/mounts.js

index 7ee91f5aec64bd0fadef502345a9df8aa558bc68..e0a922656229ae953f4437d8519f53287239ebfa 100644 (file)
@@ -212,7 +212,8 @@ return view.extend({
                                        '%.2f%% (%1024.2mB)'.format(100 / this.mounts[i].size * used, used),
                                        umount ? E('button', {
                                                'class': 'btn cbi-button-remove',
-                                               'click': ui.createHandlerFn(view, 'handleUmount', m, this.mounts[i].mount)
+                                               'click': ui.createHandlerFn(view, 'handleUmount', m, this.mounts[i].mount),
+                                               'disabled': this.map.readonly || null
                                        }, [ _('Unmount') ]) : '-'
                                ]);
                        }