mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 08:45:12 +02:00
fixed minor errors
This commit is contained in:
parent
b25332d014
commit
adf9e4d1fe
@ -2913,7 +2913,7 @@ function color_graph_array(){
|
|||||||
//XXX Colores fijos para eventos, alertas, desconocidos, percentil, overlapped, summatory, average, projection
|
//XXX Colores fijos para eventos, alertas, desconocidos, percentil, overlapped, summatory, average, projection
|
||||||
$color_series['event'] = array(
|
$color_series['event'] = array(
|
||||||
'border' => '#ff0000',
|
'border' => '#ff0000',
|
||||||
'color' => '#ff66cc',
|
'color' => '#FF5733',
|
||||||
'alpha' => CHART_DEFAULT_ALPHA
|
'alpha' => CHART_DEFAULT_ALPHA
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -3041,11 +3041,11 @@ function series_type_graph_array($data, $show_elements_graph){
|
|||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if(strpos($key, 'baseline') !== false){
|
if(strpos($key, 'baseline') !== false){
|
||||||
$data_return['legend'][$key] = $value['agent_name'] . ' / ' .
|
$data_return['legend'][$key] = $value['agent_alias'] . ' / ' .
|
||||||
$value['module_name'] . ' Baseline ';
|
$value['module_name'] . ' Baseline ';
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$data_return['legend'][$key] = $value['agent_name'] . ' / ' .
|
$data_return['legend'][$key] = $value['agent_alias'] . ' / ' .
|
||||||
$value['module_name'] . ': ';
|
$value['module_name'] . ': ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3114,7 +3114,7 @@ function series_type_graph_array($data, $show_elements_graph){
|
|||||||
$data_return['legend'][$key] .= $show_elements_graph['labels'][$value['agent_module_id']] . ' ' ;
|
$data_return['legend'][$key] .= $show_elements_graph['labels'][$value['agent_module_id']] . ' ' ;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$data_return['legend'][$key] .= $value['agent_name'] . ' / ' .
|
$data_return['legend'][$key] .= $value['agent_alias'] . ' / ' .
|
||||||
$value['module_name'] . ': ' . ' Value: ';
|
$value['module_name'] . ': ' . ' Value: ';
|
||||||
}
|
}
|
||||||
$data_return['legend'][$key] .= remove_right_zeros(
|
$data_return['legend'][$key] .= remove_right_zeros(
|
||||||
|
@ -262,6 +262,22 @@ function grafico_modulo_sparse_data_chart (
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
/*
|
||||||
|
if(true){
|
||||||
|
$data = db_get_all_rows_filter (
|
||||||
|
'tagente_datos',
|
||||||
|
array ('id_agente_modulo' => (int)$agent_module_id,
|
||||||
|
"utimestamp > '". $date_array['start_date']. "'",
|
||||||
|
"utimestamp < '". $date_array['final_date'] . "'",
|
||||||
|
'group' => "ROUND(utimestamp / 86400)",
|
||||||
|
'order' => 'utimestamp ASC'),
|
||||||
|
array ('max(datos) as datos', 'min(utimestamp) as utimestamp'),
|
||||||
|
'AND',
|
||||||
|
$data_module_graph['history_db']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
*/
|
||||||
$data = db_get_all_rows_filter (
|
$data = db_get_all_rows_filter (
|
||||||
'tagente_datos',
|
'tagente_datos',
|
||||||
array ('id_agente_modulo' => (int)$agent_module_id,
|
array ('id_agente_modulo' => (int)$agent_module_id,
|
||||||
@ -272,6 +288,7 @@ function grafico_modulo_sparse_data_chart (
|
|||||||
'AND',
|
'AND',
|
||||||
$data_module_graph['history_db']
|
$data_module_graph['history_db']
|
||||||
);
|
);
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($data === false){
|
if($data === false){
|
||||||
@ -362,6 +379,7 @@ function grafico_modulo_sparse_data_chart (
|
|||||||
$array_data["sum" . $series_suffix]['id_module_type'] = $data_module_graph['id_module_type'];
|
$array_data["sum" . $series_suffix]['id_module_type'] = $data_module_graph['id_module_type'];
|
||||||
$array_data["sum" . $series_suffix]['agent_name'] = $data_module_graph['agent_name'];
|
$array_data["sum" . $series_suffix]['agent_name'] = $data_module_graph['agent_name'];
|
||||||
$array_data["sum" . $series_suffix]['module_name'] = $data_module_graph['module_name'];
|
$array_data["sum" . $series_suffix]['module_name'] = $data_module_graph['module_name'];
|
||||||
|
$array_data["sum" . $series_suffix]['agent_alias'] = $data_module_graph['agent_alias'];
|
||||||
|
|
||||||
if (!is_null($params['percentil']) &&
|
if (!is_null($params['percentil']) &&
|
||||||
$params['percentil'] &&
|
$params['percentil'] &&
|
||||||
@ -402,6 +420,7 @@ function grafico_modulo_sparse_data(
|
|||||||
$array_data["sum" . $series_suffix]['id_module_type'] = $data_module_graph['id_module_type'];
|
$array_data["sum" . $series_suffix]['id_module_type'] = $data_module_graph['id_module_type'];
|
||||||
$array_data["sum" . $series_suffix]['agent_name'] = $data_module_graph['agent_name'];
|
$array_data["sum" . $series_suffix]['agent_name'] = $data_module_graph['agent_name'];
|
||||||
$array_data["sum" . $series_suffix]['module_name'] = $data_module_graph['module_name'];
|
$array_data["sum" . $series_suffix]['module_name'] = $data_module_graph['module_name'];
|
||||||
|
$array_data["sum" . $series_suffix]['agent_alias'] = $data_module_graph['agent_alias'];
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$array_data = grafico_modulo_sparse_data_chart (
|
$array_data = grafico_modulo_sparse_data_chart (
|
||||||
@ -881,6 +900,7 @@ function grafico_modulo_sparse ($params) {
|
|||||||
$data_module_graph = array();
|
$data_module_graph = array();
|
||||||
$data_module_graph['history_db'] = db_search_in_history_db($date_array["start_date"]);
|
$data_module_graph['history_db'] = db_search_in_history_db($date_array["start_date"]);
|
||||||
$data_module_graph['agent_name'] = modules_get_agentmodule_agent_name($agent_module_id);
|
$data_module_graph['agent_name'] = modules_get_agentmodule_agent_name($agent_module_id);
|
||||||
|
$data_module_graph['agent_alias'] = modules_get_agentmodule_agent_alias($agent_module_id);
|
||||||
$data_module_graph['agent_id'] = $module_data['id_agente'];
|
$data_module_graph['agent_id'] = $module_data['id_agente'];
|
||||||
$data_module_graph['module_name'] = $module_data['nombre'];
|
$data_module_graph['module_name'] = $module_data['nombre'];
|
||||||
$data_module_graph['id_module_type'] = $module_data['id_tipo_modulo'];
|
$data_module_graph['id_module_type'] = $module_data['id_tipo_modulo'];
|
||||||
@ -1454,6 +1474,7 @@ function graphic_combined_module (
|
|||||||
$data_module_graph = array();
|
$data_module_graph = array();
|
||||||
$data_module_graph['history_db'] = db_search_in_history_db($date_array["start_date"]);
|
$data_module_graph['history_db'] = db_search_in_history_db($date_array["start_date"]);
|
||||||
$data_module_graph['agent_name'] = modules_get_agentmodule_agent_name($agent_module_id);
|
$data_module_graph['agent_name'] = modules_get_agentmodule_agent_name($agent_module_id);
|
||||||
|
$data_module_graph['agent_alias'] = modules_get_agentmodule_agent_alias($agent_module_id);
|
||||||
$data_module_graph['agent_id'] = $module_data['id_agente'];
|
$data_module_graph['agent_id'] = $module_data['id_agente'];
|
||||||
$data_module_graph['module_name'] = $module_data['nombre'];
|
$data_module_graph['module_name'] = $module_data['nombre'];
|
||||||
$data_module_graph['id_module_type'] = $module_data['id_tipo_modulo'];
|
$data_module_graph['id_module_type'] = $module_data['id_tipo_modulo'];
|
||||||
|
@ -1505,7 +1505,6 @@ function pandoraFlotArea(
|
|||||||
|
|
||||||
i=0;
|
i=0;
|
||||||
$.each(values, function (index, value) {
|
$.each(values, function (index, value) {
|
||||||
|
|
||||||
if (typeof value.data !== "undefined") {
|
if (typeof value.data !== "undefined") {
|
||||||
if(index.search("alert") >= 0){
|
if(index.search("alert") >= 0){
|
||||||
fill_color = '#ff7f00';
|
fill_color = '#ff7f00';
|
||||||
@ -1583,7 +1582,7 @@ function pandoraFlotArea(
|
|||||||
|
|
||||||
// The first execution, the graph data is the base data
|
// The first execution, the graph data is the base data
|
||||||
datas = data_base;
|
datas = data_base;
|
||||||
font_size = 8;
|
|
||||||
// minTickSize
|
// minTickSize
|
||||||
var count_data = datas[0].data.length;
|
var count_data = datas[0].data.length;
|
||||||
var min_tick = datas[0].data[0][0];
|
var min_tick = datas[0].data[0][0];
|
||||||
@ -1623,8 +1622,15 @@ function pandoraFlotArea(
|
|||||||
color: legend_color,
|
color: legend_color,
|
||||||
autoHighlight: true
|
autoHighlight: true
|
||||||
},
|
},
|
||||||
|
xaxis: {
|
||||||
|
min: date_array.start_date * 1000,
|
||||||
|
max: date_array.final_date * 1000
|
||||||
|
},
|
||||||
xaxes: [{
|
xaxes: [{
|
||||||
|
axisLabelUseCanvas: true,
|
||||||
axisLabelFontSizePixels: font_size,
|
axisLabelFontSizePixels: font_size,
|
||||||
|
axisLabelFontFamily: font+'Font',
|
||||||
|
axisLabelPadding: 0,
|
||||||
mode: "time",
|
mode: "time",
|
||||||
//tickFormatter: xFormatter,
|
//tickFormatter: xFormatter,
|
||||||
tickSize: [maxticks, 'hour']
|
tickSize: [maxticks, 'hour']
|
||||||
@ -1669,7 +1675,7 @@ function pandoraFlotArea(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*//XXXXXXX
|
||||||
if (vconsole) {
|
if (vconsole) {
|
||||||
var myCanvas = plot.getCanvas();
|
var myCanvas = plot.getCanvas();
|
||||||
plot.setupGrid(); // redraw plot to new size
|
plot.setupGrid(); // redraw plot to new size
|
||||||
@ -1714,13 +1720,21 @@ if (vconsole) {
|
|||||||
borderWidth:1,
|
borderWidth:1,
|
||||||
borderColor: '#C1C1C1',
|
borderColor: '#C1C1C1',
|
||||||
tickColor: background_color,
|
tickColor: background_color,
|
||||||
color: legend_color
|
color: legend_color,
|
||||||
|
autoHighlight: true
|
||||||
|
},
|
||||||
|
xaxis: {
|
||||||
|
min: date_array.start_date * 1000,
|
||||||
|
max: date_array.final_date * 1000
|
||||||
},
|
},
|
||||||
xaxes: [{
|
xaxes: [{
|
||||||
|
axisLabelUseCanvas: true,
|
||||||
axisLabelFontSizePixels: font_size,
|
axisLabelFontSizePixels: font_size,
|
||||||
|
axisLabelFontFamily: font+'Font',
|
||||||
|
axisLabelPadding: 0,
|
||||||
mode: "time",
|
mode: "time",
|
||||||
//tickFormatter: xFormatter,
|
//tickFormatter: xFormatter,
|
||||||
tickSize: [maxticks, 'hour'],
|
tickSize: [maxticks, 'hour']
|
||||||
}],
|
}],
|
||||||
yaxes: [{
|
yaxes: [{
|
||||||
tickFormatter: yFormatter,
|
tickFormatter: yFormatter,
|
||||||
@ -1729,7 +1743,7 @@ if (vconsole) {
|
|||||||
labelWidth: 30,
|
labelWidth: 30,
|
||||||
position: 'left',
|
position: 'left',
|
||||||
font: font,
|
font: font,
|
||||||
reserveSpace: true,
|
reserveSpace: true
|
||||||
}],
|
}],
|
||||||
legend: {
|
legend: {
|
||||||
position: 'se',
|
position: 'se',
|
||||||
@ -1738,8 +1752,13 @@ if (vconsole) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Connection between plot and miniplot
|
|
||||||
|
|
||||||
|
// Adjust overview when main chart is resized
|
||||||
|
$('#overview_'+graph_id).resize(function(){
|
||||||
|
update_left_width_canvas(graph_id);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Connection between plot and miniplot
|
||||||
$('#' + graph_id).bind('plotselected', function (event, ranges) {
|
$('#' + graph_id).bind('plotselected', function (event, ranges) {
|
||||||
// do the zooming if exist menu to undo it
|
// do the zooming if exist menu to undo it
|
||||||
if (menu == 0) {
|
if (menu == 0) {
|
||||||
@ -1748,9 +1767,9 @@ if (vconsole) {
|
|||||||
|
|
||||||
dataInSelection = ranges.xaxis.to - ranges.xaxis.from;
|
dataInSelection = ranges.xaxis.to - ranges.xaxis.from;
|
||||||
|
|
||||||
var maxticks_zoom = dataInSelection / 3600000 / 6;
|
var maxticks_zoom = dataInSelection / 3600000 / number_ticks;
|
||||||
if(maxticks_zoom < 0.001){
|
if(maxticks_zoom < 0.001){
|
||||||
maxticks_zoom = dataInSelection / 60000 / 6;
|
maxticks_zoom = dataInSelection / 60000 / number_ticks;
|
||||||
if(maxticks_zoom < 0.001){
|
if(maxticks_zoom < 0.001){
|
||||||
maxticks_zoom = 0;
|
maxticks_zoom = 0;
|
||||||
}
|
}
|
||||||
@ -1780,6 +1799,10 @@ if (vconsole) {
|
|||||||
max: ranges.xaxis.to
|
max: ranges.xaxis.to
|
||||||
},
|
},
|
||||||
xaxes: [{
|
xaxes: [{
|
||||||
|
axisLabelUseCanvas: true,
|
||||||
|
axisLabelFontSizePixels: font_size,
|
||||||
|
axisLabelFontFamily: font+'Font',
|
||||||
|
axisLabelPadding: 0,
|
||||||
mode: "time",
|
mode: "time",
|
||||||
//tickFormatter: xFormatter,
|
//tickFormatter: xFormatter,
|
||||||
tickSize: [maxticks_zoom, 'hour']
|
tickSize: [maxticks_zoom, 'hour']
|
||||||
@ -1815,6 +1838,10 @@ if (vconsole) {
|
|||||||
max: ranges.xaxis.to
|
max: ranges.xaxis.to
|
||||||
},
|
},
|
||||||
xaxes: [{
|
xaxes: [{
|
||||||
|
axisLabelUseCanvas: true,
|
||||||
|
axisLabelFontSizePixels: font_size,
|
||||||
|
axisLabelFontFamily: font+'Font',
|
||||||
|
axisLabelPadding: 0,
|
||||||
mode: "time",
|
mode: "time",
|
||||||
//tickFormatter: xFormatter,
|
//tickFormatter: xFormatter,
|
||||||
tickSize: [maxticks_zoom, 'hour']
|
tickSize: [maxticks_zoom, 'hour']
|
||||||
@ -1840,7 +1867,6 @@ if (vconsole) {
|
|||||||
|
|
||||||
$('#menu_cancelzoom_' + graph_id).attr('src', homeurl + '/images/zoom_cross_grey.png');
|
$('#menu_cancelzoom_' + graph_id).attr('src', homeurl + '/images/zoom_cross_grey.png');
|
||||||
|
|
||||||
// currentRanges = ranges;
|
|
||||||
// don't fire event on the overview to prevent eternal loop
|
// don't fire event on the overview to prevent eternal loop
|
||||||
overview.setSelection(ranges, true);
|
overview.setSelection(ranges, true);
|
||||||
});
|
});
|
||||||
@ -1971,7 +1997,7 @@ if (vconsole) {
|
|||||||
|
|
||||||
// Events
|
// Events
|
||||||
$('#overview_' + graph_id).bind('plothover', function (event, pos, item) {
|
$('#overview_' + graph_id).bind('plothover', function (event, pos, item) {
|
||||||
plot.setCrosshair({ x: pos.x, y: 0 });
|
plot.setCrosshair({ x: pos.x, y: pos.y });
|
||||||
currentPlot = plot;
|
currentPlot = plot;
|
||||||
latestPosition = pos;
|
latestPosition = pos;
|
||||||
if (!updateLegendTimeout) {
|
if (!updateLegendTimeout) {
|
||||||
@ -1980,7 +2006,7 @@ if (vconsole) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('#' + graph_id).bind('plothover', function (event, pos, item) {
|
$('#' + graph_id).bind('plothover', function (event, pos, item) {
|
||||||
overview.setCrosshair({ x: pos.x, y: 0 });
|
overview.setCrosshair({ x: pos.x, y: pos.y });
|
||||||
currentPlot = plot;
|
currentPlot = plot;
|
||||||
latestPosition = pos;
|
latestPosition = pos;
|
||||||
if (!updateLegendTimeout) {
|
if (!updateLegendTimeout) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user