X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2FStatus.html;h=7fb9d0be573be9f8329638206d69116df37dea21;hb=49d9ea969069430ef3fe23e5b1ac3599e929bb04;hp=f1060874c0cbf55aadbcf695c0edf78966af9e1a;hpb=8f424b802b3f3c390df497fb67a8c6eb725ab670;p=freeside.git diff --git a/httemplate/view/Status.html b/httemplate/view/Status.html index f1060874c..7fb9d0be5 100644 --- a/httemplate/view/Status.html +++ b/httemplate/view/Status.html @@ -25,14 +25,21 @@ if ( ! $@ && $os =~ /^\s*Description:\s*(.+)$/ ) { ( my $perl_ver = $^V ) =~ s/^v//; my $db = driver_name; -$db = 'PostgreSQL' if $db =~ /^Pg/; -$db = 'MySQL' if $db =~ /^mysql/; +$db = 'PostgreSQL' if $db =~ /^Pg/; +$db = 'MySQL/MariaDB' if $db =~ /^mysql/; my $db_ver = FS::Record->scalar_sql('SELECT VERSION()'); if ( $db eq 'PostgreSQL' && $db_ver =~ /^\s*PostgreSQL\s+([\w\.]+)\s+on\s+/ ) { $db_ver = $1; } +my $db_size = 'Unknown'; +if ( $db eq 'PostgreSQL' ) { + $db_size = FS::Record->scalar_sql(qq( + SELECT pg_size_pretty(pg_database_size('freeside')) + )); +} + tie my %status, 'Tie::IxHash', 'Basics' => [ { 'title' => 'Freeside version', @@ -50,6 +57,9 @@ tie my %status, 'Tie::IxHash', { 'title' => 'Database version', 'value' => $db_ver, }, + { 'title' => 'Database size', + 'value' => $db_size, + }, ], 'Required Daemons' => [ { 'title' => 'Queue daemon', @@ -93,7 +103,7 @@ if ( $db eq 'PostgreSQL' ) { && FS::Record->scalar_sql('SHOW archive_mode') eq 'on'; my $slave = - FS::Record->scalar_sql('SHOW archive_command') =~ / postgres\@([\w\.\-]): / + FS::Record->scalar_sql('SHOW archive_command') =~ / postgres\@([\w\.\-]+): / ? $1 : ''; $status{'Replication'} = [