--- misc/xenconsole/index.php 2012/12/01 11:27:10 1888 +++ misc/xenconsole/index.php 2012/12/01 16:12:51 1889 @@ -64,6 +64,19 @@ function refreshData() { $.get('ajaxdata.php', function(xml) { + $(xml).find('host').each(function() { + var memtotal = $(this).find('memtotal').text(); + var memfree = $(this).find('memfree').text(); + memtotal = Math.round ( memtotal / (1024*1024) ); + memfree = Math.round ( memfree / (1024*1024) ); + var memused = memtotal - memfree; + var mem_percentage = Math.round( (memused/memtotal) * 100); + + //alert(memused + ' ' + mem_percentage); + + $('#server_memory_usage').attr('src', 'usagebar.php?usage=' + mem_percentage); + $('#server_memory_usage_txt').text( memused + '/' + memtotal + 'MB'); + }); $(xml).find('vm').each(function() { var name = $(this).find('name').text(); var state = $(this).find('state').text(); @@ -102,7 +115,7 @@ vm.find('.actionstart').show(); } - }) + }) }); } @@ -183,15 +196,15 @@ - + - +
0/4 MB
+


12%
1%