2014-06-24 Miguel de Dios <miguel.dedios@artica.es>

* godmode/setup/setup_visuals.php, include/functions_networkmap.php,
	include/functions_config.php: added the visual config value for
	to set the width of networkmap, and fixed the overlap of networkmap
	L2.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10277 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2014-06-24 13:17:14 +00:00
parent eda02e75d6
commit f8a4628d3a
4 changed files with 65 additions and 33 deletions

View File

@ -1,3 +1,10 @@
2014-06-24 Miguel de Dios <miguel.dedios@artica.es>
* godmode/setup/setup_visuals.php, include/functions_networkmap.php,
include/functions_config.php: added the visual config value for
to set the width of networkmap, and fixed the overlap of networkmap
L2.
2014-06-24 Ramon Novoa <rnovoa@artica.es> 2014-06-24 Ramon Novoa <rnovoa@artica.es>
* operation/snmpconsole/snmp_mib_uploader.php: Added additional information. * operation/snmpconsole/snmp_mib_uploader.php: Added additional information.

View File

@ -185,21 +185,22 @@ $row++;
$table->data[$row][0] = __('Font size'); $table->data[$row][0] = __('Font size');
$font_size_array = array( 1 => 1, $font_size_array = array(
2 => 2, 1 => 1,
3 => 3, 2 => 2,
4 => 4, 3 => 3,
5 => 5, 4 => 4,
6 => 6, 5 => 5,
7 => 7, 6 => 6,
8 => 8, 7 => 7,
9 => 9, 8 => 8,
10 => 10, 9 => 9,
11 => 11, 10 => 10,
12 => 12, 11 => 11,
13 => 13, 12 => 12,
14 => 14, 13 => 13,
15 => 15); 14 => 14,
15 => 15);
$table->data[$row][1] = html_print_select($font_size_array, 'font_size', $config["font_size"], '', '', 0, true); $table->data[$row][1] = html_print_select($font_size_array, 'font_size', $config["font_size"], '', '', 0, true);
@ -393,6 +394,11 @@ $table->data[$row][1] = html_print_input_text ('graphviz_bin_dir', $config["grap
$row++; $row++;
$table->data[$row][0] = __('Networkmap max width');
$table->data[$row][1] = html_print_input_text ('networkmap_max_width', $config["networkmap_max_width"], '', 10, 20, true);
$row++;
echo '<form id="form_setup" method="post">'; echo '<form id="form_setup" method="post">';
html_print_input_hidden ('update_config', 1); html_print_input_hidden ('update_config', 1);
html_print_table ($table); html_print_table ($table);

View File

@ -437,7 +437,9 @@ function config_update_config () {
$error_update[] = __('Paginate module'); $error_update[] = __('Paginate module');
if (!config_update_value ('graphviz_bin_dir', get_parameter('graphviz_bin_dir'))) if (!config_update_value ('graphviz_bin_dir', get_parameter('graphviz_bin_dir')))
$error_update[] = __('Custom graphviz directory'); $error_update[] = __('Custom graphviz directory');
if (!config_update_value ('networkmap_max_width', get_parameter('networkmap_max_width')))
$error_update[] = __('Networkmap max width');
$interval_values = get_parameter ('interval_values'); $interval_values = get_parameter ('interval_values');
// Add new interval value if is provided // Add new interval value if is provided
@ -473,26 +475,26 @@ function config_update_config () {
if (!config_update_value ('interval_values', $interval_values)) if (!config_update_value ('interval_values', $interval_values))
$error_update[] = __('Delete interval'); $error_update[] = __('Delete interval');
// Juanma (06/05/2014) New feature: Custom front page for reports // Juanma (06/05/2014) New feature: Custom front page for reports
if (!config_update_value ('custom_report_front', get_parameter('custom_report_front'))) if (!config_update_value ('custom_report_front', get_parameter('custom_report_front')))
$error_update[] = __('Custom report front'); $error_update[] = __('Custom report front');
if (!config_update_value ('custom_report_front_font', get_parameter('custom_report_front_font'))) if (!config_update_value ('custom_report_front_font', get_parameter('custom_report_front_font')))
$error_update[] = __('Custom report front') . ' - ' . __('Font family'); $error_update[] = __('Custom report front') . ' - ' . __('Font family');
if (!config_update_value ('custom_report_front_logo', get_parameter('custom_report_front_logo'))) if (!config_update_value ('custom_report_front_logo', get_parameter('custom_report_front_logo')))
$error_update[] = __('Custom report front') . ' - ' . __('Custom logo'); $error_update[] = __('Custom report front') . ' - ' . __('Custom logo');
if (!config_update_value ('custom_report_front_header', get_parameter('custom_report_front_header'))) if (!config_update_value ('custom_report_front_header', get_parameter('custom_report_front_header')))
$error_update[] = __('Custom report front') . ' - ' . __('Header'); $error_update[] = __('Custom report front') . ' - ' . __('Header');
if (!config_update_value ('custom_report_front_firstpage', get_parameter('custom_report_front_firstpage'))) if (!config_update_value ('custom_report_front_firstpage', get_parameter('custom_report_front_firstpage')))
$error_update[] = __('Custom report front') . ' - ' . __('First page'); $error_update[] = __('Custom report front') . ' - ' . __('First page');
if (!config_update_value ('custom_report_front_footer', get_parameter('custom_report_front_footer'))) if (!config_update_value ('custom_report_front_footer', get_parameter('custom_report_front_footer')))
$error_update[] = __('Custom report front') . ' - ' . __('Footer'); $error_update[] = __('Custom report front') . ' - ' . __('Footer');
break; break;
case 'net': case 'net':
if (!config_update_value ('netflow_path', get_parameter ('netflow_path'))) if (!config_update_value ('netflow_path', get_parameter ('netflow_path')))
@ -1148,28 +1150,32 @@ function config_process_config () {
if (!isset($config['custom_report_front_font'])) { if (!isset($config['custom_report_front_font'])) {
config_update_value ('custom_report_front_font', 'FreeSans.ttf'); config_update_value ('custom_report_front_font', 'FreeSans.ttf');
} }
if (!isset($config['custom_report_front_logo'])) { if (!isset($config['custom_report_front_logo'])) {
config_update_value ('custom_report_front_logo', 'images/pandora_logo_white.jpg'); config_update_value ('custom_report_front_logo', 'images/pandora_logo_white.jpg');
} }
if (!isset($config['custom_report_front_header'])) { if (!isset($config['custom_report_front_header'])) {
config_update_value ('custom_report_front_header', ''); config_update_value ('custom_report_front_header', '');
} }
if (!isset($config['custom_report_front_firstpage'])) { if (!isset($config['custom_report_front_firstpage'])) {
config_update_value ('custom_report_front_firstpage', "&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&lt;img&#x20;src=&quot;" . ui_get_full_url(false, false, false, false) . "/images/pandora_report_logo.png&quot;&#x20;alt=&quot;&quot;&#x20;width=&quot;800&quot;&#x20;/&gt;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&lt;span&#x20;style=&quot;font-size:&#x20;xx-large;&quot;&gt;&#40;_REPORT_NAME_&#41;&lt;/span&gt;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&lt;span&#x20;style=&quot;font-size:&#x20;large;&quot;&gt;&#40;_DATETIME_&#41;&lt;/span&gt;&lt;/p&gt;"); config_update_value ('custom_report_front_firstpage', "&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&lt;img&#x20;src=&quot;" . ui_get_full_url(false, false, false, false) . "/images/pandora_report_logo.png&quot;&#x20;alt=&quot;&quot;&#x20;width=&quot;800&quot;&#x20;/&gt;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&lt;span&#x20;style=&quot;font-size:&#x20;xx-large;&quot;&gt;&#40;_REPORT_NAME_&#41;&lt;/span&gt;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&lt;span&#x20;style=&quot;font-size:&#x20;large;&quot;&gt;&#40;_DATETIME_&#41;&lt;/span&gt;&lt;/p&gt;");
} }
if (!isset($config['custom_report_front_footer'])) { if (!isset($config['custom_report_front_footer'])) {
config_update_value ('custom_report_front_footer', ''); config_update_value ('custom_report_front_footer', '');
} }
if (!isset($config['autohidden_menu'])) { if (!isset($config['autohidden_menu'])) {
config_update_value ('autohidden_menu', 0); config_update_value ('autohidden_menu', 0);
} }
if (!isset($config['networkmap_max_width'])) {
config_update_value ('networkmap_max_width', 800);
}
/* Finally, check if any value was overwritten in a form */ /* Finally, check if any value was overwritten in a form */
config_update_config(); config_update_config();
} }

View File

@ -237,6 +237,10 @@ function networkmap_generate_dot ($pandora_name, $group = 0,
global $config; global $config;
if ($l2_network) {
$nooverlap = 1;
}
$parents = array(); $parents = array();
$orphans = array(); $orphans = array();
@ -1263,10 +1267,19 @@ function networkmap_close_group () {
// Opens a graph definition // Opens a graph definition
function networkmap_open_graph ($layout, $nooverlap, $pure, $zoom, $ranksep, $font_size) { function networkmap_open_graph ($layout, $nooverlap, $pure, $zoom, $ranksep, $font_size) {
global $config;
$overlap = 'compress'; $overlap = 'compress';
$size_x = 8;
$size_y = 5.4; if (isset($config['networkmap_max_width'])) {
$size = ''; $size_x = $config['networkmap_max_width'] / 100;
$size_y = $size_x * 0.8;
}
else {
$size_x = 8;
$size_y = 5.4;
$size = '';
}
if ($layout == 'radial') { if ($layout == 'radial') {