2014-08-27 Alejandro Gallardo <alejandro.gallardo@artica.es>

* operation/visual_console/render_view.php,
	  godmode/reporting/visual_console_builder.php: Added hooks
	to the enterprise wizard of services.

	* include/constants.php: Added constants for the services modes.

	* operation/events/events.php,
	  operation/events/events.build_query.php: Now is possible to
	filter the events by module id programmatically.

	* images/wand_services.png: Added image.


git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10464 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
alexhigh 2014-08-27 17:09:07 +00:00
parent 8a72faa99c
commit fcb5b43a23
6 changed files with 71 additions and 24 deletions

View File

@ -47,7 +47,7 @@ else {
$action = get_parameterBetweenListValues('action2', array('new', 'save', 'edit', 'update', 'delete'), 'new');
}
$activeTab = get_parameterBetweenListValues('tab', array('data', 'list_elements', 'wizard', 'editor'), 'data');
$activeTab = get_parameterBetweenListValues('tab', array('data', 'list_elements', 'wizard', 'wizard_services', 'editor'), 'data');
$refr = (int) get_parameter ('refr', $config['vc_refr']);
@ -397,6 +397,25 @@ switch ($activeTab) {
break;
}
break;
case 'wizard_services':
$visualConsole = db_get_row_filter('tlayout', array('id' => $idVisualConsole));
$visualConsoleName = $visualConsole['name'];
switch ($action) {
case 'update':
enterprise_include_once("/include/functions_visual_map.php");
$icon = (string) get_parameter('icon');
$id_services = (array) get_parameter('services_selected');
$result = enterprise_hook('enterprise_visual_map_process_services_wizard_add', array($id_services, $idVisualConsole, $icon));
if ($result != ENTERPRISE_NOT_HOOK) {
$statusProcessInDB = array('flag' => $result['status'], 'message' => $result['message']);
}
$action = 'edit';
break;
}
break;
case 'editor':
switch ($action) {
case 'new':
@ -429,28 +448,36 @@ else {
// Hash for auto-auth in public link
$hash = md5($config["dbpass"] . $id_layout . $config["id_user"]);
$buttons = array(
'consoles_list' => array('active' => false,
$buttons = array();
$buttons['consoles_list'] = array('active' => false,
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/map_builder&refr=' . $refr . '">' .
html_print_image ("images/visual_console.png", true, array ("title" => __('Visual consoles list'))) .'</a>'),
'public_link' => array('active' => false,
html_print_image ("images/visual_console.png", true, array ("title" => __('Visual consoles list'))) .'</a>');
$buttons['public_link'] = array('active' => false,
'text' => '<a href="' . ui_get_full_url('operation/visual_console/public_console.php?hash='.$hash.'&id_layout='.$id_layout.'&id_user='.$config["id_user"]) . '">'.
html_print_image ("images/camera_mc.png", true, array ("title" => __('Show link to public Visual Console'))).'</a>'),
'data' => array('active' => false,
html_print_image ("images/camera_mc.png", true, array ("title" => __('Show link to public Visual Console'))).'</a>');
$buttons['data'] = array('active' => false,
'text' => '<a href="' . $url_base . $action . '&tab=data&id_visual_console=' . $idVisualConsole . '">' .
html_print_image ("images/op_reporting.png", true, array ("title" => __('Main data'))) .'</a>'),
'list_elements' => array('active' => false,
html_print_image ("images/op_reporting.png", true, array ("title" => __('Main data'))) .'</a>');
$buttons['list_elements'] = array('active' => false,
'text' => '<a href="' . $url_base . $action . '&tab=list_elements&id_visual_console=' . $idVisualConsole . '">' .
html_print_image ("images/list.png", true, array ("title" => __('List elements'))) .'</a>'),
'wizard' => array('active' => false,
html_print_image ("images/list.png", true, array ("title" => __('List elements'))) .'</a>');
if (enterprise_installed()) {
$buttons['wizard_services'] = array('active' => false,
'text' => '<a href="' . $url_base . $action . '&tab=wizard_services&id_visual_console=' . $idVisualConsole . '">' .
html_print_image ("images/wand_services.png", true, array ("title" => __('Services wizard'))) .'</a>');
}
$buttons['wizard'] = array('active' => false,
'text' => '<a href="' . $url_base . $action . '&tab=wizard&id_visual_console=' . $idVisualConsole . '">' .
html_print_image ("images/wand.png", true, array ("title" => __('Wizard'))) .'</a>'),
'editor' => array('active' => false,
html_print_image ("images/wand.png", true, array ("title" => __('Wizard'))) .'</a>');
$buttons['editor'] = array('active' => false,
'text' => '<a href="' . $url_base . $action . '&tab=editor&id_visual_console=' . $idVisualConsole . '">' .
html_print_image ("images/builder.png", true, array ("title" => __('Builder'))) .'</a>'),
'view' => array('active' => false,
html_print_image ("images/builder.png", true, array ("title" => __('Builder'))) .'</a>');
$buttons['view'] = array('active' => false,
'text' => '<a href="' . $url_view . '">' .
html_print_image ("images/operation.png", true, array ("title" => __('View'))) .'</a>'));
html_print_image ("images/operation.png", true, array ("title" => __('View'))) .'</a>');
if ($action == 'new' || $idVisualConsole === false) {
$buttons = array('data' => $buttons['data']); //Show only the data tab
@ -474,6 +501,11 @@ switch ($activeTab) {
case 'wizard':
require_once($config['homedir'] . '/godmode/reporting/visual_console_builder.wizard.php');
break;
case 'wizard_services':
if (enterprise_installed()) {
enterprise_include('/godmode/reporting/visual_console_builder.wizard_services.php');
}
break;
case 'data':
require_once($config['homedir'] . '/godmode/reporting/visual_console_builder.data.php');
break;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -226,7 +226,10 @@ define('SERVICE_ELEMENT_WEIGHT_CRITICAL', 1);
define('SERVICE_ELEMENT_WEIGHT_WARNING', 0.5);
define('SERVICE_ELEMENT_WEIGHT_OK', 0);
define('SERVICE_ELEMENT_WEIGHT_UNKNOWN', 0);
//Modes
define('SERVICE_MODE_MANUAL', 0);
define('SERVICE_MODE_AUTO', 1);
define('SERVICE_MODE_SIMPLE', 2);
/* Status images */

View File

@ -123,6 +123,11 @@ else {
$sql_post .= " AND id_agente = " . $id_agent;
break;
}
}
if ($id_agent_module) {
$sql_post .= " AND id_agentmodule = " . $id_agent_module;
}
if ($id_user_ack != "0")

View File

@ -193,6 +193,7 @@ $event_type = get_parameter ("event_type", ''); // 0 all
$severity = (int) get_parameter ("severity", -1); // -1 all
$status = (int) get_parameter ("status", 3); // -1 all, 0 only new, 1 only validated, 2 only in process, 3 only not validated,
$id_agent = (int) get_parameter ("id_agent", 0);
$id_agent_module = (int) get_parameter ("id_agent_module", 0);
$pagination = (int) get_parameter ("pagination", $config["block_size"]);
$event_view_hr = (int) get_parameter ("event_view_hr", $history ? 0 : $config["event_view_hr"]);
$id_user_ack = get_parameter ("id_user_ack", 0);

View File

@ -96,6 +96,12 @@ if (check_acl ($config["id_user"], $id_group, "RW")) {
html_print_image ("images/op_reporting.png", true, array ("title" => __('Main data'))) .'</a>';
$options['list_elements']['text'] = '<a href="' . $url_base . $action . '&tab=list_elements&id_visual_console=' . $id_layout . '">' .
html_print_image ("images/list.png", true, array ("title" => __('List elements'))) .'</a>';
if (enterprise_installed()) {
$options['wizard_services']['text'] = '<a href="' . $url_base . $action . '&tab=wizard_services&id_visual_console=' . $id_layout . '">' .
html_print_image ("images/wand_services.png", true, array ("title" => __('Services wizard'))) .'</a>';
}
$options['wizard']['text'] = '<a href="' . $url_base . $action . '&tab=wizard&id_visual_console=' . $id_layout . '">' .
html_print_image ("images/wand.png", true, array ("title" => __('Wizard'))) .'</a>';
$options['editor']['text'] = '<a href="' . $url_base . $action . '&tab=editor&id_visual_console=' . $id_layout . '">' .