Show burstable memory limit, if there is one

This commit is contained in:
Jamie Cameron
2013-06-28 15:07:53 -07:00
parent 79de24f4ce
commit c20d57519e
2 changed files with 15 additions and 3 deletions

View File

@ -29,7 +29,8 @@ right_real=Real memory
right_virt=Virtual memory
right_procs=Running processes
right_disk=Local disk space
right_used=$1 total, $2 used
right_used=$2 used, $1 total
right_used2=$2 used, $1 guaranteed, $3 burstable
right_out=$1 of $2
right_quota=Disk usage and quota
right_header5=Account Information

View File

@ -161,7 +161,18 @@ if ($level == 0) {
# Memory usage
if ($info->{'mem'}) {
@m = @{$info->{'mem'}};
if (@m && $m[0]) {
if (@m && $m[0] && $m[5]) {
# Show memory usage with bursting
print &ui_table_row($text{'right_real'},
&text('right_used2',
&nice_size($m[0]*1024),
&nice_size(($m[0]-$m[1])*1024),
&nice_size($m[5]*1024))."<br>\n".
&bar_chart_three($m[5], $m[1], $m[0]-$m[1],
$m[5]-$m[0]));
}
elsif (@m && $m[0] && !$m[5]) {
# Show memory usage on a regular system
print &ui_table_row($text{'right_real'},
&text('right_used',
&nice_size($m[0]*1024),
@ -214,7 +225,7 @@ if ($level == 0) {
print &ui_table_end();
# Check for incorrect OS
# Show other webmin-generated notifications
if (&foreign_check("webmin")) {
&foreign_require("webmin", "webmin-lib.pl");
&webmin::show_webmin_notifications();