1 |
<?php |
<?php |
2 |
|
|
3 |
|
if (! file_exists("config.php") ) { |
4 |
|
die("Could not find config.php file"); |
5 |
|
} |
6 |
|
|
7 |
require("config.php"); |
require("config.php"); |
8 |
|
|
9 |
function format_memory($size) { |
function format_memory($size) { |
88 |
openConsole(conurl,session,name); |
openConsole(conurl,session,name); |
89 |
}); |
}); |
90 |
|
|
91 |
$('#server_memory_usage').progressbar( ); |
$('.bar').progressbar( ); |
|
$('#server_cpu_usage').progressbar( ); |
|
92 |
|
|
93 |
$('#logo').click( function() { |
$('#logo').click( function() { |
94 |
refreshData(); |
refreshData(); |
287 |
} |
} |
288 |
vm.find('.os').text(' - ' + os); |
vm.find('.os').text(' - ' + os); |
289 |
|
|
290 |
|
cpuavg = cpuavg * 1; |
291 |
vm.find('.cpu_graph').show(); |
vm.find('.cpu_graph').show(); |
292 |
vm.find('.cpu_graph').attr('src', 'usagebar.php?usage=' + cpuavg); |
//vm.find('.cpu_graph').attr('src', 'usagebar.php?usage=' + cpuavg); |
293 |
|
vm.find('.cpu_graph').progressbar( "value", cpuavg ); |
294 |
vm.find('.cpu_graph').attr('title', cpuavg + '%'); |
vm.find('.cpu_graph').attr('title', cpuavg + '%'); |
295 |
|
|
296 |
vm.find('.mem_graph').show(); |
vm.find('.mem_graph').show(); |
297 |
vm.find('.mem_graph').attr('src', 'usagebar.php?usage=' + mempercent); |
//vm.find('.mem_graph').attr('src', 'usagebar.php?usage=' + mempercent); |
298 |
|
vm.find('.mem_graph').progressbar( "value", mempercent ); |
299 |
vm.find('.mem_graph').attr('title', curmem + ' / ' + maxmem + ' MB' ); |
vm.find('.mem_graph').attr('title', curmem + ' / ' + maxmem + ' MB' ); |
300 |
} else { |
} else { |
301 |
if (state == "Halted") { |
if (state == "Halted") { |
315 |
vm.find('.cpu_graph').hide(); |
vm.find('.cpu_graph').hide(); |
316 |
vm.find('.mem_graph').hide(); |
vm.find('.mem_graph').hide(); |
317 |
} |
} |
318 |
|
vm.find('.state').attr('title', state); |
319 |
|
|
320 |
}); |
}); |
321 |
$('#logo').show(); |
$('#logo').show(); |
424 |
background: #61B4F3; |
background: #61B4F3; |
425 |
} |
} |
426 |
|
|
427 |
|
.ui-progressbar { |
428 |
|
border-style:solid; |
429 |
|
border-width:1px; |
430 |
|
border-color: #666666; |
431 |
|
} |
432 |
|
|
433 |
.bar { |
.bar { |
434 |
width: 102px; |
width: 102px; |
435 |
height: 16px; |
height: 16px; |
532 |
<span class="actionstop" style='display:none'> |
<span class="actionstop" style='display:none'> |
533 |
start | |
start | |
534 |
<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> | |
535 |
<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> | |
536 |
|
<a href='#' onclick="doAction('hardreboot','<?php echo $uuid;?>','<?php echo $clean_name;?>')" >force reboot</a> |
537 |
</span> |
</span> |
538 |
|
|
539 |
<span class="actionstart" style='display:none'> |
<span class="actionstart" style='display:none'> |
545 |
</td> |
</td> |
546 |
|
|
547 |
<td width='100' align='right' class='small' valign='top'> |
<td width='100' align='right' class='small' valign='top'> |
548 |
<img src='usagebar.php?usage=1' width='102' height='16' title='static dummy data' class='cpu_graph'><br> |
<div class='cpu_graph bar'></div> |
549 |
<img src='gfx/icon-cpu.png' style='vertical-align: middle;'> |
<img src='gfx/icon-cpu.png' style='vertical-align: middle;'> |
550 |
<span class='vps_cpu_usage_txt_UID'><?php echo $cpu_count; ?> VCPU</span> |
<span class='vps_cpu_usage_txt_UID'><?php echo $cpu_count; ?> VCPU</span> |
551 |
</td> |
</td> |
552 |
<td width='100' align='right' class='small'> |
<td width='100' align='right' class='small'> |
553 |
<img src='usagebar.php?usage=1' width='102' height='16' title='static dummy data' class='mem_graph'><br> |
<div class='mem_graph bar'></div> |
554 |
<img src='gfx/icon-memory.png' style='vertical-align: middle;'> |
<img src='gfx/icon-memory.png' style='vertical-align: middle;'> |
555 |
<span class='vps_memory_usage_txt_UID'><?php echo format_memory($memory); ?></span> |
<span class='vps_memory_usage_txt_UID'><?php echo format_memory($memory); ?></span> |
556 |
</td> |
</td> |