config/file: show single files

This commit is contained in:
Thomas Gelf 2015-12-17 10:54:38 +01:00
parent a93bcee68a
commit b73806d69c
3 changed files with 18 additions and 1 deletions

View File

@ -59,6 +59,18 @@ class ConfigController extends ActionController
$this->render('objects/table', null, true);
}
// Show a single file
public function fileAction()
{
$this->view->config = IcingaConfig::load(Util::hex2binary($this->params->get('config_checksum')), $this->db());
$filename = $this->view->filename = $this->params->get('file_path');
$this->view->title = sprintf(
$this->translate('Config file "%s"'),
$filename
);
$this->view->file = $this->view->config->getFile($filename);
}
public function showAction()
{
$tabs = $this->getTabs();

View File

@ -27,7 +27,7 @@ class GeneratedConfigFileTable extends QuickTable
protected function getActionUrl($row)
{
return $this->url('director/config/file', array('checksum' => $row->checksum));
return $this->url('director/config/file', array('config_checksum' => $row->config_checksum, 'file_path' => $row->file_path));
}
public function getTitles()

View File

@ -105,6 +105,11 @@ class IcingaConfig
return array_keys($this->files);
}
public function getFile($name)
{
return $this->files[$name];
}
public function getMissingFiles($missing)
{
$files = array();