/[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 2030 by torben, Tue Jul 23 21:03:32 2013 UTC revision 2105 by torben, Mon Feb 10 08:13:22 2014 UTC
# Line 1  Line 1 
1  <?php  <?php
2    
3    if (! file_exists("config.php") ) {
4      die("Could not find config.php file");
5    }
6    
7  require("config.php");  require("config.php");
8    
9  function format_memory($size) {  function format_memory($size) {
# Line 83  $(document).ready( function() { Line 88  $(document).ready( function() {
88                  openConsole(conurl,session,name);                  openConsole(conurl,session,name);
89          });          });
90    
91          $('#server_memory_usage').progressbar( );          $('.bar').progressbar( );
         $('#server_cpu_usage').progressbar( );  
92    
93          $('#logo').click( function() {          $('#logo').click( function() {
94                  refreshData();                  refreshData();
# Line 283  function refreshData() { Line 287  function refreshData() {
287                                  }                                  }
288                                  vm.find('.os').text(' - ' + os);                                  vm.find('.os').text(' - ' + os);
289    
290                                    cpuavg = cpuavg * 1;
291                                  vm.find('.cpu_graph').show();                                  vm.find('.cpu_graph').show();
292                                  vm.find('.cpu_graph').attr('src', 'usagebar.php?usage=' + cpuavg);                                  //vm.find('.cpu_graph').attr('src', 'usagebar.php?usage=' + cpuavg);
293                                    vm.find('.cpu_graph').progressbar( "value", cpuavg );
294                                  vm.find('.cpu_graph').attr('title',  cpuavg + '%');                                  vm.find('.cpu_graph').attr('title',  cpuavg + '%');
295    
296                                  vm.find('.mem_graph').show();                                  vm.find('.mem_graph').show();
297                                  vm.find('.mem_graph').attr('src', 'usagebar.php?usage=' + mempercent);                                  //vm.find('.mem_graph').attr('src', 'usagebar.php?usage=' + mempercent);
298                                    vm.find('.mem_graph').progressbar( "value", mempercent );
299                                  vm.find('.mem_graph').attr('title',  curmem + ' / ' + maxmem + ' MB' );                                  vm.find('.mem_graph').attr('title',  curmem + ' / ' + maxmem + ' MB' );
300                          } else {                          } else {
301                                  if (state == "Halted") {                                  if (state == "Halted") {
# Line 309  function refreshData() { Line 315  function refreshData() {
315                                  vm.find('.cpu_graph').hide();                                  vm.find('.cpu_graph').hide();
316                                  vm.find('.mem_graph').hide();                                  vm.find('.mem_graph').hide();
317                          }                          }
318                            vm.find('.state').attr('title', state);
319                                                    
320                  });                  });
321                  $('#logo').show();                  $('#logo').show();
# Line 417  body { Line 424  body {
424          background: #61B4F3;          background: #61B4F3;
425  }  }
426    
427    .ui-progressbar {
428            border-style:solid;
429            border-width:1px;
430            border-color: #666666;
431    }
432    
433  .bar {  .bar {
434          width:  102px;          width:  102px;
435          height:  16px;          height:  16px;
# Line 519  foreach($vms_array as $vm) { Line 532  foreach($vms_array as $vm) {
532                          <span class="actionstop" style='display:none'>                          <span class="actionstop" style='display:none'>
533                                  start |                                  start |
534                                  <a href='#' onclick="doAction('shutdown','<?php echo $uuid;?>','<?php echo $clean_name;?>')" >stop</a> |                                  <a href='#' onclick="doAction('shutdown','<?php echo $uuid;?>','<?php echo $clean_name;?>')" >stop</a> |
535                                  <a href='#' onclick="doAction('hardshutdown','<?php echo $uuid;?>','<?php echo $clean_name;?>')" >force shutdown</a>                                  <a href='#' onclick="doAction('hardshutdown','<?php echo $uuid;?>','<?php echo $clean_name;?>')" >force shutdown</a> |
536                                    <a href='#' onclick="doAction('hardreboot','<?php echo $uuid;?>','<?php echo $clean_name;?>')" >force reboot</a>
537                          </span>                          </span>
538                                                    
539                          <span class="actionstart" style='display:none'>                                          <span class="actionstart" style='display:none'>                
# Line 531  foreach($vms_array as $vm) { Line 545  foreach($vms_array as $vm) {
545                  </td>                  </td>
546    
547                  <td width='100' align='right' class='small' valign='top'>                  <td width='100' align='right' class='small' valign='top'>
548                          <img src='usagebar.php?usage=1' width='102' height='16' title='static dummy data' class='cpu_graph'><br>                          <div class='cpu_graph bar'></div>
549                          <img src='gfx/icon-cpu.png' style='vertical-align: middle;'>                          <img src='gfx/icon-cpu.png' style='vertical-align: middle;'>
550                          <span class='vps_cpu_usage_txt_UID'><?php echo $cpu_count; ?> VCPU</span>                          <span class='vps_cpu_usage_txt_UID'><?php echo $cpu_count; ?> VCPU</span>
551                  </td>                  </td>
552                  <td width='100' align='right' class='small'>                  <td width='100' align='right' class='small'>
553                          <img src='usagebar.php?usage=1' width='102' height='16' title='static dummy data' class='mem_graph'><br>                          <div class='mem_graph bar'></div>
554                          <img src='gfx/icon-memory.png' style='vertical-align: middle;'>                          <img src='gfx/icon-memory.png' style='vertical-align: middle;'>
555                          <span class='vps_memory_usage_txt_UID'><?php echo format_memory($memory); ?></span>                          <span class='vps_memory_usage_txt_UID'><?php echo format_memory($memory); ?></span>
556                  </td>                  </td>

Legend:
Removed from v.2030  
changed lines
  Added in v.2105

  ViewVC Help
Powered by ViewVC 1.1.20