luci-app-sqm: only reload view once sqm enable/start completed
Chain the exec calls to enable and start the SQM service and only reload the view once these operations are complete and return the entire promise chain from the handler function to ensure that the busy indicator remains active throughout the entire duration of the operation. Also replace exec_direct() with exec() as there is no need to bypass ubus for the init script calls. Fixes:e76d9cc767
("luci-app-sqm: fix JS error if service is disabled") Signed-off-by: Jo-Philipp Wich <jo@mein.io> (cherry picked from commit005c09a293
)
This commit is contained in:
parent
0d45661369
commit
f161b40e4c
1 changed files with 7 additions and 5 deletions
|
@ -49,9 +49,11 @@ return view.extend({
|
|||
E('button', {
|
||||
'class': 'btn cbi-button-active',
|
||||
'click': ui.createHandlerFn(this, function() {
|
||||
fs.exec_direct('/etc/init.d/sqm', ['enable']);
|
||||
fs.exec_direct('/etc/init.d/sqm', ['start']);
|
||||
return fs.exec('/etc/init.d/sqm', ['enable']).then(function() {
|
||||
return fs.exec('/etc/init.d/sqm', ['start']);
|
||||
}).then(function() {
|
||||
location.reload();
|
||||
});
|
||||
})
|
||||
}, _('Enable SQM'))
|
||||
]));
|
||||
|
|
Loading…
Reference in a new issue