#12934 added modals for edit task of DISCOVERY_DEPLOY_AGENTS
This commit is contained in:
parent
ef4d7b90ac
commit
bf1874ca09
|
@ -100,6 +100,26 @@ class DiscoveryTaskList extends HTML
|
||||||
// Load styles.
|
// Load styles.
|
||||||
parent::run();
|
parent::run();
|
||||||
|
|
||||||
|
$deploymentCenter = new DeploymentCenter();
|
||||||
|
echo $deploymentCenter->loadJS();
|
||||||
|
ui_require_css_file('deployment_list');
|
||||||
|
|
||||||
|
html_print_div(
|
||||||
|
[
|
||||||
|
'content' => '',
|
||||||
|
'id' => 'modal_add_target',
|
||||||
|
'class' => 'invisible',
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
html_print_div(
|
||||||
|
[
|
||||||
|
'content' => '',
|
||||||
|
'id' => 'modal_deploy_targets',
|
||||||
|
'class' => 'invisible',
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
$this->prepareBreadcrum(
|
$this->prepareBreadcrum(
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
|
@ -176,7 +196,7 @@ class DiscoveryTaskList extends HTML
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_reporting_console_node() === false) {
|
if (is_reporting_console_node() === false) {
|
||||||
$ret2 = $this->showList(__('Host & devices tasks'), [0, 1]);
|
$ret2 = $this->showList(__('Host & devices tasks'), [0, 1, 9]);
|
||||||
$ret2 .= $this->showList(__('Applications tasks'), [3, 4, 5, 10, 11, 12], 'app');
|
$ret2 .= $this->showList(__('Applications tasks'), [3, 4, 5, 10, 11, 12], 'app');
|
||||||
$ret2 .= $this->showList(__('Cloud tasks'), [6, 7, 8, 13, 14], 'cloud');
|
$ret2 .= $this->showList(__('Cloud tasks'), [6, 7, 8, 13, 14], 'cloud');
|
||||||
$ret2 .= $this->showList(__('Custom tasks'), [-1], 'custom');
|
$ret2 .= $this->showList(__('Custom tasks'), [-1], 'custom');
|
||||||
|
@ -870,14 +890,12 @@ class DiscoveryTaskList extends HTML
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DISCOVERY_DEPLOY_AGENTS:
|
case DISCOVERY_DEPLOY_AGENTS:
|
||||||
// Internal deployment task.
|
|
||||||
$no_operations = true;
|
|
||||||
$data[6] = html_print_image(
|
$data[6] = html_print_image(
|
||||||
'images/osx-terminal@groups.svg',
|
'images/osx-terminal@groups.svg',
|
||||||
true,
|
true,
|
||||||
['title' => __('Agent deployment')]
|
['title' => __('Agent deployment')]
|
||||||
).' ';
|
).' ';
|
||||||
$data[6] .= __('Discovery.Agent.Deployment (legacy)');
|
$data[6] .= __('Discovery.Agent.Deployment');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DISCOVERY_APP_MICROSOFT_SQL_SERVER:
|
case DISCOVERY_APP_MICROSOFT_SQL_SERVER:
|
||||||
|
@ -1003,6 +1021,7 @@ class DiscoveryTaskList extends HTML
|
||||||
&& $task['type'] != DISCOVERY_APP_SAP
|
&& $task['type'] != DISCOVERY_APP_SAP
|
||||||
&& $task['type'] != DISCOVERY_CLOUD_AWS_RDS
|
&& $task['type'] != DISCOVERY_CLOUD_AWS_RDS
|
||||||
&& $task['type'] != DISCOVERY_CLOUD_AWS_S3
|
&& $task['type'] != DISCOVERY_CLOUD_AWS_S3
|
||||||
|
&& $task['type'] != DISCOVERY_DEPLOY_AGENTS
|
||||||
) {
|
) {
|
||||||
if (check_acl($config['id_user'], 0, 'MR') && (int) $task['type'] !== DISCOVERY_EXTENSION) {
|
if (check_acl($config['id_user'], 0, 'MR') && (int) $task['type'] !== DISCOVERY_EXTENSION) {
|
||||||
$data[9] .= '<a href="#" onclick="show_map('.$task['id_rt'].',\''.$task['name'].'\')">';
|
$data[9] .= '<a href="#" onclick="show_map('.$task['id_rt'].',\''.$task['name'].'\')">';
|
||||||
|
@ -1062,25 +1081,40 @@ class DiscoveryTaskList extends HTML
|
||||||
).'</a>';
|
).'</a>';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$url_edit = sprintf(
|
// Create the url edit.
|
||||||
'index.php?sec=gservers&sec2=godmode/servers/discovery&%s&task=%d',
|
switch ((int) $task['type']) {
|
||||||
$this->getTargetWiz($task, $recon_script_data),
|
case DISCOVERY_EXTENSION:
|
||||||
$task['id_rt']
|
$url_edit = ui_get_full_url(
|
||||||
);
|
sprintf(
|
||||||
|
|
||||||
if ((int) $task['type'] === DISCOVERY_EXTENSION) {
|
|
||||||
$url_edit = sprintf(
|
|
||||||
'index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=%s&mode=%s&id_task=%s',
|
'index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=%s&mode=%s&id_task=%s',
|
||||||
$task['section'],
|
$task['section'],
|
||||||
$task['short_name'],
|
$task['short_name'],
|
||||||
$task['id_rt'],
|
$task['id_rt'],
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DISCOVERY_DEPLOY_AGENTS:
|
||||||
|
if (empty($task['field1']) === false) {
|
||||||
|
$url_edit = 'javascript:show_deploy_targets('.$task['id_rt'].')';
|
||||||
|
} else {
|
||||||
|
$url_edit = 'javascript:show_scan_targets('.$task['id_rt'].')';
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
$url_edit = ui_get_full_url(
|
||||||
|
sprintf(
|
||||||
|
'index.php?sec=gservers&sec2=godmode/servers/discovery&%s&task=%d',
|
||||||
|
$this->getTargetWiz($task, $recon_script_data),
|
||||||
|
$task['id_rt']
|
||||||
|
)
|
||||||
|
);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if is a H&D, Cloud or Application or IPAM.
|
// Check if is a H&D, Cloud or Application or IPAM.
|
||||||
$data[9] .= '<a href="'.ui_get_full_url(
|
$data[9] .= '<a href="'.$url_edit.'">'.html_print_image(
|
||||||
$url_edit
|
|
||||||
).'">'.html_print_image(
|
|
||||||
'images/edit.svg',
|
'images/edit.svg',
|
||||||
true,
|
true,
|
||||||
[
|
[
|
||||||
|
|
Loading…
Reference in New Issue