WIP: Agent deployment center
This commit is contained in:
parent
58465090b2
commit
47cc0d9d6e
|
@ -10,4 +10,33 @@ ALTER TABLE `treport_content_template` ADD COLUMN `failover_type` tinyint(1) DEF
|
|||
|
||||
ALTER TABLE `tmodule_relationship` ADD COLUMN `type` ENUM('direct', 'failover') DEFAULT 'direct';
|
||||
|
||||
CREATE TABLE `ttask_credentials` (
|
||||
`id_rt` int(10) unsigned NOT NULL,
|
||||
`identifier` varchar(100) NOT NULL,
|
||||
PRIMARY KEY (`id_rt`,`identifier`),
|
||||
KEY `identifier` (`identifier`),
|
||||
FOREIGN KEY (`id_rt`) REFERENCES `trecon_task` (`id_rt`)
|
||||
ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
FOREIGN KEY (`identifier`) REFERENCES `tcredential_store` (`identifier`)
|
||||
ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE `tdeployment_hosts` (
|
||||
`id` SERIAL,
|
||||
`id_cs` VARCHAR(100),
|
||||
`ip` VARCHAR(100) NOT NULL,
|
||||
`id_os` INT(10) UNSIGNED DEFAULT 0,
|
||||
`os_version` VARCHAR(100) DEFAULT '' COMMENT "OS version in STR format",
|
||||
`arch` ENUM('x64', 'x86') DEFAULT 'x64',
|
||||
`current_agent_version` VARCHAR(100) DEFAULT '',
|
||||
`desired_agent_version` VARCHAR(100) DEFAULT '',
|
||||
`deployed` bigint(20) unsigned COMMENT "When it was deployed",
|
||||
`last_err` text,
|
||||
PRIMARY KEY (`id`),
|
||||
FOREIGN KEY (`id_cs`) REFERENCES `tcredential_store` (`identifier`)
|
||||
ON UPDATE CASCADE ON DELETE SET NULL,
|
||||
FOREIGN KEY (`id_os`) REFERENCES tconfig_os(`id_os`)
|
||||
ON UPDATE CASCADE ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
COMMIT;
|
|
@ -2219,3 +2219,38 @@ CREATE TABLE IF NOT EXISTS `tcredential_store` (
|
|||
-- Table `treport_content_sla_combined`
|
||||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE `treport_content_sla_combined` ADD `id_agent_module_failover` int(10) unsigned NOT NULL;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `ttask_credentials`
|
||||
-- ----------------------------------------------------------------------
|
||||
CREATE TABLE `ttask_credentials` (
|
||||
`id_rt` int(10) unsigned NOT NULL,
|
||||
`identifier` varchar(100) NOT NULL,
|
||||
PRIMARY KEY (`id_rt`,`identifier`),
|
||||
KEY `identifier` (`identifier`),
|
||||
FOREIGN KEY (`id_rt`) REFERENCES `trecon_task` (`id_rt`)
|
||||
ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
FOREIGN KEY (`identifier`) REFERENCES `tcredential_store` (`identifier`)
|
||||
ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `tdeployment_hosts`
|
||||
-- ----------------------------------------------------------------------
|
||||
CREATE TABLE `tdeployment_hosts` (
|
||||
`id` SERIAL,
|
||||
`id_cs` VARCHAR(100),
|
||||
`ip` VARCHAR(100) NOT NULL,
|
||||
`id_os` INT(10) UNSIGNED DEFAULT 0,
|
||||
`os_version` VARCHAR(100) DEFAULT '' COMMENT "OS version in STR format",
|
||||
`arch` ENUM('x64', 'x86') DEFAULT 'x64',
|
||||
`current_agent_version` VARCHAR(100) DEFAULT '',
|
||||
`desired_agent_version` VARCHAR(100) DEFAULT '',
|
||||
`deployed` bigint(20) unsigned COMMENT "When it was deployed",
|
||||
`last_err` text,
|
||||
PRIMARY KEY (`id`),
|
||||
FOREIGN KEY (`id_cs`) REFERENCES `tcredential_store` (`identifier`)
|
||||
ON UPDATE CASCADE ON DELETE SET NULL,
|
||||
FOREIGN KEY (`id_os`) REFERENCES tconfig_os(`id_os`)
|
||||
ON UPDATE CASCADE ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
|
|
@ -514,8 +514,10 @@ if (enterprise_installed()) {
|
|||
);
|
||||
$safe_mode_modules = [];
|
||||
$safe_mode_modules[0] = __('Any');
|
||||
foreach ($sql_modules as $m) {
|
||||
$safe_mode_modules[$m['id_module']] = $m['name'];
|
||||
if (is_array($sql_modules)) {
|
||||
foreach ($sql_modules as $m) {
|
||||
$safe_mode_modules[$m['id_module']] = $m['name'];
|
||||
}
|
||||
}
|
||||
|
||||
$table_adv_safe = '<div class="label_select_simple label_simple_items"><p class="input_label input_label_simple">'.__('Safe operation mode').': '.ui_print_help_tip(
|
||||
|
|
|
@ -522,12 +522,10 @@ echo '</div>';
|
|||
|
||||
function calculate_inputs() {
|
||||
if ($('#product :selected').val() == "CUSTOM") {
|
||||
$('#div-username label').text('<?php echo __('Username'); ?>');
|
||||
$('#div-username label').text('<?php echo __('User'); ?>');
|
||||
$('#div-password label').text('<?php echo __('Password'); ?>');
|
||||
$('#div-extra_1 label').text('<?php echo __('Extra'); ?>');
|
||||
$('#div-extra_2 label').text('<?php echo __('Extra (2)'); ?>');
|
||||
$('#div-extra_1').show();
|
||||
$('#div-extra_2').show();
|
||||
$('#div-extra_1').hide();
|
||||
$('#div-extra_2').hide();
|
||||
} else if ($('#product :selected').val() == "AWS") {
|
||||
$('#div-username label').text('<?php echo __('Access key ID'); ?>');
|
||||
$('#div-password label').text('<?php echo __('Secret access key'); ?>');
|
||||
|
|
|
@ -32,6 +32,7 @@ require_once $config['homedir'].'/include/class/CustomNetScan.class.php';
|
|||
require_once $config['homedir'].'/include/class/ManageNetScanScripts.class.php';
|
||||
|
||||
enterprise_include_once('include/class/CSVImportAgents.class.php');
|
||||
enterprise_include_once('include/class/DeploymentCenter.class.php');
|
||||
enterprise_include_once('include/functions_hostdevices.php');
|
||||
|
||||
/**
|
||||
|
@ -127,6 +128,12 @@ class HostDevices extends Wizard
|
|||
'icon' => ENTERPRISE_DIR.'/images/wizard/csv.png',
|
||||
'label' => __('Import CSV'),
|
||||
];
|
||||
|
||||
$buttons[] = [
|
||||
'url' => $this->url.'&mode=deploy',
|
||||
'icon' => ENTERPRISE_DIR.'/images/wizard/deployment.png',
|
||||
'label' => __('Agent deployment'),
|
||||
];
|
||||
}
|
||||
|
||||
$buttons[] = [
|
||||
|
@ -167,6 +174,14 @@ class HostDevices extends Wizard
|
|||
);
|
||||
return $csv_importer->runCSV();
|
||||
}
|
||||
|
||||
if ($mode === 'deploy') {
|
||||
$deployObject = new DeploymentCenter(
|
||||
$this->page,
|
||||
$this->breadcrum
|
||||
);
|
||||
return $deployObject->run();
|
||||
}
|
||||
}
|
||||
|
||||
if ($mode === 'customnetscan') {
|
||||
|
|
|
@ -296,241 +296,20 @@ class Wizard
|
|||
*/
|
||||
public function printInput($data)
|
||||
{
|
||||
global $config;
|
||||
|
||||
include_once $config['homedir'].'/include/functions_html.php';
|
||||
|
||||
if (is_array($data) === false) {
|
||||
return '';
|
||||
}
|
||||
|
||||
switch ($data['type']) {
|
||||
case 'text':
|
||||
return html_print_input_text(
|
||||
$data['name'],
|
||||
$data['value'],
|
||||
((isset($data['alt']) === true) ? $data['alt'] : ''),
|
||||
((isset($data['size']) === true) ? $data['size'] : 50),
|
||||
((isset($data['maxlength']) === true) ? $data['maxlength'] : 255),
|
||||
((isset($data['return']) === true) ? $data['return'] : true),
|
||||
((isset($data['disabled']) === true) ? $data['disabled'] : false),
|
||||
((isset($data['required']) === true) ? $data['required'] : false),
|
||||
((isset($data['function']) === true) ? $data['function'] : ''),
|
||||
((isset($data['class']) === true) ? $data['class'] : ''),
|
||||
((isset($data['onChange']) === true) ? $data['onChange'] : ''),
|
||||
((isset($data['autocomplete']) === true) ? $data['autocomplete'] : '')
|
||||
);
|
||||
|
||||
case 'image':
|
||||
return html_print_input_image(
|
||||
$data['name'],
|
||||
$data['src'],
|
||||
$data['value'],
|
||||
((isset($data['style']) === true) ? $data['style'] : ''),
|
||||
((isset($data['return']) === true) ? $data['return'] : false),
|
||||
((isset($data['options']) === true) ? $data['options'] : false)
|
||||
);
|
||||
|
||||
case 'text_extended':
|
||||
return html_print_input_text_extended(
|
||||
$data['name'],
|
||||
$data['value'],
|
||||
$data['id'],
|
||||
$data['alt'],
|
||||
$data['size'],
|
||||
$data['maxlength'],
|
||||
$data['disabled'],
|
||||
$data['script'],
|
||||
$data['attributes'],
|
||||
((isset($data['return']) === true) ? $data['return'] : false),
|
||||
((isset($data['password']) === true) ? $data['password'] : false),
|
||||
((isset($data['function']) === true) ? $data['function'] : '')
|
||||
);
|
||||
|
||||
case 'password':
|
||||
return html_print_input_password(
|
||||
$data['name'],
|
||||
$data['value'],
|
||||
((isset($data['alt']) === true) ? $data['alt'] : ''),
|
||||
((isset($data['size']) === true) ? $data['size'] : 50),
|
||||
((isset($data['maxlength']) === true) ? $data['maxlength'] : 255),
|
||||
((isset($data['return']) === true) ? $data['return'] : false),
|
||||
((isset($data['disabled']) === true) ? $data['disabled'] : false),
|
||||
((isset($data['required']) === true) ? $data['required'] : false),
|
||||
((isset($data['class']) === true) ? $data['class'] : '')
|
||||
);
|
||||
|
||||
case 'text':
|
||||
return html_print_input_text(
|
||||
$data['name'],
|
||||
$data['value'],
|
||||
((isset($data['alt']) === true) ? $data['alt'] : ''),
|
||||
((isset($data['size']) === true) ? $data['size'] : 50),
|
||||
((isset($data['maxlength']) === true) ? $data['maxlength'] : 255),
|
||||
((isset($data['return']) === true) ? $data['return'] : false),
|
||||
((isset($data['disabled']) === true) ? $data['disabled'] : false),
|
||||
((isset($data['required']) === true) ? $data['required'] : false),
|
||||
((isset($data['function']) === true) ? $data['function'] : ''),
|
||||
((isset($data['class']) === true) ? $data['class'] : ''),
|
||||
((isset($data['onChange']) === true) ? $data['onChange'] : ''),
|
||||
((isset($data['autocomplete']) === true) ? $data['autocomplete'] : '')
|
||||
);
|
||||
|
||||
case 'image':
|
||||
return html_print_input_image(
|
||||
$data['name'],
|
||||
$data['src'],
|
||||
$data['value'],
|
||||
((isset($data['style']) === true) ? $data['style'] : ''),
|
||||
((isset($data['return']) === true) ? $data['return'] : false),
|
||||
((isset($data['options']) === true) ? $data['options'] : false)
|
||||
);
|
||||
|
||||
case 'hidden':
|
||||
return html_print_input_hidden(
|
||||
$data['name'],
|
||||
$data['value'],
|
||||
((isset($data['return']) === true) ? $data['return'] : false),
|
||||
((isset($data['class']) === true) ? $data['class'] : false)
|
||||
);
|
||||
|
||||
case 'hidden_extended':
|
||||
return html_print_input_hidden_extended(
|
||||
$data['name'],
|
||||
$data['value'],
|
||||
$data['id'],
|
||||
((isset($data['return']) === true) ? $data['return'] : false),
|
||||
((isset($data['class']) === true) ? $data['class'] : false)
|
||||
);
|
||||
|
||||
case 'color':
|
||||
return html_print_input_color(
|
||||
$data['name'],
|
||||
$data['value'],
|
||||
((isset($data['class']) === true) ? $data['class'] : false),
|
||||
((isset($data['return']) === true) ? $data['return'] : false)
|
||||
);
|
||||
|
||||
case 'file':
|
||||
return html_print_input_file(
|
||||
$data['name'],
|
||||
((isset($data['return']) === true) ? $data['return'] : false),
|
||||
((isset($data['options']) === true) ? $data['options'] : false)
|
||||
);
|
||||
|
||||
case 'select':
|
||||
return html_print_select(
|
||||
$data['fields'],
|
||||
$data['name'],
|
||||
((isset($data['selected']) === true) ? $data['selected'] : ''),
|
||||
((isset($data['script']) === true) ? $data['script'] : ''),
|
||||
((isset($data['nothing']) === true) ? $data['nothing'] : ''),
|
||||
((isset($data['nothing_value']) === true) ? $data['nothing_value'] : 0),
|
||||
((isset($data['return']) === true) ? $data['return'] : false),
|
||||
((isset($data['multiple']) === true) ? $data['multiple'] : false),
|
||||
((isset($data['sort']) === true) ? $data['sort'] : true),
|
||||
((isset($data['class']) === true) ? $data['class'] : ''),
|
||||
((isset($data['disabled']) === true) ? $data['disabled'] : false),
|
||||
((isset($data['style']) === true) ? $data['style'] : false),
|
||||
((isset($data['option_style']) === true) ? $data['option_style'] : false),
|
||||
((isset($data['size']) === true) ? $data['size'] : false),
|
||||
((isset($data['modal']) === true) ? $data['modal'] : false),
|
||||
((isset($data['message']) === true) ? $data['message'] : ''),
|
||||
((isset($data['select_all']) === true) ? $data['select_all'] : false)
|
||||
);
|
||||
|
||||
case 'select_from_sql':
|
||||
return html_print_select_from_sql(
|
||||
$data['sql'],
|
||||
$data['name'],
|
||||
((isset($data['selected']) === true) ? $data['selected'] : ''),
|
||||
((isset($data['script']) === true) ? $data['script'] : ''),
|
||||
((isset($data['nothing']) === true) ? $data['nothing'] : ''),
|
||||
((isset($data['nothing_value']) === true) ? $data['nothing_value'] : '0'),
|
||||
((isset($data['return']) === true) ? $data['return'] : false),
|
||||
((isset($data['multiple']) === true) ? $data['multiple'] : false),
|
||||
((isset($data['sort']) === true) ? $data['sort'] : true),
|
||||
((isset($data['disabled']) === true) ? $data['disabled'] : false),
|
||||
((isset($data['style']) === true) ? $data['style'] : false),
|
||||
((isset($data['size']) === true) ? $data['size'] : false),
|
||||
((isset($data['trucate_size']) === true) ? $data['trucate_size'] : GENERIC_SIZE_TEXT)
|
||||
);
|
||||
|
||||
case 'select_groups':
|
||||
return html_print_select_groups(
|
||||
((isset($data['id_user']) === true) ? $data['id_user'] : false),
|
||||
((isset($data['privilege']) === true) ? $data['privilege'] : 'AR'),
|
||||
((isset($data['returnAllGroup']) === true) ? $data['returnAllGroup'] : true),
|
||||
$data['name'],
|
||||
((isset($data['selected']) === true) ? $data['selected'] : ''),
|
||||
((isset($data['script']) === true) ? $data['script'] : ''),
|
||||
((isset($data['nothing']) === true) ? $data['nothing'] : ''),
|
||||
((isset($data['nothing_value']) === true) ? $data['nothing_value'] : 0),
|
||||
((isset($data['return']) === true) ? $data['return'] : false),
|
||||
((isset($data['multiple']) === true) ? $data['multiple'] : false),
|
||||
((isset($data['sort']) === true) ? $data['sort'] : true),
|
||||
((isset($data['class']) === true) ? $data['class'] : ''),
|
||||
((isset($data['disabled']) === true) ? $data['disabled'] : false),
|
||||
((isset($data['style']) === true) ? $data['style'] : false),
|
||||
((isset($data['option_style']) === true) ? $data['option_style'] : false),
|
||||
((isset($data['id_group']) === true) ? $data['id_group'] : false),
|
||||
((isset($data['keys_field']) === true) ? $data['keys_field'] : 'id_grupo'),
|
||||
((isset($data['strict_user']) === true) ? $data['strict_user'] : false),
|
||||
((isset($data['delete_groups']) === true) ? $data['delete_groups'] : false),
|
||||
((isset($data['include_groups']) === true) ? $data['include_groups'] : false),
|
||||
((isset($data['size']) === true) ? $data['size'] : false),
|
||||
((isset($data['simple_multiple_options']) === true) ? $data['simple_multiple_options'] : false)
|
||||
);
|
||||
|
||||
case 'submit':
|
||||
return '<div class="action-buttons" style="width: 100%">'.html_print_submit_button(
|
||||
((isset($data['label']) === true) ? $data['label'] : 'OK'),
|
||||
((isset($data['name']) === true) ? $data['name'] : ''),
|
||||
((isset($data['disabled']) === true) ? $data['disabled'] : false),
|
||||
((isset($data['attributes']) === true) ? $data['attributes'] : ''),
|
||||
((isset($data['return']) === true) ? $data['return'] : false)
|
||||
).'</div>';
|
||||
|
||||
case 'checkbox':
|
||||
return html_print_checkbox(
|
||||
$data['name'],
|
||||
$data['value'],
|
||||
((isset($data['checked']) === true) ? $data['checked'] : false),
|
||||
((isset($data['return']) === true) ? $data['return'] : false),
|
||||
((isset($data['disabled']) === true) ? $data['disabled'] : false),
|
||||
((isset($data['script']) === true) ? $data['script'] : ''),
|
||||
((isset($data['disabled_hidden']) === true) ? $data['disabled_hidden'] : false)
|
||||
);
|
||||
|
||||
case 'switch':
|
||||
return html_print_switch($data);
|
||||
|
||||
case 'interval':
|
||||
return html_print_extended_select_for_time(
|
||||
$data['name'],
|
||||
$data['value'],
|
||||
((isset($data['script']) === true) ? $data['script'] : ''),
|
||||
((isset($data['nothing']) === true) ? $data['nothing'] : ''),
|
||||
((isset($data['nothing_value']) === true) ? $data['nothing_value'] : 0),
|
||||
((isset($data['size']) === true) ? $data['size'] : false),
|
||||
((isset($data['return']) === true) ? $data['return'] : false),
|
||||
((isset($data['style']) === true) ? $data['selected'] : false),
|
||||
((isset($data['unique']) === true) ? $data['unique'] : false)
|
||||
);
|
||||
|
||||
case 'textarea':
|
||||
return html_print_textarea(
|
||||
$data['name'],
|
||||
$data['rows'],
|
||||
$data['columns'],
|
||||
((isset($data['value']) === true) ? $data['value'] : ''),
|
||||
((isset($data['attributes']) === true) ? $data['attributes'] : ''),
|
||||
((isset($data['return']) === true) ? $data['return'] : false),
|
||||
((isset($data['class']) === true) ? $data['class'] : '')
|
||||
);
|
||||
|
||||
default:
|
||||
// Ignore.
|
||||
break;
|
||||
$input = html_print_input(($data + ['return' => true]), 'div', true);
|
||||
if ($input === false) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return '';
|
||||
return $input;
|
||||
}
|
||||
|
||||
|
||||
|
@ -800,7 +579,7 @@ class Wizard
|
|||
$cb_function = $data['cb_function'];
|
||||
$cb_args = $data['cb_args'];
|
||||
|
||||
$output_head = '<form class="discovery" enctype="'.$form['enctype'].'" action="'.$form['action'].'" method="'.$form['method'];
|
||||
$output_head = '<form class="discovery" onsubmit="'.$form['onsubmit'].'" enctype="'.$form['enctype'].'" action="'.$form['action'].'" method="'.$form['method'];
|
||||
$output_head .= '" '.$form['extra'].'>';
|
||||
|
||||
if ($return === false) {
|
||||
|
@ -872,7 +651,7 @@ class Wizard
|
|||
$cb_function = $data['cb_function'];
|
||||
$cb_args = $data['cb_args'];
|
||||
|
||||
$output_head = '<form class="discovery" enctype="'.$form['enctype'].'" action="'.$form['action'].'" method="'.$form['method'];
|
||||
$output_head = '<form class="discovery" onsubmit="'.$form['onsubmit'].'" enctype="'.$form['enctype'].'" action="'.$form['action'].'" method="'.$form['method'];
|
||||
$output_head .= '" '.$form['extra'].'>';
|
||||
|
||||
if ($return === false) {
|
||||
|
@ -967,7 +746,7 @@ class Wizard
|
|||
$cb_function = $data['cb_function'];
|
||||
$cb_args = $data['cb_args'];
|
||||
|
||||
$output_head = '<form class="discovery" enctype="'.$form['enctype'].'" action="'.$form['action'].'" method="'.$form['method'];
|
||||
$output_head = '<form class="discovery" onsubmit="'.$form['onsubmit'].'" enctype="'.$form['enctype'].'" action="'.$form['action'].'" method="'.$form['method'];
|
||||
$output_head .= '" '.$form['extra'].'>';
|
||||
|
||||
if ($return === false) {
|
||||
|
|
|
@ -583,6 +583,7 @@ define('DISCOVERY_APP_ORACLE', 5);
|
|||
define('DISCOVERY_CLOUD_AWS_EC2', 6);
|
||||
define('DISCOVERY_CLOUD_AWS_RDS', 7);
|
||||
define('DISCOVERY_CLOUD_AZURE_COMPUTE', 8);
|
||||
define('DISCOVERY_DEPLOY_AGENTS', 9);
|
||||
|
||||
|
||||
// Discovery types matching definition.
|
||||
|
|
|
@ -295,9 +295,9 @@ function print_inputs($values=null)
|
|||
'type' => 'select',
|
||||
'script' => 'calculate_inputs()',
|
||||
'fields' => [
|
||||
// 'CUSTOM' => __('Custom'),
|
||||
'AWS' => __('Aws'),
|
||||
'AZURE' => __('Azure'),
|
||||
'CUSTOM' => __('Custom'),
|
||||
'AWS' => __('Aws'),
|
||||
'AZURE' => __('Azure'),
|
||||
// 'GOOGLE' => __('Google'),
|
||||
],
|
||||
'selected' => $values['product'],
|
||||
|
@ -331,6 +331,8 @@ function print_inputs($values=null)
|
|||
case 'GOOGLE':
|
||||
// Need further investigation.
|
||||
case 'CUSTOM':
|
||||
$user_label = __('Account ID');
|
||||
$pass_label = __('Password');
|
||||
default:
|
||||
// Use defaults.
|
||||
break;
|
||||
|
|
|
@ -3071,11 +3071,13 @@ function html_print_link_with_params($text, $params=[], $type='text', $style='')
|
|||
/**
|
||||
* Print input using functions html lib.
|
||||
*
|
||||
* @param array $data Input definition.
|
||||
* @param array $data Input definition.
|
||||
* @param string $wrapper Wrapper 'div' or 'li'.
|
||||
* @param boolean $input_only Return or print only input or also label.
|
||||
*
|
||||
* @return string HTML code for desired input.
|
||||
*/
|
||||
function html_print_input($data)
|
||||
function html_print_input($data, $wrapper='div', $input_only=false)
|
||||
{
|
||||
if (is_array($data) === false) {
|
||||
return '';
|
||||
|
@ -3083,8 +3085,8 @@ function html_print_input($data)
|
|||
|
||||
$output = '';
|
||||
|
||||
if ($data['label']) {
|
||||
$output = '<div id="div-'.$data['name'].'" ';
|
||||
if ($data['label'] && $input_only === false) {
|
||||
$output = '<'.$wrapper.' id="'.$wrapper.'-'.$data['name'].'" ';
|
||||
$output .= ' class="'.$data['input_class'].'">';
|
||||
$output .= '<label class="'.$data['label_class'].'">';
|
||||
$output .= $data['label'];
|
||||
|
@ -3172,17 +3174,6 @@ function html_print_input($data)
|
|||
);
|
||||
break;
|
||||
|
||||
case 'image':
|
||||
$output .= html_print_input_image(
|
||||
$data['name'],
|
||||
$data['src'],
|
||||
$data['value'],
|
||||
((isset($data['style']) === true) ? $data['style'] : ''),
|
||||
((isset($data['return']) === true) ? $data['return'] : false),
|
||||
((isset($data['options']) === true) ? $data['options'] : false)
|
||||
);
|
||||
break;
|
||||
|
||||
case 'hidden':
|
||||
$output .= html_print_input_hidden(
|
||||
$data['name'],
|
||||
|
@ -3287,13 +3278,13 @@ function html_print_input($data)
|
|||
break;
|
||||
|
||||
case 'submit':
|
||||
$output .= '<div class="action-buttons" style="width: 100%">'.html_print_submit_button(
|
||||
$output .= '<'.$wrapper.' class="action-buttons" style="width: 100%">'.html_print_submit_button(
|
||||
((isset($data['label']) === true) ? $data['label'] : 'OK'),
|
||||
((isset($data['name']) === true) ? $data['name'] : ''),
|
||||
((isset($data['disabled']) === true) ? $data['disabled'] : false),
|
||||
((isset($data['attributes']) === true) ? $data['attributes'] : ''),
|
||||
((isset($data['return']) === true) ? $data['return'] : false)
|
||||
).'</div>';
|
||||
).'</'.$wrapper.'>';
|
||||
break;
|
||||
|
||||
case 'checkbox':
|
||||
|
@ -3336,20 +3327,33 @@ function html_print_input($data)
|
|||
((isset($data['return']) === true) ? $data['return'] : false),
|
||||
((isset($data['class']) === true) ? $data['class'] : '')
|
||||
);
|
||||
break;
|
||||
|
||||
case 'button':
|
||||
$output .= html_print_button(
|
||||
((isset($data['label']) === true) ? $data['label'] : 'OK'),
|
||||
((isset($data['name']) === true) ? $data['name'] : ''),
|
||||
((isset($data['disabled']) === true) ? $data['disabled'] : false),
|
||||
((isset($data['script']) === true) ? $data['script'] : ''),
|
||||
((isset($data['attributes']) === true) ? $data['attributes'] : ''),
|
||||
((isset($data['return']) === true) ? $data['return'] : false),
|
||||
((isset($data['imageButton']) === true) ? $data['imageButton'] : false),
|
||||
((isset($data['modal']) === true) ? $data['modal'] : false),
|
||||
((isset($data['message']) === true) ? $data['message'] : '')
|
||||
);
|
||||
break;
|
||||
|
||||
default:
|
||||
// Ignore.
|
||||
break;
|
||||
}
|
||||
|
||||
if ($data['label']) {
|
||||
$output .= '</div>';
|
||||
if ($data['label'] && $input_only === false) {
|
||||
$output .= '</'.$wrapper.'>';
|
||||
if (!$data['return']) {
|
||||
echo '</div>';
|
||||
echo '</'.$wrapper.'>';
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -3094,38 +3094,7 @@ function ui_print_datatable(array $parameters)
|
|||
$filter .= '<ul class="datatable_filter content">';
|
||||
|
||||
foreach ($parameters['form']['inputs'] as $input) {
|
||||
$filter .= '<li>';
|
||||
$filter .= '<label>'.$input['label'].'</label>';
|
||||
if ($input['type'] != 'select') {
|
||||
$filter .= '<input type="'.$input['type'].'" ';
|
||||
$filter .= ' style="'.$input['style'].'" ';
|
||||
$filter .= ' class="'.$input['class'].'" ';
|
||||
$filter .= ' value="'.$input['value'].'" ';
|
||||
$filter .= ' name="'.$input['name'].'" id="'.$input['id'].'" />';
|
||||
} else {
|
||||
// Select.
|
||||
$filter .= '<select class="'.$input['class'].'"';
|
||||
$filter .= ' style="'.$input['style'].'" ';
|
||||
$filter .= ' name="'.$input['name'].'" ';
|
||||
$filter .= 'id="'.$input['id'].'">';
|
||||
|
||||
foreach ($input['options'] as $key => $opt) {
|
||||
if (is_array($opt)) {
|
||||
$filter .= '<option value="'.$opt['value'].'"';
|
||||
if ($opt['selected']) {
|
||||
$filter .= ' selected="yes" >';
|
||||
}
|
||||
|
||||
$filter .= __($opt['text']).'</option>';
|
||||
} else {
|
||||
$filter .= '<option value="'.$key.'">'.$opt.'</option>';
|
||||
}
|
||||
}
|
||||
|
||||
$filter .= '</select>';
|
||||
}
|
||||
|
||||
$filter .= '</li>';
|
||||
$filter .= html_print_input(($input + ['return' => true]), 'li');
|
||||
}
|
||||
|
||||
$filter .= '<li>';
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
ul.wizard li > label:not(.p-switch) {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
ul.wizard {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
ul.wizard li {
|
||||
margin-right: 1em;
|
||||
}
|
|
@ -810,6 +810,41 @@ CREATE TABLE IF NOT EXISTS `trecon_task` (
|
|||
KEY `recon_task_daemon` (`id_recon_server`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `ttask_credentials`
|
||||
-- ----------------------------------------------------------------------
|
||||
CREATE TABLE `ttask_credentials` (
|
||||
`id_rt` int(10) unsigned NOT NULL,
|
||||
`identifier` varchar(100) NOT NULL,
|
||||
PRIMARY KEY (`id_rt`,`identifier`),
|
||||
KEY `identifier` (`identifier`),
|
||||
FOREIGN KEY (`id_rt`) REFERENCES `trecon_task` (`id_rt`)
|
||||
ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
FOREIGN KEY (`identifier`) REFERENCES `tcredential_store` (`identifier`)
|
||||
ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `tdeployment_hosts`
|
||||
-- ----------------------------------------------------------------------
|
||||
CREATE TABLE `tdeployment_hosts` (
|
||||
`id` SERIAL,
|
||||
`id_cs` VARCHAR(100),
|
||||
`ip` VARCHAR(100) NOT NULL,
|
||||
`id_os` INT(10) UNSIGNED DEFAULT 0,
|
||||
`os_version` VARCHAR(100) DEFAULT '' COMMENT "OS version in STR format",
|
||||
`arch` ENUM('x64', 'x86') DEFAULT 'x64',
|
||||
`current_agent_version` VARCHAR(100) DEFAULT '',
|
||||
`desired_agent_version` VARCHAR(100) DEFAULT '',
|
||||
`deployed` bigint(20) unsigned COMMENT "When it was deployed",
|
||||
`last_err` text,
|
||||
PRIMARY KEY (`id`),
|
||||
FOREIGN KEY (`id_cs`) REFERENCES `tcredential_store` (`identifier`)
|
||||
ON UPDATE CASCADE ON DELETE SET NULL,
|
||||
FOREIGN KEY (`id_os`) REFERENCES tconfig_os(`id_os`)
|
||||
ON UPDATE CASCADE ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `tmodule_relationship`
|
||||
-- ----------------------------------------------------------------------
|
||||
|
|
|
@ -31,7 +31,9 @@ use constant {
|
|||
DISCOVERY_APP_MYSQL => 4,
|
||||
DISCOVERY_APP_ORACLE => 5,
|
||||
DISCOVERY_CLOUD_AWS_EC2 => 6,
|
||||
DISCOVERY_CLOUD_AWS_RDS => 7
|
||||
DISCOVERY_CLOUD_AWS_RDS => 7,
|
||||
DISCOVERY_CLOUD_AZURE_COMPUTE => 8,
|
||||
DISCOVERY_DEPLOY_AGENTS => 9,
|
||||
};
|
||||
|
||||
# /dev/null
|
||||
|
|
Loading…
Reference in New Issue