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 "\n"; - print "\n"; + print &ui_table_row($text{'right_host'}, + &get_system_hostname().$ip); # Operating system - print "\n"; - if ($gconfig{'os_version'} eq '*') { - print "\n"; - } - else { - print "\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 "\n"; - print "\n"; + print &ui_table_row($text{'right_webmin'}, + &get_webmin_version()); # System time $tm = localtime(time()); - print "\n"; - if (&foreign_available("time")) { - $tm = "$tm"; - } - print "\n"; + print &ui_table_row($text{'right_time'}, + &foreign_available("time") ? "$tm" : $tm); # Kernel and CPU if ($info->{'kernel'}) { - print "\n"; - print "\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 "\n"; - print "\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 "\n"; - print "\n"; + print &ui_table_row($text{'right_uptime'}, $uptime); } # Running processes if (&foreign_check("proc")) { @procs = &proc::list_processes(); $pr = scalar(@procs); - print "\n"; - if (&foreign_available("proc")) { - $pr = "$pr"; - } - print "\n"; + print &ui_table_row($text{'right_procs'}, + &foreign_available("proc") ? "$pr" + : $pr); } # Load averages if ($info->{'load'}) { @c = @{$info->{'load'}}; if (@c) { - print "\n"; - print "\n"; + print &ui_table_row($text{'right_cpu'}, + &text('right_load', @c)); } } # CPU usage if ($info->{'cpu'}) { @c = @{$info->{'cpu'}}; - print "\n"; - print "\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 "\n"; - print "\n"; - print "\n"; - print "\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 "\n"; - print "\n"; - print "\n"; - print "\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 "\n"; - print "\n"; - print "\n"; - print "\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 "\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 "\n"; + print &ui_table_row($text{'right_updates'}, $msg); } - print "
$text{'right_host'}",&get_system_hostname(),$ip,"
$text{'right_os'}$gconfig{'real_os_type'}
$gconfig{'real_os_type'} $gconfig{'real_os_version'}
$text{'right_webmin'}",&get_webmin_version(),"
$text{'right_time'}$tm
$text{'right_kernel'}",&text('right_kernelon', - $info->{'kernel'}->{'os'}, - $info->{'kernel'}->{'version'}, - $info->{'kernel'}->{'arch'}),"
$text{'right_cpuinfo'}",&text('right_cputype', @c),"
$text{'right_uptime'}$uptime
$text{'right_procs'}$pr
$text{'right_cpu'}",&text('right_load', @c),"
$text{'right_cpuuse'}",&text('right_cpustats', @c),"
$text{'right_real'}",&text('right_used', - &nice_size($m[0]*1024), - &nice_size(($m[0]-$m[1])*1024)), - "
",&bar_chart($m[0], $m[0]-$m[1], 1), - "
$text{'right_virt'}",&text('right_used', - &nice_size($m[2]*1024), - &nice_size(($m[2]-$m[3])*1024)), - "
",&bar_chart($m[2], $m[2]-$m[3], 1), - "
$text{'right_disk'}",&text('right_used', - &nice_size($total), - &nice_size($total-$free)),"
",&bar_chart($total, $total-$free, 1), - "
$text{'right_updates'}$msg
\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 "

$text{'right_header5'}

\n"; - print "\n"; + print &ui_table_start(undef, undef, 2); # Host and login info - print "\n"; - print "\n"; + print &ui_table_row($text{'right_host'}, + &get_system_hostname()); - print "\n"; - if ($gconfig{'os_version'} eq '*') { - print "\n"; - } - else { - print "\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 "\n"; - print "\n"; + # Webmin version + print &ui_table_row($text{'right_usermin'}, + &get_webmin_version()); # System time $tm = localtime(time()); - print "\n"; - print "\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 "\n"; - print "\n"; - print "\n"; - print "\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 "
$text{'right_host'}",&get_system_hostname(),"
$text{'right_os'}$gconfig{'real_os_type'}
$gconfig{'real_os_type'} $gconfig{'real_os_version'}
$text{'right_usermin'}",&get_webmin_version(),"
$text{'right_time'}$tm
$text{'right_uquota'}",&text('right_out', - &nice_size($usage*$bsize), - &nice_size($quota*$bsize)),"
",&bar_chart($quota, $usage, 1), - "
\n"; + print &ui_table_end(); } print "\n";