mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-25 23:04:53 +02:00
DataTypeSqlQuery: set textarea rows, use Util::*
This commit is contained in:
parent
fa9a6eeabb
commit
ceb22f830d
@ -2,9 +2,10 @@
|
|||||||
|
|
||||||
namespace Icinga\Module\Director\DataType;
|
namespace Icinga\Module\Director\DataType;
|
||||||
|
|
||||||
|
use Icinga\Data\Db\DbConnection;
|
||||||
use Icinga\Module\Director\Web\Form\QuickForm;
|
use Icinga\Module\Director\Web\Form\QuickForm;
|
||||||
use Icinga\Module\Director\Web\Hook\DataTypeHook;
|
use Icinga\Module\Director\Web\Hook\DataTypeHook;
|
||||||
use Icinga\Data\Db\DbConnection;
|
use Icinga\Module\Director\Util;
|
||||||
|
|
||||||
class DataTypeSqlQuery extends DataTypeHook
|
class DataTypeSqlQuery extends DataTypeHook
|
||||||
{
|
{
|
||||||
@ -36,17 +37,13 @@ class DataTypeSqlQuery extends DataTypeHook
|
|||||||
|
|
||||||
public static function addSettingsFormFields(QuickForm $form)
|
public static function addSettingsFormFields(QuickForm $form)
|
||||||
{
|
{
|
||||||
$db = $form->getDb();
|
Util::addDbResourceFormElement($form, 'resource');
|
||||||
|
|
||||||
$form->addElement('text', 'resource', array(
|
|
||||||
'label' => 'Resource name',
|
|
||||||
'required' => true,
|
|
||||||
));
|
|
||||||
|
|
||||||
$form->addElement('textarea', 'query', array(
|
$form->addElement('textarea', 'query', array(
|
||||||
'label' => 'DB Query',
|
'label' => 'DB Query',
|
||||||
'description' => 'This query should return exactly two columns, value and label',
|
'description' => 'This query should return exactly two columns, value and label',
|
||||||
'required' => true,
|
'required' => true,
|
||||||
|
'rows' => 10,
|
||||||
));
|
));
|
||||||
|
|
||||||
return $form;
|
return $form;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user