Hide stop button for critical services

This commit is contained in:
Alexandre Aubin 2020-04-26 21:56:59 +02:00
parent adca9ed616
commit 7ac6f1e45a

View file

@ -58,6 +58,18 @@
c.view('service/service_info', data, function() {
// Don't allow user to stop critical services from the webadmin
$('button[data-action="stop"]').each(function() {
var critical = ['nginx', 'ssh', 'slapd', 'yunohost-api'];
var service = $(this).data('service');
if (critical.indexOf(service) >= 0)
{
$(this).hide();
}
});
// Configure behavior for enable/disable and start/stop buttons
$('button[data-action="start"], button[data-action="restart"], button[data-action="stop"]').on('click', function() {