Monitoring/Commands: Add help messages to the reschedule next check form
refs #4524
This commit is contained in:
parent
bcdda6c0c6
commit
48a393894c
|
@ -28,13 +28,13 @@
|
||||||
|
|
||||||
namespace Monitoring\Form\Command;
|
namespace Monitoring\Form\Command;
|
||||||
|
|
||||||
use \DateTime;
|
|
||||||
use \Zend_Form_Element_Checkbox;
|
use \Zend_Form_Element_Checkbox;
|
||||||
use \Icinga\Web\Form\Element\DateTimePicker;
|
use \Icinga\Web\Form\Element\DateTimePicker;
|
||||||
use \Icinga\Util\DateTimeFactory;
|
use \Icinga\Util\DateTimeFactory;
|
||||||
|
use \Icinga\Web\Form\Element\Note;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Form for RescheduleNextCheck
|
* Form for scheduling checks
|
||||||
*/
|
*/
|
||||||
class RescheduleNextCheckForm extends WithChildrenCommandForm
|
class RescheduleNextCheckForm extends WithChildrenCommandForm
|
||||||
{
|
{
|
||||||
|
@ -43,33 +43,66 @@ class RescheduleNextCheckForm extends WithChildrenCommandForm
|
||||||
*/
|
*/
|
||||||
protected function create()
|
protected function create()
|
||||||
{
|
{
|
||||||
$now = DateTimeFactory::create();
|
$this->addElement(
|
||||||
$dateElement = new DateTimePicker(
|
new Note(
|
||||||
|
array(
|
||||||
|
'name' => 'commanddescription',
|
||||||
|
'value' => t(
|
||||||
|
'This command is used to schedule the next check of hosts/services. Icinga will re-queue the '
|
||||||
|
. 'check at the time you specify.'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->addElement(
|
||||||
|
new DateTimePicker(
|
||||||
array(
|
array(
|
||||||
'name' => 'checktime',
|
'name' => 'checktime',
|
||||||
'label' => t('Check time'),
|
'label' => t('Check Time'),
|
||||||
'value' => $now->getTimestamp()
|
'value' => DateTimeFactory::create()->getTimestamp()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$this->addElement(
|
||||||
|
new Note(
|
||||||
|
array(
|
||||||
|
'name' => 'checktimenote',
|
||||||
|
'value' => t('Set the date/time when this check should be executed.')
|
||||||
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$this->addElement($dateElement);
|
|
||||||
|
|
||||||
$checkBox = new Zend_Form_Element_Checkbox(
|
$this->addElement(
|
||||||
|
new Zend_Form_Element_Checkbox(
|
||||||
array(
|
array(
|
||||||
'name' => 'forcecheck',
|
'name' => 'forcecheck',
|
||||||
'label' => t('Force check'),
|
'label' => t('Force Check'),
|
||||||
'value' => true
|
'value' => true
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$this->addElement(
|
||||||
|
new Note(
|
||||||
|
array(
|
||||||
|
'name' => 'forcechecknote',
|
||||||
|
'value' => t(
|
||||||
|
'If you select this option, Icinga will force a check regardless of both what time the '
|
||||||
|
. 'scheduled check occurs and whether or not checks are enabled.'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->addElement($checkBox);
|
// TODO: As of the time of writing it's possible to set hosts AND services as affected by this command but
|
||||||
|
// with children only makes sense on hosts
|
||||||
if ($this->getWithChildren() === true) {
|
if ($this->getWithChildren() === true) {
|
||||||
$this->addNote(t('Reschedule next check for this host and its services.'));
|
$this->addNote(t('TODO: Help message when with children is enabled'));
|
||||||
} else {
|
} else {
|
||||||
$this->addNote(t('Reschedule next check for this object.'));
|
$this->addNote(t('TODO: Help message when with children is disabled'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->setSubmitLabel(t('Reschedule check'));
|
$this->setSubmitLabel(t('Reschedule Check'));
|
||||||
|
|
||||||
parent::create();
|
parent::create();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue