Merge pull request #295 from YunoHost/hide-stop-button-for-critical-services

Hide stop button for critical services ?
This commit is contained in:
Alexandre Aubin 2020-04-29 18:06:08 +02:00 committed by GitHub
commit 420b1831e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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() {