[freeside-commits] branch master updated. ce71ca0fc6ca933af93c76c2f8e5f764e304b3a0

Ivan ivan at 420.am
Fri Oct 7 07:19:03 PDT 2016


The branch, master has been updated
       via  ce71ca0fc6ca933af93c76c2f8e5f764e304b3a0 (commit)
      from  c42bf39feed32a9d0ca83944284463a148dbfed6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ce71ca0fc6ca933af93c76c2f8e5f764e304b3a0
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri Oct 7 07:19:02 2016 -0700

    show DB size

diff --git a/httemplate/view/Status.html b/httemplate/view/Status.html
index eb7df68..7fd019e 100644
--- a/httemplate/view/Status.html
+++ b/httemplate/view/Status.html
@@ -25,14 +25,23 @@ 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(datname))
+      FROM pg_catalog.pg_database
+     WHERE datname = 'freeside'
+  ));
+}
+
 tie my %status, 'Tie::IxHash',
   'Basics' => [
     { 'title' => 'Freeside version',
@@ -50,6 +59,9 @@ tie my %status, 'Tie::IxHash',
     { 'title' => 'Database version',
       'value' => $db_ver,
     },
+    { 'title' => 'Database size',
+      'value' => $db_size,
+    },
   ],
   'Required Daemons' => [
     { 'title' => 'Queue daemon',

-----------------------------------------------------------------------

Summary of changes:
 httemplate/view/Status.html |   16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list