--- misc/xenconsole/index.php 2012/11/30 17:56:07 1885 +++ misc/xenconsole/index.php 2012/12/01 11:27:10 1888 @@ -28,6 +28,16 @@ /* Establish session with Xenserver */ $xenserver = new XenApi($url, $login, $password); +$hosts_array = $xenserver->host__get_all(); +$host = $xenserver->host__get_record($hosts_array[0]); +$host_metrics = $xenserver->host_metrics__get_record($host["metrics"]); + +$xenversion = $host["software_version"]["product_brand"] . " " . $host["software_version"]["product_version"]; +$xenversion .= " / Linux:" . $host["software_version"]["linux"] . " / xen: " . $host["software_version"]["xen"] . " / xapi: " . $host["software_version"]["xapi"] ; + +$expire = split('T', $host["license_params"]["expiry"]); +$license = "License: " . $host["license_params"]["sku_type"] . ", expires " . $expire[0] ; + $vms_array = $xenserver->VM__get_all_records(); @@ -46,6 +56,10 @@ var conurl = $(this).data('conurl'); console(conurl,session); }); + + $('#logo').click( function() { + refreshData(); + }); }); function refreshData() { @@ -57,6 +71,7 @@ var state = $(this).find('state').text(); var conurl = $(this).find('conurl').text(); var session = $(this).find('session').text(); + var os = $(this).find('os').text(); name = name.replace(" ", "_"); name = name.replace(".", "_"); @@ -74,6 +89,7 @@ vm.find('.console').data('session', session); vm.find('.actionstop').show(); vm.find('.actionstart').hide(); + vm.find('.os').text(' - ' + os); } else { if (state == "Halted") { vm.find('.state').css("background-image", "url('gfx/vps_topred.png')"); @@ -90,16 +106,19 @@ }); } -function doAction(action, uuid) { +function doAction(action, uuid, vm) { var key = prompt("Key"); if (key == "" || key == null) { return; } 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; var response = $.get(url, function(data) { - alert(data); + if (data != 'OK') { + alert(data); + } document.body.style.cursor = 'default' refreshData(); @@ -163,8 +182,8 @@ - - + +
Linux:2.6.32.12-0.7.1.xs6.0.2.542.170665xen / xen: 4.1.2 / xapi: 1.3
@@ -216,7 +235,7 @@ - +
  - start | + start | stop | force shutdown