1 |
<?php |
<?php |
2 |
include("config.php"); |
require("config.php"); |
3 |
|
|
4 |
function format_memory($size) { |
function format_memory($size) { |
5 |
if (1024 > $size) { |
if (1024 > $size) { |
40 |
|
|
41 |
$vms_array = $xenserver->VM__get_all_records(); |
$vms_array = $xenserver->VM__get_all_records(); |
42 |
|
|
43 |
|
$namelabel = $host["name_label"]; |
44 |
|
|
45 |
?> |
?> |
46 |
<html> |
<html> |
47 |
<head> |
<head> |
48 |
<title>XenServer::SERVER</title> |
<title>XenServer::<?php echo $namelabel;?></title> |
49 |
<script type='text/javascript' src="jquery-1.8.2.min.js"></script> |
|
50 |
|
<link rel="stylesheet" type="text/css" href="jquery/theme/jquery-ui.css"> |
51 |
|
<style> |
52 |
|
.ui-menu { |
53 |
|
width: 200px; |
54 |
|
} |
55 |
|
</style> |
56 |
|
<script type='text/javascript' src="jquery/jquery-1.9.1.min.js"></script> |
57 |
|
<script type='text/javascript' src="jquery/jquery-ui-1.10.2.min.js"></script> |
58 |
|
|
59 |
<script type='text/javascript'> |
<script type='text/javascript'> |
60 |
|
var menu = 0; |
61 |
|
var menu_uuid = ''; |
62 |
|
|
63 |
|
var user = ""; |
64 |
|
var password = ""; |
65 |
|
var loggedin = false; |
66 |
|
|
67 |
|
function isLoggedIn() { |
68 |
|
if (loggedin == false) { |
69 |
|
alert("You need to login to perform this operation"); |
70 |
|
} |
71 |
|
return loggedin; |
72 |
|
} |
73 |
|
|
74 |
|
|
75 |
$(document).ready( function() { |
$(document).ready( function() { |
76 |
|
$("#menu").hide(); |
77 |
setInterval(refreshData, 60000); |
setInterval(refreshData, 60000); |
78 |
refreshData(); |
refreshData(); |
79 |
$('.console').click( function() { |
$('.console').click( function() { |
80 |
var session = $(this).data('session'); |
var session = $(this).data('session'); |
81 |
var conurl = $(this).data('conurl'); |
var conurl = $(this).data('conurl'); |
82 |
console(conurl,session); |
var name = $(this).data('name'); |
83 |
|
openConsole(conurl,session,name); |
84 |
}); |
}); |
85 |
|
|
86 |
|
$('.bar').progressbar( ); |
87 |
|
|
88 |
$('#logo').click( function() { |
$('#logo').click( function() { |
89 |
refreshData(); |
refreshData(); |
90 |
}); |
}); |
91 |
|
|
92 |
|
$('.settings').click( function(event) { |
93 |
|
menu_uuid = $(this).attr('uuid'); |
94 |
|
|
95 |
|
$('#menu').menu( { |
96 |
|
select: function(event2,ui) { |
97 |
|
var action = $(ui.item).attr("action"); |
98 |
|
if (action == "memory") { |
99 |
|
doAction("setMemory", menu_uuid, ""); |
100 |
|
} |
101 |
|
if (action == "cpu") { |
102 |
|
doAction("setCPU", menu_uuid, ""); |
103 |
|
} |
104 |
|
}, |
105 |
|
create: function(event3,ui) { |
106 |
|
menu = 1; |
107 |
|
} |
108 |
|
/*position: { |
109 |
|
my: "left", of: event |
110 |
|
}*/ |
111 |
|
}); |
112 |
|
$('#menu').show().position( {my: "left top", of: event} ); |
113 |
|
event.stopPropagation(); |
114 |
|
}); |
115 |
|
|
116 |
|
$('.cd').click( function(event) { |
117 |
|
var uuid = $(this).attr('uuid'); |
118 |
|
cdSelectorDialog(uuid); |
119 |
|
}); |
120 |
|
$('#loginlink').click( function(event) { |
121 |
|
loginDialog(); |
122 |
|
}); |
123 |
|
|
124 |
|
$(document).click( function(event) { |
125 |
|
closeMenu(); |
126 |
|
}); |
127 |
|
$('#dialog-login').keypress(function(e) { |
128 |
|
if (e.keyCode == $.ui.keyCode.ENTER) { |
129 |
|
loginDialogSubmit(); |
130 |
|
} |
131 |
|
}); |
132 |
}); |
}); |
133 |
|
|
134 |
|
function loginDialog() { |
135 |
|
$('#dialog-login').dialog({ |
136 |
|
modal: true, |
137 |
|
height: 210, |
138 |
|
width: 350, |
139 |
|
buttons: { |
140 |
|
Login: loginDialogSubmit |
141 |
|
} |
142 |
|
}); |
143 |
|
} |
144 |
|
function loginDialogSubmit() { |
145 |
|
var params = $('#loginform').serialize(); |
146 |
|
|
147 |
|
$.get('login.php?' + params, function(data) { |
148 |
|
if (data == "OK") { |
149 |
|
loggedin = true; |
150 |
|
username = $('#username').val(); |
151 |
|
password = $('#password').val(); |
152 |
|
|
153 |
|
$('#login').html("Logged in as <i>" + username + "</i>"); |
154 |
|
refreshData(); |
155 |
|
} else { |
156 |
|
alert(data); |
157 |
|
} |
158 |
|
$("#dialog-login").dialog( "close" ); |
159 |
|
}); |
160 |
|
} |
161 |
|
|
162 |
|
function cdSelectorDialog(uuid) { |
163 |
|
if (isLoggedIn() == false) |
164 |
|
return; |
165 |
|
|
166 |
|
$('#cdselector').html(''); |
167 |
|
$('#cdselector').load( 'getisolist.php' ); |
168 |
|
var cddata; |
169 |
|
|
170 |
|
$.getJSON('getcdinfo.php?uuid=' + uuid, function(data) { |
171 |
|
cddata = data; |
172 |
|
if (data.ISO != '') { |
173 |
|
$('#cdcurrent').html( data.ISO ); |
174 |
|
$(":button:contains('Mount')").prop("disabled", true).addClass("ui-state-disabled"); |
175 |
|
} else { |
176 |
|
$('#cdcurrent').html('<i>No ISO currently mounted</i>'); |
177 |
|
$(":button:contains('Eject')").prop("disabled", true).addClass("ui-state-disabled"); |
178 |
|
} |
179 |
|
}); |
180 |
|
|
181 |
|
$('#dialog-cd').dialog({ |
182 |
|
modal: true, |
183 |
|
width: 800, |
184 |
|
height: 300, |
185 |
|
buttons: { |
186 |
|
Mount: function() { |
187 |
|
$( this ).dialog( "close" ); |
188 |
|
var vdi = $("#cdselector").val(); |
189 |
|
cdAction("mount", cddata.VBD, vdi); |
190 |
|
}, |
191 |
|
Eject: function() { |
192 |
|
$( this ).dialog( "close" ); |
193 |
|
cdAction("eject", cddata.VBD, ""); |
194 |
|
}, |
195 |
|
Cancel: function() { |
196 |
|
$( this ).dialog( "close" ); |
197 |
|
} |
198 |
|
|
199 |
|
} |
200 |
|
}); |
201 |
|
} |
202 |
|
|
203 |
|
function closeMenu() { |
204 |
|
if (menu > 0) { |
205 |
|
$("#menu").menu("destroy").hide(); |
206 |
|
menu = 0; |
207 |
|
} |
208 |
|
} |
209 |
|
|
210 |
function refreshData() { |
function refreshData() { |
211 |
|
$("#logo").hide(); |
212 |
$.get('ajaxdata.php', function(xml) { |
$.get('ajaxdata.php', function(xml) { |
213 |
$(xml).find('host').each(function() { |
$(xml).find('host').each(function() { |
214 |
var memtotal = $(this).find('memtotal').text(); |
var memtotal = $(this).find('memtotal').text(); |
215 |
var memfree = $(this).find('memfree').text(); |
var memfree = $(this).find('memfree').text(); |
216 |
var cpuavg = $(this).find('cpuavg').text(); |
var cpuavg = $(this).find('cpuavg').text() * 1; // *1 is used to convert the string var to an int |
217 |
|
|
218 |
memtotal = Math.round ( memtotal / (1024*1024) ); |
memtotal = Math.round ( memtotal / (1024*1024) ); |
219 |
memfree = Math.round ( memfree / (1024*1024) ); |
memfree = Math.round ( memfree / (1024*1024) ); |
222 |
|
|
223 |
//alert(memused + ' ' + mem_percentage); |
//alert(memused + ' ' + mem_percentage); |
224 |
|
|
225 |
$('#server_memory_usage').attr('src', 'usagebar.php?usage=' + mem_percentage); |
//$('#server_memory_usage').attr('src', 'usagebar.php?usage=' + mem_percentage); |
226 |
|
$('#server_memory_usage').progressbar( "value", mem_percentage ); |
227 |
$('#server_memory_usage').attr('alt', mem_percentage + '%'); |
$('#server_memory_usage').attr('alt', mem_percentage + '%'); |
228 |
$('#server_memory_usage').attr('title', mem_percentage + '%'); |
$('#server_memory_usage').attr('title', mem_percentage + '%'); |
229 |
$('#server_memory_usage_txt').text( memused + '/' + memtotal + 'MB'); |
$('#server_memory_usage_txt').text( memused + '/' + memtotal + 'MB'); |
230 |
|
|
231 |
|
|
232 |
$('#server_cpu_usage').attr('src', 'usagebar.php?usage=' + cpuavg); |
//$('#server_cpu_usage').attr('src', 'usagebar.php?usage=' + cpuavg); |
233 |
|
$('#server_cpu_usage').progressbar( "value", cpuavg ); |
234 |
$('#server_cpu_usage').attr('alt', cpuavg + '%'); |
$('#server_cpu_usage').attr('alt', cpuavg + '%'); |
235 |
$('#server_cpu_usage').attr('title', cpuavg + '%'); |
$('#server_cpu_usage').attr('title', cpuavg + '%'); |
236 |
$('#server_cpu_usage_txt').text( cpuavg+ '%'); |
$('#server_cpu_usage_txt').text( cpuavg+ '%'); |
243 |
var conurl = $(this).find('conurl').text(); |
var conurl = $(this).find('conurl').text(); |
244 |
var session = $(this).find('session').text(); |
var session = $(this).find('session').text(); |
245 |
var os = $(this).find('os').text(); |
var os = $(this).find('os').text(); |
246 |
|
var guestversion = $(this).find('guestversion').text(); |
247 |
var cpuavg = $(this).find('cpuavg').text(); |
var cpuavg = $(this).find('cpuavg').text(); |
248 |
|
var curmem = $(this).find('curmem').text(); |
249 |
name = name.replace(" ", "_"); |
var maxmem = $(this).find('maxmem').text(); |
250 |
name = name.replace(".", "_"); |
var cpus = $(this).find('cpus').text(); |
251 |
|
|
252 |
|
var mempercent = Math.round( (curmem*100) / maxmem ); |
253 |
|
|
254 |
|
name = name.replace(/ /g, "_"); |
255 |
|
name = name.replace(/\./g, "_"); |
256 |
|
name = name.replace(/\(/g, "_"); |
257 |
|
name = name.replace(/\)/g, "_"); |
258 |
|
|
259 |
var id = "#vm_" + name; |
var id = "#vm_" + name; |
260 |
|
|
261 |
var vm = $(id); |
var vm = $(id); |
262 |
|
|
263 |
|
if (guestversion != '') { |
264 |
|
os += ' Guest Tools: ' + guestversion; |
265 |
|
} |
266 |
|
|
267 |
|
vm.find('.vps_memory_usage_txt_UID').text( maxmem + " MB"); |
268 |
|
vm.find('.vps_cpu_usage_txt_UID').text( cpus + " VCPU"); |
269 |
|
|
270 |
if (state == "Running") { |
if (state == "Running") { |
271 |
vm.find('.state').css("background-image", "url('gfx/vps_topgreen.png')"); |
vm.find('.state').css("background-image", "url('gfx/vps_topgreen.png')"); |
272 |
vm.find('.network').show(); |
vm.find('.network').show(); |
274 |
vm.find('.console').show(); |
vm.find('.console').show(); |
275 |
vm.find('.console').data('conurl', conurl); |
vm.find('.console').data('conurl', conurl); |
276 |
vm.find('.console').data('session', session); |
vm.find('.console').data('session', session); |
277 |
vm.find('.actionstop').show(); |
vm.find('.console').data('name', name); |
278 |
vm.find('.actionstart').hide(); |
vm.find('.settings').hide(); |
279 |
|
if (loggedin) { |
280 |
|
vm.find('.actionstop').show(); |
281 |
|
vm.find('.actionstart').hide(); |
282 |
|
} |
283 |
vm.find('.os').text(' - ' + os); |
vm.find('.os').text(' - ' + os); |
284 |
|
|
285 |
|
cpuavg = cpuavg * 1; |
286 |
vm.find('.cpu_graph').show(); |
vm.find('.cpu_graph').show(); |
287 |
vm.find('.cpu_graph').attr('src', 'usagebar.php?usage=' + cpuavg); |
//vm.find('.cpu_graph').attr('src', 'usagebar.php?usage=' + cpuavg); |
288 |
|
vm.find('.cpu_graph').progressbar( "value", cpuavg ); |
289 |
vm.find('.cpu_graph').attr('title', cpuavg + '%'); |
vm.find('.cpu_graph').attr('title', cpuavg + '%'); |
290 |
|
|
291 |
|
vm.find('.mem_graph').show(); |
292 |
|
//vm.find('.mem_graph').attr('src', 'usagebar.php?usage=' + mempercent); |
293 |
|
vm.find('.mem_graph').progressbar( "value", mempercent ); |
294 |
|
vm.find('.mem_graph').attr('title', curmem + ' / ' + maxmem + ' MB' ); |
295 |
} else { |
} else { |
296 |
if (state == "Halted") { |
if (state == "Halted") { |
297 |
vm.find('.state').css("background-image", "url('gfx/vps_topred.png')"); |
vm.find('.state').css("background-image", "url('gfx/vps_topred.png')"); |
298 |
} else { |
} else { |
299 |
vm.find('.state').css("background-image", "url('gfx/vps_topyellow.png')"); |
vm.find('.state').css("background-image", "url('gfx/vps_topyellow.png')"); |
300 |
} |
} |
301 |
|
vm.find('.os').text(''); |
302 |
|
|
303 |
vm.find('.network').hide(); |
vm.find('.network').hide(); |
304 |
vm.find('.console').hide(); |
vm.find('.console').hide(); |
305 |
vm.find('.actionstop').hide(); |
vm.find('.settings').show(); |
306 |
vm.find('.actionstart').show(); |
if (loggedin) { |
307 |
|
vm.find('.actionstop').hide(); |
308 |
|
vm.find('.actionstart').show(); |
309 |
|
} |
310 |
vm.find('.cpu_graph').hide(); |
vm.find('.cpu_graph').hide(); |
311 |
vm.find('.mem_graph').hide(); |
vm.find('.mem_graph').hide(); |
312 |
} |
} |
313 |
|
vm.find('.state').attr('title', state); |
314 |
|
|
315 |
}) |
}); |
316 |
|
$('#logo').show(); |
317 |
}); |
}); |
318 |
} |
} |
319 |
|
|
320 |
function doAction(action, uuid, vm) { |
function doAction(action, uuid, vm) { |
321 |
var key = prompt("Key"); |
var val=""; |
322 |
if (key == "" || key == null) { |
|
323 |
|
if (isLoggedIn() == false) |
324 |
return; |
return; |
325 |
} |
|
326 |
document.body.style.cursor = 'wait'; |
document.body.style.cursor = 'wait'; |
327 |
$('#vm_' + vm).find('.state').css("background-image", "url('gfx/vps_topyellow.png')"); |
$('#vm_' + vm).find('.state').css("background-image", "url('gfx/vps_topyellow.png')"); |
328 |
|
|
329 |
var url = "action.php?action=" + action + "&uuid=" + uuid + "&key=" + key; |
if (action == "setMemory") { |
330 |
|
val = prompt("Set memory target"); |
331 |
|
val *= (1024*1024); |
332 |
|
if (val == "" || val == null) { |
333 |
|
return; |
334 |
|
} |
335 |
|
} |
336 |
|
if (action == "setCPU") { |
337 |
|
val = prompt("Set CPU count"); |
338 |
|
if (val == "" || val == null) { |
339 |
|
return; |
340 |
|
} |
341 |
|
} |
342 |
|
|
343 |
|
var url = "action.php?action=" + action + "&uuid=" + uuid + "&key=" + password + "&val=" + val;; |
344 |
var response = $.get(url, function(data) { |
var response = $.get(url, function(data) { |
345 |
if (data != 'OK') { |
if (data != 'OK') { |
346 |
alert(data); |
alert(data); |
351 |
}); |
}); |
352 |
} |
} |
353 |
|
|
354 |
function console(url, session) { |
function cdAction(action, vbd,vdi) { |
355 |
|
if (isLoggedIn() == false) |
356 |
|
return; |
357 |
|
|
358 |
|
document.body.style.cursor = 'wait'; |
359 |
|
var url = "cdaction.php?action=" + action + "&VBD=" + vbd + "&key=" + password + "&VDI=" + vdi; |
360 |
|
var response = $.get(url, function(data) { |
361 |
|
if (data != 'OK') { |
362 |
|
alert(data); |
363 |
|
} |
364 |
|
document.body.style.cursor = 'default' |
365 |
|
}); |
366 |
|
|
367 |
|
} |
368 |
|
|
369 |
|
function openConsole(url, session, name) { |
370 |
if (url == '') |
if (url == '') |
371 |
return; |
return; |
372 |
|
|
373 |
var key = prompt("Key"); |
if (isLoggedIn() == false) |
|
if (key == "" || key == null) { |
|
374 |
return; |
return; |
375 |
} |
|
376 |
var url = "console.php?url=" + url + "&session=" + session + "&key=" + key; |
var url = "console.php?url=" + url + "&session=" + session + "&key=" + password + "&name=" + name; |
377 |
|
|
378 |
//window.location = url; |
//window.location = url; |
379 |
//$('#mainwindow').load(url); |
//$('#mainwindow').load(url); |
414 |
margin: 4; |
margin: 4; |
415 |
border: 1px solid #222; |
border: 1px solid #222; |
416 |
} |
} |
417 |
|
|
418 |
|
.ui-progressbar-value { |
419 |
|
background: #61B4F3; |
420 |
|
} |
421 |
|
|
422 |
|
.ui-progressbar { |
423 |
|
border-style:solid; |
424 |
|
border-width:1px; |
425 |
|
border-color: #666666; |
426 |
|
} |
427 |
|
|
428 |
|
.bar { |
429 |
|
width: 102px; |
430 |
|
height: 16px; |
431 |
|
} |
432 |
|
|
433 |
</style> |
</style> |
434 |
</head> |
</head> |
435 |
<body> |
<body> |
439 |
<table width='100%' background='gfx/topbg.png' cellpadding='3' cellspacing='0' border='0' class='toptable'> |
<table width='100%' background='gfx/topbg.png' cellpadding='3' cellspacing='0' border='0' class='toptable'> |
440 |
<tr> |
<tr> |
441 |
<td rowspan='2' width='160'><img src='gfx/citrix-logo.png' id='logo'></td> |
<td rowspan='2' width='160'><img src='gfx/citrix-logo.png' id='logo'></td> |
442 |
<td colspan='4' class='small' align='right'><?php echo $xenversion;?><br><?php echo $license;?></td> |
<td colspan='4' class='small' align='right'><?php echo $namelabel . " / " . $xenversion;?><br><?php echo $license;?></td> |
443 |
</tr> |
</tr> |
444 |
<tr> |
<tr> |
445 |
<td width='150' align='right' class='small'><img src='gfx/icon-cpu.png'> |
<td width='150'> |
446 |
<img id='server_cpu_usage' src='usagebar.php?usage=12' width='102' height='16' title='static dummy data'><div id='server_cpu_usage_txt'>12%</div></td> |
<span id="login" class='small'><i>Not <a href="#" id="loginlink">logged in</a></i> |
447 |
|
</span> |
448 |
<td width='150' align='right' class='small'><img src='gfx/icon-memory.png'> |
</td> |
449 |
<img id='server_memory_usage' src='usagebar.php?usage=1' width='102' height='16' title='static dummy data'><div id='server_memory_usage_txt'>0/4 MB</div></td> |
<td width='150'></td> |
450 |
|
<td width='150' align='right' class='small'> |
451 |
|
<div id='server_cpu_usage' class='bar'></div> |
452 |
|
<img src='gfx/icon-cpu.png'> |
453 |
|
<span id='server_cpu_usage_txt'>12%</span> |
454 |
|
</td> |
455 |
|
|
456 |
|
<td width='150' align='right' class='small'> |
457 |
|
<div id='server_memory_usage' class='bar'></div> |
458 |
|
<img src='gfx/icon-memory.png'> |
459 |
|
<span id='server_memory_usage_txt'>0/4 MB</span> |
460 |
|
</td> |
461 |
|
<!-- |
462 |
<td width='150' align='right' class='small'><img src='gfx/icon-network.png'> |
<td width='150' align='right' class='small'><img src='gfx/icon-network.png'> |
463 |
<img id='server_net_usage' src='usagebar.php?usage=41' width='102' height='16' title='static dummy data'><div id='server_net_usage_txt'>1%</div></td> |
<img id='server_net_usage' src='usagebar.php?usage=41' width='102' height='16' title='static dummy data'><div id='server_net_usage_txt'>1%</div></td> |
464 |
<td width='150' align='right' class='small'><img src='gfx/icon-disk.png'> |
<td width='150' align='right' class='small'><img src='gfx/icon-disk.png'> |
465 |
<img id='server_disk_usage' src='usagebar.php?usage=41' width='102' height='16' title='static dummy data'><div id='server_memory_usage_txt'>89.3/405.5 GB</div></td> |
<img id='server_disk_usage' src='usagebar.php?usage=41' width='102' height='16' title='static dummy data'><div id='server_memory_usage_txt'>89.3/405.5 GB</div></td> |
|
|
|
466 |
</td> |
</td> |
467 |
|
--> |
468 |
</tr></table> |
</tr></table> |
469 |
|
|
470 |
|
|
477 |
} |
} |
478 |
|
|
479 |
$name = $vm["name_label"]; |
$name = $vm["name_label"]; |
480 |
|
$description = $vm["name_description"]; |
481 |
$uuid = $vm["uuid"]; |
$uuid = $vm["uuid"]; |
482 |
$state = $vm["power_state"] ; |
$state = $vm["power_state"] ; |
483 |
$memory = $vm['memory_target']; |
$memory = $vm['memory_target']; |
486 |
|
|
487 |
$clean_name = str_replace(" ", "_", $name); |
$clean_name = str_replace(" ", "_", $name); |
488 |
$clean_name = str_replace(".", "_", $clean_name); |
$clean_name = str_replace(".", "_", $clean_name); |
489 |
|
$clean_name = str_replace("(", "_", $clean_name); |
490 |
|
$clean_name = str_replace(")", "_", $clean_name); |
491 |
|
|
492 |
|
|
493 |
foreach ($vm["VBDs"] as $vbds) { |
foreach ($vm["VBDs"] as $vbds) { |
505 |
<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;?>'> |
506 |
<tr background='gfx/vps_topbg.png' > |
<tr background='gfx/vps_topbg.png' > |
507 |
<td width='10' class='small state'> </td> |
<td width='10' class='small state'> </td> |
508 |
<td colspan='2' class='small'><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> |
509 |
<td colspan='2' class='small' align='right'> |
<td colspan='2' class='small' align='right'> |
510 |
<span class='network'></span> |
<span class='network'></span> |
511 |
|
<a href='#' class='cd' uuid='<?php echo $uuid;?>' > |
512 |
|
<img src='gfx/icon-cd.gif' style='vertical-align: middle;'></a> |
513 |
<a href='#' style='display:none;' class='console'> |
<a href='#' style='display:none;' class='console'> |
514 |
<img src='gfx/icon-terminal.png' style='vertical-align: middle;'> |
<img src='gfx/icon-terminal.png' style='vertical-align: middle;'> |
515 |
</a> |
</a> |
516 |
|
|
517 |
|
<a href='#' style='display:none;' class='settings' uuid='<?php echo $uuid;?>'> |
518 |
|
<img src='gfx/icon-settings16.png' style='vertical-align: middle;'> |
519 |
|
</a> |
520 |
</td> |
</td> |
521 |
</tr> |
</tr> |
522 |
|
|
527 |
<span class="actionstop" style='display:none'> |
<span class="actionstop" style='display:none'> |
528 |
start | |
start | |
529 |
<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> | |
530 |
<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> | |
531 |
|
<a href='#' onclick="doAction('hardreboot','<?php echo $uuid;?>','<?php echo $clean_name;?>')" >force reboot</a> |
532 |
</span> |
</span> |
533 |
|
|
534 |
<span class="actionstart"> |
<span class="actionstart" style='display:none'> |
535 |
<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> | |
536 |
stop | |
stop | |
537 |
force shutdown |
force shutdown |
540 |
</td> |
</td> |
541 |
|
|
542 |
<td width='100' align='right' class='small' valign='top'> |
<td width='100' align='right' class='small' valign='top'> |
543 |
<img src='usagebar.php?usage=1' width='102' height='16' title='static dummy data' class='cpu_graph'><br> |
<div class='cpu_graph bar'></div> |
544 |
<img src='gfx/icon-cpu.png' style='vertical-align: middle;'> |
<img src='gfx/icon-cpu.png' style='vertical-align: middle;'> |
545 |
<span id='vps_cpu_usage_txt_UID'><?php echo $cpu_count; ?> VCPU</span> |
<span class='vps_cpu_usage_txt_UID'><?php echo $cpu_count; ?> VCPU</span> |
546 |
</td> |
</td> |
547 |
<td width='100' align='right' class='small'> |
<td width='100' align='right' class='small'> |
548 |
<img src='usagebar.php?usage=1' width='102' height='16' title='static dummy data' class='mem_graph'><br> |
<div class='mem_graph bar'></div> |
549 |
<img src='gfx/icon-memory.png' style='vertical-align: middle;'> |
<img src='gfx/icon-memory.png' style='vertical-align: middle;'> |
550 |
<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> |
551 |
</td> |
</td> |
552 |
<!-- |
<!-- |
553 |
<td width='100' align='right' class='small'> |
<td width='100' align='right' class='small'> |
555 |
<span id='vps_net_usage_txt_UID'>na</span> |
<span id='vps_net_usage_txt_UID'>na</span> |
556 |
</td> |
</td> |
557 |
--> |
--> |
558 |
<td width='100' align='right' class='small' valign='top'> |
<td width='100' align='right' class='small' valign='bottom'> |
559 |
<img src='gfx/icon-disk.png' style='vertical-align: middle;'> |
<img src='gfx/icon-disk.png' style='vertical-align: middle;'> |
560 |
<span id='vps_disk_usage_txt_UID'><?php echo format_storage($harddrive_size); ?></span> |
<span id='vps_disk_usage_txt_UID'><?php echo format_storage($harddrive_size); ?></span> |
561 |
</td> |
</td> |
567 |
|
|
568 |
<?PHP } ?> |
<?PHP } ?> |
569 |
</td></tr></table> |
</td></tr></table> |
570 |
|
|
571 |
|
<br> |
572 |
|
|
573 |
|
<div style="display: none;"> |
574 |
|
|
575 |
|
<div id="dialog-login" title="Login"> |
576 |
|
<form id="loginform"> |
577 |
|
<table border="0"> |
578 |
|
<tr> |
579 |
|
<td>Username: </td> |
580 |
|
<td><input type="text" id="username" name="username"></td> |
581 |
|
<tr> |
582 |
|
<tr> |
583 |
|
<td>Password: </td> |
584 |
|
<td><input type="password" id="password" name="password"></td> |
585 |
|
</tr> |
586 |
|
</table> |
587 |
|
</form> |
588 |
|
</div> |
589 |
|
|
590 |
|
<div id="dialog-cd" title="Select CD"> |
591 |
|
|
592 |
|
<table border=0> |
593 |
|
<tr> |
594 |
|
<td>Current: <span id="cdcurrent"></span></td> |
595 |
|
</tr> |
596 |
|
<tr> |
597 |
|
<td> |
598 |
|
CD: <select id="cdselector"></select> |
599 |
|
</td> |
600 |
|
</tr> |
601 |
|
</table> |
602 |
|
</div> |
603 |
|
|
604 |
|
</div> |
605 |
|
|
606 |
|
<ul id="menu"> |
607 |
|
<li action="memory"><a href="#">Set Memory Size</a></li> |
608 |
|
<li action="cpu"><a href="#">Set CPU Count</a></li> |
609 |
|
|
610 |
|
|
611 |
|
<!-- <li><a href="#">Item 3</a> |
612 |
|
<ul> |
613 |
|
<li><a href="#">Item 3-1</a></li> |
614 |
|
<li><a href="#">Item 3-2</a></li> |
615 |
|
<li><a href="#">Item 3-3</a></li> |
616 |
|
<li><a href="#">Item 3-4</a></li> |
617 |
|
<li><a href="#">Item 3-5</a></li> |
618 |
|
</ul> |
619 |
|
</li> |
620 |
|
<li><a href="#">Item 4</a></li> |
621 |
|
<li><a href="#">Item 5</a></li>--> |
622 |
|
</ul> |
623 |
|
|
624 |
</body></html> |
</body></html> |
625 |
|
|