Merge pull request #3962 from janh/vnstat2-acl
luci-app-vnstat2: fix ACL rules, disable button on insufficient ACLs
This commit is contained in:
commit
8f67311c26
2 changed files with 6 additions and 2 deletions
|
@ -8,6 +8,8 @@
|
||||||
'require form';
|
'require form';
|
||||||
'require tools.widgets as widgets';
|
'require tools.widgets as widgets';
|
||||||
|
|
||||||
|
var isReadonlyView = !L.hasViewPermission() || null;
|
||||||
|
|
||||||
return view.extend({
|
return view.extend({
|
||||||
handleDeleteModal: function(m, iface, ev) {
|
handleDeleteModal: function(m, iface, ev) {
|
||||||
L.showModal(_('Delete interface <em>%h</em>').format(iface), [
|
L.showModal(_('Delete interface <em>%h</em>').format(iface), [
|
||||||
|
@ -88,7 +90,8 @@ return view.extend({
|
||||||
this.interfaces[i],
|
this.interfaces[i],
|
||||||
E('button', {
|
E('button', {
|
||||||
'class': 'btn cbi-button-remove',
|
'class': 'btn cbi-button-remove',
|
||||||
'click': ui.createHandlerFn(view, 'handleDeleteModal', m, this.interfaces[i])
|
'click': ui.createHandlerFn(view, 'handleDeleteModal', m, this.interfaces[i]),
|
||||||
|
'disabled': isReadonlyView
|
||||||
}, [ _('Delete…') ])
|
}, [ _('Delete…') ])
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
"file": {
|
"file": {
|
||||||
"/usr/bin/vnstat --json f 1": [ "exec" ],
|
"/usr/bin/vnstat --json f 1": [ "exec" ],
|
||||||
"/usr/bin/vnstati -[5dhmsty] -i * -o -": [ "exec" ]
|
"/usr/bin/vnstati -[5dhmsty] -i * -o -": [ "exec" ]
|
||||||
}
|
},
|
||||||
|
"uci": [ "vnstat" ]
|
||||||
},
|
},
|
||||||
"write": {
|
"write": {
|
||||||
"file": {
|
"file": {
|
||||||
|
|
Loading…
Reference in a new issue