/[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 1951 by torben, Tue Jan 29 13:39:39 2013 UTC revision 1952 by torben, Mon Mar 25 12:47:31 2013 UTC
# Line 116  function refreshData() { Line 116  function refreshData() {
116                                  os += ' Guest Tools: ' + guestversion;                                  os += ' Guest Tools: ' + guestversion;
117                          }                          }
118    
119                            vm.find('.vps_memory_usage_txt_UID').text( maxmem + " MB");
120    
121                          if (state == "Running") {                          if (state == "Running") {
122                                  vm.find('.state').css("background-image", "url('gfx/vps_topgreen.png')");                                  vm.find('.state').css("background-image", "url('gfx/vps_topgreen.png')");
123                                  vm.find('.network').show();                                  vm.find('.network').show();
# Line 158  function refreshData() { Line 160  function refreshData() {
160  }  }
161    
162  function doAction(action, uuid, vm) {  function doAction(action, uuid, vm) {
163            var val="";
164    
165          var key = prompt("Key");          var key = prompt("Key");
166          if (key == "" || key == null) {          if (key == "" || key == null) {
167                  return;                  return;
# Line 165  function doAction(action, uuid, vm) { Line 169  function doAction(action, uuid, vm) {
169          document.body.style.cursor = 'wait';          document.body.style.cursor = 'wait';
170          $('#vm_' + vm).find('.state').css("background-image", "url('gfx/vps_topyellow.png')");          $('#vm_' + vm).find('.state').css("background-image", "url('gfx/vps_topyellow.png')");
171    
172          var url = "action.php?action=" + action + "&uuid=" + uuid + "&key=" + key;          if (action == "setMemory") {
173                    val = prompt("Set memory target");
174                    if (val == "" || val == null) {
175                            alert("" + val);
176                            return;
177                    }
178            }
179    
180            var url = "action.php?action=" + action + "&uuid=" + uuid + "&key=" + key + "&val=" + val;;
181          var response = $.get(url, function(data) {          var response = $.get(url, function(data) {
182                  if (data != 'OK') {                  if (data != 'OK') {
183                          alert(data);                          alert(data);
# Line 289  foreach($vms_array as $vm) { Line 301  foreach($vms_array as $vm) {
301          <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;?>'>
302                  <tr background='gfx/vps_topbg.png'  >                  <tr background='gfx/vps_topbg.png'  >
303                          <td width='10' class='small state'>&nbsp;</td>                          <td width='10' class='small state'>&nbsp;</td>
304                          <td colspan='3' class='small' title='<?php echo $description;?>'><b><?php echo $name; ?></b><span class='os'></span></td>                          <td colspan='2' class='small' title='<?php echo $description;?>'><b><?php echo $name; ?></b><span class='os'></span></td>
305                          <td colspan='1' class='small' align='right'>                          <td colspan='2' class='small' align='right'>
306                                  <span class='network'></span>                                  <span class='network'></span>
307                                  <a href='#' style='display:none;' class='console'>                                  <a href='#' style='display:none;' class='console'>
308                                          <img src='gfx/icon-terminal.png' style='vertical-align: middle;'>                                          <img src='gfx/icon-terminal.png' style='vertical-align: middle;'>
# Line 305  foreach($vms_array as $vm) { Line 317  foreach($vms_array as $vm) {
317                          <span class="actionstop" style='display:none'>                          <span class="actionstop" style='display:none'>
318                                  start |                                  start |
319                                  <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> |
320                                  <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> |
321                                    set memory
322                          </span>                          </span>
323                                                    
324                          <span class="actionstart">                                                <span class="actionstart">                      
325                                  <a href='#' onclick="doAction('start','<?php echo $uuid;?>','<?php echo $clean_name;?>')" >start</a> |                                  <a href='#' onclick="doAction('start','<?php echo $uuid;?>','<?php echo $clean_name;?>')" >start</a> |
326                                  stop |                                  stop |
327                                  force shutdown                                  force shutdown |
328    
329                                    <a href='#' onclick="doAction('setMemory','<?php echo $uuid;?>','<?php echo $clean_name;?>')" >set memory</a>
330                          </span>                          </span>
331    
332                  </td>                  </td>
# Line 324  foreach($vms_array as $vm) { Line 339  foreach($vms_array as $vm) {
339                  <td width='100' align='right' class='small'>                  <td width='100' align='right' class='small'>
340                          <img src='usagebar.php?usage=1' width='102' height='16' title='static dummy data' class='mem_graph'><br>                          <img src='usagebar.php?usage=1' width='102' height='16' title='static dummy data' class='mem_graph'><br>
341                          <img src='gfx/icon-memory.png' style='vertical-align: middle;'>                          <img src='gfx/icon-memory.png' style='vertical-align: middle;'>
342                          <span id='vps_memory_usage_txt_UID'><?php echo format_memory($memory); ?></span>                          <span class='vps_memory_usage_txt_UID'><?php echo format_memory($memory); ?></span>
343                  </td>                  </td>
344  <!--  <!--
345                  <td width='100' align='right' class='small'>                  <td width='100' align='right' class='small'>

Legend:
Removed from v.1951  
changed lines
  Added in v.1952

  ViewVC Help
Powered by ViewVC 1.1.20