Merge branch 'ent-9662-second-round' of brutus.artica.es:artica/pandorafms into ent-9662-second-round

This commit is contained in:
Pablo Aragon 2023-03-13 16:14:02 +01:00
commit 51ab985784
25 changed files with 801 additions and 559 deletions

View File

@ -808,7 +808,7 @@ if ($id_agente) {
$pure = (int) get_parameter('pure');
if ($pure === 0) {
ui_print_standard_header(
__('Agent setup view'),
__('Agent setup view').' ( '.strtolower(agents_get_alias($id_agente)).' )',
'images/agent.png',
false,
$helper,

View File

@ -251,69 +251,69 @@ if (enterprise_installed()) {
switch ($section) {
case 'general':
$buttons['general']['active'] = true;
$subpage = ' &raquo '.__('General');
$subpage = __('General');
$help_header = 'setup_general_tab';
break;
case 'auth':
$buttons['auth']['active'] = true;
$subpage = ' &raquo '.__('Authentication');
$subpage = __('Authentication');
break;
case 'perf':
$buttons['perf']['active'] = true;
$subpage = ' &raquo '.__('Performance');
$subpage = __('Performance');
$help_header = '';
break;
case 'vis':
$buttons['vis']['active'] = true;
$subpage = ' &raquo '.__('Visual styles');
$subpage = __('Visual styles');
break;
case 'net':
$buttons['net']['active'] = true;
$subpage = ' &raquo '.__('Netflow');
$subpage = __('Netflow');
$help_header = 'setup_netflow_tab';
break;
case 'ehorus':
$buttons['ehorus']['active'] = true;
$subpage = ' &raquo '.__('eHorus');
$subpage = __('eHorus');
$help_header = 'setup_ehorus_tab';
break;
case 'integria':
$buttons['integria']['active'] = true;
$subpage = ' &raquo '.__('Integria IMS');
$subpage = __('Integria IMS');
$help_header = 'setup_integria_tab';
break;
case 'module_library':
$buttons['module_library']['active'] = true;
$subpage = ' &raquo '.__('Module Library');
$subpage = __('Module Library');
$help_header = 'setup_module_library_tab';
break;
case 'gis':
$buttons['gis']['active'] = true;
$subpage = ' &raquo '.__('Map conections GIS');
$subpage = __('Map conections GIS');
break;
case 'notifications':
$buttons['notifications']['active'] = true;
$subpage = ' &raquo '.__('Notifications');
$subpage = __('Notifications');
break;
case 'websocket_engine':
$buttons['websocket_engine']['active'] = true;
$subpage = ' &raquo '.__('Pandora Websocket Engine');
$subpage = __('Pandora Websocket Engine');
$help_header = 'quickshell_settings';
break;
case 'external_tools':
$buttons['external_tools']['active'] = true;
$subpage = ' &raquo '.__('External Tools');
$subpage = __('External Tools');
$help_header = '';
break;
@ -327,39 +327,49 @@ switch ($section) {
}
$buttons['welcome_tips']['active'] = true;
$subpage = ' &raquo '.$title;
$subpage = $title;
$help_header = '';
break;
case 'enterprise':
$buttons['enterprise']['active'] = true;
$subpage = ' &raquo '.__('Enterprise');
$subpage = __('Enterprise');
$help_header = 'setup_enterprise_tab';
break;
case 'hist_db':
$buttons['hist_db']['active'] = true;
$subpage = __('Historical database');
$help_header = '';
break;
case 'pass':
$buttons['pass']['active'] = true;
$subpage = __('Password policies');
$help_header = '';
break;
default:
$subpage = 'seccion: '.$section;
// Default.
break;
}
// Put header inside div for special sizing.(No right margin).
echo '<div id="header_configuration" style="width: calc(100%);">';
// Header.
ui_print_page_header(
__('Configuration').$subpage,
ui_print_standard_header(
$subpage,
'',
false,
$help_header,
true,
$buttons,
false,
'',
GENERIC_SIZE_TEXT,
'',
'',
true
[
[
'link' => '',
'label' => __('Setup'),
],
]
);
echo '</div>';
if (isset($config['error_config_update_config'])) {
if ($config['error_config_update_config']['correct'] == false) {

View File

@ -873,7 +873,7 @@ class DiscoveryTaskList extends HTML
'100%',
1.9,
// Color.
'#82b92e',
'#ececec',
// Return.
true,
// Text.
@ -1218,12 +1218,12 @@ class DiscoveryTaskList extends HTML
$result .= progress_circular_bar(
$task['id_rt'],
($task['status'] < 0) ? 100 : $task['status'],
200,
200,
'#7eb641',
150,
150,
'#3A3A3A',
'%',
'',
'#3A3A3A',
'#ececec',
0
);
@ -1288,12 +1288,12 @@ class DiscoveryTaskList extends HTML
$result .= progress_circular_bar(
$task['id_rt'].'_detail',
$task['stats']['c_network_percent'],
200,
200,
'#7eb641',
150,
150,
'#3A3A3A',
'%',
'',
'#3A3A3A',
'#ececec',
0
);
$result .= '</div></div>';

View File

@ -1831,7 +1831,7 @@ class Diagnostics extends Wizard
if ($items[$key]['status'] === 2) {
$items[$key]['value'] = html_print_image(
'images/icono-warning.png',
'images/alert-yellow@svg.svg',
true,
[
'title' => __('Warning'),
@ -1840,7 +1840,7 @@ class Diagnostics extends Wizard
);
} else if ($items[$key]['status'] === 1) {
$items[$key]['value'] = html_print_image(
'images/exito.png',
'images/validate.svg',
true,
[
'title' => __('Successfully'),
@ -1849,7 +1849,7 @@ class Diagnostics extends Wizard
);
} else {
$items[$key]['value'] = html_print_image(
'images/error_1.png',
'images/fail@svg.svg',
true,
[
'title' => __('Error'),

View File

@ -181,113 +181,47 @@ class SnmpConsole extends HTML
$default_refr = 300;
if (!isset($config['pure']) || $config['pure'] === false) {
$statistics['text'] = '<a href="index.php?sec=estado&sec2=operation/snmpconsole/snmp_statistics&pure='.$config['pure'].'">'.html_print_image(
'images/logs@svg.svg',
true,
[
'title' => __('Statistics'),
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
$list['text'] = '<a href="index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view&pure=0">'.html_print_image(
'images/SNMP-network-numeric-data@svg.svg',
true,
[
'title' => __('List'),
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
$list['active'] = true;
$statistics['text'] = '<a href="index.php?sec=estado&sec2=operation/snmpconsole/snmp_statistics&pure='.$config['pure'].'">'.html_print_image(
'images/logs@svg.svg',
true,
[
'title' => __('Statistics'),
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
$list['text'] = '<a href="index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view&pure=0">'.html_print_image(
'images/SNMP-network-numeric-data@svg.svg',
true,
[
'title' => __('List'),
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
$list['active'] = true;
$screen['text'] = '<a href="#" onClick="javascript:fullscreen(1)">'.html_print_image(
'images/fullscreen@svg.svg',
true,
// Header.
ui_print_standard_header(
__('SNMP Console'),
'images/op_snmp.png',
false,
'snmp_console',
false,
[
$screen,
$list,
$statistics,
],
[
[
'title' => __('View in full screen'),
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
// Header.
ui_print_standard_header(
__('SNMP Console'),
'images/op_snmp.png',
false,
'snmp_console',
false,
[
$screen,
$list,
$statistics,
'link' => '',
'label' => __('Monitoring'),
],
[
[
'link' => '',
'label' => __('Monitoring'),
],
[
'link' => '',
'label' => __('SNMP'),
],
]
);
} else {
echo '<div id="dashboard-controls">';
echo '<div id="menu_tab">';
echo '<ul class="mn">';
// Normal view button.
echo '<li class="nomn">';
echo '<a href="#" onClick="javascript:fullscreen(0)">';
echo html_print_image(
'images/exit_fullscreen@svg.svg',
true,
[
'title' => __('Exit fullscreen'),
'class' => 'main_menu_icon invert_filter',
]
);
echo '</a>';
echo '</li>';
// Auto refresh control.
echo '<li class="nomn">';
echo '<div class="dashboard-refr mrgn_top_6px">';
echo '<div class="dashboard-countdown display_in"></div>';
$normal_url = 'index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view';
echo '<form id="refr-form" method="get" action="'.$normal_url.'" >';
echo __('Refresh every').':';
echo html_print_select(get_refresh_time_array(), 'refresh', $this->refr, '', '', 0, true, false, false);
echo '</form>';
echo '</li>';
html_print_input_hidden('sec', 'snmpconsole');
html_print_input_hidden('sec2', 'operation/snmpconsole/snmp_view');
html_print_input_hidden('pure', 1);
html_print_input_hidden('refresh', (($this->refr > 0) ? $this->refr : $default_refr));
// Dashboard name.
echo '<li class="nomn">';
echo '<div class="dashboard-title">'.__('SNMP Traps').'</div>';
echo '</li>';
echo '</ul>';
echo '</div>';
echo '</div>';
ui_require_css_file('pandora_enterprise', ENTERPRISE_DIR.'/include/styles/');
ui_require_css_file('pandora_dashboard', ENTERPRISE_DIR.'/include/styles/');
ui_require_css_file('cluetip', 'include/styles/js/');
ui_require_jquery_file('countdown');
ui_require_javascript_file('pandora_dashboard', ENTERPRISE_DIR.'/include/javascript/');
ui_require_javascript_file('wz_jsgraphics');
ui_require_javascript_file('pandora_visual_console');
}
'link' => '',
'label' => __('SNMP'),
],
]
);
// Datatables list.
try {

View File

@ -842,7 +842,7 @@ if (is_ajax()) {
$fragmentation_status = '';
if ($db_fragmentation->data->tablesFragmentationStatus->status === 1) {
$fragmentation_status = html_print_image(
'images/exito.png',
'images/validate.svg',
true,
[
'title' => __('Successfully'),
@ -851,7 +851,7 @@ if (is_ajax()) {
);
} else {
$fragmentation_status = html_print_image(
'images/error_1.png',
'images/fail@svg.svg',
true,
[
'title' => __('Error'),

View File

@ -5083,6 +5083,8 @@ function ui_print_page_header(
$breadcrumbs='',
$hide_left_small=false
) {
global $config;
$title = io_safe_input_html($title);
if (($icon == '') && ($godmode == true)) {
$icon = 'images/gm_setup.png';
@ -5096,13 +5098,18 @@ function ui_print_page_header(
$type = 'view';
$type2 = 'menu_tab_frame_view';
$separator_class = 'separator';
$div_style = '';
} else {
$type = 'view';
$type2 = 'menu_tab_frame_view';
$separator_class = 'separator_view';
$div_style = '';
if ($config['pure'] === true) {
$div_style = 'top:0px;';
}
}
$buffer = '<div id="'.$type2.'" >';
$buffer = '<div id="'.$type2.'" style="'.$div_style.'" >';
if (!empty($breadcrumbs)) {
$buffer .= '<div class="menu_tab_left_bc">';

View File

@ -2167,7 +2167,7 @@ function print_circular_progress_bar(
var numberText = circle
.append("text")
.attr("fill", label_color)
.attr("fill", "#333333")
.style("font-weight", "bold")
.style("font-size", numberSize)
.attr("text-anchor", "middle")
@ -2175,7 +2175,7 @@ function print_circular_progress_bar(
var percentText = circle
.append("text")
.attr("fill", label_color)
.attr("fill", "#333333")
.style("font-weight", "bold")
.style("font-size", unitSize)
.text(unit)

View File

@ -5843,6 +5843,7 @@ div.switch_radio_button label {
margin-right: -1px;
border: 1px solid #cbcbcb;
transition: all 0.1s ease-in-out;
background: transparent;
}
div.switch_radio_button label:first-of-type {
@ -11244,8 +11245,8 @@ input.main_menu_icon[src$=".svg"] {
}
.header_help_icon {
width: 16px;
height: 16px;
width: 16px !important;
height: 16px !important;
}
.main_menu_icon.arrow_up {
transform: rotate(90deg);
@ -11640,3 +11641,21 @@ ul.tag-editor {
padding-left: 5px !important;
font-size: 20px !important;
}
div.ui-dialog-buttonset > button.ui-button.ui-corner-all.ui-widget {
background-color: var(--primary-color);
color: #fff;
border: 1px solid var(--primary-color);
border-radius: 8px;
font-size: 11pt;
}
div.ui-dialog-buttonset > button.ui-button.ui-corner-all.ui-widget:hover {
background-color: #1d7873;
border-color: #1d7873;
}
div.ui-dialog-buttonset > button.ui-button.ui-corner-all.ui-widget:active {
background-color: #0d312f;
border-color: #0d312f;
}

View File

@ -38,7 +38,7 @@ table.header_table tr td {
}
table thead tr th {
background-color: #919191;
background-color: #e5e5e5;
}
table thead tr th.title_table_pdf {

View File

@ -1249,8 +1249,7 @@ a.pandora_pagination:hover {
background-color: #555 !important;
}
.dt-button.buttons-csv.buttons-html5 {
filter: invert(100%);
background-color: transparent;
box-shadow: 0px 3px 6px #111;
}
.info_table.events > tbody > tr > td {
@ -1494,7 +1493,7 @@ div.white_box.white_box_opened.no_border {
border-radius: 0px;
}
table.filter-table-adv td > div label {
table.filter-table-adv td > div label:not(.inputFile) {
color: white !important;
}
@ -1507,3 +1506,12 @@ div.fixed-bottom-box
> div.fixed-bottom-box-head-body {
background-color: #111111 !important;
}
.filter_table,
.white_table_graph_fixed table {
background-color: transparent;
}
span.select2 {
border-radius: 6px;
}

View File

@ -802,3 +802,7 @@ div[id^="auto-os-"] > img {
.dataTables_paginate {
margin-right: 10px;
}
.dataTables_paginate.paging_simple_numbers {
margin-right: 0;
}

View File

@ -43,7 +43,7 @@ div.subtitle {
}
div.subtitle span {
font-size: 1.9em;
font-size: 1.3em;
}
div.subtitle div.manage {

View File

@ -97,7 +97,7 @@ ui_print_message_dialog(
$conn_title,
$conn_text,
'connection',
'/images/error_1.png'
'/images/fail@svg.svg'
);
?>

View File

@ -1921,7 +1921,7 @@ switch ($tab) {
if ((bool) $config['pure'] === false) {
ui_print_standard_header(
__('Agent main view'),
__('Agent main view').' ( '.strtolower(agents_get_alias($id_agente)).' )',
$icon,
false,
($help_header ?? ''),

View File

@ -173,7 +173,7 @@ ui_print_message_dialog(
$conn_title,
$conn_text,
'connection',
'/images/error_1.png'
'/images/fail@svg.svg'
);
$inputs = [];

View File

@ -278,7 +278,7 @@ if ($layers != false) {
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.');
ui_require_javascript_file('connection_check');
set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false));
ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/error_1.png');
ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/fail@svg.svg');
}
// Resize GIS map on fullscreen

View File

@ -101,7 +101,7 @@ $max_aggregates = (int) get_parameter('max_aggregates', 10);
$update_date = (int) get_parameter('update_date', 0);
$connection_name = get_parameter('connection_name', '');
$interval_length = get_parameter('interval_length', NETFLOW_RES_MEDD);
$address_resolution = (int) get_parameter('address_resolution', $config['netflow_get_ip_hostname']);
$address_resolution = (int) get_parameter('address_resolution', ($config['netflow_get_ip_hostname'] ?? ''));
$filter_selected = (int) get_parameter('filter_selected', 0);
// Read time values.
@ -127,13 +127,23 @@ $update = get_parameter('update_button', '');
if (is_metaconsole() === false) {
// Header.
ui_print_page_header(
ui_print_standard_header(
__('Netflow live view'),
'images/op_netflow.png',
false,
'',
false,
[]
[],
[
[
'link' => '',
'label' => __('Monitoring'),
],
[
'link' => '',
'label' => __('Network'),
],
]
);
$is_windows = strtoupper(substr(PHP_OS, 0, 3)) == 'WIN';
@ -202,22 +212,9 @@ if (isset($config['netflow_disable_custom_lvfilters'])) {
$netflow_disable_custom_lvfilters = $config['netflow_disable_custom_lvfilters'];
}
$class = 'databox filters';
echo '<form method="post" action="'.$config['homeurl'].'index.php?sec=netf&sec2=operation/netflow/nf_live_view&pure='.$pure.'">';
echo "<table class='".$class."' width='100%'>";
if (is_metaconsole()) {
echo '<thead>
<tr>
<th align=center colspan=6>
'.__('Draw live filter').'
</th>
</tr>
</thead>';
// Add nodes list.
if (is_metaconsole() === true) {
$list_servers = [];
$servers = db_get_all_rows_sql(
'SELECT *
FROM tmetaconsole_setup'
@ -244,62 +241,245 @@ if (is_metaconsole()) {
metaconsole_restore_db();
}
echo '<tr>';
echo '<td><b>'.__('Connection').'</b></td>';
echo '<td>'.html_print_select(
$list_servers,
'connection_name',
$connection_name,
$nodeListInput = html_print_label_input_block(
__('Connection'),
html_print_select(
$list_servers,
'connection_name',
$connection_name,
'',
'',
0,
true,
false,
false
)
);
} else {
$nodeListInput = '';
}
$class_not_period = ($is_period === true) ? 'nf_hidden' : 'nf_display';
$class_period = ($is_period === true) ? 'nf_display' : 'nf_hidden';
$max_values = [
'2' => '2',
'5' => '5',
'10' => '10',
'15' => '15',
'20' => '20',
'25' => '25',
'50' => '50',
$max_aggregates => $max_aggregates,
];
$aggregate_list = [];
$aggregate_list = [
'srcip' => __('Src Ip Address'),
'dstip' => __('Dst Ip Address'),
'srcport' => __('Src Port'),
'dstport' => __('Dst Port'),
];
$advanced_toggle = '<table style="width:100%">';
$advanced_toggle .= '<tr>';
if ($netflow_disable_custom_lvfilters) {
$advanced_toggle .= '<td></td>';
$advanced_toggle .= '<td></td>';
} else {
$advanced_toggle .= '<td><b>'.__('Filter').'</b></td>';
$advanced_toggle .= '<td colspan="2">'.__('Normal').' '.html_print_radio_button_extended('filter_type', 0, '', $filter_type, false, 'displayNormalFilter();', 'style="margin-right: 40px;"', true).__('Custom').' '.html_print_radio_button_extended('filter_type', 1, '', $filter_type, false, 'displayAdvancedFilter();', 'style="margin-right: 40px;"', true).'</td>';
}
$advanced_toggle .= '<td><b>'.__('Load filter').'</b></td>';
$user_groups = users_get_groups($config['id_user'], 'AR', $own_info['is_admin'], true);
$user_groups[0] = 0;
// Add all groups.
$sql = 'SELECT *
FROM tnetflow_filter
WHERE id_group IN ('.implode(',', array_keys($user_groups)).')';
$advanced_toggle .= "<td colspan='3'>".html_print_select_from_sql($sql, 'filter_id', $filter_id, '', __('Select a filter'), 0, true);
$advanced_toggle .= html_print_input_hidden('filter_selected', $filter_selected, false);
$advanced_toggle .= '</td>';
$advanced_toggle .= '</tr>';
$advanced_toggle .= "<tr class='filter_normal'>";
if ($netflow_disable_custom_lvfilters) {
$advanced_toggle .= '<td></td>';
$advanced_toggle .= '<td></td>';
} else {
$advanced_toggle .= "<td style='font-weight:bold;'>".__('Dst Ip').ui_print_help_tip(__('Destination IP. A comma separated list of destination ip. If we leave the field blank, will show all ip. Example filter by ip:<br>25.46.157.214,160.253.135.249'), true).'</td>';
$advanced_toggle .= '<td colspan="2">'.html_print_input_text('ip_dst', $filter['ip_dst'], false, 40, 80, true).'</td>';
}
if ($netflow_disable_custom_lvfilters) {
$advanced_toggle .= '<td></td>';
$advanced_toggle .= '<td></td>';
} else {
$advanced_toggle .= "<td style='font-weight:bold;'>".__('Src Ip').ui_print_help_tip(__('Source IP. A comma separated list of source ip. If we leave the field blank, will show all ip. Example filter by ip:<br>25.46.157.214,160.253.135.249'), true).'</td>';
$advanced_toggle .= '<td colspan="2">'.html_print_input_text('ip_src', $filter['ip_src'], false, 40, 80, true).'</td>';
}
$advanced_toggle .= '</tr>';
$advanced_toggle .= "<tr class='filter_normal'>";
if ($netflow_disable_custom_lvfilters) {
$advanced_toggle .= '<td></td>';
$advanced_toggle .= '<td></td>';
} else {
$advanced_toggle .= "<td style='font-weight:bold;'>".__('Dst Port').ui_print_help_tip(__('Destination port. A comma separated list of destination ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22:<br>80,22'), true).'</td>';
$advanced_toggle .= '<td colspan="2">'.html_print_input_text('dst_port', $filter['dst_port'], false, 40, 80, true).'</td>';
}
if ($netflow_disable_custom_lvfilters) {
$advanced_toggle .= '<td></td>';
$advanced_toggle .= '<td></td>';
} else {
$advanced_toggle .= "<td style='font-weight:bold;'>".__('Src Port').ui_print_help_tip(__('Source port. A comma separated list of source ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22:<br>80,22'), true).'</td>';
$advanced_toggle .= '<td colspan="2">'.html_print_input_text('src_port', $filter['src_port'], false, 40, 80, true).'</td>';
}
$advanced_toggle .= '</tr>';
$advanced_toggle .= "<tr class='filter_advance' style='display: none;'>";
if ($netflow_disable_custom_lvfilters) {
$advanced_toggle .= '<td></td>';
$advanced_toggle .= '<td></td>';
} else {
$advanced_toggle .= '<td>'.ui_print_help_icon('pcap_filter', true).'</td>';
$advanced_toggle .= "<td colspan='5'>".html_print_textarea('advanced_filter', 4, 40, $filter['advanced_filter'], "style='min-height: 0px; width: 90%;'", true).'</td>';
}
$advanced_toggle .= '</tr>';
$advanced_toggle .= '<tr>';
$onclick = "if (!confirm('".__('Warning').'. '.__('IP address resolution can take a lot of time')."')) return false;";
$radio_buttons = __('Yes').'&nbsp;&nbsp;'.html_print_radio_button_extended(
'address_resolution',
1,
'',
$address_resolution,
false,
$onclick,
'',
true
).'&nbsp;&nbsp;&nbsp;';
$radio_buttons .= __('No').'&nbsp;&nbsp;'.html_print_radio_button(
'address_resolution',
0,
'',
$address_resolution,
true
);
$advanced_toggle .= '<td><b>'.__('IP address resolution').'</b>'.ui_print_help_tip(__('Resolve the IP addresses to get their hostnames.'), true).'</td>';
$advanced_toggle .= '<td colspan="2">'.$radio_buttons.'</td>';
$advanced_toggle .= '<td><b>'.__('Source ip').'</b></td>';
$advanced_toggle .= '<td colspan="2">'.html_print_input_text('router_ip', $filter['router_ip'], false, 40, 80, true).'</td>';
$advanced_toggle .= '</tr>';
$advanced_toggle .= '</table>';
// Read filter type.
if (empty($filter['advanced_filter']) === false) {
$filter_type = 1;
} else {
$filter_type = 0;
}
$filterTable = new stdClass();
$filterTable->id = '';
$filterTable->class = 'filter-table-adv';
$filterTable->size = [];
$filterTable->size[0] = '33%';
$filterTable->size[1] = '33%';
$filterTable->size[2] = '33%';
$filterTable->data = [];
if (empty($nodeListInput) === false) {
$filterTable->data[-1][] = $nodeListInput;
}
$filterTable->data[0][0] = html_print_label_input_block(
__('Interval'),
html_print_extended_select_for_time(
'period',
$period,
'',
'',
0,
true,
false,
false
).'</td>';
echo '</tr>';
}
true
),
[ 'div_id' => 'period_container' ]
);
echo '<tr>';
$class_not_period = ($is_period) ? 'nf_hidden' : 'nf_display';
$class_period = ($is_period) ? 'nf_display' : 'nf_hidden';
echo '<td>';
echo '<b class="'.$class_period.'">'.__('Interval').'</b>';
echo '<b class="'.$class_not_period.'">'.__('Start date').'</b>';
echo '</td>';
echo '<td>';
echo html_print_extended_select_for_time('period', $period, '', '', 0, false, true, false, true, $class_period);
echo html_print_input_text('date_lower', $date_lower, false, 13, 10, true, false, false, '', $class_not_period);
echo html_print_image(
'images/calendar_view_day.png',
true,
$filterTable->data[0][0] .= html_print_label_input_block(
__('Start date'),
html_print_div(
[
'alt' => 'calendar',
'class' => $class_not_period,
]
).html_print_input_text('time_lower', $time_lower, false, 10, 8, true, false, false, '', $class_not_period);
echo html_print_checkbox(
'is_period',
1,
($is_period === true) ? 1 : 0,
true,
false,
'nf_view_click_period(event)'
);
echo ui_print_help_tip(__('Select this checkbox to write interval instead a date.'), true);
echo '</td>';
'class' => '',
'content' => html_print_input_text(
'date_lower',
$date_lower,
false,
13,
10,
true
).html_print_image(
'images/calendar_view_day.png',
true,
[
'alt' => 'calendar',
'class' => 'main_menu_icon invert_filter',
]
).html_print_input_text(
'time_lower',
$time_lower,
false,
10,
8,
true
),
],
true
),
[ 'div_id' => 'end_date_container' ]
);
echo '<td><b>'.__('End date').'</b></td>';
echo '<td>'.html_print_input_text('date', $date, false, 13, 10, true).html_print_image(
'images/calendar_view_day.png',
true,
['alt' => 'calendar']
).html_print_input_text('time', $time, false, 10, 8, true);
echo '</td>';
$filterTable->data[0][1] = html_print_label_input_block(
__('End date'),
html_print_div(
[
'class' => '',
'content' => html_print_input_text(
'date',
$date,
false,
13,
10,
true
).html_print_image(
'images/calendar_view_day.png',
true,
['alt' => 'calendar']
).html_print_input_text(
'time',
$time,
false,
10,
8,
true
),
],
true
)
);
echo '<td><b>'.__('Resolution').ui_print_help_tip(__('The interval will be divided in chunks the length of the resolution.'), true).'</b></td>';
echo '<td>'.html_print_select(
$filterTable->data[0][2] = html_print_label_input_block(
__('Resolution'),
html_print_select(
netflow_resolution_select_params(),
'interval_length',
$interval_length,
@ -309,13 +489,27 @@ if (is_metaconsole()) {
true,
false,
false
).'</td>';
).ui_print_input_placeholder(
__('The interval will be divided in chunks the length of the resolution.'),
true
)
);
echo '</tr>';
echo '<tr>';
$filterTable->data[1][] = html_print_label_input_block(
__('Defined period'),
html_print_checkbox_switch(
'is_period',
1,
($is_period === true) ? 1 : 0,
true,
false,
'nf_view_click_period(event)'
)
);
echo '<td><b>'.__('Type').'</b></td>';
echo '<td>'.html_print_select(
$filterTable->data[1][] = html_print_label_input_block(
__('Type'),
html_print_select(
netflow_get_chart_types(),
'chart_type',
$chart_type,
@ -323,224 +517,157 @@ if (is_metaconsole()) {
'',
0,
true
).'</td>';
)
);
echo '<td><b>'.__('Max. values').'</b></td>';
$max_values = [
'2' => '2',
'5' => '5',
'10' => '10',
'15' => '15',
'20' => '20',
'25' => '25',
'50' => '50',
$max_aggregates => $max_aggregates,
];
echo '<td>'.html_print_select($max_values, 'max_aggregates', $max_aggregates, '', '', 0, true).'<a id="max_values" href="#" onclick="javascript: edit_max_value();">'.html_print_image('images/edit.svg', true, ['id' => 'pencil', 'class' => 'main_menu_icon invert_filter']).'</a>';
echo '</td>';
echo '<td><b>'.__('Aggregate by').'</b></td>';
$aggregate_list = [];
$aggregate_list = [
'srcip' => __('Src Ip Address'),
'dstip' => __('Dst Ip Address'),
'srcport' => __('Src Port'),
'dstport' => __('Dst Port'),
];
echo '<td>'.html_print_select($aggregate_list, 'aggregate', $filter['aggregate'], '', '', 0, true, false, true, '', false).'</td>';
echo '</tr>';
// Read filter type.
if ($filter['advanced_filter'] != '') {
$filter_type = 1;
} else {
$filter_type = 0;
}
echo "<tr class='filter_save' style='display: none;'>";
echo "<td colspan='6'>".ui_print_error_message('Define a name for the filter and click on Save as new filter again', '', true).'</td>';
echo '</tr>';
echo "<tr class='filter_save' style='display: none;'>";
echo '<td><span id="filter_name_color"><b>'.__('Name').'</b></span></td>';
echo "<td colspan='2'>".html_print_input_text(
'name',
$filter['id_name'],
false,
20,
80,
true
).'</td>';
$own_info = get_user_info($config['id_user']);
echo '<td><span id="filter_group_color"><b>'.__('Group').'</b></span></td>';
echo "<td colspan='2'>".html_print_select_groups($config['id_user'], 'AR', $own_info['is_admin'], 'assign_group', $filter['id_group'], '', '', -1, true, false, false).'</td>';
echo '</tr>';
$advanced_toggle = '<table style="width:100%">';
$advanced_toggle .= '<tr>';
if ($netflow_disable_custom_lvfilters) {
$advanced_toggle .= '<td></td>';
$advanced_toggle .= '<td></td>';
} else {
$advanced_toggle .= '<td><b>'.__('Filter').'</b></td>';
$advanced_toggle .= '<td colspan="2">'.__('Normal').' '.html_print_radio_button_extended('filter_type', 0, '', $filter_type, false, 'displayNormalFilter();', 'style="margin-right: 40px;"', true).__('Custom').' '.html_print_radio_button_extended('filter_type', 1, '', $filter_type, false, 'displayAdvancedFilter();', 'style="margin-right: 40px;"', true).'</td>';
}
$advanced_toggle .= '<td><b>'.__('Load filter').'</b></td>';
$user_groups = users_get_groups($config['id_user'], 'AR', $own_info['is_admin'], true);
$user_groups[0] = 0;
// Add all groups.
$sql = 'SELECT *
FROM tnetflow_filter
WHERE id_group IN ('.implode(',', array_keys($user_groups)).')';
$advanced_toggle .= "<td colspan='3'>".html_print_select_from_sql($sql, 'filter_id', $filter_id, '', __('Select a filter'), 0, true);
$advanced_toggle .= html_print_input_hidden('filter_selected', $filter_selected, false);
$advanced_toggle .= '</td>';
$advanced_toggle .= '</tr>';
$advanced_toggle .= "<tr class='filter_normal'>";
if ($netflow_disable_custom_lvfilters) {
$advanced_toggle .= '<td></td>';
$advanced_toggle .= '<td></td>';
} else {
$advanced_toggle .= "<td style='font-weight:bold;'>".__('Dst Ip').ui_print_help_tip(__('Destination IP. A comma separated list of destination ip. If we leave the field blank, will show all ip. Example filter by ip:<br>25.46.157.214,160.253.135.249'), true).'</td>';
$advanced_toggle .= '<td colspan="2">'.html_print_input_text('ip_dst', $filter['ip_dst'], false, 40, 80, true).'</td>';
}
if ($netflow_disable_custom_lvfilters) {
$advanced_toggle .= '<td></td>';
$advanced_toggle .= '<td></td>';
} else {
$advanced_toggle .= "<td style='font-weight:bold;'>".__('Src Ip').ui_print_help_tip(__('Source IP. A comma separated list of source ip. If we leave the field blank, will show all ip. Example filter by ip:<br>25.46.157.214,160.253.135.249'), true).'</td>';
$advanced_toggle .= '<td colspan="2">'.html_print_input_text('ip_src', $filter['ip_src'], false, 40, 80, true).'</td>';
}
$advanced_toggle .= '</tr>';
$advanced_toggle .= "<tr class='filter_normal'>";
if ($netflow_disable_custom_lvfilters) {
$advanced_toggle .= '<td></td>';
$advanced_toggle .= '<td></td>';
} else {
$advanced_toggle .= "<td style='font-weight:bold;'>".__('Dst Port').ui_print_help_tip(__('Destination port. A comma separated list of destination ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22:<br>80,22'), true).'</td>';
$advanced_toggle .= '<td colspan="2">'.html_print_input_text('dst_port', $filter['dst_port'], false, 40, 80, true).'</td>';
}
if ($netflow_disable_custom_lvfilters) {
$advanced_toggle .= '<td></td>';
$advanced_toggle .= '<td></td>';
} else {
$advanced_toggle .= "<td style='font-weight:bold;'>".__('Src Port').ui_print_help_tip(__('Source port. A comma separated list of source ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22:<br>80,22'), true).'</td>';
$advanced_toggle .= '<td colspan="2">'.html_print_input_text('src_port', $filter['src_port'], false, 40, 80, true).'</td>';
}
$advanced_toggle .= '</tr>';
$advanced_toggle .= "<tr class='filter_advance' style='display: none;'>";
if ($netflow_disable_custom_lvfilters) {
$advanced_toggle .= '<td></td>';
$advanced_toggle .= '<td></td>';
} else {
$advanced_toggle .= '<td>'.ui_print_help_icon('pcap_filter', true).'</td>';
$advanced_toggle .= "<td colspan='5'>".html_print_textarea('advanced_filter', 4, 40, $filter['advanced_filter'], "style='min-height: 0px; width: 90%;'", true).'</td>';
}
$advanced_toggle .= '</tr>';
$advanced_toggle .= '<tr>';
$onclick = "if (!confirm('".__('Warning').'. '.__('IP address resolution can take a lot of time')."')) return false;";
$radio_buttons = __('Yes').'&nbsp;&nbsp;'.html_print_radio_button_extended(
'address_resolution',
1,
$filterTable->data[1][] = html_print_label_input_block(
__('Aggregated by'),
html_print_select(
$aggregate_list,
'aggregate',
$filter['aggregate'],
'',
$address_resolution,
false,
$onclick,
'',
true
).'&nbsp;&nbsp;&nbsp;';
$radio_buttons .= __('No').'&nbsp;&nbsp;'.html_print_radio_button(
'address_resolution',
0,
true,
false,
true,
'',
$address_resolution,
false
)
);
$filterTable->data[2][] = html_print_label_input_block(
__('Max values'),
html_print_div(
[
'class' => '',
'content' => html_print_select(
$max_values,
'max_aggregates',
$max_aggregates,
'',
'',
0,
true
).html_print_anchor(
[
'id' => 'max_values',
'href' => '#',
'onClick' => 'edit_max_value()',
'content' => html_print_image(
'images/edit.svg',
true,
[
'id' => 'pencil',
'class' => 'main_menu_icon invert_filter',
]
),
],
true
),
],
true
);
$advanced_toggle .= '<td><b>'.__('IP address resolution').'</b>'.ui_print_help_tip(__('Resolve the IP addresses to get their hostnames.'), true).'</td>';
$advanced_toggle .= '<td colspan="2">'.$radio_buttons.'</td>';
)
);
$advanced_toggle .= '<td><b>'.__('Source ip').'</b></td>';
$advanced_toggle .= '<td colspan="2">'.html_print_input_text('router_ip', $filter['router_ip'], false, 40, 80, true).'</td>';
$advanced_toggle .= '</tr>';
$advanced_toggle .= '</table>';
echo '<tr><td colspan="6">';
echo ui_toggle(
$filterTable->colspan[3][0] = 3;
$filterTable->data[3][0] = html_print_label_input_block(
'',
ui_toggle(
$advanced_toggle,
__('Advanced'),
'',
'',
true,
true,
'white_box white_box_opened',
'no-border flex-row'
);
echo '</td></tr>';
echo '</table>';
'',
'white-box-content',
'box-flat white_table_graph'
)
);
echo "<table class='' width='100%' style='border: 0px; text-align:right;'><tr><td>";
$buttons = html_print_submit_button(
__('Draw'),
'draw_button',
false,
[
'icon' => 'cog',
'mode' => 'mini',
],
true
);
echo html_print_submit_button(__('Draw'), 'draw_button', false, 'class="sub upd"', true);
if (!$netflow_disable_custom_lvfilters) {
if (check_acl($config['id_user'], 0, 'AW')) {
html_print_submit_button(__('Save as new filter'), 'save_button', false, 'style="margin-left: 5px;" class="sub upd" onClick="return defineFilterName();"');
html_print_submit_button(__('Update current filter'), 'update_button', false, 'style="margin-left: 5px;" class="sub upd"');
}
if (!$netflow_disable_custom_lvfilters) {
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
$buttons .= html_print_submit_button(__('Save as new filter'), 'save_button', false, ['icon' => 'load', 'onClick' => 'return defineFilterName();', 'mode' => 'mini secondary'], true);
$buttons .= html_print_submit_button(__('Update current filter'), 'update_button', false, ['icon' => 'load', 'mode' => 'mini secondary'], true);
}
}
echo '</td></tr></table>';
$filterInputTable = '<form method="post" action="'.$config['homeurl'].'index.php?sec=netf&sec2=operation/netflow/nf_live_view&pure='.$pure.'">';
$filterInputTable .= html_print_table($filterTable, true);
$filterInputTable .= html_print_div(
[
'class' => 'action-buttons',
'content' => $buttons,
],
true
);
$filterInputTable .= '</form>';
echo '</form>';
ui_toggle(
$filterInputTable,
'<span class="subsection_header_title">'.__('Filter').'</span>',
__('Filter'),
'search',
true,
false,
'',
'white-box-content no_border',
'box-flat white_table_graph fixed_filter_bar'
);
if (empty($draw) === false) {
// Draw.
echo '<br/>';
// No filter selected.
if ($netflow_disable_custom_lvfilters && $filter_selected == 0) {
ui_print_error_message(__('No filter selected'));
} else {
// Hidden input for handle properly the text colors.
html_print_input_hidden(
'selected_style_theme',
$config['style']
);
// Draw the netflow chart.
echo netflow_draw_item(
$start_date,
$end_date,
$interval_length,
$chart_type,
$filter,
$max_aggregates,
$connection_name,
'HTML',
$address_resolution
);
}
if (empty($draw) === false) {
// No filter selected.
if ($netflow_disable_custom_lvfilters && $filter_selected == 0) {
ui_print_error_message(__('No filter selected'));
} else {
// Hidden input for handle properly the text colors.
html_print_input_hidden(
'selected_style_theme',
$config['style']
);
// Draw the netflow chart.
html_print_div(
[
'class' => 'white_box',
'content' => netflow_draw_item(
$start_date,
$end_date,
$interval_length,
$chart_type,
$filter,
$max_aggregates,
$connection_name,
'HTML',
$address_resolution
),
]
);
}
} else {
ui_print_info_message(__('No data to show'));
}
ui_include_time_picker();
?>
ui_include_time_picker();
?>
<style>
.parent_graph {
margin: 0 auto !important;
}
</style>
<script type="text/javascript">
function edit_max_value () {
@ -722,6 +849,8 @@ if (is_metaconsole()) {
});
$(document).ready( function() {
// Update visibility of controls.
nf_view_click_period();
// Hide update filter button
if ($("#filter_id").val() == 0) {
$("#submit-update_button").hide();
@ -758,13 +887,10 @@ if (is_metaconsole()) {
$.datepicker.regional["<?php echo get_user_language(); ?>"];
function nf_view_click_period(event) {
$(".nf_display").toggle();
$(".nf_hidden").toggle();
function nf_view_click_period() {
var is_period = document.getElementById('checkbox-is_period').checked;
document.getElementById('period_container').style.display = !is_period ? 'none' : 'flex';
document.getElementById('end_date_container').style.display = is_period ? 'none' : 'flex';
}
</script>
<style type="text/css">
.nf_hidden {
display: none;
}
</style>

View File

@ -266,6 +266,7 @@ unset($table);
$table = new stdClass();
$table->id = '';
$table->width = '100%';
$table->class = 'info_table';
// Print the header.
$table->head = [];
$table->head['main'] = __('IP');
@ -394,8 +395,8 @@ if (empty($data)) {
'height' => 230,
'legend' => [
'display' => true,
'position' => 'right',
'align' => 'center',
'position' => 'top',
'align' => 'left',
],
'labels' => $labels,
];
@ -403,7 +404,7 @@ if (empty($data)) {
$resultsTable = html_print_div(
[
'class' => '',
'style' => 'flex: 50;margin-right: 5px;',
'style' => 'flex: 75;margin-right: 5px;',
'content' => html_print_table($table, true),
],
true
@ -412,7 +413,7 @@ if (empty($data)) {
$pieGraph = html_print_div(
[
'class' => 'databox netflow-pie-graph-container padding-2 white_box',
'style' => 'flex: 50;margin-left: 5px;',
'style' => 'flex: 25;margin-left: 5px;',
'content' => pie_graph(
$chart_data,
$options

View File

@ -1,24 +1,32 @@
<?php
/**
* Netflow functions
* Netflow usage map.
*
* @package Netflow usage map.
* @subpackage UI.
* @category Netflow
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* Pandora FMS - http://pandorafms.com
* ==================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
require_once $config['homedir'].'/include/functions_network.php';
require_once $config['homedir'].'/include/class/NetworkMap.class.php';
@ -26,7 +34,25 @@ global $config;
check_login();
ui_print_page_header(__('Network usage map'));
// Header.
ui_print_standard_header(
__('Network usage map'),
'images/op_netflow.png',
false,
'',
false,
[],
[
[
'link' => '',
'label' => __('Monitoring'),
],
[
'link' => '',
'label' => __('Network'),
],
]
);
// ACL Check.
if (! check_acl($config['id_user'], 0, 'AR')) {
@ -58,105 +84,180 @@ if (!$is_period) {
$top = (int) get_parameter('top', 10);
$order_by = get_parameter('order_by', 'bytes');
if (!in_array($order_by, ['bytes', 'pkts', 'flows'])) {
if (in_array($order_by, ['bytes', 'pkts', 'flows']) === false) {
$order_by = 'bytes';
}
$style_end = ($is_period) ? 'display: none;' : '';
$style_period = ($is_period) ? '' : 'display: none;';
// Build the table.
$table = new stdClass();
$table->class = 'databox filters';
$table->styleTable = 'width: 100%';
$table->data['0']['0'] = '<div class="flex">';
$table->data['0']['0'] .= '<div id="end_date_container" style="'.$style_end.'">';
$table->data['0']['0'] .= __('Start date').'&nbsp;&nbsp;';
$table->data['0']['0'] .= html_print_input_text('date_lower', $date_lower, '', 10, 7, true);
$table->data['0']['0'] .= '&nbsp;&nbsp;';
$table->data['0']['0'] .= html_print_input_text('time_lower', $time_lower, '', 7, 8, true);
$table->data['0']['0'] .= '</div>';
$table->data['0']['0'] .= '<div id="period_container" style="'.$style_period.'">';
$table->data['0']['0'] .= __('Time Period').'&nbsp;&nbsp;';
$table->data['0']['0'] .= html_print_extended_select_for_time('period', $period, '', '', 0, false, true);
$table->data['0']['0'] .= '</div>';
$table->data['0']['0'] .= html_print_checkbox(
'is_period',
1,
($is_period === true) ? 1 : 0,
true,
false,
'network_report_click_period(event)'
);
$table->data['0']['0'] .= ui_print_help_tip(
__('Select this checkbox to write interval instead a date.'),
true
);
$table->data['0']['0'] .= '</div>';
$table->data['0']['1'] = __('End date').'&nbsp;&nbsp;';
$table->data['0']['1'] .= html_print_input_text('date_greater', $date_greater, '', 10, 7, true);
$table->data['0']['1'] .= '&nbsp;&nbsp;';
$table->data['0']['1'] .= html_print_input_text('time_greater', $time_greater, '', 7, 8, true);
$table->data['0']['2'] = __('Number of result to show').'&nbsp;&nbsp;';
$table->data['0']['2'] .= html_print_select(
[
'5' => 5,
'10' => 10,
'15' => 15,
'20' => 20,
'25' => 25,
'50' => 50,
'100' => 100,
'250' => 250,
],
'top',
$top,
'',
'',
0,
true
);
$table->data['1']['0'] = __('Data to show').'&nbsp;&nbsp;';
$table->data['1']['0'] .= html_print_select(
network_get_report_actions(),
'action',
$action,
'',
'',
0,
true
);
$table->data['1']['1'] = '';
$netflow_button = '';
if ((bool) $config['activate_netflow'] === true) {
$netflow_button = html_print_submit_button(
__('Show netflow map'),
'update_netflow',
false,
'class="sub upd"',
['icon' => 'update'],
true
);
} else {
$netflow_button = '';
}
$table->data['1']['2'] .= implode(
'&nbsp;&nbsp;',
[$netflow_button]
$filterTable = new stdClass();
$filterTable->id = '';
$filterTable->class = 'filter-table-adv';
$filterTable->size = [];
$filterTable->size[0] = '33%';
$filterTable->size[1] = '33%';
$filterTable->size[2] = '33%';
$filterTable->data = [];
$filterTable->data[0][0] = html_print_label_input_block(
__('Interval'),
html_print_extended_select_for_time(
'period',
$period,
'',
'',
0,
false,
true
),
[ 'div_id' => 'period_container' ]
);
echo '<form method="post">';
html_print_input_hidden('order_by', $order_by);
$filterTable->data[0][0] .= html_print_label_input_block(
__('Start date'),
html_print_div(
[
'class' => '',
'content' => html_print_input_text(
'date_lower',
$date_lower,
false,
13,
10,
true
).html_print_image(
'images/calendar_view_day.png',
true,
[
'alt' => 'calendar',
'class' => 'main_menu_icon invert_filter',
]
).html_print_input_text(
'time_lower',
$time_lower,
false,
10,
8,
true
),
],
true
),
[ 'div_id' => 'end_date_container' ]
);
html_print_table($table);
echo '</form>';
$filterTable->data[0][1] = html_print_label_input_block(
__('End date'),
html_print_div(
[
'content' => html_print_input_text(
'date',
$date_greater,
false,
13,
10,
true
).html_print_image(
'images/calendar_view_day.png',
true,
['alt' => 'calendar']
).html_print_input_text(
'time',
$time_greater,
false,
10,
8,
true
),
],
true
)
);
$filterTable->data[0][2] = html_print_label_input_block(
__('Defined period'),
html_print_checkbox_switch(
'is_period',
1,
($is_period === true) ? 1 : 0,
true,
false,
'nf_view_click_period()'
)
);
$filterTable->data[1][] = html_print_label_input_block(
__('Results to show'),
html_print_select(
[
'5' => 5,
'10' => 10,
'15' => 15,
'20' => 20,
'25' => 25,
'50' => 50,
'100' => 100,
'250' => 250,
],
'top',
$top,
'',
'',
0,
true
)
);
$filterTable->data[1][] = html_print_label_input_block(
__('Data to show'),
html_print_select(
network_get_report_actions(),
'action',
$action,
'',
'',
0,
true
)
);
$filterInputTable = '<form method="POST">';
$filterInputTable .= html_print_input_hidden('order_by', $order_by);
$filterInputTable .= html_print_table($filterTable, true);
$filterInputTable .= html_print_div(
[
'class' => 'action-buttons',
'content' => $netflow_button,
],
true
);
$filterInputTable .= '</form>';
ui_toggle(
$filterInputTable,
'<span class="subsection_header_title">'.__('Filter').'</span>',
__('Filter'),
'search',
true,
false,
'',
'white-box-content no_border',
'box-flat white_table_graph fixed_filter_bar'
);
$has_data = false;
$first_load = true;
if ((bool) get_parameter('update_netflow') === true) {
$map_data = netflow_build_map_data(
$utimestamp_lower,
@ -165,18 +266,27 @@ if ((bool) get_parameter('update_netflow') === true) {
($action === 'talkers') ? 'srcip' : 'dstip'
);
$has_data = !empty($map_data['nodes']);
$first_load = false;
}
if ($has_data === true) {
$map_manager = new NetworkMap($map_data);
$map_manager->printMap();
} else if (!$first_load) {
ui_print_info_message(__('No data retrieved'));
} else {
ui_print_info_message(__('No data to show'));
}
?>
<style>
.networkconsole {
min-height: calc(100vh - 280px) !important;
}
</style>
<script>
$(document).ready(function(){
nf_view_click_period();
}
);
// Configure jQuery timepickers.
$("#text-time_lower, #text-time_greater").timepicker({
showSecond: true,
@ -193,16 +303,13 @@ $("#text-time_lower, #text-time_greater").timepicker({
$("#text-date_lower, #text-date_greater").datepicker({dateFormat: "<?php echo DATE_FORMAT_JS; ?>"});
$.datepicker.setDefaults($.datepicker.regional[ "<?php echo get_user_language(); ?>"]);
function network_report_click_period(event) {
var is_period = document.getElementById(event.target.id).checked;
function nf_view_click_period() {
var is_period = document.getElementById('checkbox-is_period').checked;
document.getElementById('period_container').style.display = !is_period
? 'none'
: 'block';
document.getElementById('end_date_container').style.display = is_period
? 'none'
: 'block';
document.getElementById('period_container').style.display = !is_period ? 'none' : 'flex';
document.getElementById('end_date_container').style.display = is_period ? 'none' : 'flex';
}
</script>
<style type="text/css">
tspan {

View File

@ -57,16 +57,18 @@ if ($config['pure']) {
).'</a>';
}
// List
$list = [];
$list['text'] = '<a href="index.php?sec=estado&sec2=operation/snmpconsole/snmp_view&pure='.$config['pure'].'&refresh='.$refr.'">'.html_print_image(
'images/SNMP-network-numeric-data@svg.svg',
true,
[
'title' => __('List'),
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
if ($config['pure'] === false) {
// List.
$list = [];
$list['text'] = '<a href="index.php?sec=estado&sec2=operation/snmpconsole/snmp_view&pure='.$config['pure'].'&refresh='.$refr.'">'.html_print_image(
'images/SNMP-network-numeric-data@svg.svg',
true,
[
'title' => __('List'),
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
}
// Statistics (This file)
$statistics = [];
@ -165,10 +167,9 @@ $water_mark = [
// By SOURCE
$table_source = new StdClass();
$table_source->width = '100%';
$table_source->class = 'databox data';
$table_source->class = 'info_table';
$table_source->head[] = __('Traps received by source').' - '.sprintf(__('Top %d'), 25);
$table_source->head_colspan[] = 2;
$table_source->headstyle[] = 'background-color: #82b92e';
$table_source->size = [];
$table_source->size['table'] = '50%';
$table_source->size['graph'] = '50%';
@ -182,6 +183,7 @@ $table_source_data->head = [];
$table_source_data->head['source'] = __('Source IP');
$table_source_data->head['num'] = __('Number');
$table_source_data->data = [];
$table_source_data->class = 'info_table';
$table_source_graph_data = [];
$labels = [];
@ -239,9 +241,9 @@ unset($table_source);
// By OID
$table_oid = new StdClass();
$table_oid->width = '100%';
$table_oid->class = 'info_table';
$table_oid->head[] = __('Traps received by Enterprise String').' - '.sprintf(__('Top %d'), 25);
$table_oid->head_colspan[] = 2;
$table_oid->headstyle[] = 'background-color: #82b92e';
$table_oid->size = [];
$table_oid->size['table'] = '50%';
$table_oid->size['graph'] = '50%';
@ -255,6 +257,7 @@ $table_oid_data->head = [];
$table_oid_data->head['oid'] = __('Trap Enterprise String');
$table_oid_data->head['num'] = __('Number');
$table_oid_data->data = [];
$table_oid_data->class = 'info_table';
$table_oid_graph_data = [];
$labels = [];

View File

@ -56,7 +56,7 @@ ui_require_javascript_file('connection_check', 'include/javascript/', true);
set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false));
$conn_title = __('Connection with server has been lost');
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.');
ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/error_1.png');
ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/fail@svg.svg');
require_once 'include/functions_visual_map.php';

View File

@ -37,7 +37,7 @@ ui_require_javascript_file('connection_check', 'include/javascript/', true);
set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false));
$conn_title = __('Connection with server has been lost');
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.');
ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/error_1.png');
ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/fail@svg.svg');
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n";
echo '<html xmlns="http://www.w3.org/1999/xhtml">'."\n";

View File

@ -286,6 +286,9 @@ class FontVariables
"unbatang" => [/* Korean */
'R' => "UnBatang_0613.ttf",
],
"lato" => [/* lato */
'R' => 'Lato-Regular.ttf',
],
],
// Add fonts to this array if they contain characters in the SIP or SMP Unicode planes
@ -296,6 +299,7 @@ class FontVariables
"dejavuserifcondensed",
"dejavuserif",
"dejavusansmono",
"lato",
],
// These next 3 arrays do two things:
@ -321,6 +325,8 @@ class FontVariables
'mono_fonts' => ['dejavusansmono', 'mono', 'monospace', 'freemono', 'liberationmono', 'courier', 'ocrb', 'ocr-b', 'lucidaconsole',
'couriernew', 'monotypecorsiva'
],
'lato' => ['lato'],
];
}

View File

@ -468,6 +468,7 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
var $serif_fonts;
var $mono_fonts;
var $defaultSubsFont;
var $lato;
// List of ALL available CJK fonts (incl. styles) (Adobe add-ons) hw removed
var $available_CJK_fonts;
@ -1478,15 +1479,31 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
$default_font = $this->defaultCSS['BODY']['FONT-FAMILY'];
}
}
if ($default_font) {
$this->SetDefaultFont($default_font);
}
if (!$default_font_size) {
$mmsize = $this->sizeConverter->convert($this->defaultCSS['BODY']['FONT-SIZE']);
$default_font_size = $mmsize * (Mpdf::SCALE);
}
if ($default_font) {
$this->SetDefaultFont($default_font);
}
if ($default_font_size) {
if ($_SESSION['font_size_report']) {
// DefaultCss.
$this->defaultCSS['BODY']['FONT-SIZE'] = $_SESSION['font_size_report'].'px';
$this->defaultCSS['TABLE']['FONT-SIZE'] = $_SESSION['font_size_report'].'pt';
$this->defaultCSS['THEAD']['FONT-SIZE'] = $_SESSION['font_size_report'].'pt';
$this->defaultCSS['TH']['FONT-SIZE'] = $_SESSION['font_size_report'].'pt';
$this->defaultCSS['TD']['FONT-SIZE'] = $_SESSION['font_size_report'].'pt';
// CssManager.
$this->cssManager->CSS['BODY']['FONT-SIZE'] = $_SESSION['font_size_report'].'px';
$this->cssManager->CSS['TABLE']['FONT-SIZE'] = $_SESSION['font_size_report'].'pt';
$this->cssManager->CSS['THEAD']['FONT-SIZE'] = $_SESSION['font_size_report'].'pt';
$this->cssManager->CSS['TH']['FONT-SIZE'] = $_SESSION['font_size_report'].'pt';
$this->cssManager->CSS['TD']['FONT-SIZE'] = $_SESSION['font_size_report'].'pt';
} elseif ($default_font_size) {
$this->SetDefaultFontSize($default_font_size);
}