New maps in progress... (Added fields to creation)

This commit is contained in:
Arturo Gonzalez 2016-02-10 14:17:08 +01:00
parent 211f2d0832
commit 5a908d8c02
3 changed files with 56 additions and 36 deletions

View File

@ -30,7 +30,10 @@ abstract class Map {
protected $subtype = null; protected $subtype = null;
protected $id_group = null; protected $id_group = null;
protected $generation_method = null; protected $generation_method = null;
protected $width = null;
protected $height = null;
protected $nodes = null; protected $nodes = null;
protected $requires_js = null; protected $requires_js = null;
@ -53,6 +56,9 @@ abstract class Map {
$this->id_group = (int)$dbValues['id_group']; $this->id_group = (int)$dbValues['id_group'];
$this->generation_method = (int)$dbValues['generation_method']; $this->generation_method = (int)$dbValues['generation_method'];
$this->width = (int)$dbValues['width'];
$this->height = (int)$dbValues['height'];
} }
private function loadDB() { private function loadDB() {
@ -84,7 +90,7 @@ abstract class Map {
?> ?>
<div id="map" data-id="<?php echo $this->id;?>" > <div id="map" data-id="<?php echo $this->id;?>" >
<svg style="border: 2px solid red;" pointer-events="all" width="800px" height="800px"> <svg style="border: 2px solid red;" pointer-events="all" width="<?php echo $this->width;?>px" height="<?php echo $this->height;?>px">
</svg> </svg>
</div> </div>

View File

@ -34,6 +34,8 @@ if ($create_networkmap) {
$subtype = MAP_SUBTYPE_GROUPS; $subtype = MAP_SUBTYPE_GROUPS;
$name = ""; $name = "";
$description = ""; $description = "";
$width = 800;
$height = 800;
$source_period = 60 * 5; $source_period = 60 * 5;
$source = MAP_SOURCE_GROUP; $source = MAP_SOURCE_GROUP;
$source_data = ""; $source_data = "";
@ -75,6 +77,8 @@ if ($edit_networkmap) {
$subtype = $values['subtype']; $subtype = $values['subtype'];
$name = io_safe_output($values['name']); $name = io_safe_output($values['name']);
$description = io_safe_output($values['description']); $description = io_safe_output($values['description']);
$width = $values['width'];
$height = $values['height'];
$source_period = $values['source_period']; $source_period = $values['source_period'];
$source = $values['source']; $source = $values['source'];
if ($source == 'group') { if ($source == 'group') {
@ -193,41 +197,43 @@ else {
$table->data['method_generation'][1] = html_print_select($generation_methods, 'generation_method', $generation_method, $table->data['method_generation'][1] = html_print_select($generation_methods, 'generation_method', $generation_method,
'', '', 'twopi', true, false, true, '', '', '', 'twopi', true, false, true, '',
$disabled_select); $disabled_select);
$table->data[6][0] = __('Size of networkmap (Width x Height)');
$table->data[6][1] = html_print_input_text ('width', $width, '', 4,
10,true) . __("x");
$table->data[6][1] .= html_print_input_text ('height', $height, '',
$table->data[6][0] = __('Refresh time'); 4, 10,true);
$table->data[6][1] = html_print_input_text ('source_period', $source_period, '', 8,
$table->data[7][0] = __('Refresh time');
$table->data[7][1] = html_print_input_text ('source_period', $source_period, '', 8,
20,true); 20,true);
$table->data[7][0] = __('Show groups filter'); $table->data[8][0] = __('Show groups filter');
$table->data[7][1] = html_print_checkbox('show_groups_filter', '1', $show_groups_filter, true); $table->data[8][1] = html_print_checkbox('show_groups_filter', '1', $show_groups_filter, true);
$table->data[8][0] = __('Show module plugins'); $table->data[9][0] = __('Show module plugins');
$table->data[8][1] = html_print_checkbox('show_module_plugins', '1', $show_module_plugins, true); $table->data[9][1] = html_print_checkbox('show_module_plugins', '1', $show_module_plugins, true);
$table->data[9][0] = __('Show snmp modules'); $table->data[10][0] = __('Show snmp modules');
$table->data[9][1] = html_print_checkbox('show_snmp_modules', '1', $show_snmp_modules, true); $table->data[10][1] = html_print_checkbox('show_snmp_modules', '1', $show_snmp_modules, true);
$table->data[10][0] = __('Show modules'); $table->data[11][0] = __('Show modules');
$table->data[10][1] = html_print_checkbox('show_modules', '1', $show_modules, true); $table->data[11][1] = html_print_checkbox('show_modules', '1', $show_modules, true);
$table->data[11][0] = __('Show policy modules'); $table->data[12][0] = __('Show policy modules');
$table->data[11][1] = html_print_checkbox('show_policy_modules', '1', $show_policy_modules, true); $table->data[12][1] = html_print_checkbox('show_policy_modules', '1', $show_policy_modules, true);
$table->data[12][0] = __('Show pandora nodes'); $table->data[13][0] = __('Show pandora nodes');
$table->data[12][1] = html_print_checkbox('show_pandora_nodes', '1', $show_pandora_nodes, true); $table->data[13][1] = html_print_checkbox('show_pandora_nodes', '1', $show_pandora_nodes, true);
$table->data[13][0] = __('Show module group'); $table->data[14][0] = __('Show module group');
$table->data[13][1] = html_print_checkbox('show_module_group', '1', $show_module_group, true); $table->data[14][1] = html_print_checkbox('show_module_group', '1', $show_module_group, true);
$table->data[14][0] = __('Filter by tags'); $table->data[15][0] = __('Filter by tags');
$table->data[14][1] = html_print_select (tags_get_user_tags(), "id_tag", $id_tag, '', __('All'), 0, true, false, true, '', false, ''); $table->data[15][1] = html_print_select (tags_get_user_tags(), "id_tag", $id_tag, '', __('All'), 0, true, false, true, '', false, '');
$table->data[15][0] = __('Filter by text'); $table->data[16][0] = __('Filter by text');
$table->data[15][1] = html_print_input_text ('text', $text, '', 30, $table->data[16][1] = html_print_input_text ('text', $text, '', 30,
100,true); 100,true);
echo '<form method="post" action="index.php?sec=maps&amp;sec2=operation/maps/networkmap_list">'; echo '<form method="post" action="index.php?sec=maps&amp;sec2=operation/maps/networkmap_list">';

View File

@ -125,6 +125,8 @@ if ($save_networkmap) {
$source = (string) get_parameter('source_ip_mask', 0); $source = (string) get_parameter('source_ip_mask', 0);
break; break;
} }
$width = (int) get_parameter('width', 800);
$height = (int) get_parameter('height', 800);
$generation_method = (int) get_parameter('generation_method', MAP_GENERATION_CIRCULAR); $generation_method = (int) get_parameter('generation_method', MAP_GENERATION_CIRCULAR);
$show_groups_filter = (int) get_parameter('show_groups_filter', false); $show_groups_filter = (int) get_parameter('show_groups_filter', false);
$show_module_plugins = (int) get_parameter('show_module_plugins', false); $show_module_plugins = (int) get_parameter('show_module_plugins', false);
@ -146,6 +148,8 @@ if ($save_networkmap) {
$values['source_period'] = $source_period; $values['source_period'] = $source_period;
$values['source_data'] = $source_data; $values['source_data'] = $source_data;
$values['generation_method'] = $generation_method; $values['generation_method'] = $generation_method;
$values['width'] = $width;
$values['height'] = $height;
$values['source'] = $source; $values['source'] = $source;
$filter = array(); $filter = array();
$filter['show_groups_filter'] = 60; $filter['show_groups_filter'] = 60;
@ -235,6 +239,8 @@ else if ($delete_networkmap || $duplicate_networkmap || $update_networkmap) {
$source_period = (int) get_parameter('source_period', 60 * 5); $source_period = (int) get_parameter('source_period', 60 * 5);
$source = (int) get_parameter('source', MAP_SOURCE_GROUP); $source = (int) get_parameter('source', MAP_SOURCE_GROUP);
$source_data = (string) get_parameter('source_data', 'group'); $source_data = (string) get_parameter('source_data', 'group');
$width = (int) get_parameter('width', 800);
$height = (int) get_parameter('height', 800);
$show_groups_filter = (int) get_parameter('show_groups_filter', false); $show_groups_filter = (int) get_parameter('show_groups_filter', false);
$show_module_plugins = (int) get_parameter('show_module_plugins', false); $show_module_plugins = (int) get_parameter('show_module_plugins', false);
$show_snmp_modules = (int) get_parameter('show_snmp_modules', false); $show_snmp_modules = (int) get_parameter('show_snmp_modules', false);
@ -252,6 +258,8 @@ else if ($delete_networkmap || $duplicate_networkmap || $update_networkmap) {
$values['source_period'] = $source_period; $values['source_period'] = $source_period;
$values['source_data'] = $source_data; $values['source_data'] = $source_data;
$values['source'] = $source; $values['source'] = $source;
$values['width'] = $width;
$values['height'] = $height;
$filter = array(); $filter = array();
$filter['show_groups_filter'] = $show_groups_filter; $filter['show_groups_filter'] = $show_groups_filter;
$filter['show_module_plugins'] = $show_module_plugins; $filter['show_module_plugins'] = $show_module_plugins;