[icinga-checkins] icinga.org: icingaweb2-module-director/feature/job-scheduling-11627: DeploymentLogTable: show short config checksum

git at icinga.org git at icinga.org
Tue May 10 21:32:33 CEST 2016


Module: icingaweb2-module-director
Branch: feature/job-scheduling-11627
Commit: 45f9d33843f4d9d104b861d71a9c0edb5bebe401
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=45f9d33843f4d9d104b861d71a9c0edb5bebe401

Author: Thomas Gelf <thomas at gelf.net>
Date:   Tue May 10 21:32:14 2016 +0200

DeploymentLogTable: show short config checksum

---

 application/tables/DeploymentLogTable.php |   15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/application/tables/DeploymentLogTable.php b/application/tables/DeploymentLogTable.php
index 1f56715..79375ad 100644
--- a/application/tables/DeploymentLogTable.php
+++ b/application/tables/DeploymentLogTable.php
@@ -45,22 +45,29 @@ class DeploymentLogTable extends QuickTable
 
     public function getColumns()
     {
+        $db = $this->connection();
+
         $columns = array(
             'id'                => 'l.id',
             'peer_identity'     => 'l.peer_identity',
+            'identifier'        => "l.peer_identity || ' (' || SUBSTRING(",
             'start_time'        => 'l.start_time',
             'stage_collected'   => 'l.stage_collected',
             'dump_succeeded'    => 'l.dump_succeeded',
             'stage_name'        => 'l.stage_name',
             'startup_succeeded' => 'l.startup_succeeded',
-            'checksum'          => 'LOWER(HEX(c.checksum))',
+            'checksum'          => $db->dbHexFunc('c.checksum'),
             'duration'          => "l.duration_dump || 'ms'",
         );
 
         if ($this->connection->isPgsql()) {
-            $columns['checksum'] = "LOWER(ENCODE(c.checksum, 'hex'))";
+            $columns['identifier'] .= $columns['checksum'] . ' FROM 1 FOR 7)';
+        } else {
+            $columns['identifier'] .= $columns['checksum'] . ', 1, 7)';
         }
 
+        $columns['identifier'] .= " || ')'";
+
         return $columns;
     }
 
@@ -73,8 +80,8 @@ class DeploymentLogTable extends QuickTable
     {
         $view = $this->view();
         return array(
-            'peer_identity'     => $view->translate('Icinga Node'),
-            'start_time'        => $view->translate('Time'),
+            'identifier' => $view->translate('Icinga Node'),
+            'start_time' => $view->translate('Time'),
         );
     }
 



More information about the icinga-checkins mailing list