From 4decf62f0ff1b22b6a8e64c4b9be560e6dc2cf25 Mon Sep 17 00:00:00 2001 From: Will Budic Date: Tue, 25 Feb 2020 11:12:37 +1100 Subject: [PATCH] Fixed theme and layout. --- htdocs/cgi-bin/stats.cgi | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/htdocs/cgi-bin/stats.cgi b/htdocs/cgi-bin/stats.cgi index b8c24cc..46ce769 100755 --- a/htdocs/cgi-bin/stats.cgi +++ b/htdocs/cgi-bin/stats.cgi @@ -20,7 +20,6 @@ use lib "system/modules"; use lib $ENV{'PWD'}.'/htdocs/cgi-bin/system/modules'; require Settings; - my $cgi = CGI->new; my $session = new CGI::Session("driver:File",$cgi, {Directory=>&Settings::logPath}); my $sid=$session->id(); @@ -45,11 +44,11 @@ try{ my $database = &Settings::logPath . $dbname; my @stat = stat $database; -my $dsn = "DBI:SQLite:dbname=$database"; -$db = DBI->connect( $dsn, $userid, $password, { RaiseError => 1 } ); +my $dsn = "DBI:SQLite:dbname=$database"; +$db = DBI->connect( $dsn, $userid, $password, { RaiseError => 1 } ); Settings::getConfiguration($db); - +Settings::getTheme(); my $today = DateTime->now; $today->set_time_zone(&Settings::timezone); @@ -100,13 +99,13 @@ run \@cmd, '>&', \$HS; #instead of -> system("inxi",'-b', '-c0'); my $hardware_status = $HS;#`inxi -b -c0; uptime -p`; my $syslog = "".substr $HS, index($HS, 'Host:'), index($HS, 'Console:'); $syslog .= "\n".substr $HS, rindex($HS, 'Info:'); - $HS = "
".`df -h -l -x tmpfs`."
"; + $HS = "
\n".`df -h -l -x tmpfs`."
"; $syslog .= $HS; $hardware_status =~ s/\n//g; $hardware_status =~ s/Memory:/Memory:/g; $hardware_status =~ s/Init:/<\/b>Initial:/g; $hardware_status =~ s/up\s/Server is up: /g; -$hardware_status .= "

$HS

"; +$hardware_status .= qq(
$HS
); my $prc = 'ps -eo size,pid,user,command --sort -size | awk \'{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }\''; my $processes = `$prc | sort -u -r -`; -- 2.34.1