Merge branch 'ent-9662-Restyling-fuentes-colores-botones' of brutus.artica.es:artica/pandorafms into ent-9662-Restyling-fuentes-colores-botones

This commit is contained in:
Jonathan 2023-02-24 10:30:55 +01:00
commit 5e25f96c76
8 changed files with 169 additions and 124 deletions

View File

@ -602,7 +602,14 @@ function mainAgentsModules()
$show_filters .= '</form>';
ui_toggle(
$show_filters,
__('Filters ').ui_print_help_tip(__('Secondary groups and agent subgroups will be taken into account.'), true)
__('Filters ').ui_print_help_tip(__('Secondary groups and agent subgroups will be taken into account.'), true),
'filter_form',
'',
true,
false,
'',
'white-box-content',
'box-flat white_table_graph fixed_filter_bar'
);
}

View File

@ -74,61 +74,11 @@ function pandora_realtime_graphs()
);
}
$chart[time()]['graph'] = '0';
$interactive_graph = true;
$color = [];
$legend = '';
$long_index = [];
$no_data_image = '';
$canvas = '<div id="graph_container" class="graph_container">';
$canvas .= '<div id="chartLegend" class="chartLegend"></div>';
$width = 800;
$height = 300;
$data_array['realtime']['data'][0][0] = (time() - 10);
$data_array['realtime']['data'][0][1] = 0;
$data_array['realtime']['data'][1][0] = time();
$data_array['realtime']['data'][1][1] = 0;
$data_array['realtime']['color'] = 'green';
$params = [
'agent_module_id' => false,
'period' => 300,
'width' => $width,
'height' => $height,
'unit' => $unit,
'only_image' => $only_image,
'homeurl' => $homeurl,
'type_graph' => 'area',
'font' => $config['fontpath'],
'font-size' => $config['font_size'],
'array_data_create' => $data_array,
'show_legend' => false,
'show_menu' => false,
];
$canvas .= grafico_modulo_sparse($params);
$canvas .= '</div>';
echo $canvas;
$table = new stdClass();
$table->width = '100%';
$table->id = 'table-form';
$table->class = 'databox filters';
$table->class = 'filter-table-adv';
$table->style = [];
$table->cellpadding = '0';
$table->cellspacing = '0';
$table->style['graph'] = 'font-weight: bold;';
$table->style['refresh'] = 'font-weight: bold;';
$table->style['incremental'] = 'font-weight: bold;';
$table->style['reset'] = 'font-weight: bold;';
$table->style['snmp_address'] = 'font-weight: bold;';
$table->style['snmp_community'] = 'font-weight: bold;';
$table->style['snmp_oid'] = 'font-weight: bold;';
$table->style['snmp_oid'] = 'font-weight: bold;';
$table->data = [];
$graph_fields['cpu_load'] = __('%s Server CPU', get_product_name());
@ -158,15 +108,22 @@ function pandora_realtime_graphs()
$refresh = get_parameter('refresh', '1000');
if ($graph != 'snmp_module') {
$data['graph'] = __('Graph').'&nbsp;&nbsp;';
$data['graph'] .= html_print_select(
$graph_fields,
'graph',
$graph,
'',
'',
0,
true
$data['graph'] = html_print_label_input_block(
__('Graph'),
html_print_select(
$graph_fields,
'graph',
$graph,
'',
'',
0,
true,
false,
true,
'',
false,
'width: 100%'
)
);
}
@ -179,18 +136,35 @@ function pandora_realtime_graphs()
$agent_alias = io_safe_output(get_parameter('agent_alias', ''));
$module_name = io_safe_output(get_parameter('module_name', ''));
$module_incremental = get_parameter('incremental', 0);
$data['module_info'] = $agent_alias.': <b>'.$module_name.'</b>';
// Append all the hidden in this cell.
$data['module_info'] .= html_print_input_hidden(
'incremental',
$module_incremental,
true
$data['module_info'] = html_print_label_input_block(
$agent_alias.': '.$module_name,
html_print_input_hidden(
'incremental',
$module_incremental,
true
).html_print_select(
['snmp_module' => '-'],
'graph',
'snmp_module',
'',
'',
0,
true,
false,
true,
'',
false,
'width: 100%; display: none;'
)
);
$data['module_info'] .= html_print_select(
['snmp_module' => '-'],
'graph',
'snmp_module',
}
$data['refresh'] = html_print_label_input_block(
__('Refresh interval'),
html_print_select(
$refresh_fields,
'refresh',
$refresh,
'',
'',
0,
@ -199,33 +173,17 @@ function pandora_realtime_graphs()
true,
'',
false,
'display: none;'
'width: 100%'
)
);
if ($graph != 'snmp_module') {
$data['incremental'] = html_print_label_input_block(
__('Incremental'),
html_print_checkbox_switch('incremental', 1, 0, true)
);
}
$data['refresh'] = __('Refresh interval').'&nbsp;&nbsp;';
$data['refresh'] .= html_print_select(
$refresh_fields,
'refresh',
$refresh,
'',
'',
0,
true
);
if ($graph != 'snmp_module') {
$data['incremental'] = __('Incremental').'&nbsp;&nbsp;';
$data['incremental'] .= html_print_checkbox('incremental', 1, 0, true);
}
$data['reset'] = html_print_button(
__('Clear graph'),
'reset',
false,
'javascript:realtimeGraphs.clearGraph();',
'class="sub delete mgn_tp_0" ',
true
);
$table->data[] = $data;
if ($graph == 'snmp_interface' || $graph == 'snmp_module') {
@ -236,9 +194,71 @@ function pandora_realtime_graphs()
html_print_input_hidden('rel_path', get_parameter('rel_path', ''));
// Print the form.
echo '<form id="realgraph" method="post">';
html_print_table($table);
echo '</form>';
$searchForm = '<form id="realgraph" method="post">';
$searchForm .= html_print_table($table, true);
$searchForm .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Clear graph'),
'srcbutton',
false,
[
'icon' => 'delete',
'mode' => 'mini',
'onClick' => 'javascript:realtimeGraphs.clearGraph();',
],
true
),
],
true
);
$searchForm .= '</form>';
ui_toggle(
$searchForm,
'<span class="subsection_header_title">'.__('Filters').'</span>',
'filter_form',
'',
true,
false,
'',
'white-box-content',
'box-flat white_table_graph fixed_filter_bar'
);
$chart[time()]['graph'] = '0';
$canvas = '<div id="graph_container" class="graph_container">';
$canvas .= '<div id="chartLegend" class="chartLegend"></div>';
$width = 800;
$height = 300;
$data_array['realtime']['data'][0][0] = (time() - 10);
$data_array['realtime']['data'][0][1] = 0;
$data_array['realtime']['data'][1][0] = time();
$data_array['realtime']['data'][1][1] = 0;
$data_array['realtime']['color'] = 'green';
$params = [
'agent_module_id' => false,
'period' => 300,
'width' => $width,
'height' => $height,
'only_image' => false,
'type_graph' => 'area',
'font' => $config['fontpath'],
'font-size' => $config['font_size'],
'array_data_create' => $data_array,
'show_legend' => false,
'show_menu' => false,
'backgroundColor' => 'transparent',
];
$canvas .= grafico_modulo_sparse($params);
$canvas .= '</div>';
echo $canvas;
// Define a custom action to save
// the OID selected in the SNMP browser to the form.

View File

@ -12,6 +12,5 @@
#graph_container {
width: 800px;
margin: 20px auto;
background-color: white;
border-radius: 3px;
}

View File

@ -230,14 +230,14 @@ class AgentsAlerts extends HTML
$agent_modules = db_get_all_rows_sql($sql);
ui_pagination(
$tablePagination = ui_pagination(
$count_agent_module[0]['COUNT(tagente_modulo.nombre)'],
ui_get_url_refresh(),
0,
false,
false,
'offset',
true,
'offset',
false,
'',
'',
false,
@ -419,6 +419,11 @@ class AgentsAlerts extends HTML
}
html_print_table($table);
html_print_action_buttons(
'',
['right_content' => $tablePagination]
);
}
@ -781,7 +786,7 @@ class AgentsAlerts extends HTML
'name' => 'show-modules-without-alerts',
'checked' => $this->showWithoutAlertModules,
'input_class' => 'flex-row',
'type' => 'checkbox',
'type' => 'switch',
'class' => '',
'disabled_hidden' => true,
'return' => true,
@ -858,13 +863,16 @@ class AgentsAlerts extends HTML
true
);
// Prints the header controls.
$header = html_print_div(
[
'class' => 'white_box agents_alerts_header',
'content' => $filterForm,
],
true
$header = ui_toggle(
$filterForm,
'<span class="subsection_header_title">'.__('Filters').'</span>',
'filter_form',
'',
true,
true,
'',
'white-box-content',
'box-flat white_table_graph fixed_filter_bar'
);
echo $header;

View File

@ -462,7 +462,7 @@ function treeview_printAlertsTable($id_module, $server_data=[], $no_head=false)
// Actions table
echo '<div class="w100p right_align">';
echo '<a target=_blank href="'.$console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&search=1&module_name='.$module_name.'&id_agente='.$agent_id.$url_hash.'" target="_blank">';
html_print_submit_button(__('Go to alerts edition'), 'upd_button', false, 'class="sub search" style="margin-right: 20px"');
html_print_submit_button(__('Go to alerts edition'), 'upd_button', false, ['icon' => 'alert']);
echo '</a>';
echo '</div>';
}

View File

@ -150,7 +150,7 @@
self._box
.addClass("fixed-bottom-box")
.css("position", "fixed")
.css("top", "112px")
.css("top", "150px")
.css("right", "0")
.css("width", "25%");

View File

@ -9931,6 +9931,11 @@ select {
box-sizing: border-box;
}
input[list],
textarea[list],
select[list] {
line-height: initial;
}
textarea {
padding: 10px;
height: auto;
@ -10312,7 +10317,10 @@ button div.camera {
mask: url(../../images/picture.svg) no-repeat center / contain;
-webkit-mask: url(../../images/picture.svg) no-repeat center / contain;
}
button div.alert {
mask: url(../../images/alert@svg.svg) no-repeat center / contain;
-webkit-mask: url(../../images/alert@svg.svg) no-repeat center / contain;
}
button div.ok {
mask: url(../../images/ok.svg) no-repeat center / contain;
-webkit-mask: url(../../images/ok.svg) no-repeat center / contain;
@ -10458,7 +10466,7 @@ button.ui-button.ui-widget.submit-cancel:active {
}
.moduleIdBox {
height: 36px;
height: 35px;
border-top-right-radius: 6px;
border-bottom-right-radius: 6px;
margin-left: -56px;

View File

@ -51,17 +51,15 @@
width: 16px;
}
.tree-node .node-status {
width: 40px;
height: 31px;
border-radius: 7px 0 0 7px;
box-sizing: border-box;
position: absolute;
padding: 8px;
border-radius: 8px;
width: 19px;
height: 17px;
width: 18px;
height: 18px;
top: 6px;
left: 9px;
margin: 0;
padding: 0;
left: 13px;
}
.tree-node .node-name {
position: relative;
@ -315,8 +313,6 @@ div.tree-node span {
div#tree-controller-recipient {
text-align: left;
width: calc((100% - 30%) - 20px);
margin-top: 10px;
margin-left: 20px;
}
.tree-controller-recipient {
@ -384,3 +380,10 @@ div#tree-controller-recipient {
margin-top: 0;
margin-bottom: 2px;
}
.tree-node > .node-content > .agent-alerts-fired {
float: left;
position: relative;
left: 26px;
top: -5px;
}