/[projects]/misc/xenconsole/index.php
ViewVC logotype

Diff of /misc/xenconsole/index.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1887 by torben, Sat Dec 1 10:59:57 2012 UTC revision 1888 by torben, Sat Dec 1 11:27:10 2012 UTC
# Line 28  include('xenapi.php'); Line 28  include('xenapi.php');
28  /* Establish session with Xenserver */  /* Establish session with Xenserver */
29  $xenserver = new XenApi($url, $login, $password);  $xenserver = new XenApi($url, $login, $password);
30    
31    $hosts_array = $xenserver->host__get_all();
32    $host = $xenserver->host__get_record($hosts_array[0]);
33    $host_metrics = $xenserver->host_metrics__get_record($host["metrics"]);
34    
35    $xenversion = $host["software_version"]["product_brand"] . " " . $host["software_version"]["product_version"];
36    $xenversion .= " / Linux:" . $host["software_version"]["linux"] . " / xen: " . $host["software_version"]["xen"] . " / xapi: " . $host["software_version"]["xapi"] ;
37    
38    $expire = split('T', $host["license_params"]["expiry"]);
39    $license = "License: " . $host["license_params"]["sku_type"] . ", expires " . $expire[0] ;
40    
41  $vms_array = $xenserver->VM__get_all_records();  $vms_array = $xenserver->VM__get_all_records();
42    
43    
# Line 61  function refreshData() { Line 71  function refreshData() {
71                          var state = $(this).find('state').text();                          var state = $(this).find('state').text();
72                          var conurl = $(this).find('conurl').text();                          var conurl = $(this).find('conurl').text();
73                          var session = $(this).find('session').text();                          var session = $(this).find('session').text();
74                            var os = $(this).find('os').text();
75    
76                          name = name.replace(" ", "_");                          name = name.replace(" ", "_");
77                          name = name.replace(".", "_");                          name = name.replace(".", "_");
# Line 78  function refreshData() { Line 89  function refreshData() {
89                                  vm.find('.console').data('session', session);                                  vm.find('.console').data('session', session);
90                                  vm.find('.actionstop').show();                                  vm.find('.actionstop').show();
91                                  vm.find('.actionstart').hide();                                  vm.find('.actionstart').hide();
92                                    vm.find('.os').text(' - ' + os);
93                          } else {                          } else {
94                                  if (state == "Halted") {                                  if (state == "Halted") {
95                                          vm.find('.state').css("background-image", "url('gfx/vps_topred.png')");                                          vm.find('.state').css("background-image", "url('gfx/vps_topred.png')");
# Line 171  body { Line 183  body {
183  <table width='100%' background='gfx/topbg.png' cellpadding='3' cellspacing='0' border='0' class='toptable'>  <table width='100%' background='gfx/topbg.png' cellpadding='3' cellspacing='0' border='0' class='toptable'>
184  <tr>  <tr>
185          <td rowspan='2' width='160'><img src='gfx/citrix-logo.png' id='logo'></td>          <td rowspan='2' width='160'><img src='gfx/citrix-logo.png' id='logo'></td>
186          <td colspan='3' class='small' align='right'>Linux:2.6.32.12-0.7.1.xs6.0.2.542.170665xen / xen: 4.1.2 / xapi: 1.3</td>          <td colspan='3' class='small' align='right'><?php echo $xenversion;?><br><?php echo $license;?></td>
187  </tr>  </tr>
188  <tr>  <tr>
189          <td width='150' align='right' class='small'><img src='gfx/icon-cpu.png'>          <td width='150' align='right' class='small'><img src='gfx/icon-cpu.png'>
# Line 223  foreach($vms_array as $vm) { Line 235  foreach($vms_array as $vm) {
235          <table width='99%' cellpadding='3' cellspacing='0' border='0' class='vps' id='vm_<?php echo $clean_name;?>'>          <table width='99%' cellpadding='3' cellspacing='0' border='0' class='vps' id='vm_<?php echo $clean_name;?>'>
236                  <tr background='gfx/vps_topbg.png'  >                  <tr background='gfx/vps_topbg.png'  >
237                          <td width='10' class='small state'>&nbsp;</td>                          <td width='10' class='small state'>&nbsp;</td>
238                          <td colspan='2' class='small'><b><?php echo $name; ?></b></td>                          <td colspan='2' class='small'><b><?php echo $name; ?></b><span class='os'></span></td>
239                          <td colspan='2' class='small' align='right'>                          <td colspan='2' class='small' align='right'>
240                                  <span class='network'></span>                                  <span class='network'></span>
241                                  <a href='#' style='display:none;' class='console'>                                  <a href='#' style='display:none;' class='console'>

Legend:
Removed from v.1887  
changed lines
  Added in v.1888

  ViewVC Help
Powered by ViewVC 1.1.20