mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
Forgot to finish implementing service restart...
This commit is contained in:
parent
a955e201c1
commit
e7d914882a
2 changed files with 19 additions and 9 deletions
|
@ -59,18 +59,29 @@
|
||||||
c.view('service/service_info', data, function() {
|
c.view('service/service_info', data, function() {
|
||||||
|
|
||||||
// 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="stop"]').on('click', function() {
|
$('button[data-action="start"], button[data-action="restart"], button[data-action="stop"]').on('click', function() {
|
||||||
|
|
||||||
var service = $(this).data('service');
|
var service = $(this).data('service');
|
||||||
var action = $(this).data('action');
|
var action = $(this).data('action');
|
||||||
|
|
||||||
c.confirm("Service", y18n.t('confirm_service_' + action, [service]), function(){
|
c.confirm(y18n.t("services"), y18n.t('confirm_service_' + action, [service]), function(){
|
||||||
|
|
||||||
var method = null,
|
if (action == "start")
|
||||||
endurl = service;
|
{
|
||||||
|
var method = "PUT";
|
||||||
method = action === "start" ? 'PUT' : 'DELETE';
|
var url = "/services/" + service;
|
||||||
c.api(method, '/services/'+ endurl, {}, function() { c.refresh(); });
|
}
|
||||||
|
else if (action == "restart")
|
||||||
|
{
|
||||||
|
var method = "PUT";
|
||||||
|
var url = "/services/" + service + "/restart";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var method = "DELETE";
|
||||||
|
var url = "/services/" + service;
|
||||||
|
}
|
||||||
|
c.api(method, url, {}, function() { c.refresh(); });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -61,10 +61,9 @@
|
||||||
"confirm_migrations_skip": "Skipping migrations is not recommended. Are you sure you want to do that?",
|
"confirm_migrations_skip": "Skipping migrations is not recommended. Are you sure you want to do that?",
|
||||||
"confirm_postinstall": "You are about to launch the post-installation process on the domain %s. It may take a few minutes, *do not interrupt the operation*.",
|
"confirm_postinstall": "You are about to launch the post-installation process on the domain %s. It may take a few minutes, *do not interrupt the operation*.",
|
||||||
"confirm_restore": "Are you sure you want to restore %s?",
|
"confirm_restore": "Are you sure you want to restore %s?",
|
||||||
|
"confirm_service_restart": "Are you sure you want to restart %s?",
|
||||||
"confirm_service_start": "Are you sure you want to start %s?",
|
"confirm_service_start": "Are you sure you want to start %s?",
|
||||||
"confirm_service_stop": "Are you sure you want to stop %s?",
|
"confirm_service_stop": "Are you sure you want to stop %s?",
|
||||||
"confirm_service_enable": "Are you sure you want to enable %s?",
|
|
||||||
"confirm_service_disable": "Are you sure you want to disable %s?",
|
|
||||||
"confirm_uninstall": "Are you sure you want to uninstall %s?",
|
"confirm_uninstall": "Are you sure you want to uninstall %s?",
|
||||||
"confirm_update_apps": "Are you sure you want to update all applications?",
|
"confirm_update_apps": "Are you sure you want to update all applications?",
|
||||||
"confirm_update_system": "Are you sure you want to update all system packages?",
|
"confirm_update_system": "Are you sure you want to update all system packages?",
|
||||||
|
|
Loading…
Reference in a new issue