2014-10-29 10:40:34 -04:00
|
|
|
<?php
|
2016-02-08 09:41:00 -05:00
|
|
|
/* Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */
|
2014-10-29 10:40:34 -04:00
|
|
|
|
2014-11-14 05:17:22 -05:00
|
|
|
namespace Icinga\Module\Monitoring\Forms\Setup;
|
2014-10-29 10:40:34 -04:00
|
|
|
|
|
|
|
|
use Icinga\Web\Form;
|
|
|
|
|
use Icinga\Application\Platform;
|
|
|
|
|
|
|
|
|
|
class BackendPage extends Form
|
|
|
|
|
{
|
|
|
|
|
public function init()
|
|
|
|
|
{
|
|
|
|
|
$this->setName('setup_monitoring_backend');
|
2015-03-02 12:36:04 -05:00
|
|
|
$this->setTitle($this->translate('Monitoring Backend', 'setup.page.title'));
|
|
|
|
|
$this->addDescription($this->translate(
|
|
|
|
|
'Please configure below how Icinga Web 2 should retrieve monitoring information.'
|
|
|
|
|
));
|
2014-10-29 10:40:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function createElements(array $formData)
|
|
|
|
|
{
|
|
|
|
|
$this->addElement(
|
|
|
|
|
'text',
|
|
|
|
|
'name',
|
|
|
|
|
array(
|
|
|
|
|
'required' => true,
|
2014-11-11 06:41:02 -05:00
|
|
|
'value' => 'icinga',
|
2015-01-19 07:47:01 -05:00
|
|
|
'label' => $this->translate('Backend Name'),
|
|
|
|
|
'description' => $this->translate('The identifier of this backend')
|
2014-10-29 10:40:34 -04:00
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
|
2014-11-07 08:47:37 -05:00
|
|
|
$resourceTypes = array();
|
2014-12-01 09:38:10 -05:00
|
|
|
if (Platform::hasMysqlSupport() || Platform::hasPostgresqlSupport()) {
|
2014-10-29 10:40:34 -04:00
|
|
|
$resourceTypes['ido'] = 'IDO';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->addElement(
|
|
|
|
|
'select',
|
|
|
|
|
'type',
|
|
|
|
|
array(
|
|
|
|
|
'required' => true,
|
2015-01-19 07:47:01 -05:00
|
|
|
'label' => $this->translate('Backend Type'),
|
|
|
|
|
'description' => $this->translate(
|
|
|
|
|
'The data source used for retrieving monitoring information'
|
|
|
|
|
),
|
2014-10-29 10:40:34 -04:00
|
|
|
'multiOptions' => $resourceTypes
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|