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

* include/functions_graph.php: Added filters to the
	function "graph_monitor_wheel".
	
	* operation/agentes/networkmap.dinamic.php,
	  operation/agentes/networkmap.php,
	  include/functions_networkmap.php: Added the 'radial
	dinamic' type.


git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10443 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
alexhigh 2014-08-21 11:41:30 +00:00
parent d172f5e26d
commit fe497317be
5 changed files with 56 additions and 10 deletions

View File

@ -1,3 +1,13 @@
2014-08-21 Alejandro Gallardo <alejandro.gallardo@artica.es>
* include/functions_graph.php: Added filters to the
function "graph_monitor_wheel".
* operation/agentes/networkmap.dinamic.php,
operation/agentes/networkmap.php,
include/functions_networkmap.php: Added the 'radial
dinamic' type.
2014-08-21 Alejandro Gallardo <alejandro.gallardo@artica.es>
* include/functions_graph.php: Improved the function

View File

@ -4091,7 +4091,7 @@ function graph_snmp_traps_treemap ($data, $width = 700, $height = 700) {
/**
* Print a solarburst graph with a representation of all the groups, agents, module groups and modules grouped
*/
function graph_monitor_wheel ($width = 500, $height = 600) {
function graph_monitor_wheel ($width = 550, $height = 600, $filter = false) {
global $config;
include_once ($config['homedir'] . "/include/functions_users.php");
@ -4101,7 +4101,9 @@ function graph_monitor_wheel ($width = 500, $height = 600) {
$graph_data = array();
$groups = users_get_groups(false, "AR", false, true);
$filter_module_group = (!empty($filter) && !empty($filter['module_group'])) ? $filter['module_group'] : false;
$groups = users_get_groups(false, "AR", false, true, (!empty($filter) && isset($filter['group']) ? $filter['group'] : null));
$data_groups = array();
if (!empty($groups)) {
@ -4139,6 +4141,9 @@ function graph_monitor_wheel ($width = 500, $height = 600) {
$module_status = modules_get_agentmodule_status($module_id);
$module_value = modules_get_last_value($module_id);
if ($filter_module_group && $filter_module_group != $module_group_id)
continue;
if (!isset($data_agents[$agent_id])) {
$data_agents[$agent_id] = array();
$data_agents[$agent_id]['id'] = $agent_id;

View File

@ -1584,6 +1584,7 @@ function networkmap_get_types () {
$networkmap_types['topology'] = __('Create a new topology map');
$networkmap_types['groups'] = __('Create a new group map');
$networkmap_types['dinamic'] = __('Create a new dinamic map');
$networkmap_types['radial_dinamic'] = __('Create a new radial dinamic map');
if ($is_enterprise !== ENTERPRISE_NOT_HOOK) {
$enterprise_types = enterprise_hook('policies_get_networkmap_types');
@ -1607,6 +1608,7 @@ function networkmap_get_filter_types () {
$networkmap_types['topology'] = __('Topology');
$networkmap_types['groups'] = __('Group');
$networkmap_types['dinamic'] = __('Dinamic');
$networkmap_types['radial_dinamic'] = __('Radial dinamic');
if ($is_enterprise !== ENTERPRISE_NOT_HOOK) {
$enterprise_types = enterprise_hook('policies_get_networkmap_filter_types');

View File

@ -28,6 +28,23 @@ if (! check_acl ($config['id_user'], 0, "AR")) {
require_once ('include/functions_networkmap.php');
if ($activeTab == "radial_dinamic") {
include_once("include/functions_graph.php");
echo "<div style='width: auto; text-align: center;'>";
$filter = array();
if (!empty($group))
$filter['group'] = $group;
if (!empty($module_group))
$filter['module_group'] = $module_group;
echo graph_monitor_wheel(600, 650, $filter);
echo "</div>";
return;
}
// Set filter
$filter = networkmap_get_filter ($layout);

View File

@ -215,6 +215,9 @@ $buttons['dinamic'] = array('active' => $activeTab == 'dinamic',
'text' => '<a href="index.php?sec=network&amp;sec2=operation/agentes/networkmap&amp;tab=dinamic&amp;pure='.$pure.'">' .
html_print_image("images/dynamic_network_icon.png", true, array ("title" => __('Dinamic view'))) .'</a>');
$buttons['radial_dinamic'] = array('active' => $activeTab == 'radial_dinamic',
'text' => '<a href="index.php?sec=network&amp;sec2=operation/agentes/networkmap&amp;tab=radial_dinamic&amp;pure='.$pure.'">' .
html_print_image("images/dynamic_network_icon.png", true, array ("title" => __('Radial dinamic view'))) .'</a>');
$combolist = '<form name="query_sel" method="post" action="index.php?sec=network&sec2=operation/agentes/networkmap">';
@ -280,6 +283,9 @@ switch ($activeTab) {
case 'dinamic':
$title = __('Dinamic view');
break;
case 'radial_dinamic':
$title = __('Radial dinamic view');
break;
}
if (!empty($name)) {
@ -327,7 +333,7 @@ $table->data[0][] = __('Name:') . '&nbsp;' .
html_print_input_text ('name', $name, '', 25, 50, true);
$table->data[0][] = __('Group:') . '&nbsp;' .
html_print_select_groups(false, 'AR', false, 'group', $group, '', 'All', 0, true);
if ($activeTab == 'groups' || $activeTab == 'policies') {
if ($activeTab == 'groups' || $activeTab == 'policies' || $activeTab == 'radial_dinamic') {
$table->data[0][] = __('Module group') . '&nbsp;' .
html_print_select_from_sql ('
SELECT id_mg, name
@ -339,7 +345,7 @@ if ($activeTab == 'topology') {
html_print_checkbox ('show_snmp_modules', '1', $show_snmp_modules, true);
}
if ($activeTab != 'dinamic') {
if ($activeTab != 'dinamic' && $activeTab != 'radial_dinamic') {
$table->data[0][] = __('Layout') . '&nbsp;' .
html_print_select ($layout_array, 'layout', $layout, '', '', '', true);
}
@ -362,7 +368,7 @@ if ($activeTab == 'policies') {
html_print_select ($depth_levels, 'depth', $depth, '', '', '', true, false, false);
}
if ($activeTab != 'dinamic') {
if ($activeTab != 'dinamic' && $activeTab != 'radial_dinamic') {
$table->data[1][] = __('No Overlap') . '&nbsp;' .
html_print_checkbox ('nooverlap', '1', $nooverlap, true);
}
@ -380,12 +386,12 @@ if (($activeTab == 'groups' || $activeTab == 'policies') &&
}
}
if ($activeTab != 'dinamic') {
if ($activeTab != 'dinamic' && $activeTab != 'radial_dinamic') {
$table->data[1][] = __('Simple') . '&nbsp;' .
html_print_checkbox ('simple', '1', $simple, true);
}
if ($activeTab != 'dinamic') {
if ($activeTab != 'dinamic' && $activeTab != 'radial_dinamic') {
$table->data[1][] = __('Regenerate') . '&nbsp;' .
html_print_checkbox ('regen', '1', $regen, true);
}
@ -406,13 +412,16 @@ if ($pure == "1") {
}
if ($activeTab != 'dinamic') {
if ($activeTab != 'dinamic' && $activeTab != 'radial_dinamic') {
$table->data[1][] = __('Font') . '&nbsp;' .
html_print_input_text ('font_size', $font_size, $alt = 'Font size (in pt)', 2, 4, true);
}
$table->data[2][] = __('Free text for search (*):') . '&nbsp;' .
html_print_input_text('text_filter', $text_filter, '', 30, 100, true);
if ($activeTab != 'radial_dinamic') {
$table->data[2][] = __('Free text for search (*):') . '&nbsp;' .
html_print_input_text('text_filter', $text_filter, '', 30, 100, true);
}
if (($activeTab == 'groups') || ($activeTab == 'topology')) {
$table->data[2][] = __('Don\'t show subgroups:') .
ui_print_help_tip(__('Only run with it is filter for any group'), true) .
@ -451,6 +460,9 @@ if ($id_networkmap != 0) {
case 'dinamic':
require_once('operation/agentes/networkmap.dinamic.php');
break;
case 'radial_dinamic':
require_once('operation/agentes/networkmap.dinamic.php');
break;
default:
case 'topology':
require_once('operation/agentes/networkmap.topology.php');