Fixed 'Update All Containers' button sometimes hidden in docker list

This commit is contained in:
bergware
2018-08-01 09:37:58 +02:00
parent 0602a7e7c0
commit 5a728b1d72
3 changed files with 5 additions and 30 deletions
@@ -87,7 +87,7 @@ var sortableHelper = function(e,i){
});
return i;
};
function loadlist(update) {
function loadlist() {
$.get('/plugins/dynamix.docker.manager/include/DockerContainers.php',function(d) {
var data = d.split(/\0/);
$('div.spinner').hide('slow');
@@ -113,6 +113,8 @@ function loadlist(update) {
listview();
context.init({preventDoubleContext:false});
$('input[type=button]').prop('disabled',false).show('slow');
var update = false;
for (var i=0,ct; ct=docker[i]; i++) if (ct.update=='false') {update = true; break;};
if (!update) $('input#updateAll').hide();
});
}
@@ -133,7 +135,7 @@ $(function() {
$.cookie('docker_listview_mode',$('.advancedview').is(':checked')?'advanced':'basic',{expires:3650});
listview();
});
$.post('/plugins/dynamix.docker.manager/include/DockerUpdate.php',{},function(u){loadlist(u);});
loadlist();
watchDocker.start();
});
</script>
@@ -1,27 +0,0 @@
<?PHP
/* Copyright 2005-2018, Lime Technology
* Copyright 2014-2018, Guilherme Jardim, Eric Schultz, Jon Panozzo.
* Copyright 2012-2018, Bergware International.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation.
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*/
?>
<?
$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
require_once "$docroot/plugins/dynamix.docker.manager/include/DockerClient.php";
$DockerTemplates = new DockerTemplates();
if ($_POST['check']) {
$DockerTemplates->downloadTemplates();
$DockerTemplates->getAllInfo(true);
}
foreach ($DockerTemplates->getAllInfo() as $info) {
if ($info['updated']=='false' && $info['updated']!='undef') {echo 'true'; break;}
}
?>
@@ -186,7 +186,7 @@ function resumeAll() {
function checkAll() {
$('input[type=button]').prop('disabled',true);
$('.updatecolumn').html('<span style="color:#267CA8"><i class="fa fa-refresh fa-spin"></i> checking...</span>');
$.post('/plugins/dynamix.docker.manager/include/DockerUpdate.php',{check:true},function(u){loadlist(u);});
loadlist();
}
function updateAll() {
$('input[type=button]').prop('disabled',true);