add graph agent new feature ticket integria: 3722
(cherry picked from commit dcb18bcbd2
)
This commit is contained in:
parent
8b5aa318a3
commit
8a1deb4b87
|
@ -3239,7 +3239,7 @@ function graph_graphic_agentevents ($id_agent, $width, $height, $period = 0, $ho
|
|||
|
||||
// Draw slicebar graph
|
||||
if ($config['flash_charts']) {
|
||||
$out = flot_slicesbar_graph($data, $period, $width, $height, $full_legend, $colors, $config['fontpath'], $config['round_corner'], $homeurl);
|
||||
$out = flot_slicesbar_graph($data, $period, $width, $height, $full_legend, $colors, $config['fontpath'], $config['round_corner'], $homeurl, '', '', false, $id_agent);
|
||||
}
|
||||
else {
|
||||
$out = slicesbar_graph($data, $period, $width, $height, $colors, $config['fontpath'], $config['round_corner'], $homeurl);
|
||||
|
|
|
@ -729,8 +729,7 @@ function pandoraFlotVBars(graph_id, values, labels, labels_long, legend, colors,
|
|||
}
|
||||
}
|
||||
|
||||
function pandoraFlotSlicebar(graph_id, values, datacolor, labels, legend, acumulate_data, intervaltick, water_mark, maxvalue, separator, separator2, graph_javascript) {
|
||||
|
||||
function pandoraFlotSlicebar(graph_id, values, datacolor, labels, legend, acumulate_data, intervaltick, water_mark, maxvalue, separator, separator2, graph_javascript, id_agent) {
|
||||
values = values.split(separator2);
|
||||
labels = labels.split(separator);
|
||||
legend = legend.split(separator);
|
||||
|
@ -765,6 +764,7 @@ function pandoraFlotSlicebar(graph_id, values, datacolor, labels, legend, acumul
|
|||
},
|
||||
grid: {
|
||||
hoverable: true,
|
||||
clickable: true,
|
||||
borderWidth:1,
|
||||
borderColor: '#000',
|
||||
tickColor: '#fff'
|
||||
|
@ -805,6 +805,28 @@ function pandoraFlotSlicebar(graph_id, values, datacolor, labels, legend, acumul
|
|||
}
|
||||
});
|
||||
|
||||
$('#'+graph_id).bind('plotclick', function(event, pos, item) {
|
||||
if (item) {
|
||||
//from time
|
||||
var from = legend[item.seriesIndex];
|
||||
//to time
|
||||
var to = legend[item.seriesIndex+1];
|
||||
//current date
|
||||
var dateObj = new Date();
|
||||
var month = dateObj.getUTCMonth() + 1; //months from 1-12
|
||||
var day = dateObj.getUTCDate();
|
||||
var year = dateObj.getUTCFullYear();
|
||||
newdate = year + "/" + month + "/" + day;
|
||||
|
||||
if(!to){
|
||||
to= '12:00';
|
||||
}
|
||||
window.location='index.php?sec=eventos&sec2=operation/events/events&id_agent='+id_agent+'&date_from='+newdate+'&time_from='+from+'&date_to='+newdate+'&time_to='+to+'&status=-1';
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('#'+graph_id).bind('mouseout',resetInteractivity);
|
||||
|
||||
// Reset interactivity styles
|
||||
|
|
|
@ -166,13 +166,22 @@ if (($date_from == '') && ($date_to == '')) {
|
|||
}
|
||||
else {
|
||||
if ($date_from != '') {
|
||||
$udate_from = strtotime($date_from . " 00:00:00");
|
||||
$sql_post .= " AND (utimestamp >= " . $udate_from . ")";
|
||||
|
||||
if($time_from != '') {
|
||||
$udate_from = strtotime($date_from . " " . $time_from);
|
||||
$sql_post .= " AND (utimestamp >= " . $udate_from . ")";
|
||||
} else {
|
||||
$udate_from = strtotime($date_from . " 00:00:00");
|
||||
$sql_post .= " AND (utimestamp >= " . $udate_from . ")";
|
||||
}
|
||||
}
|
||||
if ($date_to != '') {
|
||||
$udate_to = strtotime($date_to . " 23:59:59");
|
||||
$sql_post .= " AND (utimestamp <= " . $udate_to . ")";
|
||||
if($time_to != '') {
|
||||
$udate_to = strtotime($date_to . " " . $time_to);
|
||||
$sql_post .= " AND (utimestamp <= " . $udate_to . ")";
|
||||
} else {
|
||||
$udate_to = strtotime($date_to . " 23:59:59");
|
||||
$sql_post .= " AND (utimestamp <= " . $udate_to . ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -220,6 +220,8 @@ $id_name = (string) get_parameter('id_name', '');
|
|||
$open_filter = (int) get_parameter('open_filter', 0);
|
||||
$date_from = (string)get_parameter('date_from', '');
|
||||
$date_to = (string)get_parameter('date_to', '');
|
||||
$time_from = (string)get_parameter('time_from', '');
|
||||
$time_to = (string)get_parameter('time_to', '');
|
||||
$server_id = (int)get_parameter('server_id', 0);
|
||||
$text_agent = (string) get_parameter("text_agent");
|
||||
|
||||
|
@ -295,6 +297,8 @@ $params = "search=" . rawurlencode(io_safe_input($search)) .
|
|||
"&open_filter=" . $open_filter .
|
||||
"&date_from=" . $date_from .
|
||||
"&date_to=" . $date_to .
|
||||
"&time_from=" . $time_from .
|
||||
"&time_to=" . $time_to .
|
||||
"&pure=" . $config["pure"];
|
||||
|
||||
if ($meta) {
|
||||
|
|
|
@ -478,6 +478,15 @@ $data[1] .= html_print_input_text ('date_to', $date_to, '', 15, 10, true);
|
|||
$table_advanced->data[] = $data;
|
||||
$table_advanced->rowclass[] = '';
|
||||
|
||||
$data[0] = __('Timestamp from:') . $jump;
|
||||
$data[0] .= html_print_input_text('time_from', $time_from, '', 9, 7, true);
|
||||
|
||||
$data[1] = __('Timestamp to:') . $jump;
|
||||
$data[1] .= html_print_input_text('time_to', $time_to, '', 9, 7, true);
|
||||
|
||||
$table_advanced->data[] = $data;
|
||||
$table_advanced->rowclass[] = '';
|
||||
|
||||
$data = array();
|
||||
if (defined('METACONSOLE'))
|
||||
{
|
||||
|
@ -1476,4 +1485,24 @@ function show_events_graph_dialog() {
|
|||
.show ();
|
||||
}
|
||||
/* ]]> */
|
||||
|
||||
//function datetime
|
||||
function datetime_picker_callback() {
|
||||
|
||||
$("#text-time_from, #text-time_to").timepicker({
|
||||
showSecond: true,
|
||||
timeFormat: '<?php echo TIME_FORMAT_JS; ?>',
|
||||
timeOnlyTitle: '<?php echo __('Choose time');?>',
|
||||
timeText: '<?php echo __('Time');?>',
|
||||
hourText: '<?php echo __('Hour');?>',
|
||||
minuteText: '<?php echo __('Minute');?>',
|
||||
secondText: '<?php echo __('Second');?>',
|
||||
currentText: '<?php echo __('Now');?>',
|
||||
closeText: '<?php echo __('Close');?>'});
|
||||
|
||||
$("#text-date_from, #text-date_to").datepicker({dateFormat: "<?php echo DATE_FORMAT_JS; ?>"});
|
||||
|
||||
$.datepicker.setDefaults($.datepicker.regional[ "<?php echo get_user_language(); ?>"]);
|
||||
}
|
||||
datetime_picker_callback();
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue