--- misc/xenconsole/index.php 2012/12/10 12:32:50 1897 +++ misc/xenconsole/index.php 2013/03/25 12:47:31 1952 @@ -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() { @@ -115,6 +116,8 @@ os += ' Guest Tools: ' + guestversion; } + vm.find('.vps_memory_usage_txt_UID').text( maxmem + " MB"); + if (state == "Running") { vm.find('.state').css("background-image", "url('gfx/vps_topgreen.png')"); vm.find('.network').show(); @@ -122,6 +125,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); @@ -140,6 +144,8 @@ } 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(); @@ -154,6 +160,8 @@ } function doAction(action, uuid, vm) { + var val=""; + var key = prompt("Key"); if (key == "" || key == null) { return; @@ -161,7 +169,15 @@ document.body.style.cursor = 'wait'; $('#vm_' + vm).find('.state').css("background-image", "url('gfx/vps_topyellow.png')"); - var url = "action.php?action=" + action + "&uuid=" + uuid + "&key=" + key; + if (action == "setMemory") { + val = prompt("Set memory target"); + if (val == "" || val == null) { + alert("" + val); + return; + } + } + + var url = "action.php?action=" + action + "&uuid=" + uuid + "&key=" + key + "&val=" + val;; var response = $.get(url, function(data) { if (data != 'OK') { alert(data); @@ -172,7 +188,7 @@ }); } -function console(url, session) { +function console(url, session, name) { if (url == '') return; @@ -180,7 +196,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); @@ -233,18 +249,20 @@
+ +
12%
0/4 MB
- + @@ -257,6 +275,7 @@ } $name = $vm["name_label"]; + $description = $vm["name_description"]; $uuid = $vm["uuid"]; $state = $vm["power_state"] ; $memory = $vm['memory_target']; @@ -282,8 +301,8 @@ - - + @@ -317,7 +339,7 @@ -
  + stop | - force shutdown + force shutdown | + set memory start | stop | - force shutdown + force shutdown | + + set memory
- +
+