/[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 1893 by torben, Mon Dec 3 11:25:39 2012 UTC revision 1896 by torben, Mon Dec 10 12:20:57 2012 UTC
# Line 40  $license = "License: " . $host["license_ Line 40  $license = "License: " . $host["license_
40    
41  $vms_array = $xenserver->VM__get_all_records();  $vms_array = $xenserver->VM__get_all_records();
42    
43    $namelabel = $host["name_label"];
44    
45  ?>  ?>
46  <html>  <html>
47  <head>  <head>
48  <title>XenServer::SERVER</title>  <title>XenServer::<?php echo $namelabel;?></title>
49  <script type='text/javascript' src="jquery-1.8.2.min.js"></script>  <script type='text/javascript' src="jquery-1.8.2.min.js"></script>
50    
51  <script type='text/javascript'>  <script type='text/javascript'>
# Line 63  $(document).ready( function() { Line 64  $(document).ready( function() {
64  });  });
65    
66  function refreshData() {  function refreshData() {
67            $("#logo").hide();      
68          $.get('ajaxdata.php', function(xml) {          $.get('ajaxdata.php', function(xml) {
69                  $(xml).find('host').each(function() {                  $(xml).find('host').each(function() {
70                          var memtotal = $(this).find('memtotal').text();                          var memtotal = $(this).find('memtotal').text();
# Line 96  function refreshData() { Line 98  function refreshData() {
98                          var session = $(this).find('session').text();                          var session = $(this).find('session').text();
99                          var os = $(this).find('os').text();                          var os = $(this).find('os').text();
100                          var cpuavg = $(this).find('cpuavg').text();                          var cpuavg = $(this).find('cpuavg').text();
101                            var curmem = $(this).find('curmem').text();
102                            var maxmem = $(this).find('maxmem').text();
103    
104                            var mempercent = Math.round( (curmem*100) / maxmem );
105    
106                          name = name.replace(" ", "_");                          name = name.replace(" ", "_");
107                          name = name.replace(".", "_");                          name = name.replace(".", "_");
# Line 119  function refreshData() { Line 125  function refreshData() {
125                                  vm.find('.cpu_graph').show();                                  vm.find('.cpu_graph').show();
126                                  vm.find('.cpu_graph').attr('src', 'usagebar.php?usage=' + cpuavg);                                  vm.find('.cpu_graph').attr('src', 'usagebar.php?usage=' + cpuavg);
127                                  vm.find('.cpu_graph').attr('title',  cpuavg + '%');                                  vm.find('.cpu_graph').attr('title',  cpuavg + '%');
128    
129                                  vm.find('.mem_graph').show();                                  vm.find('.mem_graph').show();
130                                    vm.find('.mem_graph').attr('src', 'usagebar.php?usage=' + mempercent);
131                                    vm.find('.mem_graph').attr('title',  curmem + ' / ' + maxmem + ' MB' );
132                          } else {                          } else {
133                                  if (state == "Halted") {                                  if (state == "Halted") {
134                                          vm.find('.state').css("background-image", "url('gfx/vps_topred.png')");                                          vm.find('.state').css("background-image", "url('gfx/vps_topred.png')");
# Line 134  function refreshData() { Line 143  function refreshData() {
143                                  vm.find('.mem_graph').hide();                                  vm.find('.mem_graph').hide();
144                          }                          }
145                                                    
146                  })                  });
147                    $('#logo').show();
148         });         });
149  }  }
150    
# Line 215  body { Line 225  body {
225  <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'>
226  <tr>  <tr>
227          <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>
228          <td colspan='4' class='small' align='right'><?php echo $xenversion;?><br><?php echo $license;?></td>          <td colspan='4' class='small' align='right'><?php echo $namelabel . " / " . $xenversion;?><br><?php echo $license;?></td>
229  </tr>  </tr>
230  <tr>  <tr>
231          <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'>

Legend:
Removed from v.1893  
changed lines
  Added in v.1896

  ViewVC Help
Powered by ViewVC 1.1.20