From e3496a44b641fe96547d8867471783db35a7ce0b Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Tue, 11 Jul 2023 16:52:39 +0200 Subject: [PATCH 01/37] #11206 Add custom field view in nodes --- .../images/module_event_critical.png | Bin 0 -> 487 bytes pandora_console/images/module_event_ok.png | Bin 0 -> 487 bytes .../images/module_event_unknown.png | Bin 0 -> 487 bytes .../images/module_event_warning.png | Bin 0 -> 487 bytes .../include/ajax/custom_fields.php | 210 ++- .../include/functions_custom_fields.php | 194 ++- pandora_console/include/styles/pandora.css | 68 + .../custom_fields/custom_fields_view.php | 1257 +++++++++++++++++ pandora_console/operation/menu.php | 4 + 9 files changed, 1663 insertions(+), 70 deletions(-) create mode 100644 pandora_console/images/module_event_critical.png create mode 100644 pandora_console/images/module_event_ok.png create mode 100644 pandora_console/images/module_event_unknown.png create mode 100644 pandora_console/images/module_event_warning.png create mode 100644 pandora_console/operation/custom_fields/custom_fields_view.php diff --git a/pandora_console/images/module_event_critical.png b/pandora_console/images/module_event_critical.png new file mode 100644 index 0000000000000000000000000000000000000000..d92fd2cf07188e1f9c588f41c595a49fa7c6b7b9 GIT binary patch literal 487 zcmV0)GL6a={& zW&$IW(TLBk`^YW=2q0LX6aXm!LLLTM*MQZd>$&^PgIyd#U0RX zz~#{fT!xSg00M|4L?E4^fDa7NbmKrsCCD#KI3(U<6KBGr5N8Y{M-nU+_d`=x0!GZj z(mD{#htjZ^d=E{I@1f%Vae5G>8Qp`7P=)b8{E$F^)Z+{$f?*HMny~D7AIerBE4l#! zj4o*j6e#4a$A6kNzsvkgw)dT9|0PO&O~?&Tu-EL d5~0C`0szVqS`Z%#4gmlF002ovPDHLkV1i7yx7z>! literal 0 HcmV?d00001 diff --git a/pandora_console/images/module_event_ok.png b/pandora_console/images/module_event_ok.png new file mode 100644 index 0000000000000000000000000000000000000000..d92fd2cf07188e1f9c588f41c595a49fa7c6b7b9 GIT binary patch literal 487 zcmV0)GL6a={& zW&$IW(TLBk`^YW=2q0LX6aXm!LLLTM*MQZd>$&^PgIyd#U0RX zz~#{fT!xSg00M|4L?E4^fDa7NbmKrsCCD#KI3(U<6KBGr5N8Y{M-nU+_d`=x0!GZj z(mD{#htjZ^d=E{I@1f%Vae5G>8Qp`7P=)b8{E$F^)Z+{$f?*HMny~D7AIerBE4l#! zj4o*j6e#4a$A6kNzsvkgw)dT9|0PO&O~?&Tu-EL d5~0C`0szVqS`Z%#4gmlF002ovPDHLkV1i7yx7z>! literal 0 HcmV?d00001 diff --git a/pandora_console/images/module_event_unknown.png b/pandora_console/images/module_event_unknown.png new file mode 100644 index 0000000000000000000000000000000000000000..d92fd2cf07188e1f9c588f41c595a49fa7c6b7b9 GIT binary patch literal 487 zcmV0)GL6a={& zW&$IW(TLBk`^YW=2q0LX6aXm!LLLTM*MQZd>$&^PgIyd#U0RX zz~#{fT!xSg00M|4L?E4^fDa7NbmKrsCCD#KI3(U<6KBGr5N8Y{M-nU+_d`=x0!GZj z(mD{#htjZ^d=E{I@1f%Vae5G>8Qp`7P=)b8{E$F^)Z+{$f?*HMny~D7AIerBE4l#! zj4o*j6e#4a$A6kNzsvkgw)dT9|0PO&O~?&Tu-EL d5~0C`0szVqS`Z%#4gmlF002ovPDHLkV1i7yx7z>! literal 0 HcmV?d00001 diff --git a/pandora_console/images/module_event_warning.png b/pandora_console/images/module_event_warning.png new file mode 100644 index 0000000000000000000000000000000000000000..d92fd2cf07188e1f9c588f41c595a49fa7c6b7b9 GIT binary patch literal 487 zcmV0)GL6a={& zW&$IW(TLBk`^YW=2q0LX6aXm!LLLTM*MQZd>$&^PgIyd#U0RX zz~#{fT!xSg00M|4L?E4^fDa7NbmKrsCCD#KI3(U<6KBGr5N8Y{M-nU+_d`=x0!GZj z(mD{#htjZ^d=E{I@1f%Vae5G>8Qp`7P=)b8{E$F^)Z+{$f?*HMny~D7AIerBE4l#! zj4o*j6e#4a$A6kNzsvkgw)dT9|0PO&O~?&Tu-EL d5~0C`0szVqS`Z%#4gmlF002ovPDHLkV1i7yx7z>! literal 0 HcmV?d00001 diff --git a/pandora_console/include/ajax/custom_fields.php b/pandora_console/include/ajax/custom_fields.php index a403f77748..9ceb89de5f 100644 --- a/pandora_console/include/ajax/custom_fields.php +++ b/pandora_console/include/ajax/custom_fields.php @@ -65,6 +65,7 @@ if (check_login()) { } } + if ($get_custom_fields_data) { $name_custom_fields = get_parameter('name_custom_fields', 0); $array_custom_fields_data = get_custom_fields_data($name_custom_fields); @@ -110,30 +111,51 @@ if (check_login()) { // Table temporary for save array in table // by order and search custom_field data. - $table_temporary = 'CREATE TEMPORARY TABLE temp_custom_fields ( - id_server int(10), - id_agent int(10), - name_custom_fields varchar(2048), - critical_count int, - warning_count int, - unknown_count int, - notinit_count int, - normal_count int, - total_count int, - `status` int(2), - KEY `data_index_temp_1` (`id_server`, `id_agent`) - )'; - db_process_sql($table_temporary); + if (is_metaconsole() === true) { + $table_temporary = 'CREATE TEMPORARY TABLE temp_custom_fields ( + id_server int(10), + id_agent int(10), + name_custom_fields varchar(2048), + critical_count int, + warning_count int, + unknown_count int, + notinit_count int, + normal_count int, + total_count int, + `status` int(2), + KEY `data_index_temp_1` (`id_server`, `id_agent`) + )'; + } else { + $table_temporary = 'CREATE TEMPORARY TABLE temp_custom_fields ( + id_agent int(10), + name_custom_fields varchar(2048), + critical_count int, + warning_count int, + unknown_count int, + notinit_count int, + normal_count int, + total_count int, + `status` int(2), + KEY `data_index_temp_1` ( `id_agent`) + )'; + } + + $resul_tab_temp = db_process_sql($table_temporary); // Insert values array in table temporary. $values_insert = []; foreach ($indexed_descriptions as $key => $value) { - $values_insert[] = '('.$value['id_server'].', '.$value['id_agente'].", '".$value['description']."', '".$value['critical_count']."', '".$value['warning_count']."', '".$value['unknown_count']."', '".$value['notinit_count']."', '".$value['normal_count']."', '".$value['total_count']."', ".$value['status'].')'; + if (is_metaconsole() === true) { + $values_insert[] = '('.$value['id_server'].', '.$value['id_agente'].", '".$value['description']."', '".$value['critical_count']."', '".$value['warning_count']."', '".$value['unknown_count']."', '".$value['notinit_count']."', '".$value['normal_count']."', '".$value['total_count']."', ".$value['status'].')'; + } else { + $values_insert[] = '('.$value['id_agente'].", '".$value['description']."', '".$value['critical_count']."', '".$value['warning_count']."', '".$value['unknown_count']."', '".$value['notinit_count']."', '".$value['normal_count']."', '".$value['total_count']."', ".$value['status'].')'; + } } $values_insert_implode = implode(',', $values_insert); $query_insert = 'INSERT INTO temp_custom_fields VALUES '.$values_insert_implode; - db_process_sql($query_insert); + + $result_temp = db_process_sql($query_insert); // Search table for alias, custom field data, server_name, direction. $search_query = ''; @@ -199,41 +221,17 @@ if (check_login()) { } // Query all fields result. - $query = sprintf( - 'SELECT - tma.id_agente, - tma.id_tagente, - tma.id_tmetaconsole_setup, - tma.alias, - tma.direccion, - tma.server_name, - temp.name_custom_fields, - temp.status - FROM tmetaconsole_agent tma - INNER JOIN temp_custom_fields temp - ON temp.id_agent = tma.id_tagente - AND temp.id_server = tma.id_tmetaconsole_setup - WHERE tma.disabled = 0 - %s - %s - %s - %s - LIMIT %d OFFSET %d - ', - $search_query, - $status_agent_search, - $status_module_search, - $order_by, - $length, - $start - ); - - $result = db_get_all_rows_sql($query); - - // Query count. - $query_count = sprintf( - 'SELECT - COUNT(tma.id_agente) AS `count` + if (is_metaconsole() === true) { + $query = sprintf( + 'SELECT + tma.id_agente, + tma.id_tagente, + tma.id_tmetaconsole_setup, + tma.alias, + tma.direccion, + tma.server_name, + temp.name_custom_fields, + temp.status FROM tmetaconsole_agent tma INNER JOIN temp_custom_fields temp ON temp.id_agent = tma.id_tagente @@ -242,16 +240,87 @@ if (check_login()) { %s %s %s + %s + LIMIT %d OFFSET %d ', - $search_query, - $status_agent_search, - $status_module_search - ); + $search_query, + $status_agent_search, + $status_module_search, + $order_by, + $length, + $start + ); + } else { + $query = sprintf( + 'SELECT + tma.id_agente, + tma.alias, + tma.direccion, + tma.server_name, + temp.name_custom_fields, + temp.status + FROM tagente as tma + INNER JOIN temp_custom_fields temp + ON temp.id_agent = tma.id_agente + WHERE tma.disabled = 0 + %s + %s + %s + %s + LIMIT %d OFFSET %d + ', + $search_query, + $status_agent_search, + $status_module_search, + $order_by, + $length, + $start + ); + } + + $result = db_get_all_rows_sql($query); + // Query count. + if (is_metaconsole() === true) { + $query_count = sprintf( + 'SELECT + COUNT(tma.id_agente) AS `count` + FROM tmetaconsole_agent tma + INNER JOIN temp_custom_fields temp + ON temp.id_agent = tma.id_tagente + AND temp.id_server = tma.id_tmetaconsole_setup + WHERE tma.disabled = 0 + %s + %s + %s + ', + $search_query, + $status_agent_search, + $status_module_search + ); + } else { + $query_count = sprintf( + 'SELECT + COUNT(tma.id_agente) AS `count` + FROM tagente tma + INNER JOIN temp_custom_fields temp + ON temp.id_agent = tma.id_agente + WHERE tma.disabled = 0 + %s + %s + %s + ', + $search_query, + $status_agent_search, + $status_module_search + ); + } $count = db_get_sql($query_count); - // For link nodes. - $array_nodes = metaconsole_get_connections(); + if (is_metaconsole() === true) { + $array_nodes = metaconsole_get_connections(); + } + if (isset($array_nodes) && is_array($array_nodes)) { $hash_array_nodes = []; foreach ($array_nodes as $key => $server) { @@ -280,19 +349,24 @@ if (check_login()) { $data = []; foreach ($result as $values) { $image_status = agents_get_image_status($values['status']); - // Link nodes. - $agent_link = ''; + if (is_metaconsole() === true) { + $agent_link = ''; + $agent_alias = ui_print_truncate_text( + $values['alias'], + 'agent_small', + false, + true, + true, + '[…]', + 'font-size:7.5pt;' + ); + } else { + $agent_link = ''; + $agent_alias = $values['alias']; + } + - $agent_alias = ui_print_truncate_text( - $values['alias'], - 'agent_small', - false, - true, - true, - '[…]', - 'font-size:7.5pt;' - ); if (can_user_access_node()) { $agent = $agent_link.''.$agent_alias.''; diff --git a/pandora_console/include/functions_custom_fields.php b/pandora_console/include/functions_custom_fields.php index 3632f9511c..9ce92a0c78 100644 --- a/pandora_console/include/functions_custom_fields.php +++ b/pandora_console/include/functions_custom_fields.php @@ -613,8 +613,198 @@ function agent_counters_custom_fields($filters) $final_result['indexed_descriptions'] = $data; } else { - // TODO. - $final_result = false; + $result_meta = []; + $data = []; + + $query = sprintf( + "SELECT tcd.description AS name_data, + SUM(IF($agent_state_total, 1, 0)) AS a_agents, + SUM(IF($agent_state_critical, 1, 0)) AS a_critical, + SUM(IF($agent_state_warning, 1, 0)) AS a_warning, + SUM(IF($agent_state_unknown, 1, 0)) AS a_unknown, + SUM(IF($agent_state_normal, 1, 0)) AS a_normal, + SUM(IF($agent_state_notinit, 1, 0)) AS a_not_init, + SUM(tagent_counters.mm_normal) AS m_normal, + SUM(tagent_counters.mm_critical) AS m_critical, + SUM(tagent_counters.mm_warning) AS m_warning, + SUM(tagent_counters.mm_unknown) AS m_unknown, + SUM(tagent_counters.mm_not_init) AS m_not_init, + SUM(tagent_counters.mm_total) AS m_total + FROM tagent_custom_data tcd + INNER JOIN tagent_custom_fields tcf + ON tcd.id_field = tcf.id_field + INNER JOIN ( + SELECT ta.id_agente, + ta.total_count AS c_m_total, + SUM( IF(tae.estado = 0, 1, 0) ) AS mm_normal, + SUM( IF(tae.estado = 1, 1, 0) ) AS mm_critical, + SUM( IF(tae.estado = 2, 1, 0) ) AS mm_warning, + SUM( IF(tae.estado = 3, 1, 0) ) AS mm_unknown, + SUM( IF(tae.estado = 4 OR tae.estado = 5, 1, 0) ) AS mm_not_init, + COUNT(tam.id_agente_modulo) AS mm_total + FROM tagente ta + LEFT JOIN tagent_secondary_group tasg + ON ta.id_agente = tasg.id_agent + INNER JOIN tagente_modulo tam + ON ta.id_agente = tam.id_agente + INNER JOIN tagente_estado tae + ON tam.id_agente = tae.id_agente + AND tam.id_agente_modulo = tae.id_agente_modulo + WHERE ta.disabled = 0 + AND tam.disabled = 0 + %s + %s + %s + %s + GROUP by ta.id_agente + %s + ) AS tagent_counters + ON tcd.id_agent = tagent_counters.id_agente + INNER JOIN tagente ta + ON ta.id_agente = tagent_counters.id_agente + WHERE tcf.name = '%s' + AND tcd.description <> '' + %s + GROUP BY tcd.description", + $groups_and, + $and_status, + $and_module_search, + $and_module_status, + $empty_agents_count, + $custom_field_name, + $custom_data_and + ); + + $result_meta[] = db_get_all_rows_sql($query); + + $query_data = sprintf( + "SELECT + tcd.description, + ta.id_agente, + %d AS id_server, + (CASE + WHEN ta.critical_count > 0 + THEN 1 + WHEN ta.critical_count = 0 + AND ta.warning_count > 0 + THEN 2 + WHEN ta.critical_count = 0 + AND ta.warning_count = 0 + AND ta.unknown_count > 0 + THEN 3 + WHEN ta.critical_count = 0 + AND ta.warning_count = 0 + AND ta.unknown_count = 0 + AND ta.notinit_count <> ta.total_count + THEN 0 + WHEN ta.total_count = ta.notinit_count + THEN 5 + ELSE 0 + END) AS `status`, + ta.critical_count, + ta.warning_count, + ta.unknown_count, + ta.notinit_count, + ta.normal_count, + ta.total_count + FROM tagente ta + LEFT JOIN tagent_secondary_group tasg + ON ta.id_agente = tasg.id_agent + INNER JOIN tagente_modulo tam + ON ta.id_agente = tam.id_agente + INNER JOIN tagente_estado tae + ON tam.id_agente = tae.id_agente + AND tam.id_agente_modulo = tae.id_agente_modulo + INNER JOIN tagent_custom_data tcd + ON tcd.id_agent = ta.id_agente + INNER JOIN tagent_custom_fields tcf + ON tcd.id_field = tcf.id_field + WHERE ta.disabled = 0 + AND tcf.name = '%s' + AND tcd.description <> '' + AND tam.disabled = 0 + %s + %s + %s + %s + %s + GROUP BY ta.id_agente + ", + $server_data['id'], + $custom_field_name, + $custom_data_and, + $groups_and, + $and_status, + $and_module_search, + $and_module_status + ); + + $node_result = db_get_all_rows_sql($query_data); + ; + if (empty($node_result)) { + $node_result = []; + } + + $data = array_merge($data, $node_result); + $final_result = []; + $array_data = []; + if (isset($result_meta) && is_array($result_meta)) { + // Initialize counters. + $final_result['counters_total'] = [ + 't_m_normal' => 0, + 't_m_critical' => 0, + 't_m_warning' => 0, + 't_m_unknown' => 0, + 't_m_not_init' => 0, + 't_m_alerts' => 0, + 't_m_total' => 0, + 't_a_critical' => 0, + 't_a_warning' => 0, + 't_a_unknown' => 0, + 't_a_normal' => 0, + 't_a_not_init' => 0, + 't_a_agents' => 0, + ]; + foreach ($result_meta as $k => $nodo) { + if (isset($nodo) && is_array($nodo)) { + foreach ($nodo as $key => $value) { + // Sum counters total. + $final_result['counters_total']['t_m_normal'] += $value['m_normal']; + $final_result['counters_total']['t_m_critical'] += $value['m_critical']; + $final_result['counters_total']['t_m_warning'] += $value['m_warning']; + $final_result['counters_total']['t_m_unknown'] += $value['m_unknown']; + $final_result['counters_total']['t_m_not_init'] += $value['m_not_init']; + $final_result['counters_total']['t_m_alerts'] += $value['m_alerts']; + $final_result['counters_total']['t_m_total'] += $value['m_total']; + $final_result['counters_total']['t_a_critical'] += $value['a_critical']; + $final_result['counters_total']['t_a_warning'] += $value['a_warning']; + $final_result['counters_total']['t_a_unknown'] += $value['a_unknown']; + $final_result['counters_total']['t_a_normal'] += $value['a_normal']; + $final_result['counters_total']['t_a_not_init'] += $value['a_not_init']; + $final_result['counters_total']['t_a_agents'] += $value['a_agents']; + + // Sum counters for data. + $array_data[$value['name_data']]['m_normal'] += $value['m_normal']; + $array_data[$value['name_data']]['m_critical'] += $value['m_critical']; + $array_data[$value['name_data']]['m_warning'] += $value['m_warning']; + $array_data[$value['name_data']]['m_unknown'] += $value['m_unknown']; + $array_data[$value['name_data']]['m_not_init'] += $value['m_not_init']; + $array_data[$value['name_data']]['m_alerts'] += $value['m_alerts']; + $array_data[$value['name_data']]['m_total'] += $value['m_total']; + $array_data[$value['name_data']]['a_critical'] += $value['a_critical']; + $array_data[$value['name_data']]['a_warning'] += $value['a_warning']; + $array_data[$value['name_data']]['a_unknown'] += $value['a_unknown']; + $array_data[$value['name_data']]['a_normal'] += $value['a_normal']; + $array_data[$value['name_data']]['a_not_init'] += $value['a_not_init']; + $array_data[$value['name_data']]['a_agents'] += $value['a_agents']; + } + } + } + + $final_result['counters_name'] = $array_data; + } + + $final_result['indexed_descriptions'] = $data; } return $final_result; diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index d4fec36d08..892c6fa40a 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -12341,3 +12341,71 @@ tr[id^="network_component-plugin-wmi-fields-dynamicMacroRow-"] input, tr[id^="network_component-plugin-snmp-fields-dynamicMacroRow-"] input { width: 100% !important; } + +form.cfv_status_agent { + margin: 0 auto; + display: flex; + justify-content: space-around; +} + +form.cfv_status_agent label { + display: block; + line-height: 35px; + height: 40px; + width: 19%; + -webkit-font-smoothing: antialiased; + margin-top: 10px; + color: #ffffff; + text-align: center; + cursor: pointer; + opacity: 0.3; + font-size: 13pt; +} + +form.cfv_status_agent label img { + vertical-align: middle; + margin-right: 8px; +} + +form.cfv_status_agent input[type="checkbox"] { + display: none; +} + +form.cfv_status_agent input:checked + label { + opacity: 1; +} + +form.cfv_status_agent input:checked + label:before { + content: "✓ "; +} + +/* --- Custom fields view --- */ +.custom_fields_view_layout { + margin-top: 15px; +} + +.custom_fields_view { + width: 30%; + float: left; + margin-left: 10px; + padding-right: 10px; + max-height: 890px; + overflow: auto; + background-color: #f9f9f9; +} + +.agents_custom_fields { + width: 100%; + + margin-bottom: 15px; + padding: 25px 5px; +} +div.agents_custom_fields #datatables_wrapper div.top, +div.agents_custom_fields #datatables_wrapper div.bottom { + background-color: #414141; + color: #ffffff; + border: none; + padding: 5px; + height: 38px; + width: 99%; +} diff --git a/pandora_console/operation/custom_fields/custom_fields_view.php b/pandora_console/operation/custom_fields/custom_fields_view.php new file mode 100644 index 0000000000..eb6184528f --- /dev/null +++ b/pandora_console/operation/custom_fields/custom_fields_view.php @@ -0,0 +1,1257 @@ + 'index.php?sec=estado&sec2=operation/custom_fields/custom_fields_view', + 'label' => __('Monitoring'), + ], + ] +); + +// ===================================================================== +// Includes +// ===================================================================== +enterprise_include_once('include/functions_metaconsole.php'); +require_once $config['homedir'].'/include/functions_custom_fields.php'; + +// ===================================================================== +// parameters +// ===================================================================== +$info_user = get_user_info($config['id_user']); +$group = get_parameter('group', 0); +$id_custom_fields = get_parameter('id_custom_fields', 0); +$id_custom_fields_data = get_parameter('id_custom_fields_data', -1); +$id_status = get_parameter('id_status', AGENT_MODULE_STATUS_NOT_NORMAL); +$module_search = get_parameter('module_search', ''); +$search = get_parameter('uptbutton', ''); +$id_filter = get_parameter('id_name', 0); +$recursion = get_parameter('recursion', 0); +$module_status = get_parameter('module_status', AGENT_MODULE_STATUS_NOT_NORMAL); + +// ===================================================================== +// Custom filter search +// ===================================================================== +if ($search != 'Show') { + if ($id_filter || $info_user['default_custom_view']) { + if ($id_filter) { + $filter_array = array_shift( + get_filters_custom_fields_view($id_filter) + ); + } else { + if ($info_user['default_custom_view']) { + $filter_array = array_shift( + get_filters_custom_fields_view( + $info_user['default_custom_view'] + ) + ); + } + } + + $group = $filter_array['id_group']; + $id_custom_fields = io_safe_input($filter_array['id_custom_field']); + $id_custom_fields_data = json_decode( + $filter_array['id_custom_fields_data'] + ); + $id_status = json_decode($filter_array['id_status']); + $module_search = $filter_array['module_search']; + $recursion = $filter_array['recursion']; + $module_status = json_decode($filter_array['module_status']); + } +} + +// ===================================================================== +// filters for search +// ===================================================================== +$filters = [ + 'group' => $group, + 'id_custom_fields' => $id_custom_fields, + 'id_custom_fields_data' => $id_custom_fields_data, + 'id_status' => $id_status, + 'module_search' => $module_search, + 'module_status' => $module_status, + 'block_size' => $config['block_size'], + 'recursion' => $recursion, +]; + +// ===================================================================== +// Table filters custom field +// ===================================================================== +$table = new StdClass(); +$table->width = '100%'; +$table->class = 'databox filters'; +$table->data = []; +$table->rowspan = []; +$table->colspan = []; + + +$array_custom_fields = get_custom_fields(false, true, true); + +if ($id_custom_fields) { + $array_custom_fields_data = get_custom_fields_data($id_custom_fields); +} else { + $array_custom_fields_data = []; +} + +$table->data[0][0] = __('Group'); +$table->data[0][1] = html_print_select_groups( + $config['id_user'], + 'AR', + true, + 'group', + $group, + '', + '', + '0', + true, + false, + false, + '', + false, + 'width:180px;', + false, + false, + 'id_grupo', + false +); + +$table->data[0][2] = ' '.__('Recursion').' '; +$table->data[0][3] = html_print_checkbox( + 'recursion', + 1, + $recursion, + true, + false, + '' +); + +$array_status = []; +$array_status[AGENT_MODULE_STATUS_NORMAL] = __('Normal'); +$array_status[AGENT_MODULE_STATUS_WARNING] = __('Warning'); +$array_status[AGENT_MODULE_STATUS_CRITICAL_BAD] = __('Critical'); +$array_status[AGENT_MODULE_STATUS_UNKNOWN] = __('Unknown'); +$array_status[AGENT_MODULE_STATUS_NOT_NORMAL] = __('Not normal'); +// Default. +$array_status[AGENT_MODULE_STATUS_NOT_INIT] = __('Not init'); + +$table->data[1][0] = __('Status agents'); +$table->data[1][1] = html_print_select( + $array_status, + 'id_status[]', + $id_status, + '', + __('All'), + -1, + true, + true, + true, + '', + false, + 'min-width:150px' +); + +$table->data[1][2] = __('Status module'); +$table->data[1][3] = html_print_select( + $array_status, + 'module_status[]', + $module_status, + '', + __('All'), + -1, + true, + true, + true, + '', + false, + 'min-width:150px' +); + +$table->data[1][4] = ''; + +$table->data[2][0] = __('Custom Fields'); +$table->data[2][1] = html_print_select( + $array_custom_fields, + 'id_custom_fields', + $id_custom_fields, + '', + __('None'), + 0, + true, + false, + true, + '', + false, + 'width:10em' +); + +$table->data[2][2] = __('Custom Fields Data'); +$table->data[2][3] = html_print_select( + $array_custom_fields_data, + 'id_custom_fields_data[]', + io_safe_output($id_custom_fields_data), + 'set_custom_fields_data_title()', + __('All'), + -1, + true, + true, + true, + '', + false, + 'min-width:150px;', + false, + false, + false, + '', + false, + true, + false, + false, + true, + true +); + +$table->colspan[3][1] = 3; +$table->data[3][0] = __('Module search'); +$table->data[3][1] = html_print_input_text( + 'module_search', + $module_search, + '', + 20, + 40, + true +); + +$table->data[2][5] = html_print_submit_button( + __('Show'), + 'uptbutton', + false, + 'class="sub search mgn_tp_0"', + true +); + +if (check_acl($config['id_user'], 0, 'PM')) { + // Pass the parameters to the page that generates the csv file (arrays) + $decode_id_status = base64_encode(json_encode($id_status)); + $decode_module_status = base64_encode(json_encode($module_status)); + $decode_filters = base64_encode(json_encode($filters)); + + $table->data[3][5] = '
'; + + $table->data[3][5] .= html_print_button( + __('Export to CSV'), + 'csv_export', + false, + "blockResubmit($(this)); location.href='monitoring/custom_fields_csv.php?filters=$decode_filters&id_custom_field=$id_custom_fields&id_status=$decode_id_status&module_status=$decode_module_status'", + 'class="sub next"', + true + ); + $table->data[3][5] .= '
'; +} + + +$form = '
'; + $form .= html_print_table($table, true); +$form .= '
'; + +ui_toggle( + $form, + ''.__('Filters').'', + 'filters', + false, + true, + false, + '', + 'white-box-content', + 'box-flat white_table_graph fixed_filter_bar' +); + +// ===================================================================== +// div for show success messages +// ===================================================================== +echo "
"; + + +// Image for gif datatables processing. +$processing = html_print_image( + 'images/spinner.gif', + true, + [ + 'title' => __('Processing'), + ] +).''.__('Processing').'...'; + +if (isset($id_custom_fields_data) && is_array($id_custom_fields_data)) { + $data = agent_counters_custom_fields($filters); + + if (!empty($data['indexed_descriptions'])) { + echo "
"; + echo "
"; + + if (in_array(-1, $filters['id_custom_fields_data'])) { + $id_custom_field_array = get_custom_fields_data($id_custom_fields); + } else { + $id_custom_field_array = $filters['id_custom_fields_data']; + } + + foreach ($id_custom_field_array as $value) { + /* + $table_agent = html_get_predefined_table(); + $table_agent->style = []; + $table_agent->class = 'tactical_view';*/ + + $table_agent = new StdClass(); + $table_agent->width = '100%'; + $table_agent->class = 'tactical_view'; + $table_agent->data = []; + $table_agent->rowspan = []; + $table_agent->colspan = []; + + $agent_data = []; + + // Critical. + $agent_data[0] = html_print_image( + 'images/agent_critical.png', + true, + ['title' => __('Agents critical')] + ); + $agent_data[1] = ""; + $agent_data[1] .= ""; + $agent_data[1] .= format_numeric( + $data['counters_name'][$value]['a_critical'] + ); + $agent_data[1] .= ''; + + // Warning. + $agent_data[2] = html_print_image( + 'images/agent_warning.png', + true, + ['title' => __('Agents warning')] + ); + $agent_data[3] = ""; + $agent_data[3] .= ""; + $agent_data[3] .= format_numeric( + $data['counters_name'][$value]['a_warning'] + ); + $agent_data[3] .= ''; + + // OK. + $agent_data[4] = html_print_image( + 'images/agent_ok.png', + true, + ['title' => __('Agents ok')] + ); + $agent_data[5] = ""; + $agent_data[5] .= ""; + $agent_data[5] .= format_numeric( + $data['counters_name'][$value]['a_normal'] + ); + $agent_data[5] .= ''; + + // Unknown. + $agent_data[6] = html_print_image( + 'images/agent_unknown.png', + true, + ['title' => __('Agents unknown')] + ); + $agent_data[7] = ""; + $agent_data[7] .= ""; + $agent_data[7] .= format_numeric( + $data['counters_name'][$value]['a_unknown'] + ); + $agent_data[7] .= ''; + + // Not init. + $agent_data[8] = html_print_image( + 'images/agent_notinit.png', + true, + ['title' => __('Agents not init')] + ); + $agent_data[9] = ""; + $agent_data[9] .= ""; + $agent_data[9] .= format_numeric( + $data['counters_name'][$value]['a_not_init'] + ); + $agent_data[9] .= ''; + + $table_agent->data[] = $agent_data; + + $m_critical = ($data['counters_name'][$value]['m_critical'] <= 0) ? '0' : $data['counters_name'][$value]['m_critical']; + $m_warning = ($data['counters_name'][$value]['m_warning'] <= 0) ? '0' : $data['counters_name'][$value]['m_warning']; + $m_normal = ($data['counters_name'][$value]['m_normal'] <= 0) ? '0' : $data['counters_name'][$value]['m_normal']; + $m_unknown = ($data['counters_name'][$value]['m_unknown'] <= 0) ? '0' : $data['counters_name'][$value]['m_unknown']; + $m_not_init = ($data['counters_name'][$value]['m_not_init'] <= 0) ? '0' : $data['counters_name'][$value]['m_not_init']; + + // Modules by status table. + /* + $table_mbs = html_get_predefined_table(); + $table_mbs->class = 'tactical_view'; + $table_mbs->style = [];*/ + + $table_mbs = new StdClass(); + $table_mbs->width = '100%'; + $table_mbs->class = 'tactical_view'; + $table_mbs->data = []; + $table_mbs->rowspan = []; + $table_mbs->colspan = []; + + $tdata = []; + $tdata[0] = html_print_image( + 'images/module_critical.png', + true, + ['title' => __('Monitor critical')], + false, + false, + false, + true + ); + $tdata[1] = ''.$m_critical.''; + + $tdata[2] = html_print_image( + 'images/module_warning.png', + true, + ['title' => __('Monitor warning')], + false, + false, + false, + true + ); + $tdata[3] = ''.$m_warning.''; + + $tdata[4] = html_print_image( + 'images/module_ok.png', + true, + ['title' => __('Monitor normal')], + false, + false, + false, + true + ); + $tdata[5] = ''.$m_normal.''; + + $tdata[6] = html_print_image( + 'images/module_unknown.png', + true, + ['title' => __('Monitor unknown')], + false, + false, + false, + true + ); + $tdata[7] = ''.$m_unknown.''; + + $tdata[8] = html_print_image( + 'images/module_notinit.png', + true, + ['title' => __('Monitor not init')], + false, + false, + false, + true + ); + + $tdata[9] = ''.$m_not_init.''; + + $table_mbs->data[] = $tdata; + + echo "
".ui_bbcode_to_html($value).'
'; + // Agents data. + echo '
'; + echo "
"; + echo ''.__('Agents by status').': '.$data['counters_name'][$value]['a_agents'].''; + echo html_print_table($table_agent, true); + echo '
'; + echo '
'; + + // Modules data. + echo "
"; + echo "
"; + echo ''.__('Monitors by status').': '.$data['counters_name'][$value]['m_total'].''; + echo html_print_table($table_mbs, true); + echo '
'; + echo '
'; + } + + echo '
'; + // Agent status. + $status_agent_array = [ + 1 => [ + 'value' => 'AGENT_STATUS_CRITICAL', + 'checked' => 1, + 'image' => 'images/agent_mc.menu-2.png', + 'title' => __('Critical agents'), + 'color' => '#e63c52', + 'counter' => format_numeric( + $data['counters_total']['t_a_critical'] + ), + ], + 2 => [ + 'value' => 'AGENT_STATUS_WARNING', + 'checked' => 1, + 'image' => 'images/agent_mc.menu-2.png', + 'title' => __('Warning agents'), + 'color' => '#f3b200', + 'counter' => format_numeric( + $data['counters_total']['t_a_warning'] + ), + ], + 0 => [ + 'value' => 'AGENT_STATUS_NORMAL', + 'checked' => 1, + 'image' => 'images/agent_mc.menu-2.png', + 'title' => __('Normal agents'), + 'color' => '#82b92e', + 'counter' => format_numeric( + $data['counters_total']['t_a_normal'] + ), + ], + 3 => [ + 'value' => 'AGENT_STATUS_UNKNOWN', + 'checked' => 1, + 'image' => 'images/agent_mc.menu-2.png', + 'title' => __('Unknown agents'), + 'color' => '#B2B2B2', + 'counter' => format_numeric( + $data['counters_total']['t_a_unknown'] + ), + ], + 5 => [ + 'value' => 'AGENT_STATUS_NOT_INIT', + 'checked' => 1, + 'image' => 'images/agent_mc.menu-2.png', + 'title' => __('Not init agents'), + 'color' => '#60aae9', + 'counter' => format_numeric( + $data['counters_total']['t_a_not_init'] + ), + ], + ]; + + if (isset($filters['id_status']) === true && is_array($filters['id_status']) === true) { + if (in_array(-1, $filters['id_status']) === false) { + if (in_array(AGENT_MODULE_STATUS_NOT_NORMAL, $filters['id_status']) === false) { + foreach ($status_agent_array as $key => $value) { + if (in_array($key, $filters['id_status']) === false) { + $status_agent_array[$key]['checked'] = 0; + } + } + } else { + // Not normal statuses. + $status_agent_array[0]['checked'] = 0; + } + } + } + + // Module status. + $status_module_array = [ + 1 => [ + 'value' => 'AGENT_STATUS_CRITICAL', + 'checked' => 1, + 'image' => 'images/module_event_ok.png', + 'title' => __('Critical modules'), + 'color' => '#e63c52', + 'counter' => format_numeric( + $data['counters_total']['t_m_critical'] + ), + 'class' => 'line_heigth_0pt', + ], + 2 => [ + 'value' => 'AGENT_STATUS_WARNING', + 'checked' => 1, + 'image' => 'images/module_event_ok.png', + 'title' => __('Warning modules'), + 'color' => '#f3b200', + 'counter' => format_numeric( + $data['counters_total']['t_m_warning'] + ), + 'class' => 'line_heigth_0pt', + ], + 0 => [ + 'value' => 'AGENT_STATUS_NORMAL', + 'checked' => 1, + 'image' => 'images/module_event_ok.png', + 'title' => __('Normal modules'), + 'color' => '#82b92e', + 'counter' => format_numeric( + $data['counters_total']['t_m_normal'] + ), + 'class' => 'line_heigth_0pt', + ], + 3 => [ + 'value' => 'AGENT_STATUS_UNKNOWN', + 'checked' => 1, + 'image' => 'images/module_event_ok.png', + 'title' => __('Unknown modules'), + 'color' => '#B2B2B2', + 'counter' => format_numeric( + $data['counters_total']['t_m_unknown'] + ), + 'class' => 'line_heigth_0pt', + ], + 5 => [ + 'value' => 'AGENT_STATUS_NOT_INIT', + 'checked' => 1, + 'image' => 'images/module_event_ok.png', + 'title' => __('Not init modules'), + 'color' => '#60aae9', + 'counter' => format_numeric( + $data['counters_total']['t_m_not_init'] + ), + 'class' => 'line_heigth_0pt', + ], + ]; + + if (isset($filters['module_status']) === true && is_array($filters['module_status']) === true) { + if (in_array(-1, $filters['module_status']) === false) { + if (in_array(AGENT_MODULE_STATUS_NOT_NORMAL, $filters['module_status']) === false) { + foreach ($status_module_array as $key => $value) { + if (in_array($key, $filters['module_status']) === false) { + $status_module_array[$key]['checked'] = 0; + } + } + } else { + // Not normal statuses. + $status_module_array[0]['checked'] = 0; + } + } + } + + // Total status. + echo "
"; + echo "
".__('Total counters').'
'; + + echo "
"; + echo ''.__('Total Agents').''; + echo print_counters_cfv( + $status_agent_array, + 'form-agent-counters', + 'agents' + ); + echo '
'; + + echo "
"; + echo ''.__('Total Modules').''; + echo print_counters_cfv( + $status_module_array, + 'form-module-counters', + 'modules' + ); + echo '
'; + + echo '
'; + + echo "
"; + echo ""; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + // Content of the dynamically created load. + echo ''; + echo '
'.$array_custom_fields[$id_custom_fields].''.__('Agent').''.__('I.P').''.__('Server').''.__('Status').'
'; + echo '
'; + + echo '
'; + + $indexed_descriptions = $data['indexed_descriptions']; + } else { + ui_print_info_message( + [ + 'no_close' => true, + 'message' => __('No data to show.'), + ] + ); + } +} else { + ui_print_info_message( + [ + 'no_close' => true, + 'message' => __('There are no custom search defined.'), + ] + ); +} + +// Div modal for display filters. +echo ''; + +ui_require_css_file('datatables.min', 'include/styles/js/'); +ui_require_javascript_file_enterprise('functions_csv'); +ui_require_javascript_file('datatables.min'); +ui_require_javascript_file('buttons.dataTables.min'); +ui_require_javascript_file('dataTables.buttons.min'); +ui_require_javascript_file('buttons.html5.min'); +ui_require_javascript_file('buttons.print.min'); +enterprise_include_once('include/functions_reporting_csv.php'); +?> + + diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index 3641a79f80..5412b9a895 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -205,6 +205,10 @@ if ($access_console_node === true) { $sub['operation/inventory/inventory']['refr'] = 0; } + $sub['operation/custom_fields/custom_fields_view']['text'] = __('Custom fields view'); + $sub['operation/custom_fields/custom_fields_view']['id'] = 'Custom fields view'; + $sub['operation/custom_fields/custom_fields_view']['refr'] = 0; + if ($config['activate_netflow'] || $config['activate_sflow']) { $sub['network_traffic'] = [ 'text' => __('Network'), From 0194fbaa59f39e1facae77cc13ad834bc33962e1 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Tue, 22 Aug 2023 11:16:17 +0200 Subject: [PATCH 02/37] #11206 Fix custom field view --- .../include/ajax/custom_fields.php | 39 +++++++++++--- pandora_console/include/styles/pandora.css | 14 ++++- .../custom_fields/custom_fields_view.php | 51 ++++++++++++------- 3 files changed, 77 insertions(+), 27 deletions(-) diff --git a/pandora_console/include/ajax/custom_fields.php b/pandora_console/include/ajax/custom_fields.php index 04ab4f95d5..f247c2e51e 100644 --- a/pandora_console/include/ajax/custom_fields.php +++ b/pandora_console/include/ajax/custom_fields.php @@ -374,6 +374,11 @@ if (check_login()) { $agent = $agent_alias; } + if (is_metaconsole() === false) { + $values['id_tagente'] = $values['id_agente']; + $values['id_tmetaconsole_setup'] = 1; + } + $data[] = [ 'ref' => $referencia, 'data_custom_field' => ui_bbcode_to_html($values['name_custom_fields']), @@ -479,7 +484,7 @@ if (check_login()) { $table_modules = new stdClass(); $table_modules->width = '100%'; - $table_modules->class = 'databox data'; + $table_modules->class = 'databox data custom_field_data'; $table_modules->head = []; $table_modules->head[0] = __('Module name'); @@ -663,7 +668,11 @@ if (check_login()) { __('Load filter'), 'load_filter', false, - 'class="sub upd"', + [ + 'icon' => 'search', + 'class' => 'sub upd', + 'onclick' => 'load_filter()', + ], true ); @@ -687,6 +696,9 @@ if (check_login()) { $table->width = '100%'; $table->class = 'databox'; $table->rowspan = []; + $table->style = []; + $table->cellstyle[0][0] = 'display: grid'; + $table->cellstyle[0][1] = 'display: grid'; if ($filters['id'] == 'extended_create_filter') { echo "
"; @@ -697,7 +709,7 @@ if (check_login()) { '', 15, 255, - true + true, ); $table->data[1][0] = __('Group'); @@ -728,7 +740,11 @@ if (check_login()) { __('Create filter'), 'create_filter', false, - 'class="sub upd"', + [ + 'icon' => 'search', + 'class' => 'sub upd', + 'onclick' => 'create_filter()', + ], true ); } else { @@ -776,21 +792,28 @@ if (check_login()) { __('Delete filter'), 'delete_filter', false, - 'class="sub upd"', + [ + 'icon' => 'delete', + 'class' => 'sub upd', + 'onclick' => 'delete_filter()', + ], true ); + $table->data[1][2] = html_print_submit_button( __('Update filter'), 'update_filter', false, - 'class="sub upd"', + [ + 'icon' => 'update', + 'class' => 'sub upd', + 'onclick' => 'update_filter()', + ], true ); } - echo '
'; html_print_table($table); - echo '
'; return; } diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 5b66c5c356..0af1762470 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -12601,7 +12601,7 @@ div.agents_custom_fields #datatables_wrapper div.bottom { .dt-buttons { width: auto; - position: fixed; + position: absolute; margin-left: 55px; } @@ -12618,3 +12618,15 @@ div.agents_custom_fields #datatables_wrapper div.bottom { -webkit-font-smoothing: antialiased; font-weight: bold; } + +td.details-control { + background: url("../../images/darrowdown.png") no-repeat center center; + cursor: pointer; +} +tr.shown td.details-control { + background: url("../../images/darrowup.png") no-repeat center center; +} + +.custom_field_data > tbody > tr > td:not(:first-child) { + text-align: center; +} diff --git a/pandora_console/operation/custom_fields/custom_fields_view.php b/pandora_console/operation/custom_fields/custom_fields_view.php index bfb124cfce..674895837a 100644 --- a/pandora_console/operation/custom_fields/custom_fields_view.php +++ b/pandora_console/operation/custom_fields/custom_fields_view.php @@ -58,8 +58,7 @@ ui_print_standard_header( // ===================================================================== // Includes // ===================================================================== -enterprise_include_once('include/functions_metaconsole.php'); -require_once $config['homedir'].'/include/functions_custom_fields.php'; +require_once 'include/functions_custom_fields.php'; // ===================================================================== // parameters @@ -829,19 +828,35 @@ $(document).ready (function () { * Create dialog */ function dialog_filter_cf(title, type_form){ - $("#filter_cf").dialog ({ - title: title, - resizable: true, - draggable: true, - modal: true, - overlay: { - opacity: 0.5, - background: "black" - }, - width: 688, - height: 280 - }) - .show (); + if (type_form == 'load') { + $("#filter_cf").dialog ({ + title: title, + resizable: true, + draggable: true, + modal: true, + overlay: { + opacity: 0.5, + background: "black" + }, + width: 688, + height: 200 + }) + .show (); + } else { + $("#filter_cf").dialog ({ + title: title, + resizable: true, + draggable: true, + modal: true, + overlay: { + opacity: 0.5, + background: "black" + }, + width: 688, + height: 350 + }) + .show (); + } $("#filter_cf").empty(); @@ -1067,7 +1082,7 @@ function table_datatables(filters, indexed_descriptions, processing){ function build_table_child (d, filters, processing) { array_data = JSON.parse(filters); - + var filters_modules = $('#form-module-counters').serializeArray(); var status_modules = filters_modules.map( name => name.name.replace(/lists_modules\[/g,'').replace(/\]/g,'') @@ -1146,7 +1161,7 @@ function append_tab_filter(filters){ }); //action update - $('#submit-update_filter').on('click', function(){ + $('#button-update_filter').on('click', function(){ id = $('#id_name').val(); group_search = $('#group_search_up').val(); $.ajax({ @@ -1170,7 +1185,7 @@ function append_tab_filter(filters){ }); //delete update - $('#submit-delete_filter').on('click', function(){ + $('#button-delete_filter').on('click', function(){ //dialog confirm display_confirm_dialog( From f5d20dc8ebc6c627f73a8f87dce595de80e19a2c Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Fri, 25 Aug 2023 12:20:07 +0200 Subject: [PATCH 03/37] #11206 Fix custom field view --- pandora_console/include/styles/pandora.css | 2 +- pandora_console/include/styles/tables.css | 8 ++++++-- .../custom_fields/custom_fields_view.php | 15 +++++++-------- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 494e494ee7..1092ad3e63 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -12659,7 +12659,7 @@ div.agents_custom_fields #datatables_wrapper div.bottom { .dt-buttons { width: auto; position: absolute; - margin-left: 55px; + margin-left: 90px; } .title_tactical { diff --git a/pandora_console/include/styles/tables.css b/pandora_console/include/styles/tables.css index 5e8e316da3..ef8e15d67b 100644 --- a/pandora_console/include/styles/tables.css +++ b/pandora_console/include/styles/tables.css @@ -369,7 +369,7 @@ a.pandora_pagination.current:hover { font-size: 20px; height: 38px; width: 80px; - margin-left: 130px; + margin-left: 90px; display: flex; justify-content: space-between; @@ -900,7 +900,11 @@ td.w75p#rightcolumn { .dataTables_wrapper .dataTables_filter { float: left; text-align: right; - margin-left: 65%; + margin-left: 64%; padding-left: 0px; margin-top: -5px; } + +.dataTables_wrapper .dataTables_paginate .paginate_button { + background: #bcbcbc; +} diff --git a/pandora_console/operation/custom_fields/custom_fields_view.php b/pandora_console/operation/custom_fields/custom_fields_view.php index 674895837a..a65b46db92 100644 --- a/pandora_console/operation/custom_fields/custom_fields_view.php +++ b/pandora_console/operation/custom_fields/custom_fields_view.php @@ -310,15 +310,15 @@ if (check_acl($config['id_user'], 0, 'PM')) { $decode_filters = base64_encode(json_encode($filters)); $table->data[3][5] = '
'; - - $table->data[3][5] .= html_print_button( + /* + $table->data[3][5] .= html_print_button( __('Export to CSV'), 'csv_export', false, "blockResubmit($(this)); location.href='monitoring/custom_fields_csv.php?filters=$decode_filters&id_custom_field=$id_custom_fields&id_status=$decode_id_status&module_status=$decode_module_status'", 'class="sub next"', true - ); + );*/ $table->data[3][5] .= '
'; } @@ -943,12 +943,11 @@ function table_datatables(filters, indexed_descriptions, processing){ //info: "Page _PAGE_ of _PAGES_", infoEmpty: "No results", infoFiltered: "", - search: "Search:" - /* + search: "Search:", paginate:{ - next: "First", - previous: "Last" - }*/ + next: "Last", + previous: "Next" + } }, sDom: '<"top"lfp>rt<"bottom"ip><"clear">', columns: [ From c2e6dd378dd6713f68de7e42dcf6b8f0a9b291ba Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Thu, 31 Aug 2023 13:36:26 +0200 Subject: [PATCH 04/37] #11206 Fix buttons --- pandora_console/include/styles/js/datatables.min.css | 2 +- pandora_console/include/styles/tables.css | 2 +- .../operation/custom_fields/custom_fields_view.php | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/styles/js/datatables.min.css b/pandora_console/include/styles/js/datatables.min.css index 6b65296b2f..c5a5598611 100644 --- a/pandora_console/include/styles/js/datatables.min.css +++ b/pandora_console/include/styles/js/datatables.min.css @@ -1873,7 +1873,7 @@ table.dataTable td { .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active { cursor: default; color: #fff !important; - border: 1px solid transparent; + border: 1px solid #fff !important; background: transparent; box-shadow: none; } diff --git a/pandora_console/include/styles/tables.css b/pandora_console/include/styles/tables.css index ef8e15d67b..0e4879220a 100644 --- a/pandora_console/include/styles/tables.css +++ b/pandora_console/include/styles/tables.css @@ -900,7 +900,7 @@ td.w75p#rightcolumn { .dataTables_wrapper .dataTables_filter { float: left; text-align: right; - margin-left: 64%; + margin-left: 8%; padding-left: 0px; margin-top: -5px; } diff --git a/pandora_console/operation/custom_fields/custom_fields_view.php b/pandora_console/operation/custom_fields/custom_fields_view.php index a65b46db92..bd95ab26fd 100644 --- a/pandora_console/operation/custom_fields/custom_fields_view.php +++ b/pandora_console/operation/custom_fields/custom_fields_view.php @@ -944,10 +944,10 @@ function table_datatables(filters, indexed_descriptions, processing){ infoEmpty: "No results", infoFiltered: "", search: "Search:", - paginate:{ - next: "Last", + /*paginate:{ + next: "Next", previous: "Next" - } + }*/ }, sDom: '<"top"lfp>rt<"bottom"ip><"clear">', columns: [ From 550bd0e6ba6600e9b19ce8c76c0793889ada849c Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Mon, 25 Sep 2023 15:39:48 +0200 Subject: [PATCH 05/37] #12073 Add tip --- pandora_console/operation/events/sound_events.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandora_console/operation/events/sound_events.php b/pandora_console/operation/events/sound_events.php index 7c04359f98..0bec0e65d8 100644 --- a/pandora_console/operation/events/sound_events.php +++ b/pandora_console/operation/events/sound_events.php @@ -32,6 +32,7 @@ require_once '../../include/config.php'; require_once '../../include/functions.php'; require_once '../../include/functions_db.php'; require_once '../../include/functions_events.php'; +require_once '../../include/functions_ui.php'; require_once '../../include/auth/mysql.php'; require_once $config['homedir'].'/include/class/HTML.class.php'; @@ -127,7 +128,7 @@ $output = '
'; // Content tabs. $output .= '
'; $output .= '

'; - $output .= __('Console configuration'); + $output .= __('Console configuration').ui_print_help_tip(__('Warning: Minimizing this window will cause the Acoustic Console to not work as expected'), true); $output .= '

'; $inputs = []; @@ -334,6 +335,7 @@ $output = '
'; ); $output .= '
'; $output .= '
'; + $output .= html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', 'hidden' => true]); echo $output; ?> From d1f2fa4b44d5e732c8046e46993ebb1327a0e993 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Wed, 27 Sep 2023 10:50:33 +0200 Subject: [PATCH 06/37] #12113 Set select to close when an option is chosen --- .../godmode/agentes/module_manager_editor_common.php | 6 ++++++ pandora_console/include/javascript/extensions_discovery.js | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index f70af23627..d9a0d3ba22 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -1668,6 +1668,12 @@ ui_require_jquery_file('json');