Various: cosmetics, hints, more links

This commit is contained in:
Thomas Gelf 2017-07-28 23:07:48 +02:00
parent 99ab56e6f9
commit 5ca7740285
4 changed files with 24 additions and 11 deletions

View File

@ -135,11 +135,10 @@ abstract class TemplateController extends CompatController
$list->addItem(new FormattedString( $list->addItem(new FormattedString(
$this->translate('Create a new %s inheriting from this one'), $this->translate('Create a new %s inheriting from this one'),
[Link::create( [Link::create(
$this->translate('Template'), $this->translate('Template'),
"director/$type/add", "director/$type/add",
['imports' => $templateName, 'type' => 'template'] ['imports' => $templateName, 'type' => 'template']
) )]
]
)); ));
} }
if ($template->supportsApplyRules()) { if ($template->supportsApplyRules()) {

View File

@ -5,6 +5,7 @@ namespace Icinga\Module\Director\Web\Table;
use Icinga\Authentication\Auth; use Icinga\Authentication\Auth;
use Icinga\Data\Filter\Filter; use Icinga\Data\Filter\Filter;
use Icinga\Exception\IcingaException; use Icinga\Exception\IcingaException;
use Icinga\Module\Director\Db;
use Icinga\Module\Director\Db\IcingaObjectFilterHelper; use Icinga\Module\Director\Db\IcingaObjectFilterHelper;
use Icinga\Module\Director\IcingaConfig\AssignRenderer; use Icinga\Module\Director\IcingaConfig\AssignRenderer;
use Icinga\Module\Director\Objects\IcingaObject; use Icinga\Module\Director\Objects\IcingaObject;
@ -24,6 +25,13 @@ class ApplyRulesTable extends ZfQueryBasedTable
private $type; private $type;
public static function create($type, Db $db)
{
$table = new static($db);
$table->setType($type);
return $table;
}
public function setType($type) public function setType($type)
{ {
$this->type = $type; $this->type = $type;

View File

@ -68,6 +68,7 @@ class ObjectsTableEndpoint extends ObjectsTable
public function prepareQuery() public function prepareQuery()
{ {
if ($this->deploymentEndpoint === null) { if ($this->deploymentEndpoint === null) {
/** @var \Icinga\Module\Director\Db $c */
$c = $this->connection(); $c = $this->connection();
if ($c->hasDeploymentEndpoint()) { if ($c->hasDeploymentEndpoint()) {
$this->deploymentEndpoint = $c->getDeploymentEndpointName(); $this->deploymentEndpoint = $c->getDeploymentEndpointName();

View File

@ -55,12 +55,17 @@ class TemplatesTable extends ZfQueryBasedTable
'name' => $name 'name' => $name
]); ]);
return $this::tr([ return $this::row([
$this::td(new Link($caption, $url)), new Link($caption, $url),
$this::td(new Link(new Icon('plus'), "director/$type/add", [ [
'type' => 'object', new Link(new Icon('plus'), "director/$type/add", [
'imports' => $name 'type' => 'object',
])) 'imports' => $name
]),
new Link(new Icon('history'), "director/$type/history", [
'name' => $name
])
]
]); ]);
} }