mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
Importsource/Syncrule: unify links
This commit is contained in:
parent
7f0ffb1691
commit
62a16bd259
@ -58,7 +58,10 @@ class ImportsourceController extends ActionController
|
|||||||
'type' => 'ImportSource',
|
'type' => 'ImportSource',
|
||||||
'names' => $source->getUniqueIdentifier()
|
'names' => $source->getUniqueIdentifier()
|
||||||
],
|
],
|
||||||
['class' => 'icon-tag']
|
[
|
||||||
|
'class' => 'icon-tag',
|
||||||
|
'data-base-target' => '_next'
|
||||||
|
]
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ use Icinga\Module\Director\Forms\SyncCheckForm;
|
|||||||
use Icinga\Module\Director\Forms\SyncPropertyForm;
|
use Icinga\Module\Director\Forms\SyncPropertyForm;
|
||||||
use Icinga\Module\Director\Forms\SyncRuleForm;
|
use Icinga\Module\Director\Forms\SyncRuleForm;
|
||||||
use Icinga\Module\Director\Forms\SyncRunForm;
|
use Icinga\Module\Director\Forms\SyncRunForm;
|
||||||
|
use Icinga\Module\Director\Web\ActionBar\AutomationObjectActionBar;
|
||||||
use Icinga\Module\Director\Web\Controller\ActionController;
|
use Icinga\Module\Director\Web\Controller\ActionController;
|
||||||
use Icinga\Module\Director\Objects\SyncRule;
|
use Icinga\Module\Director\Objects\SyncRule;
|
||||||
use Icinga\Module\Director\Objects\SyncRun;
|
use Icinga\Module\Director\Objects\SyncRun;
|
||||||
@ -45,16 +46,7 @@ class SyncruleController extends ActionController
|
|||||||
$this->addPropertyHint($rule);
|
$this->addPropertyHint($rule);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$this->actions()->add(Link::create(
|
$this->addMainActions();
|
||||||
$this->translate('Add to Basket'),
|
|
||||||
'director/basket/add',
|
|
||||||
[
|
|
||||||
'type' => 'SyncRule',
|
|
||||||
'names' => $rule->getUniqueIdentifier()
|
|
||||||
],
|
|
||||||
['class' => 'icon-tag']
|
|
||||||
));
|
|
||||||
|
|
||||||
if (! $run) {
|
if (! $run) {
|
||||||
$this->warning($this->translate('This Sync Rule has never been run before.'));
|
$this->warning($this->translate('This Sync Rule has never been run before.'));
|
||||||
}
|
}
|
||||||
@ -160,23 +152,7 @@ class SyncruleController extends ActionController
|
|||||||
$this->translate('Sync rule: %s'),
|
$this->translate('Sync rule: %s'),
|
||||||
$rule->rule_name
|
$rule->rule_name
|
||||||
));
|
));
|
||||||
$this->actions()->add(
|
$this->addMainActions();
|
||||||
Link::create(
|
|
||||||
$this->translate('Clone'),
|
|
||||||
'director/syncrule/clone',
|
|
||||||
['id' => $id],
|
|
||||||
['class' => 'icon-paste']
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$this->actions()->add(Link::create(
|
|
||||||
$this->translate('Add to Basket'),
|
|
||||||
'director/basket/add',
|
|
||||||
[
|
|
||||||
'type' => 'SyncRule',
|
|
||||||
'names' => $rule->getUniqueIdentifier()
|
|
||||||
],
|
|
||||||
['class' => 'icon-tag']
|
|
||||||
));
|
|
||||||
|
|
||||||
if (! $rule->hasSyncProperties()) {
|
if (! $rule->hasSyncProperties()) {
|
||||||
$this->addPropertyHint($rule);
|
$this->addPropertyHint($rule);
|
||||||
@ -308,6 +284,27 @@ class SyncruleController extends ActionController
|
|||||||
SyncRunTable::create($rule)->renderTo($this);
|
SyncRunTable::create($rule)->renderTo($this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function addMainActions()
|
||||||
|
{
|
||||||
|
$this->actions(new AutomationObjectActionBar(
|
||||||
|
$this->getRequest()
|
||||||
|
));
|
||||||
|
$source = $this->requireSyncRule();
|
||||||
|
|
||||||
|
$this->actions()->add(Link::create(
|
||||||
|
$this->translate('Add to Basket'),
|
||||||
|
'director/basket/add',
|
||||||
|
[
|
||||||
|
'type' => 'SyncRule',
|
||||||
|
'names' => $source->getUniqueIdentifier()
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'class' => 'icon-tag',
|
||||||
|
'data-base-target' => '_next',
|
||||||
|
]
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $key
|
* @param string $key
|
||||||
* @return SyncRule
|
* @return SyncRule
|
||||||
|
Loading…
x
Reference in New Issue
Block a user