mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
Hide stop button for critical services
This commit is contained in:
parent
adca9ed616
commit
7ac6f1e45a
1 changed files with 12 additions and 0 deletions
|
@ -58,6 +58,18 @@
|
||||||
|
|
||||||
c.view('service/service_info', data, function() {
|
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
|
// Configure behavior for enable/disable and start/stop buttons
|
||||||
$('button[data-action="start"], button[data-action="restart"], button[data-action="stop"]').on('click', function() {
|
$('button[data-action="start"], button[data-action="restart"], button[data-action="stop"]').on('click', function() {
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue