mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Merge branch 'ent-9662-second-round' of brutus.artica.es:artica/pandorafms into ent-9662-second-round
This commit is contained in:
commit
cbc05f7ea0
@ -471,10 +471,6 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
||||
</div> <!-- Closes #table_header_inner -->
|
||||
</div> <!-- Closes #table_header -->
|
||||
|
||||
|
||||
<!-- Notifications content wrapper-->
|
||||
<div id='notification-content' class='invisible'/></div>
|
||||
|
||||
<!-- Old style div wrapper -->
|
||||
<div id="alert_messages" class="invisible"></div>
|
||||
|
||||
|
@ -98,6 +98,7 @@ echo '</div>';
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
menuActionButtonResizing();
|
||||
const menuTypeClass = '<?php echo $menuTypeClass; ?>';
|
||||
if (menuTypeClass === 'classic' && menuTypeClass !== localStorage.getItem('menuType')) {
|
||||
localStorage.setItem('menuType', 'classic');
|
||||
|
@ -34,7 +34,6 @@ $url = sprintf(
|
||||
$url_id_agente
|
||||
);
|
||||
|
||||
enterprise_include('godmode/agentes/module_manager.php');
|
||||
$isFunctionPolicies = enterprise_include_once('include/functions_policies.php');
|
||||
require_once $config['homedir'].'/include/functions_modules.php';
|
||||
require_once $config['homedir'].'/include/functions_agents.php';
|
||||
@ -51,196 +50,10 @@ if (isset($policy_page) === false) {
|
||||
$checked = (bool) get_parameter('checked');
|
||||
$sec2 = (string) get_parameter('sec2');
|
||||
|
||||
// Table for filter bar.
|
||||
$filterTable = new stdClass();
|
||||
$filterTable->class = 'fixed_filter_bar';
|
||||
$filterTable->data = [];
|
||||
$filterTable->cellstyle[0][0] = 'width:0';
|
||||
$filterTable->data[0][0] = __('Search');
|
||||
$filterTable->data[1][0] .= html_print_input_text(
|
||||
'search_string',
|
||||
$search_string,
|
||||
'',
|
||||
30,
|
||||
255,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
''
|
||||
);
|
||||
$filterTable->data[0][0] .= html_print_input_hidden('search', 1, true);
|
||||
|
||||
if ((bool) $policy_page === false) {
|
||||
$filterTable->data[0][1] = __('Show in hierachy mode');
|
||||
$filterTable->data[1][1] = html_print_checkbox_switch(
|
||||
'status_hierachy_mode',
|
||||
'',
|
||||
((string) $checked === 'true'),
|
||||
true,
|
||||
false,
|
||||
'onChange=change_mod_filter();'
|
||||
);
|
||||
}
|
||||
|
||||
$filterTable->data[1][2] = html_print_submit_button(
|
||||
__('Filter'),
|
||||
'filter',
|
||||
false,
|
||||
[
|
||||
'icon' => 'search',
|
||||
'class' => 'float-right',
|
||||
'mode' => 'secondary mini',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
// Print filter table.
|
||||
echo '<form id="create_module_type" method="post" action="'.$url.'">';
|
||||
html_print_table($filterTable);
|
||||
echo '</form>';
|
||||
// Check if there is at least one server of each type available to assign that
|
||||
// kind of modules. If not, do not show server type in combo.
|
||||
$network_available = db_get_sql(
|
||||
'SELECT count(*)
|
||||
FROM tserver
|
||||
WHERE server_type = '.SERVER_TYPE_NETWORK
|
||||
);
|
||||
// POSTGRESQL AND ORACLE COMPATIBLE.
|
||||
$wmi_available = db_get_sql(
|
||||
'SELECT count(*)
|
||||
FROM tserver
|
||||
WHERE server_type = '.SERVER_TYPE_WMI
|
||||
);
|
||||
// POSTGRESQL AND ORACLE COMPATIBLE.
|
||||
$plugin_available = db_get_sql(
|
||||
'SELECT count(*)
|
||||
FROM tserver
|
||||
WHERE server_type = '.SERVER_TYPE_PLUGIN
|
||||
);
|
||||
// POSTGRESQL AND ORACLE COMPATIBLE.
|
||||
$prediction_available = db_get_sql(
|
||||
'SELECT count(*)
|
||||
FROM tserver
|
||||
WHERE server_type = '.SERVER_TYPE_PREDICTION
|
||||
);
|
||||
// POSTGRESQL AND ORACLE COMPATIBLE.
|
||||
$web_available = db_get_sql(
|
||||
'SELECT count(*)
|
||||
FROM tserver
|
||||
WHERE server_type = '.SERVER_TYPE_WEB
|
||||
);
|
||||
// POSTGRESQL AND ORACLE COMPATIBLE.
|
||||
// Development mode to use all servers.
|
||||
if ($develop_bypass || is_metaconsole()) {
|
||||
$network_available = 1;
|
||||
$wmi_available = 1;
|
||||
$plugin_available = 1;
|
||||
// FIXME when prediction predictions server modules can be configured.
|
||||
// on metaconsole.
|
||||
$prediction_available = (is_metaconsole() === true) ? 0 : 1;
|
||||
}
|
||||
|
||||
$modules = [];
|
||||
$modules['dataserver'] = __('Create a new data server module');
|
||||
if ($network_available) {
|
||||
$modules['networkserver'] = __('Create a new network server module');
|
||||
}
|
||||
|
||||
if ($plugin_available) {
|
||||
$modules['pluginserver'] = __('Create a new plugin server module');
|
||||
}
|
||||
|
||||
if ($wmi_available) {
|
||||
$modules['wmiserver'] = __('Create a new WMI server module');
|
||||
}
|
||||
|
||||
if ($prediction_available) {
|
||||
$modules['predictionserver'] = __('Create a new prediction server module');
|
||||
}
|
||||
|
||||
if (is_metaconsole() === true || $web_available >= '1') {
|
||||
$modules['webserver'] = __('Create a new web Server module');
|
||||
}
|
||||
|
||||
if (enterprise_installed() === true) {
|
||||
set_enterprise_module_types($modules);
|
||||
}
|
||||
|
||||
if (strstr($sec2, 'enterprise/godmode/policies/policies') !== false) {
|
||||
// It is unset because the policies haven't a table tmodule_synth and the
|
||||
// some part of code to apply this kind of modules in policy agents.
|
||||
// But in the future maybe will be good to make this feature, but remember
|
||||
// the modules to show in syntetic module policy form must be the policy
|
||||
// modules from the same policy.
|
||||
unset($modules['predictionserver']);
|
||||
if (enterprise_installed() === true) {
|
||||
unset($modules['webux']);
|
||||
}
|
||||
}
|
||||
|
||||
if (($policy_page === true) || (isset($agent) === true)) {
|
||||
if ($policy_page === true) {
|
||||
$show_creation = is_management_allowed();
|
||||
} else {
|
||||
if (isset($all_groups) === false) {
|
||||
$all_groups = agents_get_all_groups_agent(
|
||||
$agent['id_agente'],
|
||||
$agent['id_grupo']
|
||||
);
|
||||
}
|
||||
|
||||
$show_creation = check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') === true;
|
||||
}
|
||||
} else {
|
||||
$show_creation = false;
|
||||
}
|
||||
|
||||
if ($show_creation === true) {
|
||||
// Create module/type combo.
|
||||
$tableCreateModule = new stdClass();
|
||||
$tableCreateModule->id = 'create';
|
||||
$tableCreateModule->class = 'create_module_dialog';
|
||||
$tableCreateModule->width = '100%';
|
||||
$tableCreateModule->data = [];
|
||||
$tableCreateModule->style = [];
|
||||
|
||||
$tableCreateModule->data['caption_type'] = html_print_input_hidden('edit_module', 1);
|
||||
$tableCreateModule->data['caption_type'] .= __('Type');
|
||||
$tableCreateModule->data['type'] = html_print_select(
|
||||
$modules,
|
||||
'moduletype',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
'width:380px;'
|
||||
);
|
||||
|
||||
// Link for get more modules.
|
||||
if ((bool) $config['disable_help'] === false) {
|
||||
$tableCreateModule->data['get_more_modules'] = html_print_anchor(
|
||||
[
|
||||
'href' => 'https://pandorafms.com/Library/Library/',
|
||||
'target' => '_blank',
|
||||
'class' => 'color-black-grey',
|
||||
'content' => __('Get more modules on Monitoring Library'),
|
||||
],
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($id_agente) === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$module_action = (string) get_parameter('module_action');
|
||||
|
||||
if ($module_action === 'delete') {
|
||||
@ -1256,10 +1069,26 @@ if ((bool) check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') === tr
|
||||
[ 'type' => 'data_table' ]
|
||||
);
|
||||
echo '</form>';
|
||||
|
||||
}
|
||||
|
||||
$modalCreateModule = '<form name="create_module_form" method="post">';
|
||||
$modalCreateModule .= html_print_table($tableCreateModule, true);
|
||||
$input_type = html_print_input_hidden('edit_module', 1, true);
|
||||
$input_type .= html_print_select(
|
||||
policies_type_modules_availables($sec2),
|
||||
'moduletype',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
'max-width:300px;'
|
||||
);
|
||||
|
||||
$modalCreateModule .= $input_type;
|
||||
$modalCreateModule .= html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons',
|
||||
@ -1285,14 +1114,13 @@ if ((bool) check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') === tr
|
||||
'content' => $modalCreateModule,
|
||||
]
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function create_module_dialog(){
|
||||
$('#modal')
|
||||
.dialog({
|
||||
console.log('Entra');
|
||||
$('#modal').dialog({
|
||||
title: '<?php echo __('Create Module'); ?>',
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
|
@ -444,7 +444,7 @@ $tableBasicThresholds->data = [];
|
||||
$tableBasicThresholds->rowclass['caption_warning_threshold'] = 'field_half_width pdd_t_10px';
|
||||
$tableBasicThresholds->rowclass['warning_threshold'] = 'field_half_width';
|
||||
$tableBasicThresholds->data['caption_warning_threshold'][0] .= __('Warning threshold').' ';
|
||||
if ($edit_module === false || (isset($stringTypeModule) === true && $stringTypeModule === false)) {
|
||||
if ($edit_module === false && (isset($stringTypeModule) === false || $stringTypeModule === false)) {
|
||||
$tableBasicThresholds->data['caption_warning_threshold'][0] .= '<span class="font_11" id="caption_minmax_warning">('.__('Min / Max').')</span>';
|
||||
$tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text(
|
||||
'min_warning',
|
||||
@ -482,7 +482,7 @@ if ($edit_module === false || (isset($stringTypeModule) === true && $stringTypeM
|
||||
);
|
||||
}
|
||||
|
||||
if ($edit_module === false || (isset($stringTypeModule) === true && $stringTypeModule === true)) {
|
||||
if ($edit_module === false && isset($stringTypeModule) === true && $stringTypeModule === true) {
|
||||
$basicThresholdsIntervalWarning = [];
|
||||
$basicThresholdsIntervalWarning[] = '<span>'.__('Inverse interval').'</span>';
|
||||
$basicThresholdsIntervalWarning[] = html_print_checkbox_switch(
|
||||
@ -531,7 +531,7 @@ $tableBasicThresholds->data['switch_warning_threshold'][0] .= html_print_div(
|
||||
$tableBasicThresholds->rowclass['caption_critical_threshold'] = 'field_half_width pdd_t_10px';
|
||||
$tableBasicThresholds->rowclass['critical_threshold'] = 'field_half_width';
|
||||
$tableBasicThresholds->data['caption_critical_threshold'][0] .= __('Critical threshold').' ';
|
||||
if ($edit_module === false || (isset($stringTypeModule) === true && $stringTypeModule === false)) {
|
||||
if ($edit_module === false && (isset($stringTypeModule) === false || $stringTypeModule === false)) {
|
||||
$tableBasicThresholds->data['caption_critical_threshold'][0] .= '<span class="font_11" id="caption_minmax_critical">('.__('Min / Max').')</span>';
|
||||
$tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text(
|
||||
'min_critical',
|
||||
@ -569,7 +569,7 @@ if ($edit_module === false || (isset($stringTypeModule) === true && $stringTypeM
|
||||
);
|
||||
}
|
||||
|
||||
if ($edit_module === false || (isset($stringTypeModule) === true && $stringTypeModule === true)) {
|
||||
if ($edit_module === false && isset($stringTypeModule) === true && $stringTypeModule === true) {
|
||||
$basicThresholdsIntervalCritical = [];
|
||||
$basicThresholdsIntervalCritical[] = '<span>'.__('Inverse interval').'</span>';
|
||||
$basicThresholdsIntervalCritical[] = html_print_checkbox_switch(
|
||||
|
@ -243,11 +243,7 @@ $submitButtons .= html_print_submit_button(
|
||||
);
|
||||
|
||||
html_print_action_buttons(
|
||||
$submitButtons,
|
||||
[
|
||||
'type' => 'form_action',
|
||||
'id' => 'list-events-filters',
|
||||
]
|
||||
$submitButtons
|
||||
);
|
||||
?>
|
||||
|
||||
|
@ -293,6 +293,7 @@ $table->head[3] = __('Interpreter');
|
||||
|
||||
if ($management_allowed === true) {
|
||||
$table->head[4] = __('Action').html_print_checkbox('all_delete', 0, false, true, false);
|
||||
$table->size[4] = '80px';
|
||||
}
|
||||
|
||||
$result = inventory_get_modules_list($offset);
|
||||
@ -414,30 +415,14 @@ if (is_metaconsole() === true) {
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
|
||||
$( document ).ready(function() {
|
||||
|
||||
$('[id^=checkbox-delete_multiple]').change(function(){
|
||||
if($(this).parent().parent().hasClass('checkselected')){
|
||||
$(this).parent().parent().removeClass('checkselected');
|
||||
}
|
||||
else{
|
||||
$(this).parent().parent().addClass('checkselected');
|
||||
}
|
||||
});
|
||||
|
||||
$('[id^=checkbox-all_delete]').change(function() {
|
||||
if ($("#checkbox-all_delete").prop("checked")) {
|
||||
$('[id^=checkbox-delete_multiple]').parent().parent().addClass('checkselected');
|
||||
$(".check_delete").prop("checked", true);
|
||||
if ($("input[name=all_delete]").prop("checked")) {
|
||||
$(".custom_checkbox_input").prop("checked", true);
|
||||
}
|
||||
else {
|
||||
$('[id^=checkbox-delete_multiple]').parent().parent().removeClass('checkselected');
|
||||
$(".check_delete").prop("checked", false);
|
||||
$(".custom_checkbox_input").prop("checked", false);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
@ -2633,7 +2633,8 @@ $class = 'databox filters';
|
||||
'render_definition',
|
||||
3,
|
||||
25,
|
||||
$render_definition
|
||||
$render_definition,
|
||||
'style=width:100%'
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
|
@ -47,6 +47,7 @@ if (json_last_error() === JSON_ERROR_NONE) {
|
||||
$data = $data_decoded['data'];
|
||||
$session_id = $data_decoded['session_id'];
|
||||
$type_graph_pdf = $data_decoded['type_graph_pdf'];
|
||||
$id_user = $data_decoded['id_user'];
|
||||
|
||||
$data_combined = [];
|
||||
if (isset($data_decoded['data_combined']) === true) {
|
||||
@ -62,6 +63,10 @@ if (json_last_error() === JSON_ERROR_NONE) {
|
||||
// Initialize session.
|
||||
global $config;
|
||||
|
||||
// Care whit this!!! check_login not working if you remove this.
|
||||
$config['id_user'] = $id_user;
|
||||
$_SESSION['id_usuario'] = $id_user;
|
||||
|
||||
// Try to initialize session using existing php session id.
|
||||
$user = new PandoraFMS\User(['phpsessionid' => $session_id]);
|
||||
if (check_login(false) === false) {
|
||||
@ -82,6 +87,7 @@ if (check_login(false) === false) {
|
||||
</head>
|
||||
<body>
|
||||
<h1>Access is not granted</h1>
|
||||
<div id="container-chart-generator-item" style="display:none; margin:0px;">
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
@ -544,7 +544,7 @@ class HTML
|
||||
'container_class' => $input['toggle_container_class'],
|
||||
'img_a' => $input['toggle_img_a'],
|
||||
'img_b' => $input['toggle_img_b'],
|
||||
'clean' => (isset($input['toggle_clean']) ? $input['toggle_clean'] : true),
|
||||
'clean' => (isset($input['toggle_clean']) ? $input['toggle_clean'] : false),
|
||||
]
|
||||
);
|
||||
} else {
|
||||
|
@ -4264,12 +4264,14 @@ function generator_chart_to_pdf(
|
||||
'type_graph_pdf' => $type_graph_pdf,
|
||||
'data_module_list' => $module_list,
|
||||
'data_combined' => $params_combined,
|
||||
'id_user' => $config['id_user'],
|
||||
];
|
||||
} else {
|
||||
$data = [
|
||||
'data' => $params,
|
||||
'session_id' => $session_id,
|
||||
'type_graph_pdf' => $type_graph_pdf,
|
||||
'id_user' => $config['id_user'],
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -5235,9 +5235,13 @@ function html_print_switch($attributes=[])
|
||||
*
|
||||
* @return string With HTML code.
|
||||
*/
|
||||
function html_print_link_with_params($text, $params=[], $type='text', $style='')
|
||||
function html_print_link_with_params($text, $params=[], $type='text', $style='', $formStyle='')
|
||||
{
|
||||
$html = '<form method=post>';
|
||||
if (empty($formStyle) === false) {
|
||||
$formStyle = ' style="'.$formStyle.'"';
|
||||
}
|
||||
|
||||
$html = '<form method="POST"'.$formStyle.'>';
|
||||
switch ($type) {
|
||||
case 'image':
|
||||
$html .= html_print_input_image($text, $text, $text, $style, true);
|
||||
@ -5245,7 +5249,7 @@ function html_print_link_with_params($text, $params=[], $type='text', $style='')
|
||||
|
||||
case 'text':
|
||||
default:
|
||||
if (!empty($style)) {
|
||||
if (empty($style) === false) {
|
||||
$style = ' style="'.$style.'"';
|
||||
}
|
||||
|
||||
@ -5253,7 +5257,10 @@ function html_print_link_with_params($text, $params=[], $type='text', $style='')
|
||||
$text,
|
||||
$text,
|
||||
false,
|
||||
'class="button-as-link"'.$style,
|
||||
[
|
||||
'mode' => 'link',
|
||||
'style' => $style,
|
||||
],
|
||||
true
|
||||
);
|
||||
break;
|
||||
@ -5587,7 +5594,7 @@ function html_print_input($data, $wrapper='div', $input_only=false)
|
||||
);
|
||||
|
||||
case 'submit':
|
||||
$width = (isset($data['width']) === true) ? 'width: '.$data['width'] : 'width: 100%';
|
||||
$width = (isset($data['width']) === true) ? 'width: '.$data['width'] : '';
|
||||
$output .= '<'.$wrapper.' class="action-buttons" style="'.$width.'">'.html_print_submit_button(
|
||||
((isset($data['label']) === true) ? $data['label'] : 'OK'),
|
||||
((isset($data['name']) === true) ? $data['name'] : ''),
|
||||
|
@ -3918,10 +3918,15 @@ function ui_print_datatable(array $parameters)
|
||||
ordering: '.$ordering.',
|
||||
initComplete: function(settings, json) {
|
||||
// Move elements to table_action_buttons bar.
|
||||
$(".action_buttons_right_content").append($("#'.$table_id.'_wrapper > .dataTables_paginate.paging_simple_numbers"));
|
||||
$(".action_buttons_right_content").append($("#'.$table_id.'_wrapper > .dataTables_length"));
|
||||
$(".action_buttons_right_content").append($("#'.$table_id.'_wrapper > .dt-buttons"));
|
||||
$(".action_buttons_right_content").append($("#'.$table_id.'_wrapper > .dataTables_filter"));
|
||||
$(".action_buttons_right_content").html("<div class=\"pagination-child-div\"></div>");
|
||||
$(".action_buttons_right_content").html("<div class=\"pagination-child-div\"></div>");
|
||||
$(".action_buttons_right_content").html("<div class=\"pagination-child-div\"></div>");
|
||||
$(".action_buttons_right_content").html("<div class=\"pagination-child-div\"></div>");
|
||||
|
||||
$(".pagination-child-div").append($("#'.$table_id.'_wrapper > .dataTables_paginate.paging_simple_numbers"));
|
||||
$(".pagination-child-div").append($("#'.$table_id.'_wrapper > .dataTables_length"));
|
||||
$(".pagination-child-div").append($("#'.$table_id.'_wrapper > .dt-buttons"));
|
||||
$(".pagination-child-div").append($("#'.$table_id.'_wrapper > .dataTables_filter"));
|
||||
},
|
||||
columns: [';
|
||||
|
||||
@ -4519,8 +4524,8 @@ function ui_print_toggle($data)
|
||||
(isset($data['toggle_class']) === true) ? $data['toggle_class'] : '',
|
||||
(isset($data['container_class']) === true) ? $data['container_class'] : 'white-box-content',
|
||||
(isset($data['main_class']) === true) ? $data['main_class'] : 'box-flat white_table_graph',
|
||||
(isset($data['img_a']) === true) ? $data['img_a'] : 'images/arrow_down_green.png',
|
||||
(isset($data['img_b']) === true) ? $data['img_b'] : 'images/arrow_right_green.png',
|
||||
(isset($data['img_a']) === true) ? $data['img_a'] : 'images/arrow@svg.svg',
|
||||
(isset($data['img_b']) === true) ? $data['img_b'] : 'images/arrow@svg.svg',
|
||||
(isset($data['clean']) === true) ? $data['clean'] : false,
|
||||
(isset($data['reverseImg']) === true) ? $data['reverseImg'] : false,
|
||||
(isset($data['switch']) === true) ? $data['switch'] : false,
|
||||
|
@ -2402,8 +2402,8 @@ function topFunction() {
|
||||
}
|
||||
|
||||
function menuActionButtonResizing() {
|
||||
$(".action_buttons_right_content").attr(
|
||||
$("#principal_action_buttons").attr(
|
||||
"style",
|
||||
"left: " + $("#menu_full").width() + "px;"
|
||||
"width: calc(100% - " + $("#menu_full").width() + "px);"
|
||||
);
|
||||
}
|
||||
|
@ -54,10 +54,10 @@ class User extends Entity implements PublicLogin
|
||||
/**
|
||||
* Initializes a user object.
|
||||
*
|
||||
* @param string|null $id_user User id.
|
||||
* @param mixed $id_user User id.
|
||||
* - Username
|
||||
*/
|
||||
public function __construct(?string $id_user)
|
||||
public function __construct($id_user)
|
||||
{
|
||||
$this->table = 'tusuario';
|
||||
|
||||
|
@ -297,6 +297,7 @@ td input[type="checkbox"] {
|
||||
padding: 10px;
|
||||
margin-top: 2px;
|
||||
display: table-cell;
|
||||
height: 15px;
|
||||
}
|
||||
|
||||
input[type="image"] {
|
||||
@ -1052,6 +1053,10 @@ select:-internal-list-box {
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.box-flat .action-buttons {
|
||||
flex-direction: row-reverse;
|
||||
}
|
||||
|
||||
.align-top td {
|
||||
vertical-align: top;
|
||||
}
|
||||
@ -2101,20 +2106,20 @@ table.rounded_cells td {
|
||||
|
||||
.action-buttons {
|
||||
display: flex;
|
||||
flex-direction: row-reverse;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.action-buttons > *:not(#backgroundMaskId) {
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
#principal_action_buttons {
|
||||
z-index: 6;
|
||||
background: #ffffff;
|
||||
display: flex;
|
||||
flex-direction: row-reverse;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.action-buttons > button {
|
||||
#principal_action_buttons.action-buttons > button {
|
||||
margin-left: 16px;
|
||||
flex: none;
|
||||
}
|
||||
|
||||
.action-buttons-right-forced {
|
||||
@ -4816,7 +4821,7 @@ div#dialog_messages table th:last-child {
|
||||
z-index: 900000;
|
||||
position: absolute;
|
||||
width: 550px;
|
||||
margin-top: -5px;
|
||||
margin-top: 55px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
@ -10956,24 +10961,28 @@ tr.bring_next_field {
|
||||
position: fixed;
|
||||
padding: 0;
|
||||
bottom: 0;
|
||||
z-index: 1;
|
||||
width: -webkit-fill-available;
|
||||
right: 0;
|
||||
width: -moz-available;
|
||||
padding-right: 10px;
|
||||
left: 0;
|
||||
height: 62px;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.action_buttons_right_content {
|
||||
position: fixed;
|
||||
z-index: 10000;
|
||||
left: 250px;
|
||||
flex: 1;
|
||||
height: auto;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.action_buttons_right_content div {
|
||||
#principal_action_buttons > form:first-child,
|
||||
.action_buttons_right_content > div {
|
||||
height: 62px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-right: 1em;
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
@ -10989,14 +10998,14 @@ tr.bring_next_field {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
height: 62px;
|
||||
height: auto;
|
||||
border-top: 1px solid #e5e9ed;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
/*
|
||||
.fixed_action_buttons_size > .action_buttons_background_mask {
|
||||
left: -95px !important;
|
||||
}
|
||||
}*/
|
||||
|
||||
.external_tools_title {
|
||||
padding: 0 10px;
|
||||
|
@ -13,6 +13,10 @@ ul.wizard li {
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
#principal_action_buttons ul.wizard li {
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
ul.wizard.inline li {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
@ -1169,6 +1169,10 @@ if ($config['pure'] == 0) {
|
||||
$menuTypeClass = ($menuCollapsed === true) ? 'collapsed' : 'classic';
|
||||
// Container.
|
||||
echo '<div id="container">';
|
||||
|
||||
// Notifications content wrapper
|
||||
echo '<div id="notification-content" class="invisible"/></div>';
|
||||
|
||||
// Header.
|
||||
echo '<div id="head">';
|
||||
include 'general/header.php';
|
||||
@ -1515,7 +1519,6 @@ require 'include/php_to_js_values.php';
|
||||
<script type="text/javascript" language="javascript">
|
||||
// Handle the scroll.
|
||||
$(document).ready(scrollFunction());
|
||||
$(document).ready(menuActionButtonResizing());
|
||||
// When there are less than 5 rows, all rows must be white
|
||||
var theme = "<?php echo $config['style']; ?>";
|
||||
if (theme === 'pandora') {
|
||||
|
@ -1448,7 +1448,7 @@ $url_timestamp_down .= '&sort_field=timestamp&sort=down';
|
||||
if (empty($result) === false) {
|
||||
if (is_metaconsole() === true) {
|
||||
html_print_action_buttons(
|
||||
html_print_div(['style' => 'float:left; height: 55px;', 'class' => 'mrgn_top_15px'], true),
|
||||
'',
|
||||
[
|
||||
'type' => 'form_action',
|
||||
'right_content' => $tablePagination,
|
||||
@ -2229,7 +2229,7 @@ if (empty($result) === false) {
|
||||
|
||||
if (is_metaconsole() !== true) {
|
||||
html_print_action_buttons(
|
||||
html_print_div(['style' => 'float:left; height: 55px;'], true),
|
||||
'',
|
||||
[
|
||||
'type' => 'form_action',
|
||||
'right_content' => $tablePagination,
|
||||
|
@ -34,7 +34,24 @@ if (! check_acl($config['id_user'], 0, 'AR')) {
|
||||
|
||||
$action = get_parameter('action', 'listeners');
|
||||
|
||||
ui_print_page_header(__('Netflow explorer'));
|
||||
ui_print_standard_header(
|
||||
__('Netflow explorer'),
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
[],
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Monitoring'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Network'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
if (netflow_print_check_version_error()) {
|
||||
include $config['homedir'].'/operation/network/network_report.php';
|
||||
|
@ -62,10 +62,13 @@ $style_period = ($is_period) ? '' : 'display: none;';
|
||||
|
||||
// Build the table.
|
||||
$table = new stdClass();
|
||||
$table->class = 'databox filters';
|
||||
$table->styleTable = 'width: 100%';
|
||||
$table->data['0']['0'] = __('Data to show').' ';
|
||||
$table->data['0']['0'] .= html_print_select(
|
||||
$table->class = 'filter-table-adv';
|
||||
$table->width = '100%';
|
||||
$table->data = [];
|
||||
|
||||
$table->data[0][] = html_print_label_input_block(
|
||||
__('Data to show'),
|
||||
html_print_select(
|
||||
network_get_report_actions(false),
|
||||
'action',
|
||||
$action,
|
||||
@ -73,10 +76,12 @@ $table->data['0']['0'] .= html_print_select(
|
||||
'',
|
||||
0,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data['0']['1'] = __('Number of result to show').' ';
|
||||
$table->data['0']['1'] .= html_print_select(
|
||||
$table->data[0][] = html_print_label_input_block(
|
||||
__('Number of result to show'),
|
||||
html_print_select(
|
||||
[
|
||||
'5' => 5,
|
||||
'10' => 10,
|
||||
@ -93,64 +98,136 @@ $table->data['0']['1'] .= html_print_select(
|
||||
'',
|
||||
0,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data['0']['2'] = '';
|
||||
$table->data[1][] = html_print_label_input_block(
|
||||
__('Start date'),
|
||||
html_print_div(
|
||||
[
|
||||
'id' => 'end_date_container',
|
||||
'content' => html_print_input_text(
|
||||
'date_lower',
|
||||
$date_lower,
|
||||
'',
|
||||
10,
|
||||
10,
|
||||
true
|
||||
).html_print_input_text(
|
||||
'time_lower',
|
||||
$time_lower,
|
||||
'',
|
||||
7,
|
||||
8,
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
).html_print_div(
|
||||
[
|
||||
'id' => 'period_container',
|
||||
'style' => 'display: none;',
|
||||
'content' => html_print_label_input_block(
|
||||
'',
|
||||
html_print_extended_select_for_time(
|
||||
'period',
|
||||
$period,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
false,
|
||||
true
|
||||
),
|
||||
),
|
||||
],
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data['1']['0'] = '<div class="flex">';
|
||||
$table->data['1']['0'] .= '<div id="end_date_container" style="'.$style_end.'">';
|
||||
$table->data['1']['0'] .= __('Start date').' ';
|
||||
$table->data['1']['0'] .= html_print_input_text('date_lower', $date_lower, '', 10, 7, true);
|
||||
$table->data['1']['0'] .= ' ';
|
||||
$table->data['1']['0'] .= html_print_input_text('time_lower', $time_lower, '', 7, 8, true);
|
||||
$table->data['1']['0'] .= '</div>';
|
||||
$table->data[1][] = html_print_label_input_block(
|
||||
__('End date'),
|
||||
html_print_div(
|
||||
[
|
||||
'id' => '',
|
||||
'class' => '',
|
||||
'content' => html_print_input_text(
|
||||
'date_greater',
|
||||
$date_greater,
|
||||
'',
|
||||
10,
|
||||
10,
|
||||
true
|
||||
).html_print_input_text(
|
||||
'time_greater',
|
||||
$time_greater,
|
||||
'',
|
||||
7,
|
||||
8,
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data['1']['0'] .= '<div id="period_container" style="'.$style_period.'">';
|
||||
$table->data['1']['0'] .= __('Time Period').' ';
|
||||
$table->data['1']['0'] .= html_print_extended_select_for_time('period', $period, '', '', 0, false, true);
|
||||
$table->data['1']['0'] .= '</div>';
|
||||
$table->data['1']['0'] .= html_print_checkbox(
|
||||
$table->data[2][] = html_print_label_input_block(
|
||||
__('Defined period'),
|
||||
html_print_checkbox_switch(
|
||||
'is_period',
|
||||
1,
|
||||
($is_period === true) ? 1 : 0,
|
||||
true,
|
||||
false,
|
||||
'network_report_click_period(event)'
|
||||
);
|
||||
$table->data['1']['0'] .= ui_print_help_tip(
|
||||
__('Select this checkbox to write interval instead a date.'),
|
||||
true
|
||||
);
|
||||
$table->data['1']['0'] .= '</div>';
|
||||
|
||||
$table->data['1']['1'] = __('End date').' ';
|
||||
$table->data['1']['1'] .= html_print_input_text('date_greater', $date_greater, '', 10, 7, true);
|
||||
$table->data['1']['1'] .= ' ';
|
||||
$table->data['1']['1'] .= html_print_input_text('time_greater', $time_greater, '', 7, 8, true);
|
||||
|
||||
$table->data['1']['2'] = html_print_submit_button(
|
||||
__('Update'),
|
||||
'update',
|
||||
false,
|
||||
'class="sub upd"',
|
||||
true
|
||||
);
|
||||
$table->data['1']['2'] .= ' ';
|
||||
$table->data['1']['2'] .= html_print_submit_button(
|
||||
__('Export to CSV'),
|
||||
'export_csv',
|
||||
false,
|
||||
'class="sub next" onclick="blockResumit($(this))"',
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
echo '<form method="post">';
|
||||
html_print_input_hidden('order_by', $order_by);
|
||||
if (!empty($main_value)) {
|
||||
if (empty($main_value) === false) {
|
||||
html_print_input_hidden('main_value', $main_value);
|
||||
}
|
||||
|
||||
html_print_table($table);
|
||||
$outputTable = html_print_table($table, true);
|
||||
$outputTable .= html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons-right-forced',
|
||||
'content' => html_print_submit_button(
|
||||
__('Filter'),
|
||||
'update',
|
||||
false,
|
||||
[
|
||||
'icon' => 'search',
|
||||
'mode' => 'mini',
|
||||
],
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
ui_toggle(
|
||||
$outputTable,
|
||||
'<span class="subsection_header_title">'.__('Filters').'</span>',
|
||||
__('Filters'),
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
'white-box-content',
|
||||
'box-flat white_table_graph fixed_filter_bar'
|
||||
);
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
__('Export to CSV'),
|
||||
'export_csv',
|
||||
false,
|
||||
[
|
||||
'icon' => 'load',
|
||||
'onclick' => 'blockResumit($(this))',
|
||||
],
|
||||
true
|
||||
)
|
||||
);
|
||||
echo '</form>';
|
||||
|
||||
// Print the data.
|
||||
@ -178,7 +255,8 @@ $hidden_main_link = [
|
||||
|
||||
unset($table);
|
||||
$table = new stdClass();
|
||||
$table->styleTable = 'width: 60%';
|
||||
$table->id = '';
|
||||
$table->width = '100%';
|
||||
// Print the header.
|
||||
$table->head = [];
|
||||
$table->head['main'] = __('IP');
|
||||
@ -252,20 +330,6 @@ if (get_parameter('export_csv')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Print the filter remove link.
|
||||
if (!empty($main_value)) {
|
||||
echo html_print_link_with_params(
|
||||
in_array($action, ['udp', 'tcp']) ? __('Filtered by port %s. Click here to remove the filter.', $main_value) : __('Filtered by IP %s. Click here to remove the filter.', $main_value),
|
||||
array_merge(
|
||||
$hidden_main_link,
|
||||
[
|
||||
'main_value' => $main_value,
|
||||
'remove_filter' => 1,
|
||||
]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Print the data and build the chart.
|
||||
$table->data = [];
|
||||
$chart_data = [];
|
||||
@ -277,7 +341,7 @@ foreach ($data as $item) {
|
||||
$row['main'] .= $item['host'];
|
||||
if (!$hide_filter) {
|
||||
$row['main'] .= html_print_link_with_params(
|
||||
'images/filter.png',
|
||||
'images/filters@svg.svg',
|
||||
array_merge($hidden_main_link, ['main_value' => $item['host']]),
|
||||
'image'
|
||||
);
|
||||
@ -316,9 +380,7 @@ foreach ($data as $item) {
|
||||
if (empty($data)) {
|
||||
ui_print_info_message(__('No data found'));
|
||||
} else {
|
||||
echo '<div class="flex mrgn_top_10px">';
|
||||
html_print_table($table);
|
||||
|
||||
// Pie graph options.
|
||||
$options = [
|
||||
'height' => 230,
|
||||
'legend' => [
|
||||
@ -328,15 +390,35 @@ if (empty($data)) {
|
||||
],
|
||||
'labels' => $labels,
|
||||
];
|
||||
|
||||
// Print the graph.
|
||||
echo '<div class="mrgn_top_50px w40p">';
|
||||
echo pie_graph(
|
||||
// Pie graph.
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'databox netflow-pie-graph-container padding-2 white_box',
|
||||
'content' => pie_graph(
|
||||
$chart_data,
|
||||
$options
|
||||
),
|
||||
]
|
||||
);
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
// Print the filter remove link.
|
||||
if (empty($main_value) === false) {
|
||||
echo html_print_link_with_params(
|
||||
in_array($action, ['udp', 'tcp']) ? __('Filtered by port %s. Click here to remove the filter.', $main_value) : __('Filtered by IP %s. Click here to remove the filter.', $main_value),
|
||||
array_merge(
|
||||
$hidden_main_link,
|
||||
[
|
||||
'main_value' => $main_value,
|
||||
'remove_filter' => 1,
|
||||
]
|
||||
),
|
||||
'text',
|
||||
'',
|
||||
'width: 100%; display: flex; justify-content: center;'
|
||||
);
|
||||
}
|
||||
|
||||
// Print results.
|
||||
html_print_table($table);
|
||||
}
|
||||
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user