39 |
|
|
40 |
<script type='text/javascript'> |
<script type='text/javascript'> |
41 |
$(document).ready( function() { |
$(document).ready( function() { |
42 |
loadServer(); |
setInterval(refreshData, 60000); |
43 |
|
refreshData(); |
44 |
}); |
}); |
45 |
|
|
46 |
|
function refreshData() { |
47 |
|
$.get('ajaxdata.php', function(xml) { |
48 |
|
$(xml).find('vm').each(function() { |
49 |
|
var name = $(this).find('name').text(); |
50 |
|
var state = $(this).find('state').text(); |
51 |
|
|
52 |
|
name = name.replace(" ", "_"); |
53 |
|
name = name.replace(".", "_"); |
54 |
|
|
55 |
|
var id = "#state_" + name; |
56 |
|
var css = $(id).css("background"); |
57 |
|
|
58 |
|
if (state == "Running") { |
59 |
|
$(id).css("background-image", "url('gfx/vps_topgreen.png')"); |
60 |
|
} else { |
61 |
|
$(id).css("background-image", "url('gfx/vps_topred.png')"); |
62 |
|
} |
63 |
|
|
64 |
|
}) |
65 |
|
}); |
66 |
|
} |
67 |
|
|
68 |
function doAction(action, uuid) { |
function doAction(action, uuid) { |
69 |
var key = prompt("Key"); |
var key = prompt("Key"); |
70 |
if (key == "" || key == null) { |
if (key == "" || key == null) { |
76 |
var response = $.get(url, function(data) { |
var response = $.get(url, function(data) { |
77 |
alert(data); |
alert(data); |
78 |
document.body.style.cursor = 'default' |
document.body.style.cursor = 'default' |
79 |
if (data == "OK") { |
|
80 |
window.location.reload(); |
refreshData(); |
|
} |
|
81 |
}); |
}); |
82 |
} |
} |
83 |
|
|
96 |
window.open(url); |
window.open(url); |
97 |
} |
} |
98 |
|
|
|
function loadServer() { |
|
|
$('#mainwindow').load('server.php'); |
|
|
} |
|
99 |
|
|
|
function loadvm(uuid) { |
|
|
$('#mainwindow').load('vm.php?uuid=' + uuid ); |
|
|
} |
|
100 |
|
|
101 |
</script> |
</script> |
102 |
|
|
172 |
$harddrive_size = 0; |
$harddrive_size = 0; |
173 |
$cpu_count = $vm["VCPUs_max"]; |
$cpu_count = $vm["VCPUs_max"]; |
174 |
|
|
175 |
|
$clean_name = str_replace(" ", "_", $name); |
176 |
|
$clean_name = str_replace(".", "_", $clean_name); |
177 |
|
|
178 |
|
|
179 |
foreach ($vm["VBDs"] as $vbds) { |
foreach ($vm["VBDs"] as $vbds) { |
180 |
$vbd = $xenserver->VBD__get_record($vbds); |
$vbd = $xenserver->VBD__get_record($vbds); |
181 |
if ($vbd["type"] == 'Disk') { |
if ($vbd["type"] == 'Disk') { |
221 |
<!-- MACHINE --> |
<!-- MACHINE --> |
222 |
<table width='99%' cellpadding='3' cellspacing='0' border='0' class='vps' id='<?php echo $name;?>'> |
<table width='99%' cellpadding='3' cellspacing='0' border='0' class='vps' id='<?php echo $name;?>'> |
223 |
<tr background='gfx/vps_topbg.png'> |
<tr background='gfx/vps_topbg.png'> |
224 |
<td width='10' background='gfx/<?php echo $vps_topbg; ?>' class='small'> </td> |
<td width='10' background='gfx/<?php echo $vps_topbg; ?>' class='small' id='state_<?php echo $clean_name;?>'> </td> |
225 |
<td colspan='2' class='small'><b><?php echo $name; ?></b></td> |
<td colspan='2' class='small'><b><?php echo $name; ?></b></td> |
226 |
<td colspan='2' class='small' align='right'> |
<td colspan='2' class='small' align='right'> |
227 |
<?php echo $network;?> |
<?php echo $network;?> |