X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fview%2FStatus.html;h=f81c95d8f40a8c065fa49352bc6cc19ba737d117;hp=7fb03eb2f03427daee834f64f2049a515de1ede7;hb=863494143aec94688b67e8dd423977aa8bca1fed;hpb=7f7a4ecece296b4c0ff81732d3cffa4a7951ae37 diff --git a/httemplate/view/Status.html b/httemplate/view/Status.html index 7fb03eb2f..f81c95d8f 100644 --- a/httemplate/view/Status.html +++ b/httemplate/view/Status.html @@ -30,6 +30,14 @@ if ( ! $@ && $os =~ /^\s*Description:\s*(.+)$/ ) { $os = "Debian $deb_version"; } +my $pkg_version = ''; +-e '/usr/bin/dpkg-query' + and run( ['/usr/bin/dpkg-query', + '--showformat=${Version}', '--show', 'freeside' + ], + '>', \$pkg_version + ); + ( my $perl_ver = $^V ) =~ s/^v//; my $db = driver_name; @@ -37,7 +45,7 @@ $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+/ ) { +if ( $db eq 'PostgreSQL' && $db_ver =~ /^\s*PostgreSQL\s+([\w\.]+(\s+\([\w\s\.\+\-\:\~]+\))?)\s+on\s+/ ) { $db_ver = $1; } @@ -58,6 +66,13 @@ tie my %status, 'Tie::IxHash', { 'title' => 'Freeside version', 'value' => $FS::VERSION, }, + ( length($pkg_version) + ? ( { 'title' => 'Package version', + 'value' => $pkg_version, + }, + ) + : () + ), { 'title' => 'Operating System', 'value' => $os, }, @@ -121,7 +136,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'} = [ @@ -141,11 +156,11 @@ if ( $db eq 'PostgreSQL' ) { # http://www.keithf4.com/monitoring_streaming_slave_lag/ # except pg_stat_replication still doesn't fill in the columns we need as # non-Pg user :/ - push @{ $status{'Replication'} }, - { 'title' => 'Slave', - 'value' => $slave || '(Missing, or unparseable archive_command)', - }, - ; + #push @{ $status{'Replication'} }, + # { 'title' => 'Slave', + # 'value' => $slave || '(Missing, or unparseable archive_command)', + # }, + #; } }