diff --git a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php index 76521f92be..3372f8ce63 100644 --- a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php +++ b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php @@ -33,6 +33,8 @@ require_once $config['homedir'].'/include/functions_cron.php'; enterprise_include_once('include/functions_tasklist.php'); enterprise_include_once('include/functions_cron.php'); +ui_require_css_file('task_list'); + /** * Defined as wizard to guide user to explore running tasks. */ @@ -346,6 +348,8 @@ class DiscoveryTaskList extends Wizard $recon_tasks = []; } + $url_ajax = $config['homeurl'].'ajax.php'; + $table = new StdClass(); $table->cellpadding = 4; $table->cellspacing = 4; @@ -425,7 +429,16 @@ class DiscoveryTaskList extends Wizard $data[0] = ''; } - $data[1] = ''.$task['name'].''; + // Name task. + $data[1] = ''; + if ($task['disabled'] != 2) { + $data[1] .= ''; + } + + $data[1] .= ''.$task['name'].''; + if ($task['disabled'] != 2) { + $data[1] .= ''; + } $data[2] = $server_name; @@ -489,6 +502,15 @@ class DiscoveryTaskList extends Wizard $data[8] = __('Not executed yet'); } + if ($task['disabled'] != 2) { + $data[9] = ''; + $data[9] .= html_print_image( + 'images/eye.png', + true + ); + $data[9] .= ''; + } + if (check_acl( $config['id_user'], $task['id_group'], @@ -496,7 +518,7 @@ class DiscoveryTaskList extends Wizard ) ) { if ($ipam === true) { - $data[9] = ''; } else { // Check if is a H&D, Cloud or Application or IPAM. - $data[9] = 'getTargetWiz($task), @@ -545,7 +567,12 @@ class DiscoveryTaskList extends Wizard html_print_table($table); } - unset($table); + // Div neccesary for modal progress task. + echo ''; + + unset($table); + + ui_require_javascript_file('pandora_taskList'); } return true; @@ -589,6 +616,7 @@ class DiscoveryTaskList extends Wizard } else { return 'wiz=hd&mode=customnetscan'; } + break; } } diff --git a/pandora_console/include/ajax/task_list.ajax.php b/pandora_console/include/ajax/task_list.ajax.php new file mode 100644 index 0000000000..83968cb2e1 --- /dev/null +++ b/pandora_console/include/ajax/task_list.ajax.php @@ -0,0 +1,74 @@ +'; + $result .= '
  • '._('Overall Progress').'

  • '; + $result .= '
  • '; + $result .= d3_progress_bar( + $id_task, + 90, + 460, + 50, + '#EA5434' + ); + $result .= '
  • '; + $result .= '
  • '.__('Searching devices in').' red a scanear

  • '; + $result .= '
  • '; + $result .= d3_progress_bar( + $id_task.'_2', + 30, + 460, + 50, + '#2751E1' + ); + $result .= '
  • '; + $result .= '
  • '.__('Summary').'

  • '; + $result .= '
  • '.__('Estimated').': total de host
  • '; + $result .= '
  • '.__('Discovered').': total de agentes
  • '; + $result .= '
  • '.__('Not alive/Not found').': total de agentes 1-2
  • '; + $result .= ''; + + echo $result; + } else { + // Error. + ui_print_error_message( + __('Please, select task') + ); + } + + return; +} diff --git a/pandora_console/include/javascript/pandora_taskList.js b/pandora_console/include/javascript/pandora_taskList.js new file mode 100644 index 0000000000..f8fe84e8c2 --- /dev/null +++ b/pandora_console/include/javascript/pandora_taskList.js @@ -0,0 +1,33 @@ +/** + * + * @param {*} id + * @param {*} name + */ +function progress_task_list(id, name, url) { + var params = []; + params.push("page=include/ajax/task_list.ajax"); + params.push("progress_task_discovery=1"); + params.push("id=" + id); + + jQuery.ajax({ + data: params.join("&"), + type: "POST", + url: (action = url), + dataType: "html", + success: function(data) { + $("#progress_task") + .hide() + .empty() + .append(data) + .dialog({ + title: "Task: " + name, + resizable: true, + draggable: true, + modal: false, + width: 600, + height: 400 + }) + .show(); + } + }); +} diff --git a/pandora_console/include/styles/task_list.css b/pandora_console/include/styles/task_list.css new file mode 100644 index 0000000000..d3ffb5d546 --- /dev/null +++ b/pandora_console/include/styles/task_list.css @@ -0,0 +1,42 @@ +/** + * + * Name: Default theme + * + * Extension to manage a list of gateways and the node address where they should + * point to. + * + * @category css + * @package Pandora FMS + * @subpackage Community + * @version 1.0.0 + * @license See below + * + * ______ ___ _______ _______ ________ + * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __| + * | __/| _ | | _ || _ | _| _ | | ___| |__ | + * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| + * + * ============================================================================ + * Copyright (c) 2005-2019 Artica Soluciones Tecnologicas + * Please see http://pandorafms.org for full contribution list + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation for version 2. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * ============================================================================ + */ + +ul.progress_task_discovery { + width: 80%; + margin: 0 auto; + display: flex; + flex-direction: column; +} + +ul.progress_task_discovery li span { + font-size: 9pt; + margin-left: 20px; +}