VM: fix listing of vms

This commit is contained in:
bergware
2023-03-18 11:05:26 +01:00
parent 27d68ed733
commit eca5da9cb4

View File

@@ -146,15 +146,12 @@ i.mover{margin-right:8px;display:none}
<script src="<?autov("/webGui/javascript/jquery.filetree.js")?>"></script>
<script>
<?if (_var($display,'resize')):?>
function resize(bind) {
var width = [];
var h = $('#kvm_list').height();
var s = Math.max(window.innerHeight-340,330);
if (h>s || bind) {
$('#kvm_list').height(s);
$('#kvm_table thead tr th').each(function(){$(this).width($(this).width());});
if (!bind) $('#kvm_table thead,#kvm_table tbody').addClass('fixed');
}
function resize() {
$('#kvm_list').height(Math.max(window.innerHeight-340,330));
$('#kvm_table thead,#kvm_table tbody').removeClass('fixed');
$('#kvm_table thead tr th').each(function(){$(this).width($(this).width());});
$('#kvm_table tbody tr td').each(function(){$(this).width($(this).width());});
$('#kvm_table thead,#kvm_table tbody').not('.child').addClass('fixed');
}
<?endif;?>
function resetSorting() {
@@ -211,7 +208,8 @@ function dialogStyle() {
$('.ui-button-text').css({'padding':'0px 5px'});
}
var sortableHelper = function(e,ui){
ui.next().hide();
var child = ui.next();
if (child.is(':visible')) child.addClass('unhide').hide();
ui.children().each(function(){$(this).width($(this).width());});
return ui;
};
@@ -231,6 +229,7 @@ function LockButton() {
var parent = $(this).attr('parent-id');
var child = $('tr[child-id="'+parent+'"]');
child.detach().insertAfter($(this));
if (child.hasClass('unhide')) child.removeClass('unhide').show();
});
var row = $('#kvm_list tr:first');
var names = '', index = '';
@@ -258,7 +257,7 @@ function loadlist() {
$('head').append('<script>'+data[1]+'<\/script>');
<?if (_var($display,'resize')):?>
resize();
$(window).bind('resize',function(){resize(true);});
$(window).bind('resize',function(){resize();});
<?endif;?>
<?foreach ($vms as $vm) {
$res = $lv->get_domain_by_name($vm);