diff --git a/application/tables/GeneratedConfigFileTable.php b/application/tables/GeneratedConfigFileTable.php index d670bde0..44aa1335 100644 --- a/application/tables/GeneratedConfigFileTable.php +++ b/application/tables/GeneratedConfigFileTable.php @@ -15,6 +15,8 @@ class GeneratedConfigFileTable extends QuickTable 'size' => 'LENGTH(f.content)', 'cnt_object' => 'f.cnt_object', 'cnt_template' => 'f.cnt_template', + 'cnt_apply' => 'f.cnt_apply', + 'cnt_all' => "f.cnt_object || ' / ' || f.cnt_template || ' / ' || f.cnt_apply", 'checksum' => 'LOWER(HEX(f.checksum))', 'config_checksum' => 'LOWER(HEX(cf.config_checksum))', ); @@ -52,8 +54,12 @@ class GeneratedConfigFileTable extends QuickTable $view = $this->view(); return array( 'file_path' => $view->translate('File'), + 'cnt_all' => $view->translate('Object/Tpl/Apply'), + /* 'cnt_object' => $view->translate('Objects'), 'cnt_template' => $view->translate('Templates'), + 'cnt_apply' => $view->translate('Apply rules'), + */ 'size' => $view->translate('Size'), ); } diff --git a/application/views/scripts/deployment/index.phtml b/application/views/scripts/deployment/index.phtml index ab5b1cf9..ff7b0496 100644 --- a/application/views/scripts/deployment/index.phtml +++ b/application/views/scripts/deployment/index.phtml @@ -85,9 +85,10 @@ function colorize($log, $logLink) { 'deployment_id' => $deployment->id ) ) ?>, translate('%d objects, %d templates'), + $this->translate('%d objects, %d templates, %d apply rules'), $config->getObjectCount(), - $config->getTemplateCount() + $config->getTemplateCount(), + $config->getApplyCount() )?>, getSize()) ?> diff --git a/library/Director/IcingaConfig/IcingaConfig.php b/library/Director/IcingaConfig/IcingaConfig.php index c7b48023..549aa71f 100644 --- a/library/Director/IcingaConfig/IcingaConfig.php +++ b/library/Director/IcingaConfig/IcingaConfig.php @@ -111,6 +111,15 @@ class IcingaConfig return $cnt; } + public function getApplyCount() + { + $cnt = 0; + foreach ($this->getFiles() as $file) { + $cnt += $file->getApplyCount(); + } + return $cnt; + } + public function getChecksum() { return $this->checksum; @@ -614,6 +623,7 @@ apply Service for (title => params in host.vars["%s"]) { 'content' => 'f.content', 'cnt_object' => 'f.cnt_object', 'cnt_template' => 'f.cnt_template', + 'cnt_apply' => 'f.cnt_apply', ) )->join( array('f' => 'director_generated_file'), @@ -626,7 +636,8 @@ apply Service for (title => params in host.vars["%s"]) { $this->files[$row->file_path] = $file ->setContent($row->content) ->setObjectCount($row->cnt_object) - ->setTemplateCount($row->cnt_template); + ->setTemplateCount($row->cnt_template) + ->setApplyCount($row->cnt_apply); } return $this; diff --git a/library/Director/IcingaConfig/IcingaConfigFile.php b/library/Director/IcingaConfig/IcingaConfigFile.php index 8a411bcd..0bb12b64 100644 --- a/library/Director/IcingaConfig/IcingaConfigFile.php +++ b/library/Director/IcingaConfig/IcingaConfigFile.php @@ -55,6 +55,11 @@ class IcingaConfigFile return $this->cntTemplate; } + public function getApplyCount() + { + return $this->cntApply; + } + public function getSize() { return strlen($this->content); @@ -72,6 +77,12 @@ class IcingaConfigFile return $this; } + public function setApplyCount($cnt) + { + $this->cntApply = $cnt; + return $this; + } + public function getHexChecksum() { return Util::binary2hex($this->getChecksum());