[Web] Add search fields to some select forms

[Web] Better container restart js, but still a wip
[Web] Allow to set a DOCKER_TIMEOUT in vars.inc.php, default is 60 (seconds)
This commit is contained in:
André
2018-07-23 20:01:01 +02:00
parent 7de2607594
commit cedc38fbaa
10 changed files with 74 additions and 32 deletions

View File

@@ -203,27 +203,29 @@ $(document).ready(function() {
$('#triggerRestartContainer').click(function(){
$(this).prop("disabled",true);
$(this).html('<span class="glyphicon glyphicon-refresh glyphicon-spin"></span> ');
$('#statusTriggerRestartContainer').text('Restarting container, this may take a while... ');
$('#statusTriggerRestartContainer2').text('Reloading webpage... ');
$('#statusTriggerRestartContainer').html('<?= $lang['footer']['restarting_container']; ?>');
$.ajax({
method: 'get',
url: '/inc/ajax/container_ctrl.php',
timeout: 10000,
timeout: <?= $DOCKER_TIMEOUT * 1000; ?>,
data: {
'service': container,
'action': 'restart'
},
error: function() {
window.location = window.location.href.split("#")[0];
},
success: function(data) {
$('#statusTriggerRestartContainer').append(data);
$('#triggerRestartContainer').html('<span class="glyphicon glyphicon-ok"></span> ');
$('#statusTriggerRestartContainer2').append(data);
$('#triggerRestartContainer').html('<span class="glyphicon glyphicon-ok"></span> ');
window.location = window.location.href.split("#")[0];
'service': container,
'action': 'restart'
}
});
})
.always( function (data, status) {
$('#statusTriggerRestartContainer').append(data);
var htmlResponse = $.parseHTML(data)
if ($(htmlResponse).find('span').hasClass('text-success')) {
$('#triggerRestartContainer').html('<span class="glyphicon glyphicon-ok"></span> ');
setTimeout(function(){
$('#RestartContainer').modal('toggle');
window.location = window.location.href.split("#")[0];
}, 1200);
} else {
$('#triggerRestartContainer').html('<span class="glyphicon glyphicon-remove"></span> ');
}
})
});
})