[icinga-checkins] icinga.org: icingaweb2-module-director/master: config/files: config details, redeploy link

git at icinga.org git at icinga.org
Fri Feb 5 15:41:21 CET 2016


Module: icingaweb2-module-director
Branch: master
Commit: 72b1f015926e7d80c894416292aee182f8f527c1
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=72b1f015926e7d80c894416292aee182f8f527c1

Author: Thomas Gelf <thomas at gelf.net>
Date:   Fri Feb  5 15:41:02 2016 +0100

config/files: config details, redeploy link

---

 application/controllers/ConfigController.php |    6 +++-
 application/views/scripts/config/files.phtml |   42 ++++++++++++++++++++++++++
 2 files changed, 47 insertions(+), 1 deletion(-)

diff --git a/application/controllers/ConfigController.php b/application/controllers/ConfigController.php
index 371bbf1..c3e40d1 100644
--- a/application/controllers/ConfigController.php
+++ b/application/controllers/ConfigController.php
@@ -49,6 +49,7 @@ class ConfigController extends ActionController
     // Show all files for a given config
     public function filesAction()
     {
+        $this->view->title = $this->translate('Generated config');
         $tabs = $this->getTabs();
 
         if ($deploymentId = $this->params->get('deployment_id')) {
@@ -73,7 +74,10 @@ class ConfigController extends ActionController
             ->setConnection($this->db())
             ->setConfigChecksum($checksum);
 
-        $this->render('objects/table', null, true);
+        $this->view->config = IcingaConfig::load(
+            Util::hex2binary($this->params->get('checksum')),
+            $this->db()
+        );
     }
 
     // Show a single file
diff --git a/application/views/scripts/config/files.phtml b/application/views/scripts/config/files.phtml
new file mode 100644
index 0000000..cddc2d4
--- /dev/null
+++ b/application/views/scripts/config/files.phtml
@@ -0,0 +1,42 @@
+<div class="controls">
+<?= $this->tabs ?>
+<h1><?= $this->escape($this->title) ?></h1>
+<span data-base-target="_next">
+<?= $this->addLink ?>
+</span>
+<?php if (count($table) || ! $this->filterEditor->getFilter()->isEmpty()): ?>
+<?= $this->filterEditor ?>
+<?php endif ?>
+<?= $this->table->getPaginator() ?>
+</div>
+
+<div class="content" data-base-target="_next">
+<table class="name-value-table">
+ <tr>
+  <th><?= $this->translate('Actions') ?></th>
+  <td data-base-target="_main"><?= $this->qlink(
+    $this->translate('Re-deploy now'),
+    'director/config/deploy',
+    array('checksum' => $this->config->getHexChecksum()),
+    array('class' => 'icon-reply-all')
+  ) ?><br /><?= $this->qlink(
+    $this->translate('Last related activity'),
+    'director/show/activitylog',
+    array('checksum' => $this->config->getLastActivityHexChecksum()),
+    array('class' => 'icon-clock', 'data-base-target' => '_next')
+  ) ?></td>
+ </tr>
+ <tr>
+  <th><?= $this->translate('Statistics') ?></th>
+  <td><?= sprintf(
+      $this->translate('%d files rendered in %0.2fs'),
+      count($this->config->getFiles()),
+      $config->getDuration() / 1000
+  ) ?></td>
+ </tr>
+</table>
+
+<?php if (count($table)): ?>
+<?= $this->table->render() ?>
+<?php endif ?>
+</div>



More information about the icinga-checkins mailing list