Agent view fixed and other minor fixes

This commit is contained in:
jose.gonzalez@pandorafms.com 2022-11-15 08:05:04 +01:00
parent bf678b55dc
commit 325bbea8db
9 changed files with 474 additions and 604 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2210,8 +2210,8 @@ if ($disable_module) {
} }
// UPDATE GIS. // UPDATE GIS.
$updateGIS = get_parameter('update_gis', 0); $updateGIS = (bool) get_parameter('update_gis', 0);
if ($updateGIS) { if ($updateGIS === true) {
$updateGisData = get_parameter('update_gis_data'); $updateGisData = get_parameter('update_gis_data');
$lastLatitude = get_parameter('latitude'); $lastLatitude = get_parameter('latitude');
$lastLongitude = get_parameter('longitude'); $lastLongitude = get_parameter('longitude');

View File

@ -2124,35 +2124,40 @@ function html_print_extended_select_for_time(
ob_start(); ob_start();
// Use the no_meta parameter because this image is only in the base console. // Use the no_meta parameter because this image is only in the base console.
echo '<div id="'.$uniq_name.'_default" class="wauto inline_flex">'; echo '<div id="'.$uniq_name.'_default" class="wauto inline_flex">';
html_print_select( html_print_select(
$fields, $fields,
$uniq_name.'_select', $uniq_name.'_select',
$selected, $selected,
''.$script, ''.$script,
$nothing, $nothing,
$nothing_value, $nothing_value,
false, false,
false, false,
false, false,
$class, $class,
$readonly, $readonly,
'font-size: xx-small;'.$select_style 'font-size: xx-small;'.$select_style
); );
// The advanced control is only for admins. // The advanced control is only for admins.
if ($admin) { if ($admin === true) {
echo ' <a href="javascript:">'.html_print_image( html_print_anchor(
'images/pencil.png',
true,
[ [
'class' => $uniq_name.'_toggler '.$class.' invert_filter', 'href' => 'javascript:',
'alt' => __('Custom'), 'content' => html_print_image(
'title' => __('Custom'), 'images/pencil.png',
'style' => 'width: 18px; margin-bottom: -5px;'.$style_icon, true,
], [
false, 'class' => $uniq_name.'_toggler '.$class.' invert_filter',
false, 'alt' => __('Custom'),
true 'title' => __('Custom'),
).'</a>'; 'style' => 'width: 18px; margin-bottom: -5px; margin-left: 10px'.$style_icon,
],
false,
false,
true,
),
]
);
} }
echo '</div>'; echo '</div>';
@ -6132,7 +6137,7 @@ function html_print_select_agent_secondary($agent, $id_agente, $options=[])
[$id_agente] [$id_agente]
); );
$name = 'secondary_groups'.$options['extra_id']; $name = 'secondary_groups_selected'.$options['extra_id'];
if ($options['only_select'] === true) { if ($options['only_select'] === true) {
$name = 'secondary_groups'.$options['extra_id'].'[]'; $name = 'secondary_groups'.$options['extra_id'].'[]';
} }
@ -6152,7 +6157,7 @@ function html_print_select_agent_secondary($agent, $id_agente, $options=[])
$name, $name,
// Selected. // Selected.
// No select any by default. // No select any by default.
'', $secondary_groups_selected['for_select'],
// Script. // Script.
// Javascript onChange code. // Javascript onChange code.
'', '',
@ -6179,7 +6184,7 @@ function html_print_select_agent_secondary($agent, $id_agente, $options=[])
false, false,
// Style. // Style.
// Inline styles (default). // Inline styles (default).
'min-width:170px;', '',
// Option_style. // Option_style.
// Option style select (default). // Option style select (default).
false, false,
@ -6212,8 +6217,8 @@ function html_print_select_agent_secondary($agent, $id_agente, $options=[])
] ]
) )
); );
/*
$adv_secondary_groups_arrows = html_print_input_image( $adv_secondary_groups_arrows = html_print_input_image(
'add_secondary', 'add_secondary',
'images/darrowright_green.png', 'images/darrowright_green.png',
1, 1,
@ -6224,9 +6229,9 @@ function html_print_select_agent_secondary($agent, $id_agente, $options=[])
'title' => __('Add secondary groups'), 'title' => __('Add secondary groups'),
'onclick' => 'agent_manager_add_secondary_groups(event, '.$id_agente.',\''.$options['extra_id'].'\', \''.$options['id_form'].'\', \''.$dictionary.'\');', 'onclick' => 'agent_manager_add_secondary_groups(event, '.$id_agente.',\''.$options['extra_id'].'\', \''.$options['id_form'].'\', \''.$dictionary.'\');',
] ]
); );
$adv_secondary_groups_arrows .= html_print_input_image( $adv_secondary_groups_arrows .= html_print_input_image(
'remove_secondary', 'remove_secondary',
'images/darrowleft_green.png', 'images/darrowleft_green.png',
1, 1,
@ -6237,10 +6242,10 @@ function html_print_select_agent_secondary($agent, $id_agente, $options=[])
'title' => __('Remove secondary groups'), 'title' => __('Remove secondary groups'),
'onclick' => 'agent_manager_remove_secondary_groups(event, '.$id_agente.',\''.$options['extra_id'].'\', \''.$options['id_form'].'\', \''.$dictionary.'\');', 'onclick' => 'agent_manager_remove_secondary_groups(event, '.$id_agente.',\''.$options['extra_id'].'\', \''.$options['id_form'].'\', \''.$dictionary.'\');',
] ]
); );
$adv_secondary_groups_right .= html_print_select( $adv_secondary_groups_right .= html_print_select(
// Values. // Values.
$secondary_groups_selected['for_select'], $secondary_groups_selected['for_select'],
// HTML id. // HTML id.
'secondary_groups_selected'.$options['extra_id'], 'secondary_groups_selected'.$options['extra_id'],
@ -6264,8 +6269,8 @@ function html_print_select_agent_secondary($agent, $id_agente, $options=[])
false, false,
// Style. // Style.
'min-width:170px;' 'min-width:170px;'
); );
*/
$output = ''; $output = '';
if (isset($options['container']) === true if (isset($options['container']) === true
&& $options['container'] === true && $options['container'] === true
@ -6276,13 +6281,14 @@ function html_print_select_agent_secondary($agent, $id_agente, $options=[])
$output .= '<div class="sg_source">'; $output .= '<div class="sg_source">';
$output .= $adv_secondary_groups_left; $output .= $adv_secondary_groups_left;
$output .= '</div>'; $output .= '</div>';
$output .= '<div class="secondary_group_arrows">'; /*
$output .= $adv_secondary_groups_arrows; $output .= '<div class="secondary_group_arrows">';
$output .= '</div>'; $output .= $adv_secondary_groups_arrows;
$output .= '<div class="sg_target">'; $output .= '</div>';
$output .= $adv_secondary_groups_right; $output .= '<div class="sg_target">';
$output .= '</div>'; $output .= $adv_secondary_groups_right;
$output .= '</div>';
*/
if (isset($options['container']) === true if (isset($options['container']) === true
&& $options['container'] === true && $options['container'] === true
) { ) {

View File

@ -5724,7 +5724,7 @@ function reporting_get_agents_by_status($data, $graph_width=250, $graph_height=1
$agent_data = []; $agent_data = [];
$agent_data[0] = html_print_image('images/agent_ok.png', true, ['title' => __('Agents ok')]); $agent_data[0] = html_print_image('images/agent_ok.png', true, ['title' => __('Agents ok')]);
$agent_data[1] = "<a style='color: ".COL_NORMAL.";' href='".$links['agents_ok']."'><b><span class='green_color font_12pt bolder big_data'>".format_numeric($data['agent_ok']).'</span></b></a>'; $agent_data[1] = "<a style='color: ".COL_NORMAL.";' href='".$links['agents_ok']."'><b><span class='pandora_green_text font_12pt bolder big_data'>".format_numeric($data['agent_ok']).'</span></b></a>';
$agent_data[2] = html_print_image('images/agent_unknown.png', true, ['title' => __('Agents unknown')]); $agent_data[2] = html_print_image('images/agent_unknown.png', true, ['title' => __('Agents unknown')]);
$agent_data[3] = "<a style='color: ".COL_UNKNOWN.";' href='".$links['agents_unknown']."'><b><span class='grey_color font_12pt bolder big_data'>".format_numeric($data['agent_unknown']).'</span></b></a>'; $agent_data[3] = "<a style='color: ".COL_UNKNOWN.";' href='".$links['agents_unknown']."'><b><span class='grey_color font_12pt bolder big_data'>".format_numeric($data['agent_unknown']).'</span></b></a>';
@ -5844,7 +5844,7 @@ function reporting_get_events($data, $links=false)
$table_events->data[0][1] = html_print_image('images/module_warning.png', true, ['title' => __('Warning events')]); $table_events->data[0][1] = html_print_image('images/module_warning.png', true, ['title' => __('Warning events')]);
$table_events->data[0][1] .= '&nbsp;&nbsp;&nbsp;'."<a class='font_12pt bolder yellow_color' style='".$style."' href='".$links['warning']."'><b><span class='font_12pt bolder yellow_color;'>".format_numeric($data['warning']).'</span></b></a>'; $table_events->data[0][1] .= '&nbsp;&nbsp;&nbsp;'."<a class='font_12pt bolder yellow_color' style='".$style."' href='".$links['warning']."'><b><span class='font_12pt bolder yellow_color;'>".format_numeric($data['warning']).'</span></b></a>';
$table_events->data[0][2] = html_print_image('images/module_ok.png', true, ['title' => __('OK events')]); $table_events->data[0][2] = html_print_image('images/module_ok.png', true, ['title' => __('OK events')]);
$table_events->data[0][2] .= '&nbsp;&nbsp;&nbsp;'."<a class='font_12pt bolder green_color' style='".$style."' href='".$links['normal']."'><b class='font_12pt bolder green_color'>".format_numeric($data['normal']).'</b></a>'; $table_events->data[0][2] .= '&nbsp;&nbsp;&nbsp;'."<a class='font_12pt bolder pandora_green_text' style='".$style."' href='".$links['normal']."'><b class='font_12pt bolder pandora_green_text'>".format_numeric($data['normal']).'</b></a>';
$table_events->data[0][3] = html_print_image('images/module_unknown.png', true, ['title' => __('Unknown events')]); $table_events->data[0][3] = html_print_image('images/module_unknown.png', true, ['title' => __('Unknown events')]);
$table_events->data[0][3] .= '&nbsp;&nbsp;&nbsp;'."<a class='font_12pt bolder grey_color' style='".$style."' href='".$links['unknown']."'><b><span class='font_12pt bolder grey_color'>".format_numeric($data['unknown']).'</span></b></a>'; $table_events->data[0][3] .= '&nbsp;&nbsp;&nbsp;'."<a class='font_12pt bolder grey_color' style='".$style."' href='".$links['unknown']."'><b><span class='font_12pt bolder grey_color'>".format_numeric($data['unknown']).'</span></b></a>';
} }

View File

@ -274,7 +274,7 @@ var QRCode;
})() : (function () { // Drawing in Canvas })() : (function () { // Drawing in Canvas
function _onMakeImage() { function _onMakeImage() {
this._elImage.src = this._elCanvas.toDataURL("image/png"); this._elImage.src = this._elCanvas.toDataURL("image/png");
this._elImage.style.display = "block"; this._elImage.style.display = "inline";
this._elCanvas.style.display = "none"; this._elCanvas.style.display = "none";
} }

View File

@ -373,7 +373,7 @@ class WuxWidget extends Widget
$output .= '</span>'; $output .= '</span>';
} else { } else {
$output .= __('Global status').': '; $output .= __('Global status').': ';
$output .= "<span class='color_82b92e font_20px'>"; $output .= "<span class='pandora_green_bg font_20px'>";
$output .= __('Ok'); $output .= __('Ok');
$output .= '</span>'; $output .= '</span>';
} }

View File

@ -34,6 +34,7 @@
text-align: center; text-align: center;
box-sizing: border-box; box-sizing: border-box;
padding: 20px 0px; padding: 20px 0px;
margin-top: 22px;
display: flex; display: flex;
justify-content: center; justify-content: center;
flex-direction: column; flex-direction: column;
@ -44,13 +45,10 @@ a#qr_code_agent_view {
margin-top: 5px; margin-top: 5px;
} }
.p-switch {
margin-right: 1em;
}
.sg_source, .sg_source,
.sg_target { .sg_target {
width: 35%; width: 100%;
height: 110px;
} }
.sg_source select, .sg_source select,

View File

@ -166,7 +166,9 @@
border-top-right-radius: 16px !important; border-top-right-radius: 16px !important;
border-bottom-left-radius: 16px !important; border-bottom-left-radius: 16px !important;
border-bottom-right-radius: 16px !important; border-bottom-right-radius: 16px !important;
box-shadow: 5px 5px 19px #4e4e4e; box-shadow: 0 10px 6px 0 rgb(0 0 0 / 13%);
border-radius: 8px;
border: 1px solid #e5e9ed;
padding: 0; padding: 0;
} }
.ui-dialog-titlebar { .ui-dialog-titlebar {

View File

@ -865,7 +865,7 @@ select:-internal-list-box {
margin: 0; margin: 0;
} }
.box-shadow { .box-shadow {
box-shadow: 0px 0px 15px -4px #dadada; box-shadow: 0 3px 6px 0 rgb(0 0 0 / 13%);
} }
.align-top td { .align-top td {
vertical-align: top; vertical-align: top;
@ -935,10 +935,9 @@ div#container {
div#main { div#main {
width: 100%; width: 100%;
margin: 0 auto;
margin-left: 3em; margin-left: 3em;
margin-bottom: 3em;
position: relative; position: relative;
min-height: 850px;
} }
textarea.conf_editor { textarea.conf_editor {
@ -5383,22 +5382,30 @@ div.label_select_child_left > span {
padding: 7px 14px; padding: 7px 14px;
margin-right: -1px; margin-right: -1px;
border: 1px solid #cbcbcb; border: 1px solid #cbcbcb;
border-radius: 4px;
transition: all 0.1s ease-in-out; transition: all 0.1s ease-in-out;
} }
.switch_radio_button label:first-child {
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}
.switch_radio_button label:last-child {
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
margin-right: 0px;
}
.switch_radio_button label:hover { .switch_radio_button label:hover {
cursor: pointer; cursor: pointer;
} }
.switch_radio_button input:checked + label { .switch_radio_button input:checked + label {
background-color: #82b92e; background-color: #1d7873;
box-shadow: none; box-shadow: none;
color: #fff !important; color: #fff !important;
} }
.switch_radio_button label:last-child { .switch_radio_button label:last-child {
margin-right: 0px;
} }
/* /*
@ -5511,9 +5518,7 @@ div#bullets_modules div {
.blue_color_ligther { .blue_color_ligther {
color: #5bb6e5; color: #5bb6e5;
} }
.green_color {
color: #82b92e;
}
/* First row in agent view */ /* First row in agent view */
#agent_details_first_row { #agent_details_first_row {
display: flex; display: flex;
@ -5654,9 +5659,9 @@ div#status_pie {
} }
/* White tables to show graphs */ /* White tables to show graphs */
.white_table_graph, .white_table_graph {
.mgn_btt_20px {
margin-bottom: 20px; margin-bottom: 20px;
max-width: 1064px;
} }
.white_table_graph_header { .white_table_graph_header {
@ -6032,11 +6037,11 @@ form#modal_form_feedback ul.wizard li > textarea {
/* Generic classes to reuse and facilitate the creation of custom themes */ /* Generic classes to reuse and facilitate the creation of custom themes */
.pandora_green_text { .pandora_green_text {
color: #82b92e; color: #1d7873;
} }
.pandora_green_bg { .pandora_green_bg {
background-color: #82b92e; background-color: #1d7873;
} }
.default_container { .default_container {
@ -7299,9 +7304,7 @@ div.graph div.legend table {
.color_67 { .color_67 {
color: #676767; color: #676767;
} }
.color_82b92e {
color: #82b92e;
}
.networkconsole { .networkconsole {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -9013,7 +9016,8 @@ input[readonly],
input:disabled, input:disabled,
textarea:disabled, textarea:disabled,
select:disabled, select:disabled,
.select2-container .select2-selection--single:disabled { .select2-container .select2-selection--single:disabled,
.select2.select2-container.select2-container--default.select2-container--disabled {
background-color: #e5e9ed; background-color: #e5e9ed;
color: #8a96a6; color: #8a96a6;
} }
@ -9482,13 +9486,6 @@ button.ui-button.ui-widget.submit-cancel:active {
line-height: 32px; line-height: 32px;
} }
table#simple > tbody > tr {
display: flex;
flex-wrap: nowrap;
flex-direction: row;
align-items: center;
}
/* Custom Checkbox Style */ /* Custom Checkbox Style */
.custom_checkbox { .custom_checkbox {
display: inline-flex; display: inline-flex;
@ -9522,16 +9519,39 @@ table#simple > tbody > tr {
/* End custom checkbox style */ /* End custom checkbox style */
table#simple tr td { table#simple tr td,
min-height: 42px; table#advanced tr td {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
align-self: flex-start; align-self: center;
} }
table#simple tr td:first-child { table#simple > tbody > tr,
width: 180px; table#advanced > tbody > tr {
display: flex;
flex-wrap: nowrap;
flex-direction: row;
align-items: center;
min-height: 55px;
}
table#simple tr td:nth-child(even):not(:nth-child(2)) {
margin: 0 24px;
}
table#simple tr td:nth-child(odd),
table#advanced tr td:nth-child(odd) {
font-size: 10pt;
}
table tr td:first-child {
width: 190px;
align-self: flex-start !important;
}
#secondary_groups_selected > .select2-container {
width: 480px;
} }
.module_thresholds_fields em { .module_thresholds_fields em {
@ -9561,6 +9581,21 @@ span.ColorPickerDivSample {
border-radius: 8px; border-radius: 8px;
border: 1px solid #c0ccdc; border: 1px solid #c0ccdc;
} }
.custom_fields_elements {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
justify-content: space-between;
}
.custom_fields_elements > div {
width: 48%;
margin: 5px;
}
tr.bring_next_field {
min-height: 36px !important;
}
/* FINISH */ /* FINISH */
/* select */ /* select */
@ -9588,6 +9623,30 @@ span.ColorPickerDivSample {
-webkit-user-select: none; -webkit-user-select: none;
} }
.select2-container .select2-selection--multiple {
background-color: #f6f7fb !important;
height: 53px !important;
border: 1px solid #c0ccdc !important;
border-radius: 8px !important;
padding-left: 0px !important;
font: normal normal normal 12px Pandora-Light !important;
color: #2b3332 !important;
-webkit-box-sizing: border-box !important;
-moz-box-sizing: border-box !important;
box-sizing: border-box !important;
}
.sg_source > .select2-container .select2-selection--multiple {
width: 480px !important;
height: 90px !important;
overflow: overlay;
}
.select2-container--default
.select2-selection--multiple
.select2-selection__choice__remove {
margin-top: -4px;
}
.select2-hidden-accessible { .select2-hidden-accessible {
border: 0 !important; border: 0 !important;
clip: rect(0 0 0 0) !important; clip: rect(0 0 0 0) !important;