/[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 1885 by torben, Fri Nov 30 17:56:07 2012 UTC revision 1886 by torben, Fri Nov 30 21:41:29 2012 UTC
# Line 90  function refreshData() { Line 90  function refreshData() {
90         });         });
91  }  }
92    
93  function doAction(action, uuid) {  function doAction(action, uuid, vm) {
94          var key = prompt("Key");          var key = prompt("Key");
95          if (key == "" || key == null) {          if (key == "" || key == null) {
96                  return;                  return;
97          }          }
98          document.body.style.cursor = 'wait';          document.body.style.cursor = 'wait';
99            $('#vm_' + vm).find('.state').css("background-image", "url('gfx/vps_topyellow.png')");
100    
101          var url = "action.php?action=" + action + "&uuid=" + uuid + "&key=" + key;          var url = "action.php?action=" + action + "&uuid=" + uuid + "&key=" + key;
102          var response = $.get(url, function(data) {          var response = $.get(url, function(data) {
103                  alert(data);                  if (data != 'OK') {
104                            alert(data);
105                    }
106                  document.body.style.cursor = 'default'                  document.body.style.cursor = 'default'
107    
108                  refreshData();                  refreshData();
# Line 231  foreach($vms_array as $vm) { Line 234  foreach($vms_array as $vm) {
234                  <td width='150' class='small'>                  <td width='150' class='small'>
235                          <span class="actionstop" style='display:none'>                          <span class="actionstop" style='display:none'>
236                                  start |                                  start |
237                                  <a href='#' onclick="doAction('shutdown','<?php echo $uuid;?>')" >stop</a> |                                  <a href='#' onclick="doAction('shutdown','<?php echo $uuid;?>','<?php echo $clean_name;?>')" >stop</a> |
238                                  <a href='#' onclick="doAction('hardshutdown','<?php echo $uuid;?>')" >force shutdown</a>                                  <a href='#' onclick="doAction('hardshutdown','<?php echo $uuid;?>','<?php echo $clean_name;?>')" >force shutdown</a>
239                          </span>                          </span>
240                                                    
241                          <span class="actionstart">                                                <span class="actionstart">                      
242                                  <a href='#' onclick="doAction('start','<?php echo $uuid;?>')" >start</a> |                                  <a href='#' onclick="doAction('start','<?php echo $uuid;?>','<?php echo $clean_name;?>')" >start</a> |
243                                  stop |                                  stop |
244                                  force shutdown                                  force shutdown
245                          </span>                          </span>

Legend:
Removed from v.1885  
changed lines
  Added in v.1886

  ViewVC Help
Powered by ViewVC 1.1.20