Updated: animated spinner logic

This commit is contained in:
bergware
2020-02-10 02:45:51 +01:00
parent c1d85c05ad
commit bb4bc7c625
2 changed files with 8 additions and 3 deletions
@@ -41,7 +41,7 @@ table tbody td{line-height:normal}
<span class="status" style="margin-top:<?=$width?>px"><span><input type="checkbox" class="advancedview"></span></span>
<table id="docker_containers" class="tablesorter shift">
<thead><tr><th><a href="#" style="cursor:hand;margin-left:12px;display:inline-block;width:32px" onclick="resetSorting()" title="Reset sorting"><i class="fa fa-th-list"></i></a>Application</th><th>Version</th><th>Network</th><th>Port Mappings <small>(App to Host)</small></th><th>Volume Mappings <small>(App to Host)</small></th><th class="load advanced">CPU & Memory load</th><th class="nine">Autostart</th><th class="five">Log</th></tr></thead>
<tbody id="docker_list"><tr><td class="advanced"></td><td colspan='7'><div class="spinner"></div></td><td class="advanced"></td></tr></tbody>
<tbody id="docker_list"><tr><td colspan='9'></td></tr></tbody>
</table>
<input type="button" onclick="addContainer()" value="Add Container" style="display:none">
<input type="button" onclick="startAll()" value="Start All" style="display:none">
@@ -100,8 +100,9 @@ var sortableHelper = function(e,i){
};
function loadlist() {
$.get('/plugins/dynamix.docker.manager/include/DockerContainers.php',function(d) {
clearTimeout(timers.docker);
$('div.spinner.fixed').hide('slow');
var data = d.split(/\0/);
$('div.spinner').hide('slow');
$('#docker_list').html(data[0]).sortable({helper:sortableHelper,items:'tr.sortable',cursor:'move',axis:'y',containment:'parent',cancel:'span.docker_readmore,input',delay:100,opacity:0.5,zIndex:9999,
update:function(e,ui){
var row = $('#docker_list').find('tr:first');
@@ -164,6 +165,7 @@ $(function() {
$.cookie('docker_listview_mode',$('.advancedview').is(':checked')?'advanced':'basic',{expires:3650});
listview();
});
timers.docker = setTimeout(function(){$('div.spinner.fixed').show('slow');},150);
loadlist();
watchDocker.start();
});
+4 -1
View File
@@ -111,7 +111,7 @@ table tbody td{line-height:normal}
</style>
<table id="kvm_table" class="tablesorter four shift">
<thead><tr><th class="vmname"><a href="#" style="cursor:hand;margin-left:12px;display:inline-block;width:32px" onclick="resetSorting()" title="Reset sorting"><i class="fa fa-th-list"></i></a>Name</th><th>Description</th><th>CPUs</th><th>Memory</th><th>vDisks</th><th>Graphics</th><th class="eight">Autostart</th></tr></thead>
<tbody id="kvm_list"><tr><td colspan='8'><div class="spinner"></div></td></tr></tbody>
<tbody id="kvm_list"><tr><td colspan='8'></td></tr></tbody>
</table>
<input type="button" onclick="addVM()" id="btnAddVM" value="Add VM" style="display:none">
<input type="button" onclick="startAll()" value="Start All" style="display:none">
@@ -147,6 +147,8 @@ var sortableHelper = function(e,i){
};
function loadlist() {
$.get('/plugins/dynamix.vm.manager/include/VMMachines.php',{show:$.cookie('vmshow')},function(d) {
clearTimeout(timers.vm);
$('div.spinner.fixed').hide('slow');
var data = d.split(/\0/);
$('#kvm_list').html(data[0]).sortable({helper:sortableHelper,items:'tr.sortable',cursor:'move',axis:'y',containment:'parent',delay:100,opacity:0.5,zIndex:9999,
update:function(e,ui){
@@ -197,6 +199,7 @@ $(function() {
$('#countdown').html("<span class='<?-$color?>'><?=$msg?></span>");
<?endif;?>
$('#btnAddVM').click(function AddVMEvent(){$('.tab>input#tab2').click();});
timers.vm = setTimeout(function(){$('div.spinner.fixed').show('slow');},150);
loadlist();
});
</script>