mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
Merge pull request #295 from YunoHost/hide-stop-button-for-critical-services
Hide stop button for critical services ?
This commit is contained in:
commit
420b1831e3
1 changed files with 12 additions and 0 deletions
|
@ -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() {
|
||||
|
||||
|
|
Loading…
Reference in a new issue