mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
ConfigJob: replace housekeeping-related code
This commit is contained in:
parent
deea18f8df
commit
c65c8a72c7
@ -10,35 +10,41 @@ use Icinga\Module\Director\Util;
|
|||||||
|
|
||||||
class ConfigJob extends JobHook
|
class ConfigJob extends JobHook
|
||||||
{
|
{
|
||||||
protected $housekeeping;
|
|
||||||
|
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
$this->housekeeping()->runAllTasks();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function addSettingsFormFields(QuickForm $form)
|
||||||
|
{
|
||||||
|
$form->addElement('select', 'deploy_when_changed', array(
|
||||||
|
'label' => $form->translate('Deploy modified config'),
|
||||||
|
'description' => $form->translate(
|
||||||
|
'This allows you to immediately deploy a modified configuration'
|
||||||
|
),
|
||||||
|
'value' => 'n',
|
||||||
|
'multiOptions' => array(
|
||||||
|
'y' => $form->translate('Yes'),
|
||||||
|
'n' => $form->translate('No'),
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
|
return $form;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function isPending()
|
public function isPending()
|
||||||
{
|
{
|
||||||
return $this->housekeeping()->hasPendingTasks();
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getDescription(QuickForm $form)
|
public static function getDescription(QuickForm $form)
|
||||||
{
|
{
|
||||||
return $form->translate(
|
return $form->translate(
|
||||||
'The Housekeeping job provides various task that keep your Director'
|
'The Config job allows you to generate and eventually deploy your'
|
||||||
. ' database fast and clean'
|
. 'Icinga 2 configuration'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function housekeeping()
|
|
||||||
{
|
|
||||||
if ($this->housekeeping === null) {
|
|
||||||
$this->housekeeping = new Housekeeping($this->db());
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->housekeeping;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Re-render the current configuration
|
* Re-render the current configuration
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user