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(); |
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> |