mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-23 13:54:27 +02:00
Add imports support for Command
This commit is contained in:
parent
c7f7d37523
commit
cdb66b648a
@ -50,5 +50,10 @@ class IcingaCommandForm extends DirectorObjectForm
|
|||||||
'template' => $this->translate('Command template'),
|
'template' => $this->translate('Command template'),
|
||||||
))
|
))
|
||||||
));
|
));
|
||||||
|
|
||||||
|
$this->addElement('text', 'imports', array(
|
||||||
|
'label' => $this->translate('Imports'),
|
||||||
|
'description' => $this->translate('The inherited command template names')
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,8 @@ class IcingaCommand extends IcingaObject
|
|||||||
|
|
||||||
protected $supportsCustomVars = true;
|
protected $supportsCustomVars = true;
|
||||||
|
|
||||||
|
protected $supportsImports = true;
|
||||||
|
|
||||||
protected function renderMethods_execute()
|
protected function renderMethods_execute()
|
||||||
{
|
{
|
||||||
// Execute is a reserved word in SQL, column name was prefixed
|
// Execute is a reserved word in SQL, column name was prefixed
|
||||||
|
17
schema/mysql-changes/upgrade_17.sql
Normal file
17
schema/mysql-changes/upgrade_17.sql
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
CREATE TABLE icinga_command_inheritance (
|
||||||
|
command_id INT(10) UNSIGNED NOT NULL,
|
||||||
|
parent_command_id INT(10) UNSIGNED NOT NULL,
|
||||||
|
weight MEDIUMINT UNSIGNED DEFAULT NULL,
|
||||||
|
PRIMARY KEY (command_id, parent_command_id),
|
||||||
|
UNIQUE KEY unique_order (command_id, weight),
|
||||||
|
CONSTRAINT icinga_command_inheritance_command
|
||||||
|
FOREIGN KEY command (command_id)
|
||||||
|
REFERENCES icinga_command (id)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT icinga_command_inheritance_parent_command
|
||||||
|
FOREIGN KEY command (parent_command_id)
|
||||||
|
REFERENCES icinga_command (id)
|
||||||
|
ON DELETE RESTRICT
|
||||||
|
ON UPDATE CASCADE
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
@ -206,6 +206,24 @@ CREATE TABLE icinga_command (
|
|||||||
ON UPDATE CASCADE
|
ON UPDATE CASCADE
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
CREATE TABLE icinga_command_inheritance (
|
||||||
|
command_id INT(10) UNSIGNED NOT NULL,
|
||||||
|
parent_command_id INT(10) UNSIGNED NOT NULL,
|
||||||
|
weight MEDIUMINT UNSIGNED DEFAULT NULL,
|
||||||
|
PRIMARY KEY (command_id, parent_command_id),
|
||||||
|
UNIQUE KEY unique_order (command_id, weight),
|
||||||
|
CONSTRAINT icinga_command_inheritance_command
|
||||||
|
FOREIGN KEY command (command_id)
|
||||||
|
REFERENCES icinga_command (id)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT icinga_command_inheritance_parent_command
|
||||||
|
FOREIGN KEY command (parent_command_id)
|
||||||
|
REFERENCES icinga_command (id)
|
||||||
|
ON DELETE RESTRICT
|
||||||
|
ON UPDATE CASCADE
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
CREATE TABLE icinga_command_argument (
|
CREATE TABLE icinga_command_argument (
|
||||||
id INT(10) UNSIGNED AUTO_INCREMENT NOT NULL,
|
id INT(10) UNSIGNED AUTO_INCREMENT NOT NULL,
|
||||||
command_id INT(10) UNSIGNED NOT NULL,
|
command_id INT(10) UNSIGNED NOT NULL,
|
||||||
|
20
schema/pgsql-changes/upgrade-8.sql
Normal file
20
schema/pgsql-changes/upgrade-8.sql
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
CREATE TABLE icinga_command_inheritance (
|
||||||
|
command_id integer NOT NULL,
|
||||||
|
parent_command_id integer NOT NULL,
|
||||||
|
weight integer DEFAULT NULL,
|
||||||
|
PRIMARY KEY (command_id, parent_command_id),
|
||||||
|
CONSTRAINT icinga_command_inheritance_command
|
||||||
|
FOREIGN KEY (command_id)
|
||||||
|
REFERENCES icinga_command (id)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT icinga_command_inheritance_parent_command
|
||||||
|
FOREIGN KEY (parent_command_id)
|
||||||
|
REFERENCES icinga_command (id)
|
||||||
|
ON DELETE RESTRICT
|
||||||
|
ON UPDATE CASCADE
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE UNIQUE INDEX command_inheritance_unique_order ON icinga_command_inheritance (command_id, weight);
|
||||||
|
CREATE INDEX command_inheritance_command ON icinga_command_inheritance (command_id);
|
||||||
|
CREATE INDEX command_inheritance_command_parent ON icinga_command_inheritance (parent_command_id);
|
@ -263,6 +263,28 @@ CREATE INDEX command_zone ON icinga_command (zone_id);
|
|||||||
COMMENT ON COLUMN icinga_command.object_type IS 'external_object is an attempt to work with existing commands';
|
COMMENT ON COLUMN icinga_command.object_type IS 'external_object is an attempt to work with existing commands';
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE icinga_command_inheritance (
|
||||||
|
command_id integer NOT NULL,
|
||||||
|
parent_command_id integer NOT NULL,
|
||||||
|
weight integer DEFAULT NULL,
|
||||||
|
PRIMARY KEY (command_id, parent_command_id),
|
||||||
|
CONSTRAINT icinga_command_inheritance_command
|
||||||
|
FOREIGN KEY (command_id)
|
||||||
|
REFERENCES icinga_command (id)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT icinga_command_inheritance_parent_command
|
||||||
|
FOREIGN KEY (parent_command_id)
|
||||||
|
REFERENCES icinga_command (id)
|
||||||
|
ON DELETE RESTRICT
|
||||||
|
ON UPDATE CASCADE
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE UNIQUE INDEX command_inheritance_unique_order ON icinga_command_inheritance (command_id, weight);
|
||||||
|
CREATE INDEX command_inheritance_command ON icinga_command_inheritance (command_id);
|
||||||
|
CREATE INDEX command_inheritance_command_parent ON icinga_command_inheritance (parent_command_id);
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE icinga_command_argument (
|
CREATE TABLE icinga_command_argument (
|
||||||
id serial,
|
id serial,
|
||||||
command_id integer NOT NULL,
|
command_id integer NOT NULL,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user