';
+// Url address.
+$tableAdvancedAgent->data['url_description'][0] = __('Url address');
+if (enterprise_installed() === true) {
+ $tableAdvancedAgent->data['url_description'][1] = html_print_input_text(
+ 'url_description',
+ $url_description,
+ '',
+ 45,
+ 255,
+ true,
+ false,
+ false,
+ '',
+ '',
+ '',
+ // Autocomplete.
+ 'new-password'
+ );
} else {
- $advanced_div = '
';
+ $tableAdvancedAgent->data['url_description'][1] = html_print_input_text(
+ 'url_description',
+ $url_description,
+ '',
+ 45,
+ 255,
+ true
+ );
}
-// General display distribution.
-$table_adv_options = $advanced_div;
-$table_adv_options .= $adv_secondary_groups_label;
-$table_adv_options .= $select_agent_secondary;
-$table_adv_options .= '
';
+// Agent status.
+$tableAdvancedAgent->data['agent_status'][0] = __('Disabled mode');
+$tableAdvancedAgent->data['agent_status'][1] = html_print_checkbox_switch(
+ 'disabled',
+ 1,
+ $disabled,
+ true
+);
-$table_adv_options .= '
';
-$table_adv_options .= $table_adv_parent;
-$table_adv_options .= $table_adv_module_mode;
-$table_adv_options .= $table_adv_cascade;
+// Quiet mode.
+$tableAdvancedAgent->data['agent_quiet'][0] = __('Quiet');
+$tableAdvancedAgent->data['agent_quiet'][1] = html_print_checkbox_switch('quiet', 1, $quiet, true);
-if ($new_agent) {
- // If agent is new, show custom id as old style format.
- $table_adv_options .= $custom_id_div;
+// Remote configuration.
+if ($new_agent === false && isset($filename) === true && file_exists($filename['md5']) === true) {
+ $tableAdvancedAgent->data['remote_configuration'][0] = __('Remote configuration');
+ $tableAdvancedAgent->data['remote_configuration'][1] = html_print_input_text(
+ 'remote_file_timestamp',
+ date('F d Y H:i:s', fileatime($filename['md5'])),
+ '',
+ 45,
+ 255,
+ true,
+ true
+ );
+ $tableAdvancedAgent->data['remote_configuration'][1] .= html_print_anchor(
+ [
+ 'href' => 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=main&disk_conf_delete=1&id_agente='.$id_agente,
+ 'content' => html_print_image(
+ 'images/cross.png',
+ true,
+ [
+ 'title' => __('Delete remote configuration file'),
+ 'class' => 'vertical_middle invert_filter mrgn_lft_5px',
+ ]
+ ),
+ ],
+ true
+ );
}
-$table_adv_options .= '
';
+// Safe operation mode.
+$tableAdvancedAgent->rowclass['safe_operation'] = 'bring_next_field';
+$tableAdvancedAgent->data['safe_operation'][0] = __('Safe operation mode');
+$tableAdvancedAgent->data['safe_operation'][1] = html_print_checkbox_switch('safe_mode', 1, $safe_mode, true);
+$tableAdvancedAgent->data['safe_operation_module'][0] = '';
+$tableAdvancedAgent->data['safe_operation_module'][1] = html_print_select($safe_mode_modules, 'safe_mode_module', $safe_mode_module, '', '', 0, true);
-$table_adv_options .= '
-
- '.$table_adv_gis.$table_adv_agent_icon.$table_adv_url.$table_adv_quiet.$table_adv_status.$table_adv_remote.$table_adv_safe.'
-
';
-
-if (enterprise_installed()) {
- echo '
';
+if (enterprise_installed() === true) {
ui_toggle(
- $table_adv_options,
+ html_print_table($tableAdvancedAgent, true),
__('Advanced options'),
'',
'',
@@ -924,21 +770,20 @@ if (enterprise_installed()) {
'white_box white_box_opened',
'no-border flex'
);
- echo '
';
}
-$table = new stdClass();
-$table->width = '100%';
-$table->class = 'custom_fields_table';
-
-$table->head = [
- 0 => __('Click to display'),
-];
-$table->class = 'info_table';
-$table->style = [];
-$table->style[0] = 'font-weight: bold;';
-$table->data = [];
-$table->rowstyle = [];
+// Custom fields.
+/*
+ $table = new stdClass();
+ $table->width = '100%';
+ $table->class = 'custom_fields_table';
+ $table->class = '';
+ $table->style = [];
+ $table->style[0] = 'font-weight: bold;';
+ $table->data = [];
+ $table->rowstyle = [];
+*/
+$customOutputData = '';
$fields = db_get_all_fields_in_table('tagent_custom_fields');
@@ -946,13 +791,8 @@ if ($fields === false) {
$fields = [];
}
-$i = 0;
foreach ($fields as $field) {
- $id_custom_field = $field['id_field'];
-
- $data[0] = '
';
- $data[0] .= ''.$field['name'].'';
- $data[0] .= '
';
+ // Filling the data.
$combo = [];
$combo = $field['combo_values'];
$combo = explode(',', $combo);
@@ -974,15 +814,8 @@ foreach ($fields as $field) {
$custom_value = '';
}
- $table->rowstyle[$i] = 'cursor: pointer;user-select: none;';
- if (!empty($custom_value)) {
- $table->rowstyle[($i + 1)] = 'display: table-row;';
- } else {
- $table->rowstyle[($i + 1)] = 'display: none;';
- }
-
- if ($field['is_password_type']) {
- $data_field[1] = html_print_input_text_extended(
+ if ((bool) $field['is_password_type'] === true) {
+ $customContent = html_print_input_text_extended(
'customvalue_'.$field['id_field'],
$custom_value,
'customvalue_'.$field['id_field'],
@@ -996,7 +829,7 @@ foreach ($fields as $field) {
true
);
} else {
- $data_field[1] = html_print_textarea(
+ $customContent = html_print_textarea(
'customvalue_'.$field['id_field'],
2,
65,
@@ -1006,8 +839,8 @@ foreach ($fields as $field) {
);
}
- if ($field['combo_values'] !== '') {
- $data_field[1] = html_print_input(
+ if (empty($field['combo_values']) === false) {
+ $customContent = html_print_input(
[
'type' => 'select_search',
'fields' => $combo_values,
@@ -1023,61 +856,32 @@ foreach ($fields as $field) {
);
};
- $table->rowid[] = 'name_field-'.$id_custom_field;
- $table->data[] = $data;
-
- $table->rowid[] = 'field-'.$id_custom_field;
- $table->data[] = $data_field;
- $i += 2;
+ $customOutputData .= ui_toggle(
+ html_print_div(
+ [ 'content' => $customContent ],
+ true
+ ),
+ $field['name'],
+ $field['name'],
+ 'custom_field_toggle_'.$field['id_field'],
+ true,
+ true,
+ );
}
-if (enterprise_installed()) {
- if (!empty($fields)) {
- echo '
';
- ui_toggle(
- html_print_table($table, true),
- __('Custom fields'),
- '',
- '',
- true,
- false,
- 'white_box white_box_opened',
- 'no-border'
- );
- echo '
';
- }
-} else {
- echo '
';
+if (empty($fields) === false) {
ui_toggle(
- $table_adv_options,
- __('Advanced options'),
+ $customOutputData,
+ __('Custom fields'),
'',
'',
true,
false,
'white_box white_box_opened',
- 'no-border flex'
+ 'no-border custom_fields_elements'
);
- if (!empty($fields)) {
- ui_toggle(
- html_print_table($table, true),
- __('Custom fields'),
- '',
- '',
- true,
- false,
- 'white_box white_box_opened',
- 'no-border'
- );
- }
-
- echo '
';
-
- echo '
';
}
-echo '
';
-
// The context help about the learning mode.
if ($modo == 0) {
echo "";
@@ -1131,6 +935,7 @@ html_print_div(
]
);
+echo '
';
echo '';
ui_require_jquery_file('pandora.controls');
diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php
index cffa073369..9caed29db0 100644
--- a/pandora_console/godmode/agentes/configurar_agente.php
+++ b/pandora_console/godmode/agentes/configurar_agente.php
@@ -2210,8 +2210,8 @@ if ($disable_module) {
}
// UPDATE GIS.
-$updateGIS = get_parameter('update_gis', 0);
-if ($updateGIS) {
+$updateGIS = (bool) get_parameter('update_gis', 0);
+if ($updateGIS === true) {
$updateGisData = get_parameter('update_gis_data');
$lastLatitude = get_parameter('latitude');
$lastLongitude = get_parameter('longitude');
diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php
index 4ed02e8df7..14f8e7b12c 100644
--- a/pandora_console/include/functions_html.php
+++ b/pandora_console/include/functions_html.php
@@ -2124,35 +2124,40 @@ function html_print_extended_select_for_time(
ob_start();
// Use the no_meta parameter because this image is only in the base console.
echo '
';
- html_print_select(
- $fields,
- $uniq_name.'_select',
- $selected,
- ''.$script,
- $nothing,
- $nothing_value,
- false,
- false,
- false,
- $class,
- $readonly,
- 'font-size: xx-small;'.$select_style
- );
+ html_print_select(
+ $fields,
+ $uniq_name.'_select',
+ $selected,
+ ''.$script,
+ $nothing,
+ $nothing_value,
+ false,
+ false,
+ false,
+ $class,
+ $readonly,
+ 'font-size: xx-small;'.$select_style
+ );
// The advanced control is only for admins.
- if ($admin) {
- echo '
'.html_print_image(
- 'images/pencil.png',
- true,
+ if ($admin === true) {
+ html_print_anchor(
[
- 'class' => $uniq_name.'_toggler '.$class.' invert_filter',
- 'alt' => __('Custom'),
- 'title' => __('Custom'),
- 'style' => 'width: 18px; margin-bottom: -5px;'.$style_icon,
- ],
- false,
- false,
- true
- ).'';
+ 'href' => 'javascript:',
+ 'content' => html_print_image(
+ 'images/pencil.png',
+ true,
+ [
+ 'class' => $uniq_name.'_toggler '.$class.' invert_filter',
+ 'alt' => __('Custom'),
+ 'title' => __('Custom'),
+ 'style' => 'width: 18px; margin-bottom: -5px; margin-left: 10px'.$style_icon,
+ ],
+ false,
+ false,
+ true,
+ ),
+ ]
+ );
}
echo '
';
@@ -6132,7 +6137,7 @@ function html_print_select_agent_secondary($agent, $id_agente, $options=[])
[$id_agente]
);
- $name = 'secondary_groups'.$options['extra_id'];
+ $name = 'secondary_groups_selected'.$options['extra_id'];
if ($options['only_select'] === true) {
$name = 'secondary_groups'.$options['extra_id'].'[]';
}
@@ -6152,7 +6157,7 @@ function html_print_select_agent_secondary($agent, $id_agente, $options=[])
$name,
// Selected.
// No select any by default.
- '',
+ $secondary_groups_selected['for_select'],
// Script.
// Javascript onChange code.
'',
@@ -6179,7 +6184,7 @@ function html_print_select_agent_secondary($agent, $id_agente, $options=[])
false,
// Style.
// Inline styles (default).
- 'min-width:170px;',
+ '',
// Option_style.
// Option style select (default).
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',
'images/darrowright_green.png',
1,
@@ -6224,9 +6229,9 @@ function html_print_select_agent_secondary($agent, $id_agente, $options=[])
'title' => __('Add secondary groups'),
'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',
'images/darrowleft_green.png',
1,
@@ -6237,10 +6242,10 @@ function html_print_select_agent_secondary($agent, $id_agente, $options=[])
'title' => __('Remove secondary groups'),
'onclick' => 'agent_manager_remove_secondary_groups(event, '.$id_agente.',\''.$options['extra_id'].'\', \''.$options['id_form'].'\', \''.$dictionary.'\');',
]
- );
+ );
- $adv_secondary_groups_right .= html_print_select(
- // Values.
+ $adv_secondary_groups_right .= html_print_select(
+ // Values.
$secondary_groups_selected['for_select'],
// HTML id.
'secondary_groups_selected'.$options['extra_id'],
@@ -6264,8 +6269,8 @@ function html_print_select_agent_secondary($agent, $id_agente, $options=[])
false,
// Style.
'min-width:170px;'
- );
-
+ );
+ */
$output = '';
if (isset($options['container']) === true
&& $options['container'] === true
@@ -6276,13 +6281,14 @@ function html_print_select_agent_secondary($agent, $id_agente, $options=[])
$output .= '
';
$output .= $adv_secondary_groups_left;
$output .= '
';
- $output .= '
';
- $output .= $adv_secondary_groups_arrows;
- $output .= '
';
- $output .= '
';
- $output .= $adv_secondary_groups_right;
- $output .= '
';
-
+ /*
+ $output .= '
';
+ $output .= $adv_secondary_groups_arrows;
+ $output .= '
';
+ $output .= '
';
+ $output .= $adv_secondary_groups_right;
+ $output .= '
';
+ */
if (isset($options['container']) === true
&& $options['container'] === true
) {
diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php
index 029b0d70b6..6a855b1781 100644
--- a/pandora_console/include/functions_reporting_html.php
+++ b/pandora_console/include/functions_reporting_html.php
@@ -5724,7 +5724,7 @@ function reporting_get_agents_by_status($data, $graph_width=250, $graph_height=1
$agent_data = [];
$agent_data[0] = html_print_image('images/agent_ok.png', true, ['title' => __('Agents ok')]);
- $agent_data[1] = "
".format_numeric($data['agent_ok']).'';
+ $agent_data[1] = "
".format_numeric($data['agent_ok']).'';
$agent_data[2] = html_print_image('images/agent_unknown.png', true, ['title' => __('Agents unknown')]);
$agent_data[3] = "
".format_numeric($data['agent_unknown']).'';
@@ -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] .= ' '."
".format_numeric($data['warning']).'';
$table_events->data[0][2] = html_print_image('images/module_ok.png', true, ['title' => __('OK events')]);
- $table_events->data[0][2] .= ' '."
".format_numeric($data['normal']).'';
+ $table_events->data[0][2] .= ' '."
".format_numeric($data['normal']).'';
$table_events->data[0][3] = html_print_image('images/module_unknown.png', true, ['title' => __('Unknown events')]);
$table_events->data[0][3] .= ' '."
".format_numeric($data['unknown']).'';
}
diff --git a/pandora_console/include/javascript/qrcode.js b/pandora_console/include/javascript/qrcode.js
index c1217a383b..cd8485aafb 100755
--- a/pandora_console/include/javascript/qrcode.js
+++ b/pandora_console/include/javascript/qrcode.js
@@ -274,7 +274,7 @@ var QRCode;
})() : (function () { // Drawing in Canvas
function _onMakeImage() {
this._elImage.src = this._elCanvas.toDataURL("image/png");
- this._elImage.style.display = "block";
+ this._elImage.style.display = "inline";
this._elCanvas.style.display = "none";
}
diff --git a/pandora_console/include/lib/Dashboard/Widgets/wux_transaction.php b/pandora_console/include/lib/Dashboard/Widgets/wux_transaction.php
index cf64cfa222..e0430eb0e0 100644
--- a/pandora_console/include/lib/Dashboard/Widgets/wux_transaction.php
+++ b/pandora_console/include/lib/Dashboard/Widgets/wux_transaction.php
@@ -373,7 +373,7 @@ class WuxWidget extends Widget
$output .= '';
} else {
$output .= __('Global status').': ';
- $output .= "
";
+ $output .= "";
$output .= __('Ok');
$output .= '';
}
diff --git a/pandora_console/include/styles/agent_manager.css b/pandora_console/include/styles/agent_manager.css
index cecff8f9ac..78e58936e9 100644
--- a/pandora_console/include/styles/agent_manager.css
+++ b/pandora_console/include/styles/agent_manager.css
@@ -34,6 +34,7 @@
text-align: center;
box-sizing: border-box;
padding: 20px 0px;
+ margin-top: 22px;
display: flex;
justify-content: center;
flex-direction: column;
@@ -44,13 +45,10 @@ a#qr_code_agent_view {
margin-top: 5px;
}
-.p-switch {
- margin-right: 1em;
-}
-
.sg_source,
.sg_target {
- width: 35%;
+ width: 100%;
+ height: 110px;
}
.sg_source select,
diff --git a/pandora_console/include/styles/js/jquery-ui_custom.css b/pandora_console/include/styles/js/jquery-ui_custom.css
index d6a39ea815..8728a78d6b 100644
--- a/pandora_console/include/styles/js/jquery-ui_custom.css
+++ b/pandora_console/include/styles/js/jquery-ui_custom.css
@@ -166,7 +166,9 @@
border-top-right-radius: 16px !important;
border-bottom-left-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;
}
.ui-dialog-titlebar {
diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css
index b556c7a517..66a943a872 100644
--- a/pandora_console/include/styles/pandora.css
+++ b/pandora_console/include/styles/pandora.css
@@ -865,7 +865,7 @@ select:-internal-list-box {
margin: 0;
}
.box-shadow {
- box-shadow: 0px 0px 15px -4px #dadada;
+ box-shadow: 0 3px 6px 0 rgb(0 0 0 / 13%);
}
.align-top td {
vertical-align: top;
@@ -935,10 +935,9 @@ div#container {
div#main {
width: 100%;
- margin: 0 auto;
margin-left: 3em;
+ margin-bottom: 3em;
position: relative;
- min-height: 850px;
}
textarea.conf_editor {
@@ -5383,22 +5382,30 @@ div.label_select_child_left > span {
padding: 7px 14px;
margin-right: -1px;
border: 1px solid #cbcbcb;
- border-radius: 4px;
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 {
cursor: pointer;
}
.switch_radio_button input:checked + label {
- background-color: #82b92e;
+ background-color: #1d7873;
box-shadow: none;
color: #fff !important;
}
.switch_radio_button label:last-child {
- margin-right: 0px;
}
/*
@@ -5511,9 +5518,7 @@ div#bullets_modules div {
.blue_color_ligther {
color: #5bb6e5;
}
-.green_color {
- color: #82b92e;
-}
+
/* First row in agent view */
#agent_details_first_row {
display: flex;
@@ -5654,9 +5659,9 @@ div#status_pie {
}
/* White tables to show graphs */
-.white_table_graph,
-.mgn_btt_20px {
+.white_table_graph {
margin-bottom: 20px;
+ max-width: 1064px;
}
.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 */
.pandora_green_text {
- color: #82b92e;
+ color: #1d7873;
}
.pandora_green_bg {
- background-color: #82b92e;
+ background-color: #1d7873;
}
.default_container {
@@ -7299,9 +7304,7 @@ div.graph div.legend table {
.color_67 {
color: #676767;
}
-.color_82b92e {
- color: #82b92e;
-}
+
.networkconsole {
width: 100%;
height: 100%;
@@ -9013,7 +9016,8 @@ input[readonly],
input:disabled,
textarea: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;
color: #8a96a6;
}
@@ -9482,13 +9486,6 @@ button.ui-button.ui-widget.submit-cancel:active {
line-height: 32px;
}
-table#simple > tbody > tr {
- display: flex;
- flex-wrap: nowrap;
- flex-direction: row;
- align-items: center;
-}
-
/* Custom Checkbox Style */
.custom_checkbox {
display: inline-flex;
@@ -9522,16 +9519,39 @@ table#simple > tbody > tr {
/* End custom checkbox style */
-table#simple tr td {
- min-height: 42px;
+table#simple tr td,
+table#advanced tr td {
display: flex;
flex-direction: row;
align-items: center;
- align-self: flex-start;
+ align-self: center;
}
-table#simple tr td:first-child {
- width: 180px;
+table#simple > tbody > tr,
+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 {
@@ -9561,6 +9581,21 @@ span.ColorPickerDivSample {
border-radius: 8px;
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 */
/* select */
@@ -9588,6 +9623,30 @@ span.ColorPickerDivSample {
-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 {
border: 0 !important;
clip: rect(0 0 0 0) !important;