diff --git a/gray-theme/right.cgi b/gray-theme/right.cgi
index bb8b489aa..29dd09624 100755
--- a/gray-theme/right.cgi
+++ b/gray-theme/right.cgi
@@ -31,7 +31,7 @@ if (&get_product_name() eq 'webmin') {
if ($level == 0) {
# Show general system information
- print "
\n";
+ print &ui_table_start(undef, undef, 2);
# Ask status module for collected info
&foreign_require("system-status");
@@ -41,45 +41,39 @@ if ($level == 0) {
$ip = $info && $info->{'ips'} ? $info->{'ips'}->[0]->[0] :
&to_ipaddress(get_system_hostname());
$ip = " ($ip)" if ($ip);
- print " | $text{'right_host'} | \n";
- print "",&get_system_hostname(),$ip," |
\n";
+ print &ui_table_row($text{'right_host'},
+ &get_system_hostname().$ip);
# Operating system
- print " | $text{'right_os'} | \n";
- if ($gconfig{'os_version'} eq '*') {
- print "$gconfig{'real_os_type'} |
\n";
- }
- else {
- print "$gconfig{'real_os_type'} $gconfig{'real_os_version'} | \n";
- }
+ print &ui_table_row($text{'right_os'},
+ $gconfig{'os_version'} eq '*' ?
+ $gconfig{'real_os_type'} :
+ $gconfig{'real_os_type'}." ".$gconfig{'real_os_version'});
# Webmin version
- print " | $text{'right_webmin'} | \n";
- print "",&get_webmin_version()," |
\n";
+ print &ui_table_row($text{'right_webmin'},
+ &get_webmin_version());
# System time
$tm = localtime(time());
- print " | $text{'right_time'} | \n";
- if (&foreign_available("time")) {
- $tm = "$tm";
- }
- print "$tm |
\n";
+ print &ui_table_row($text{'right_time'},
+ &foreign_available("time") ? "$tm" : $tm);
# Kernel and CPU
if ($info->{'kernel'}) {
- print " | $text{'right_kernel'} | \n";
- print "",&text('right_kernelon',
- $info->{'kernel'}->{'os'},
- $info->{'kernel'}->{'version'},
- $info->{'kernel'}->{'arch'})," |
\n";
+ print &ui_table_row($text{'right_kernel'},
+ &text('right_kernelon',
+ $info->{'kernel'}->{'os'},
+ $info->{'kernel'}->{'version'},
+ $info->{'kernel'}->{'arch'}));
}
# CPU type and cores
if ($info->{'load'}) {
@c = @{$info->{'load'}};
if (@c > 3) {
- print " | $text{'right_cpuinfo'} | \n";
- print "",&text('right_cputype', @c)," |
\n";
+ print &ui_table_row($text{'right_cpuinfo'},
+ &text('right_cputype', @c));
}
}
@@ -97,78 +91,66 @@ if ($level == 0) {
$uptime = &text('right_upmins', $m);
}
if ($uptime) {
- print " | $text{'right_uptime'} | \n";
- print "$uptime |
\n";
+ print &ui_table_row($text{'right_uptime'}, $uptime);
}
# Running processes
if (&foreign_check("proc")) {
@procs = &proc::list_processes();
$pr = scalar(@procs);
- print " | $text{'right_procs'} | \n";
- if (&foreign_available("proc")) {
- $pr = "$pr";
- }
- print "$pr |
\n";
+ print &ui_table_row($text{'right_procs'},
+ &foreign_available("proc") ? "$pr"
+ : $pr);
}
# Load averages
if ($info->{'load'}) {
@c = @{$info->{'load'}};
if (@c) {
- print " | $text{'right_cpu'} | \n";
- print "",&text('right_load', @c)," |
\n";
+ print &ui_table_row($text{'right_cpu'},
+ &text('right_load', @c));
}
}
# CPU usage
if ($info->{'cpu'}) {
@c = @{$info->{'cpu'}};
- print " | $text{'right_cpuuse'} | \n";
- print "",&text('right_cpustats', @c)," |
\n";
+ print &ui_table_row($text{'right_cpuuse'},
+ &text('right_cpustats', @c));
}
# Memory usage
if ($info->{'mem'}) {
@m = @{$info->{'mem'}};
if (@m && $m[0]) {
- print " | $text{'right_real'} | \n";
- print "",&text('right_used',
- &nice_size($m[0]*1024),
- &nice_size(($m[0]-$m[1])*1024)),
- " |
\n";
- print " | \n";
- print "",&bar_chart($m[0], $m[0]-$m[1], 1),
- " |
\n";
+ print &ui_table_row($text{'right_real'},
+ &text('right_used',
+ &nice_size($m[0]*1024),
+ &nice_size(($m[0]-$m[1])*1024))."
\n".
+ &bar_chart($m[0], $m[0]-$m[1], 1));
}
if (@m && $m[2]) {
- print " | $text{'right_virt'} | \n";
- print "",&text('right_used',
- &nice_size($m[2]*1024),
- &nice_size(($m[2]-$m[3])*1024)),
- " |
\n";
- print " | \n";
- print "",&bar_chart($m[2], $m[2]-$m[3], 1),
- " |
\n";
+ print &ui_table_row($text{'right_virt'},
+ &text('right_used',
+ &nice_size($m[2]*1024),
+ &nice_size(($m[2]-$m[3])*1024))."
\n".
+ &bar_chart($m[2], $m[2]-$m[3], 1));
}
}
# Disk space on local drives
if ($info->{'disk_total'}) {
($total, $free) = ($info->{'disk_total'}, $info->{'disk_free'});
- print " | $text{'right_disk'} | \n";
- print "",&text('right_used',
- &nice_size($total),
- &nice_size($total-$free))," |
\n";
- print " | \n";
- print "",&bar_chart($total, $total-$free, 1),
- " |
\n";
+ print &ui_table_row($text{'right_disk'},
+ &text('right_used',
+ &nice_size($total),
+ &nice_size($total-$free))."
\n".
+ &bar_chart($total, $total-$free, 1));
}
# Package updates
if ($info->{'poss'}) {
- print " | $text{'right_updates'} | \n";
@poss = @{$info->{'poss'}};
@secs = grep { $_->{'security'} } @poss;
if (@poss && @secs) {
@@ -184,10 +166,10 @@ if ($level == 0) {
if (&foreign_available("package-updates")) {
$msg = "$msg";
}
- print "$msg |
\n";
+ print &ui_table_row($text{'right_updates'}, $msg);
}
- print "
\n";
+ print &ui_table_end();
# Check for incorrect OS
if (&foreign_check("webmin")) {
@@ -198,27 +180,26 @@ if ($level == 0) {
elsif ($level == 3) {
# Show Usermin user's information
print "\n";
+ print &ui_table_start(undef, undef, 2);
# Host and login info
- print " | $text{'right_host'} | \n";
- print "",&get_system_hostname()," |
\n";
+ print &ui_table_row($text{'right_host'},
+ &get_system_hostname());
- print " | $text{'right_os'} | \n";
- if ($gconfig{'os_version'} eq '*') {
- print "$gconfig{'real_os_type'} |
\n";
- }
- else {
- print "$gconfig{'real_os_type'} $gconfig{'real_os_version'} | \n";
- }
+ # Operating system
+ print &ui_table_row($text{'right_os'},
+ $gconfig{'os_version'} eq '*' ?
+ $gconfig{'real_os_type'} :
+ $gconfig{'real_os_type'}." ".$gconfig{'real_os_version'});
- print " | $text{'right_usermin'} | \n";
- print "",&get_webmin_version()," |
\n";
+ # Webmin version
+ print &ui_table_row($text{'right_usermin'},
+ &get_webmin_version());
# System time
$tm = localtime(time());
- print " | $text{'right_time'} | \n";
- print "$tm |
\n";
+ print &ui_table_row($text{'right_time'},
+ &foreign_available("time") ? "$tm" : $tm);
# Disk quotas
if (&foreign_installed("quota")) {
@@ -238,16 +219,14 @@ elsif ($level == 3) {
}
if ($quota) {
$bsize = $quota::config{'block_size'};
- print " | $text{'right_uquota'} | \n";
- print "",&text('right_out',
- &nice_size($usage*$bsize),
- &nice_size($quota*$bsize))," |
\n";
- print " | \n";
- print "",&bar_chart($quota, $usage, 1),
- " |
\n";
+ print &ui_table_row($text{'right_uquota'},
+ &text('right_out',
+ &nice_size($usage*$bsize),
+ &nice_size($quota*$bsize))."
\n".
+ &bar_chart($quota, $usage, 1));
}
}
- print "
\n";
+ print &ui_table_end();
}
print "\n";