luci-mod-system: crontab.js: disable textarea on insufficient ACLs
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
17770e49eb
commit
92902225fb
1 changed files with 3 additions and 1 deletions
|
@ -3,6 +3,8 @@
|
||||||
'require fs';
|
'require fs';
|
||||||
'require ui';
|
'require ui';
|
||||||
|
|
||||||
|
var isReadonlyView = !L.hasViewPermission() || null;
|
||||||
|
|
||||||
return view.extend({
|
return view.extend({
|
||||||
load: function() {
|
load: function() {
|
||||||
return L.resolveDefault(fs.read('/etc/crontabs/root'), '');
|
return L.resolveDefault(fs.read('/etc/crontabs/root'), '');
|
||||||
|
@ -25,7 +27,7 @@ return view.extend({
|
||||||
E('p', { 'class': 'cbi-section-descr' },
|
E('p', { 'class': 'cbi-section-descr' },
|
||||||
_('This is the system crontab in which scheduled tasks can be defined.') +
|
_('This is the system crontab in which scheduled tasks can be defined.') +
|
||||||
_('<br/>Note: you need to manually restart the cron service if the crontab file was empty before editing.')),
|
_('<br/>Note: you need to manually restart the cron service if the crontab file was empty before editing.')),
|
||||||
E('p', {}, E('textarea', { 'style': 'width:100%', 'rows': 10 }, [ crontab != null ? crontab : '' ]))
|
E('p', {}, E('textarea', { 'style': 'width:100%', 'rows': 10, 'disabled': isReadonlyView }, [ crontab != null ? crontab : '' ]))
|
||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue