[icinga-checkins] icinga.org: icingaweb2-module-director/master: index: show pending changes

git at icinga.org git at icinga.org
Thu Feb 18 02:10:55 CET 2016


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

Author: Thomas Gelf <thomas at gelf.net>
Date:   Thu Feb 18 02:10:40 2016 +0100

index: show pending changes

---

 application/controllers/IndexController.php |    1 +
 application/views/scripts/index/index.phtml |   11 +++++++----
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/application/controllers/IndexController.php b/application/controllers/IndexController.php
index 5350aa7..5561e23 100644
--- a/application/controllers/IndexController.php
+++ b/application/controllers/IndexController.php
@@ -31,6 +31,7 @@ class IndexController extends ActionController
 
         $this->addGlobalTypeTabs();
         $this->view->stats = $this->db()->getObjectSummary();
+        $this->view->undeployedActivities = $this->db()->countActivitiesSinceLastDeployedConfig();
         if ((int) $this->view->stats['apiuser']->cnt_total === 0) {
             $this->view->form = $this->loadForm('kickstart')->setDb($this->db)->handleRequest();
         }
diff --git a/application/views/scripts/index/index.phtml b/application/views/scripts/index/index.phtml
index 38f3793..9fb731a 100644
--- a/application/views/scripts/index/index.phtml
+++ b/application/views/scripts/index/index.phtml
@@ -69,10 +69,13 @@ function statSummary($self, $type) {
     return $msg . ', ' . implode(', ', $extra);
 }
 
-function renderActions($title, $actions) {
-
+function pendingDeployments($self) {
+    if ($self->undeployedActivities === 0) return '';
+    return '. <span class="error">' . sprintf(
+        $self->translate('A total of %d config changes happened since your last deployed config has been rendered'),
+        $self->undeployedActivities
+    ) . '</span>';
 }
-
 if ($this->stats && (int) $this->stats['apiuser']->cnt_total === 0) {
     echo $this->form . "</div>\n";
     return;
@@ -90,7 +93,7 @@ $all = array(
         array('chat',     $this->translate('Notifications'), '#', $this->translate('Schedule your notifications')),
     ),
     $this->translate('Deploy configuration to your Icinga nodes') => array(
-        array('wrench',   $this->translate('Deployment'), 'director/list/deploymentlog', $this->translate('Manage deployments, access audit log and history')),
+        array('wrench',   $this->translate('Deployment'), 'director/list/deploymentlog', $this->translate('Manage deployments, access audit log and history') . pendingDeployments($this)),
         array('globe',    $this->translate('Zones'), 'director/zones', statSummary($this, 'zone')),
         array('cloud',    $this->translate('Endpoints'), 'director/endpoints', statSummary($this, 'endpoint')),
         array('lock-open-alt', $this->translate('Api users'), 'director/apiusers', statSummary($this, 'apiuser')),



More information about the icinga-checkins mailing list