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(
$this->translate('Create a new %s inheriting from this one'),
[Link::create(
$this->translate('Template'),
"director/$type/add",
['imports' => $templateName, 'type' => 'template']
)
]
$this->translate('Template'),
"director/$type/add",
['imports' => $templateName, 'type' => 'template']
)]
));
}
if ($template->supportsApplyRules()) {

View File

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

View File

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

View File

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