Procházet zdrojové kódy

Update Admin\Statistics page

Visman před 3 roky
rodič
revize
4b469dbf05

+ 2 - 1
app/Core/DB/Mysql.php

@@ -553,7 +553,8 @@ class Mysql
         }
 
         return [
-            'db'      => 'MySQL (PDO) v.' . $this->db->getAttribute(PDO::ATTR_SERVER_VERSION) . ' : ' . implode(', ', $tmp),
+            'db'      => 'MySQL (PDO) v.' . $this->db->getAttribute(PDO::ATTR_SERVER_VERSION),
+            'tables'  => implode(', ', $tmp),
             'records' => $records,
             'size'    => $size,
             'server info' => $this->db->getAttribute(PDO::ATTR_SERVER_INFO),

+ 2 - 1
app/Core/DB/Pgsql.php

@@ -494,7 +494,8 @@ class Pgsql
         $other['pg_database_size'] = $this->db->query('SELECT pg_size_pretty(pg_database_size(current_database()))')->fetchColumn();
 
         return [
-            'db'          => 'PostgreSQL (PDO) v.' . $this->db->getAttribute(PDO::ATTR_SERVER_VERSION) . " : ({$tables})",
+            'db'          => 'PostgreSQL (PDO) v.' . $this->db->getAttribute(PDO::ATTR_SERVER_VERSION),
+            'tables'      => (string) $tables,
             'records'     => $records,
             'size'        => $size,
             'server info' => $this->db->getAttribute(PDO::ATTR_SERVER_INFO),

+ 2 - 1
app/Models/Pages/Admin/Statistics.php

@@ -155,7 +155,8 @@ class Statistics extends Admin
         $this->dbVersion = $stat['db'];
         $this->tSize     = $stat['size'];
         $this->tRecords  = $stat['records'];
-        unset($stat['db'], $stat['size'], $stat['records']);
+        $this->tTables   = $stat['tables'];
+        unset($stat['db'], $stat['size'], $stat['records'], $stat['tables']);
         $this->tOther    = $stat;
 
         // Check for the existence of various PHP opcode caches/optimizers

+ 3 - 0
app/lang/en/admin_index.po

@@ -99,6 +99,9 @@ msgstr "Accelerator:"
 msgid "Database label"
 msgstr "Database"
 
+msgid "Database data tables"
+msgstr "Tables: %s"
+
 msgid "Database data rows"
 msgstr "Rows: %s"
 

+ 3 - 0
app/lang/ru/admin_index.po

@@ -99,6 +99,9 @@ msgstr "Акселератор:"
 msgid "Database label"
 msgstr "База данных"
 
+msgid "Database data tables"
+msgstr "Таблиц: %s"
+
 msgid "Database data rows"
 msgstr "Строк: %s"
 

+ 1 - 2
app/templates/admin/statistics.forkbb.php

@@ -24,10 +24,9 @@
               <dt>{!! __('Database label') !!}</dt>
               <dd>
                 {{ $p->dbVersion }}
-    @if ($p->tRecords && $p->tSize)
+                <br>{!! __(['Database data tables', $p->tTables]) !!}
                 <br>{!! __(['Database data rows', num($p->tRecords)]) !!}
                 <br>{!! __(['Database data size', size($p->tSize)]) !!}
-    @endif
     @if ($p->tOther)
                 <br><br>{!! __('Other')!!}
         @foreach ($p->tOther as $key => $value)