--- misc/xenconsole/index.php 2013/07/23 15:30:12 2028 +++ misc/xenconsole/index.php 2013/07/24 06:36:43 2032 @@ -83,6 +83,8 @@ openConsole(conurl,session,name); }); + $('.bar').progressbar( ); + $('#logo').click( function() { refreshData(); }); @@ -211,7 +213,7 @@ $(xml).find('host').each(function() { var memtotal = $(this).find('memtotal').text(); var memfree = $(this).find('memfree').text(); - var cpuavg = $(this).find('cpuavg').text(); + var cpuavg = $(this).find('cpuavg').text() * 1; // *1 is used to convert the string var to an int memtotal = Math.round ( memtotal / (1024*1024) ); memfree = Math.round ( memfree / (1024*1024) ); @@ -220,13 +222,15 @@ //alert(memused + ' ' + mem_percentage); - $('#server_memory_usage').attr('src', 'usagebar.php?usage=' + mem_percentage); + //$('#server_memory_usage').attr('src', 'usagebar.php?usage=' + mem_percentage); + $('#server_memory_usage').progressbar( "value", mem_percentage ); $('#server_memory_usage').attr('alt', mem_percentage + '%'); $('#server_memory_usage').attr('title', mem_percentage + '%'); $('#server_memory_usage_txt').text( memused + '/' + memtotal + 'MB'); - $('#server_cpu_usage').attr('src', 'usagebar.php?usage=' + cpuavg); + //$('#server_cpu_usage').attr('src', 'usagebar.php?usage=' + cpuavg); + $('#server_cpu_usage').progressbar( "value", cpuavg ); $('#server_cpu_usage').attr('alt', cpuavg + '%'); $('#server_cpu_usage').attr('title', cpuavg + '%'); $('#server_cpu_usage_txt').text( cpuavg+ '%'); @@ -278,13 +282,15 @@ } vm.find('.os').text(' - ' + os); - + cpuavg = cpuavg * 1; vm.find('.cpu_graph').show(); - vm.find('.cpu_graph').attr('src', 'usagebar.php?usage=' + cpuavg); + //vm.find('.cpu_graph').attr('src', 'usagebar.php?usage=' + cpuavg); + vm.find('.cpu_graph').progressbar( "value", cpuavg ); vm.find('.cpu_graph').attr('title', cpuavg + '%'); vm.find('.mem_graph').show(); - vm.find('.mem_graph').attr('src', 'usagebar.php?usage=' + mempercent); + //vm.find('.mem_graph').attr('src', 'usagebar.php?usage=' + mempercent); + vm.find('.mem_graph').progressbar( "value", mempercent ); vm.find('.mem_graph').attr('title', curmem + ' / ' + maxmem + ' MB' ); } else { if (state == "Halted") { @@ -407,6 +413,22 @@ margin: 4; border: 1px solid #222; } + +.ui-progressbar-value { + background: #61B4F3; +} + +.ui-progressbar { + border-style:solid; + border-width:1px; + border-color: #666666; +} + +.bar { + width: 102px; + height: 16px; +} + @@ -424,11 +446,17 @@ - -
12%
+ +
+ + 12% + - -
0/4 MB
+ +
+ + 0/4 MB +