From 2db507e5e8a8d4249b9199f9d0b51538a7d01cdd Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Thu, 31 Aug 2023 22:39:45 -0700 Subject: [PATCH] Use proper UI functions for CPU and RAM modes --- proc/index_cpu.cgi | 19 +++++++++---------- proc/index_size.cgi | 21 ++++++++++++--------- proc/lang/en | 9 +++++---- 3 files changed, 26 insertions(+), 23 deletions(-) diff --git a/proc/index_cpu.cgi b/proc/index_cpu.cgi index a565dd352..84ea2d4f5 100755 --- a/proc/index_cpu.cgi +++ b/proc/index_cpu.cgi @@ -10,23 +10,22 @@ if (defined(&get_cpu_info)) { print "\n"; @c = &get_cpu_info(); if (@c) { - print "\n"; - print "\n"; + print &ui_table_start(undef, undef, 2); + print &ui_table_row($text{'index_loadname'}, + &text('index_loadnums', + "$c[0]", "$c[1]", "$c[2]")); if (@c >= 5) { - print "\n"; - print "\n"; + print &ui_table_row($text{'index_cpuname'}, $cpu); } + print &ui_table_end(),"

\n"; } - print "

$text{'index_loadname'}",&text('index_loadnums', - "$c[0]", "$c[1]", "$c[2]"), - "
$text{'index_cpuname'}$c[4]\n"; + my $cpu = $c[4]."\n"; if ($c[4] !~ /Hz/) { - print "($c[3] MHz)\n"; + $cpu .= "($c[3] MHz)\n"; } if ($c[7]) { - print ", $c[7] cores\n"; + $cpu .= ", $c[7] cores\n"; } - print "

\n"; } print &ui_columns_start([ $text{'pid'}, $text{'owner'}, diff --git a/proc/index_size.cgi b/proc/index_size.cgi index f31a90ee6..4de27d1a2 100755 --- a/proc/index_size.cgi +++ b/proc/index_size.cgi @@ -9,17 +9,20 @@ if (defined(&get_memory_info)) { @m = &get_memory_info(); if (@m) { $msg = $m[4] ? 'index_mem3' : 'index_mem2'; - print "

"; - print &text($msg, &nice_size($m[0]*1024), - &nice_size($m[1]*1024), - &nice_size($m[4]*1024)),"\n"; + print &ui_table_start(undef, undef, 2); + print &ui_table_row($text{'index_memreal'}, + &text($m[4] ? 'index_memtfc' : 'index_memtf', + &nice_size($m[0]*1024), + &nice_size($m[1]*1024), + &nice_size($m[4]*1024))); if ($m[5]) { - print "  ", - &text('index_burst', &nice_size($m[5]*1024)); + print &ui_table_row($text{'index_memburst'}, + &nice_size($m[5]*1024)); } - print "  ", - &text('index_swap2', &nice_size($m[2]*1024), - &nice_size($m[3]*1024)),"

\n"; + print &ui_table_row($text{'index_memswap'}, + &text('index_memtf', &nice_size($m[2]*1024), + &nice_size($m[3]*1024))); + print &ui_table_end(),"

\n"; } } print &ui_columns_start([ diff --git a/proc/lang/en b/proc/lang/en index 47e5cd977..43ca4c26f 100644 --- a/proc/lang/en +++ b/proc/lang/en @@ -8,10 +8,11 @@ index_search=Search index_zone=Zone index_run=Run.. index_return=process list -index_mem2=Real memory: $1 total / $2 free -index_mem3=Real memory: $1 total / $2 free / $3 cached -index_swap2=Swap space: $1 total / $2 free -index_burst=Burstable memory: $1 total +index_memreal=Real memory: +index_memswap=Swap space: +index_memburst=Burstable memory: +index_memtf=$1 total / $2 free +index_memtfc=$1 total / $2 free / $3 cached index_loadname=CPU load averages: index_loadnums=$1 (1 mins) , $2 (5 mins) , $3 (15 mins) index_cpuname=CPU type: