diff --git a/pandora_console/include/styles/custom_field.css b/pandora_console/include/styles/custom_field.css new file mode 100644 index 0000000000..fcb12d492f --- /dev/null +++ b/pandora_console/include/styles/custom_field.css @@ -0,0 +1,85 @@ +/** + * + * Name: Default theme + * Pandora Stylesheet + * + * @category Stylesheet + * @package Pandora FMS + * @subpackage Community + * @version 1.0.0 + * @license See below + * + * ______ ___ _______ _______ ________ + * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __| + * | __/| _ | | _ || _ | _| _ | | ___| |__ | + * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| + * + * ============================================================================ + * Copyright (c) 2005-2023 Pandora FMS + * Please see https://pandorafms.com for full contribution list + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation for version 2. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * ============================================================================ + */ + +.dt-buttons { + float: left; +} + +.dt-button.buttons-csv.buttons-html5 { + box-shadow: none; +} + +.dataTables_filter > label { + color: #000; +} + +.top { + background-color: #fff !important; + color: #000 !important; + border-radius: 5px !important; + border: 1px solid #e5e9ed !important; +} + +.bottom { + background-color: #fff !important; + color: #000 !important; + border-radius: 5px !important; + border: 1px solid #e5e9ed !important; +} + +.dataTables_wrapper .dataTables_paginate .paginate_button.disabled, +.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover, +.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active { + color: #000 !important; +} + +.dataTables_wrapper .dataTables_paginate .paginate_button.current, +.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover { + color: #fff !important; + background: #14524f !important; +} + +.dataTables_wrapper .dataTables_paginate .paginate_button { + background-color: #f6f7fb !important; + color: #000 !important; + border: 1px solid #cacaca; +} + +.dataTables_wrapper .dataTables_paginate .paginate_button:hover { + background: #e2e2e2 !important; + color: #000 !important; +} + +.dataTables_wrapper .dataTables_paginate .paginate_button.next { + border: 1px solid #cacaca !important; +} + +.dataTables_wrapper .dataTables_paginate .paginate_button.previous { + border: 1px solid #cacaca !important; +} diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 7c740bba2b..e5e92fea81 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -12547,9 +12547,10 @@ form.cfv_status_agent input:checked + label:before { float: left; margin-left: 10px; padding-right: 10px; - max-height: 890px; + max-height: 760px; overflow: auto; background-color: #f9f9f9; + margin-bottom: 20px; } .agents_custom_fields { @@ -12558,15 +12559,6 @@ form.cfv_status_agent input:checked + label:before { 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%; -} /*Horizontal tree*/ @@ -12597,16 +12589,6 @@ div.agents_custom_fields #datatables_wrapper div.bottom { 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%; diff --git a/pandora_console/operation/custom_fields/custom_fields_view.php b/pandora_console/operation/custom_fields/custom_fields_view.php index bd95ab26fd..83d35533c7 100644 --- a/pandora_console/operation/custom_fields/custom_fields_view.php +++ b/pandora_console/operation/custom_fields/custom_fields_view.php @@ -67,12 +67,12 @@ $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); +$id_status = get_parameter('id_status', -1); $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); +$module_status = get_parameter('module_status', -1); // ===================================================================== // Custom filter search @@ -304,21 +304,12 @@ $table->data[2][5] = html_print_submit_button( ); if (check_acl($config['id_user'], 0, 'PM')) { - // Pass the parameters to the page that generates the csv file (arrays) + // 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] .= '
'; } @@ -367,12 +358,13 @@ if (isset($id_custom_fields_data) && is_array($id_custom_fields_data)) { $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';*/ + $id_field = db_get_value_filter( + 'id_field', + 'tagent_custom_fields', + ['name' => $id_custom_fields] + ); + foreach ($id_custom_field_array as $value) { $table_agent = new StdClass(); $table_agent->width = '100%'; $table_agent->class = 'tactical_view'; @@ -388,7 +380,7 @@ if (isset($id_custom_fields_data) && is_array($id_custom_fields_data)) { true, ['title' => __('Agents critical')] ); - $agent_data[1] = ""; + $agent_data[1] = ""; $agent_data[1] .= ""; $agent_data[1] .= format_numeric( $data['counters_name'][$value]['a_critical'] @@ -401,7 +393,7 @@ if (isset($id_custom_fields_data) && is_array($id_custom_fields_data)) { true, ['title' => __('Agents warning')] ); - $agent_data[3] = ""; + $agent_data[3] = ""; $agent_data[3] .= ""; $agent_data[3] .= format_numeric( $data['counters_name'][$value]['a_warning'] @@ -414,7 +406,7 @@ if (isset($id_custom_fields_data) && is_array($id_custom_fields_data)) { true, ['title' => __('Agents ok')] ); - $agent_data[5] = ""; + $agent_data[5] = ""; $agent_data[5] .= ""; $agent_data[5] .= format_numeric( $data['counters_name'][$value]['a_normal'] @@ -427,7 +419,7 @@ if (isset($id_custom_fields_data) && is_array($id_custom_fields_data)) { true, ['title' => __('Agents unknown')] ); - $agent_data[7] = ""; + $agent_data[7] = ""; $agent_data[7] .= ""; $agent_data[7] .= format_numeric( $data['counters_name'][$value]['a_unknown'] @@ -440,7 +432,7 @@ if (isset($id_custom_fields_data) && is_array($id_custom_fields_data)) { true, ['title' => __('Agents not init')] ); - $agent_data[9] = ""; + $agent_data[9] = ""; $agent_data[9] .= ""; $agent_data[9] .= format_numeric( $data['counters_name'][$value]['a_not_init'] @@ -455,12 +447,6 @@ if (isset($id_custom_fields_data) && is_array($id_custom_fields_data)) { $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'; @@ -478,7 +464,7 @@ if (isset($id_custom_fields_data) && is_array($id_custom_fields_data)) { false, true ); - $tdata[1] = ''.$m_critical.''; + $tdata[1] = ''.$m_critical.''; $tdata[2] = html_print_image( 'images/module_warning.png', @@ -489,7 +475,7 @@ if (isset($id_custom_fields_data) && is_array($id_custom_fields_data)) { false, true ); - $tdata[3] = ''.$m_warning.''; + $tdata[3] = ''.$m_warning.''; $tdata[4] = html_print_image( 'images/module_ok.png', @@ -500,7 +486,7 @@ if (isset($id_custom_fields_data) && is_array($id_custom_fields_data)) { false, true ); - $tdata[5] = ''.$m_normal.''; + $tdata[5] = ''.$m_normal.''; $tdata[6] = html_print_image( 'images/module_unknown.png', @@ -511,7 +497,7 @@ if (isset($id_custom_fields_data) && is_array($id_custom_fields_data)) { false, true ); - $tdata[7] = ''.$m_unknown.''; + $tdata[7] = ''.$m_unknown.''; $tdata[8] = html_print_image( 'images/module_notinit.png', @@ -523,7 +509,7 @@ if (isset($id_custom_fields_data) && is_array($id_custom_fields_data)) { true ); - $tdata[9] = ''.$m_not_init.''; + $tdata[9] = ''.$m_not_init.''; $table_mbs->data[] = $tdata; @@ -714,7 +700,7 @@ if (isset($id_custom_fields_data) && is_array($id_custom_fields_data)) { echo ''; echo "
"; - echo ""; + echo "
"; echo ''; echo ''; echo ''; @@ -755,6 +741,7 @@ if (isset($id_custom_fields_data) && is_array($id_custom_fields_data)) { echo ''; ui_require_css_file('datatables.min', 'include/styles/js/'); +ui_require_css_file('custom_field', 'include/styles/'); ui_require_javascript_file_enterprise('functions_csv'); ui_require_javascript_file('datatables.min'); ui_require_javascript_file('buttons.dataTables.min'); @@ -904,7 +891,6 @@ function dialog_filter_cf(title, type_form){ } function table_datatables(filters, indexed_descriptions, processing){ - console.log(indexed_descriptions); array_data = JSON.parse(filters); table = $('#datatables').DataTable({ processing: true, @@ -913,7 +899,6 @@ function table_datatables(filters, indexed_descriptions, processing){ searching: true, pageLength: Number(array_data.block_size), lengthMenu: [ 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 75, 100], - //buttons: [{ extend: 'csvHtml5', text: 'Save as csvHtml5' }], responsive: false, ajax: { type: "POST", @@ -933,21 +918,16 @@ function table_datatables(filters, indexed_descriptions, processing){ 'paging': true, 'ordering': true, 'scrollX': true, - 'scroller': true + 'scroller': true, }, }, language: { processing: processing, lengthMenu: "Show _MENU_ items per page", zeroRecords: "Nothing found. Please change your search term", - //info: "Page _PAGE_ of _PAGES_", infoEmpty: "No results", infoFiltered: "", search: "Search:", - /*paginate:{ - next: "Next", - previous: "Next" - }*/ }, sDom: '<"top"lfp>rt<"bottom"ip><"clear">', columns: [