mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
#10118 changed CIDR input
This commit is contained in:
parent
5b263981c4
commit
ccb0cda305
@ -782,7 +782,9 @@ class NetworkMap
|
|||||||
if ($this->network) {
|
if ($this->network) {
|
||||||
// Network map, based on direct network.
|
// Network map, based on direct network.
|
||||||
$nodes = networkmap_get_nodes_from_ip_mask(
|
$nodes = networkmap_get_nodes_from_ip_mask(
|
||||||
$this->network
|
$this->network,
|
||||||
|
false,
|
||||||
|
'
'
|
||||||
);
|
);
|
||||||
} else if ($this->mapOptions['map_filter']['empty_map']) {
|
} else if ($this->mapOptions['map_filter']['empty_map']) {
|
||||||
// Empty map returns no data.
|
// Empty map returns no data.
|
||||||
|
@ -1356,9 +1356,10 @@ function networkmap_get_types($strict_user=false)
|
|||||||
*/
|
*/
|
||||||
function networkmap_get_nodes_from_ip_mask(
|
function networkmap_get_nodes_from_ip_mask(
|
||||||
$ip_mask,
|
$ip_mask,
|
||||||
$return_ids_only=false
|
$return_ids_only=false,
|
||||||
|
$separator=',',
|
||||||
) {
|
) {
|
||||||
$list_ip_masks = explode(',', $ip_mask);
|
$list_ip_masks = explode($separator, $ip_mask);
|
||||||
|
|
||||||
if (empty($list_ip_masks) === true) {
|
if (empty($list_ip_masks) === true) {
|
||||||
return [];
|
return [];
|
||||||
|
@ -273,6 +273,21 @@ if (!empty($result)) {
|
|||||||
if ($not_found) {
|
if ($not_found) {
|
||||||
ui_print_error_message(__('Not found networkmap.'));
|
ui_print_error_message(__('Not found networkmap.'));
|
||||||
} else {
|
} else {
|
||||||
|
if ($disabled_source === false) {
|
||||||
|
$info1 = __('To create a network map that visually recreates link-level (L2) relationships, you must first discover these relationships with Discovery Server. Network maps only reflect relationships that have already been discovered.');
|
||||||
|
$separator = '<br>';
|
||||||
|
$info2 = __('Discovery Server discovers relationships between interfaces (L2) through SNMP and relationships between hosts (L3) through route discovery.');
|
||||||
|
$info3 = __('You can also create these relationships manually by editing nodes or re-passing a discovery task after adding new information (for example by adding new SNMP communities).');
|
||||||
|
$info4 = __('See our documentation for more information.');
|
||||||
|
ui_print_info_message(
|
||||||
|
[
|
||||||
|
'no_close' => false,
|
||||||
|
'message' => $info1.$separator.$info2.$separator.$info3.$separator.$info4,
|
||||||
|
],
|
||||||
|
'style="width: 98%;"'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$table = new stdClass();
|
$table = new stdClass();
|
||||||
$table->id = 'form_editor';
|
$table->id = 'form_editor';
|
||||||
|
|
||||||
@ -401,7 +416,16 @@ if ($not_found) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
$table->data['source_data_ip_mask'][0] = __('Source from CIDR IP mask');
|
$table->data['source_data_ip_mask'][0] = __('Source from CIDR IP mask');
|
||||||
$table->data['source_data_ip_mask'][1] = html_print_input_text('ip_mask', $ip_mask, '', 20, 255, true, $disabled_source);
|
$table->data['source_data_ip_mask'][1] = html_print_textarea(
|
||||||
|
'ip_mask',
|
||||||
|
3,
|
||||||
|
5,
|
||||||
|
$ip_mask,
|
||||||
|
'style="width: 238px"',
|
||||||
|
true,
|
||||||
|
'',
|
||||||
|
$disabled_source
|
||||||
|
);
|
||||||
|
|
||||||
$table->data['source_data_group'][0] = __('Source group');
|
$table->data['source_data_group'][0] = __('Source group');
|
||||||
$table->data['source_data_group'][1] = '<div class="w250px">'.html_print_select_groups(
|
$table->data['source_data_group'][1] = '<div class="w250px">'.html_print_select_groups(
|
||||||
|
@ -237,7 +237,16 @@ if (is_ajax() === true) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
$table->data['source_data_ip_mask'][0] = __('Source from CIDR IP mask');
|
$table->data['source_data_ip_mask'][0] = __('Source from CIDR IP mask');
|
||||||
$table->data['source_data_ip_mask'][1] = html_print_input_text('ip_mask', $map_info['source_data'], '', 20, 255, true);
|
$table->data['source_data_ip_mask'][1] = html_print_textarea(
|
||||||
|
'ip_mask',
|
||||||
|
3,
|
||||||
|
5,
|
||||||
|
$map_info['source_data'],
|
||||||
|
'',
|
||||||
|
true,
|
||||||
|
'',
|
||||||
|
$disabled_source
|
||||||
|
);
|
||||||
|
|
||||||
$dont_show_subgroups = 0;
|
$dont_show_subgroups = 0;
|
||||||
if (isset($map_filter['dont_show_subgroups'])) {
|
if (isset($map_filter['dont_show_subgroups'])) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user