--- misc/xenconsole/index.php 2012/12/09 19:57:00 1895 +++ misc/xenconsole/index.php 2013/01/29 13:39:39 1920 @@ -55,7 +55,8 @@ $('.console').click( function() { var session = $(this).data('session'); var conurl = $(this).data('conurl'); - console(conurl,session); + var name = $(this).data('name'); + console(conurl,session,name); }); $('#logo').click( function() { @@ -97,7 +98,12 @@ var conurl = $(this).find('conurl').text(); var session = $(this).find('session').text(); var os = $(this).find('os').text(); + var guestversion = $(this).find('guestversion').text(); var cpuavg = $(this).find('cpuavg').text(); + var curmem = $(this).find('curmem').text(); + var maxmem = $(this).find('maxmem').text(); + + var mempercent = Math.round( (curmem*100) / maxmem ); name = name.replace(" ", "_"); name = name.replace(".", "_"); @@ -106,6 +112,10 @@ var vm = $(id); + if (guestversion != '') { + os += ' Guest Tools: ' + guestversion; + } + if (state == "Running") { vm.find('.state').css("background-image", "url('gfx/vps_topgreen.png')"); vm.find('.network').show(); @@ -113,6 +123,7 @@ vm.find('.console').show(); vm.find('.console').data('conurl', conurl); vm.find('.console').data('session', session); + vm.find('.console').data('name', name); vm.find('.actionstop').show(); vm.find('.actionstart').hide(); vm.find('.os').text(' - ' + os); @@ -121,13 +132,18 @@ vm.find('.cpu_graph').show(); vm.find('.cpu_graph').attr('src', 'usagebar.php?usage=' + 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('title', curmem + ' / ' + maxmem + ' MB' ); } else { if (state == "Halted") { vm.find('.state').css("background-image", "url('gfx/vps_topred.png')"); } else { vm.find('.state').css("background-image", "url('gfx/vps_topyellow.png')"); } + vm.find('.os').text(''); + vm.find('.network').hide(); vm.find('.console').hide(); vm.find('.actionstop').hide(); @@ -160,7 +176,7 @@ }); } -function console(url, session) { +function console(url, session, name) { if (url == '') return; @@ -168,7 +184,7 @@ if (key == "" || key == null) { return; } - var url = "console.php?url=" + url + "&session=" + session + "&key=" + key; + var url = "console.php?url=" + url + "&session=" + session + "&key=" + key + "&name=" + name; //window.location = url; //$('#mainwindow').load(url); @@ -221,18 +237,20 @@
+ +
12%
0/4 MB
- + @@ -245,6 +263,7 @@ } $name = $vm["name_label"]; + $description = $vm["name_description"]; $uuid = $vm["uuid"]; $state = $vm["power_state"] ; $memory = $vm['memory_target']; @@ -270,8 +289,8 @@ - - + --> -
  + +