mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-09-25 19:09:08 +02:00
Merge branch '618-new-item-auto-sla-graph-in-visual-console-dev' into 'develop'
618 new item auto sla graph in visual console dev See merge request !675
This commit is contained in:
commit
ea93a55982
@ -270,14 +270,14 @@ function update_button_palette_callback() {
|
|||||||
break;
|
break;
|
||||||
case 'box_item':
|
case 'box_item':
|
||||||
|
|
||||||
if($('input[name=width_box]').val() == ''){
|
if($('input[name=width_box]').val() == ''){
|
||||||
alert('Undefined width');
|
alert('Undefined width');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if($('input[name=height_box]').val() == ''){
|
if($('input[name=height_box]').val() == ''){
|
||||||
alert('Undefined height');
|
alert('Undefined height');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#" + idItem + " div").css('background-color', values['fill_color']);
|
$("#" + idItem + " div").css('background-color', values['fill_color']);
|
||||||
$("#" + idItem + " div").css('border-color', values['border_color']);
|
$("#" + idItem + " div").css('border-color', values['border_color']);
|
||||||
@ -295,55 +295,53 @@ function update_button_palette_callback() {
|
|||||||
case 'group_item':
|
case 'group_item':
|
||||||
case 'static_graph':
|
case 'static_graph':
|
||||||
|
|
||||||
if($('input[name=width]').val() == ''){
|
if($('input[name=width]').val() == ''){
|
||||||
alert('Undefined width');
|
alert('Undefined width');
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
if($('input[name=height]').val() == ''){
|
|
||||||
alert('Undefined height');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$("#text_" + idItem).html(values['label']);
|
|
||||||
if ((values['width'] == 0) || (values['height'] == 0)) {
|
|
||||||
if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
|
|
||||||
$("#image_" + idItem).removeAttr('width');
|
|
||||||
$("#image_" + idItem).removeAttr('height');
|
|
||||||
$("#image_" + idItem).attr('width', 70);
|
|
||||||
$("#image_" + idItem).attr('height', 70);
|
|
||||||
$("#image_" + idItem).css('width', '70px');
|
|
||||||
$("#image_" + idItem).css('height', '70px');
|
|
||||||
}
|
}
|
||||||
else{
|
if($('input[name=height]').val() == ''){
|
||||||
|
alert('Undefined height');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#text_" + idItem).html(values['label']);
|
||||||
|
if ((values['width'] == 0) || (values['height'] == 0)) {
|
||||||
|
if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
|
||||||
|
$("#image_" + idItem).removeAttr('width');
|
||||||
|
$("#image_" + idItem).removeAttr('height');
|
||||||
|
$("#image_" + idItem).attr('width', 70);
|
||||||
|
$("#image_" + idItem).attr('height', 70);
|
||||||
|
$("#image_" + idItem).css('width', '70px');
|
||||||
|
$("#image_" + idItem).css('height', '70px');
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$("#image_" + idItem).removeAttr('width');
|
||||||
|
$("#image_" + idItem).removeAttr('height');
|
||||||
|
$("#image_" + idItem).attr('width', $('#preview > img')[0].naturalHeight);
|
||||||
|
$("#image_" + idItem).attr('height', $('#preview > img')[0].naturalHeight);
|
||||||
|
$("#image_" + idItem).css('width', $('#preview > img')[0].naturalHeight+'px');
|
||||||
|
$("#image_" + idItem).css('height', $('#preview > img')[0].naturalHeight+'px');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
$("#image_" + idItem).removeAttr('width');
|
$("#image_" + idItem).removeAttr('width');
|
||||||
$("#image_" + idItem).removeAttr('height');
|
$("#image_" + idItem).removeAttr('height');
|
||||||
$("#image_" + idItem).attr('width', $('#preview > img')[0].naturalHeight);
|
$("#image_" + idItem).attr('width', values['width']);
|
||||||
$("#image_" + idItem).attr('height', $('#preview > img')[0].naturalHeight);
|
$("#image_" + idItem).attr('height', values['height']);
|
||||||
$("#image_" + idItem).css('width', $('#preview > img')[0].naturalHeight+'px');
|
$("#image_" + idItem).css('width', values['width'] + 'px');
|
||||||
$("#image_" + idItem).css('height', $('#preview > img')[0].naturalHeight+'px');
|
$("#image_" + idItem).css('height', values['height'] + 'px');
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else {
|
|
||||||
$("#image_" + idItem).removeAttr('width');
|
|
||||||
$("#image_" + idItem).removeAttr('height');
|
|
||||||
$("#image_" + idItem).attr('width', values['width']);
|
|
||||||
$("#image_" + idItem).attr('height', values['height']);
|
|
||||||
$("#image_" + idItem).css('width', values['width'] + 'px');
|
|
||||||
$("#image_" + idItem).css('height', values['height'] + 'px');
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 'percentile_bar':
|
case 'percentile_bar':
|
||||||
case 'percentile_item':
|
case 'percentile_item':
|
||||||
|
if($('input[name=width_percentile]').val() == ''){
|
||||||
if($('input[name=width_percentile]').val() == ''){
|
alert('Undefined width');
|
||||||
alert('Undefined width');
|
return false;
|
||||||
return false;
|
}
|
||||||
}
|
if($('input[name=height_percentile]').val() == ''){
|
||||||
if($('input[name=height_percentile]').val() == ''){
|
alert('Undefined height');
|
||||||
alert('Undefined height');
|
return false;
|
||||||
return false;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$("#text_" + idItem).html(values['label']);
|
$("#text_" + idItem).html(values['label']);
|
||||||
$("#image_" + idItem).attr("src", "images/spinner.gif");
|
$("#image_" + idItem).attr("src", "images/spinner.gif");
|
||||||
@ -354,50 +352,57 @@ function update_button_palette_callback() {
|
|||||||
setPercentileBar(idItem, values);
|
setPercentileBar(idItem, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'module_graph':
|
case 'module_graph':
|
||||||
|
if($('#dir_items').html() == 'horizontal'){
|
||||||
|
if(parseInt($('#text-left').val()) + (parseInt($('input[name=height_module_graph]').val() * $('#count_items').html())) > parseInt($('#background').css('width'))
|
||||||
if($('#dir_items').html() == 'horizontal'){
|
|| parseInt($('#text-left').val()) + (parseInt($('input[name=width_module_graph]').val() * $('#count_items').html())) > parseInt($('#background').css('width'))){
|
||||||
if(parseInt($('#text-left').val()) + (parseInt($('input[name=height_module_graph]').val() * $('#count_items').html())) > parseInt($('#background').css('width'))
|
|
||||||
|| parseInt($('#text-left').val()) + (parseInt($('input[name=width_module_graph]').val() * $('#count_items').html())) > parseInt($('#background').css('width'))){
|
alert($('#count_items').html()+' joined graph items are wider than background');
|
||||||
|
return false;
|
||||||
alert($('#count_items').html()+' joined graph items are wider than background');
|
|
||||||
return false;
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
if($('#dir_items').html() == 'vertical'){
|
||||||
if($('#dir_items').html() == 'vertical'){
|
if(parseInt($('#text-top').val()) + (parseInt($('input[name=height_module_graph]').val() * $('#count_items').html())) > parseInt($('#background').css('height'))){
|
||||||
if(parseInt($('#text-top').val()) + (parseInt($('input[name=height_module_graph]').val() * $('#count_items').html())) > parseInt($('#background').css('height'))){
|
alert($('#count_items').html()+' joined graph items are higher than background');
|
||||||
alert($('#count_items').html()+' joined graph items are higher than background');
|
return false;
|
||||||
return false;
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
if($('input[name=width_module_graph]').val() == ''){
|
||||||
|
alert('Undefined width');
|
||||||
if($('input[name=width_module_graph]').val() == ''){
|
return false;
|
||||||
alert('Undefined width');
|
}
|
||||||
return false;
|
if($('input[name=height_module_graph]').val() == ''){
|
||||||
}
|
alert('Undefined height');
|
||||||
if($('input[name=height_module_graph]').val() == ''){
|
return false;
|
||||||
alert('Undefined height');
|
}
|
||||||
return false;
|
if($('#custom_graph_row').css('display') != 'none' && $("#custom_graph option:selected").html() == 'None'){
|
||||||
}
|
|
||||||
if($('#custom_graph_row').css('display') != 'none' && $("#custom_graph option:selected").html() == 'None'){
|
|
||||||
alert('Undefined graph');
|
alert('Undefined graph');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$("#text_" + idItem).html(values['label']);
|
$("#text_" + idItem).html(values['label']);
|
||||||
$("#image_" + idItem).attr("src", "images/spinner.gif");
|
$("#image_" + idItem).attr("src", "images/spinner.gif");
|
||||||
setModuleGraph(idItem);
|
setModuleGraph(idItem);
|
||||||
break;
|
break;
|
||||||
|
case 'auto_sla_graph':
|
||||||
|
if($('input[name=width]').val() == ''){
|
||||||
|
alert('Undefined width');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if($('input[name=height]').val() == ''){
|
||||||
|
alert('Undefined height');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$("#text_" + idItem).html(values['label']);
|
||||||
|
$("#image_" + idItem).attr("src", "images/spinner.gif");
|
||||||
|
|
||||||
|
setEventsBar(idItem, values);
|
||||||
|
break;
|
||||||
case 'simple_value':
|
case 'simple_value':
|
||||||
//checkpoint
|
//checkpoint
|
||||||
if(($('#text-label_ifr').contents().find('#tinymce p').html() == '_VALUE_' ||
|
if(($('#text-label_ifr').contents().find('#tinymce p').html() == '_VALUE_' ||
|
||||||
@ -430,42 +435,41 @@ function update_button_palette_callback() {
|
|||||||
$("#text_" + idItem).html(values['label']);
|
$("#text_" + idItem).html(values['label']);
|
||||||
break;
|
break;
|
||||||
case 'icon':
|
case 'icon':
|
||||||
|
if($('input[name=width]').val() == ''){
|
||||||
if($('input[name=width]').val() == ''){
|
alert('Undefined width');
|
||||||
alert('Undefined width');
|
return false;
|
||||||
return false;
|
}
|
||||||
}
|
if($('input[name=height]').val() == ''){
|
||||||
if($('input[name=height]').val() == ''){
|
alert('Undefined height');
|
||||||
alert('Undefined height');
|
return false;
|
||||||
return false;
|
}
|
||||||
}
|
$("#image_" + idItem).attr('src', "images/spinner.gif");
|
||||||
$("#image_" + idItem).attr('src', "images/spinner.gif");
|
if ((values['width'] == 0) || (values['height'] == 0)) {
|
||||||
if ((values['width'] == 0) || (values['height'] == 0)) {
|
if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
|
||||||
if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
|
$("#image_" + idItem).removeAttr('width');
|
||||||
|
$("#image_" + idItem).removeAttr('height');
|
||||||
|
$("#image_" + idItem).attr('width', 70);
|
||||||
|
$("#image_" + idItem).attr('height', 70);
|
||||||
|
$("#image_" + idItem).css('width', '70px');
|
||||||
|
$("#image_" + idItem).css('height', '70px');
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$("#image_" + idItem).removeAttr('width');
|
||||||
|
$("#image_" + idItem).removeAttr('height');
|
||||||
|
$("#image_" + idItem).attr('width', $('#preview > img')[0].naturalHeight);
|
||||||
|
$("#image_" + idItem).attr('height', $('#preview > img')[0].naturalHeight);
|
||||||
|
$("#image_" + idItem).css('width', $('#preview > img')[0].naturalHeight+'px');
|
||||||
|
$("#image_" + idItem).css('height', $('#preview > img')[0].naturalHeight+'px');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
$("#image_" + idItem).removeAttr('width');
|
$("#image_" + idItem).removeAttr('width');
|
||||||
$("#image_" + idItem).removeAttr('height');
|
$("#image_" + idItem).removeAttr('height');
|
||||||
$("#image_" + idItem).attr('width', 70);
|
$("#image_" + idItem).attr('width', values['width']);
|
||||||
$("#image_" + idItem).attr('height', 70);
|
$("#image_" + idItem).attr('height', values['height']);
|
||||||
$("#image_" + idItem).css('width', '70px');
|
$("#image_" + idItem).css('width', values['width'] + 'px');
|
||||||
$("#image_" + idItem).css('height', '70px');
|
$("#image_" + idItem).css('height', values['height'] + 'px');
|
||||||
}
|
}
|
||||||
else{
|
|
||||||
$("#image_" + idItem).removeAttr('width');
|
|
||||||
$("#image_" + idItem).removeAttr('height');
|
|
||||||
$("#image_" + idItem).attr('width', $('#preview > img')[0].naturalHeight);
|
|
||||||
$("#image_" + idItem).attr('height', $('#preview > img')[0].naturalHeight);
|
|
||||||
$("#image_" + idItem).css('width', $('#preview > img')[0].naturalHeight+'px');
|
|
||||||
$("#image_" + idItem).css('height', $('#preview > img')[0].naturalHeight+'px');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$("#image_" + idItem).removeAttr('width');
|
|
||||||
$("#image_" + idItem).removeAttr('height');
|
|
||||||
$("#image_" + idItem).attr('width', values['width']);
|
|
||||||
$("#image_" + idItem).attr('height', values['height']);
|
|
||||||
$("#image_" + idItem).css('width', values['width'] + 'px');
|
|
||||||
$("#image_" + idItem).css('height', values['height'] + 'px');
|
|
||||||
}
|
|
||||||
var image = values['image'] + ".png";
|
var image = values['image'] + ".png";
|
||||||
set_image("image", idItem, image);
|
set_image("image", idItem, image);
|
||||||
break;
|
break;
|
||||||
@ -585,9 +589,10 @@ function readFields() {
|
|||||||
values['parent'] = $("select[name=parent]").val();
|
values['parent'] = $("select[name=parent]").val();
|
||||||
values['map_linked'] = $("select[name=map_linked]").val();
|
values['map_linked'] = $("select[name=map_linked]").val();
|
||||||
values['width_percentile'] = $("input[name=width_percentile]").val();
|
values['width_percentile'] = $("input[name=width_percentile]").val();
|
||||||
values['max_percentile'] = $("input[name=max_percentile]").val();
|
values['max_percentile'] = parseInt($("input[name=max_percentile]").val());
|
||||||
values['width_module_graph'] = $("input[name=width_module_graph]").val();
|
values['width_module_graph'] = $("input[name=width_module_graph]").val();
|
||||||
values['height_module_graph'] = $("input[name=height_module_graph]").val();
|
values['height_module_graph'] = $("input[name=height_module_graph]").val();
|
||||||
|
values['event_max_time_row'] = $("select[name=event_max_time_row]").val();
|
||||||
values['type_percentile'] = $("input[name=type_percentile]:checked").val();
|
values['type_percentile'] = $("input[name=type_percentile]:checked").val();
|
||||||
values['value_show'] = $("input[name=value_show]:checked").val();
|
values['value_show'] = $("input[name=value_show]:checked").val();
|
||||||
values['enable_link'] = $("input[name=enable_link]").is(':checked') ? 1 : 0;
|
values['enable_link'] = $("input[name=enable_link]").is(':checked') ? 1 : 0;
|
||||||
@ -657,6 +662,16 @@ function create_button_palette_callback() {
|
|||||||
validate = false;
|
validate = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'auto_sla_graph':
|
||||||
|
if ((values['agent'] == '')) {
|
||||||
|
alert($("#message_alert_no_agent").html());
|
||||||
|
validate = false;
|
||||||
|
}
|
||||||
|
if ((values['module'] == 0)) {
|
||||||
|
alert($("#message_alert_no_module").html());
|
||||||
|
validate = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'label':
|
case 'label':
|
||||||
if ((values['label'] == '')) {
|
if ((values['label'] == '')) {
|
||||||
alert($("#message_alert_no_label").html());
|
alert($("#message_alert_no_label").html());
|
||||||
@ -932,6 +947,7 @@ function toggle_item_palette() {
|
|||||||
activeToolboxButton('group_item', true);
|
activeToolboxButton('group_item', true);
|
||||||
activeToolboxButton('box_item', true);
|
activeToolboxButton('box_item', true);
|
||||||
activeToolboxButton('line_item', true);
|
activeToolboxButton('line_item', true);
|
||||||
|
activeToolboxButton('auto_sla_graph', true);
|
||||||
|
|
||||||
if (typeof(enterprise_activeToolboxButton) == 'function') {
|
if (typeof(enterprise_activeToolboxButton) == 'function') {
|
||||||
enterprise_activeToolboxButton(true);
|
enterprise_activeToolboxButton(true);
|
||||||
@ -951,6 +967,7 @@ function toggle_item_palette() {
|
|||||||
|
|
||||||
activeToolboxButton('static_graph', false);
|
activeToolboxButton('static_graph', false);
|
||||||
activeToolboxButton('module_graph', false);
|
activeToolboxButton('module_graph', false);
|
||||||
|
activeToolboxButton('auto_sla_graph', false);
|
||||||
activeToolboxButton('simple_value', false);
|
activeToolboxButton('simple_value', false);
|
||||||
activeToolboxButton('label', false);
|
activeToolboxButton('label', false);
|
||||||
activeToolboxButton('icon', false);
|
activeToolboxButton('icon', false);
|
||||||
@ -1091,6 +1108,8 @@ function loadFieldsFromDB(item) {
|
|||||||
fill_parent_select(idItem);
|
fill_parent_select(idItem);
|
||||||
|
|
||||||
jQuery.each(data, function(key, val) {
|
jQuery.each(data, function(key, val) {
|
||||||
|
if (key == 'event_max_time_row')
|
||||||
|
$("select[name=event_max_time_row]").val(val);
|
||||||
if (key == 'background')
|
if (key == 'background')
|
||||||
$("#background_image").val(val);
|
$("#background_image").val(val);
|
||||||
if (key == 'width') $("input[name=width]").val(val);
|
if (key == 'width') $("input[name=width]").val(val);
|
||||||
@ -1425,6 +1444,9 @@ function hiddenFields(item) {
|
|||||||
$("#process_value_row").css('display', 'none');
|
$("#process_value_row").css('display', 'none');
|
||||||
$("#process_value_row." + item).css('display', '');
|
$("#process_value_row." + item).css('display', '');
|
||||||
|
|
||||||
|
$("#event_max_time_row").css('display', 'none');
|
||||||
|
$("#event_max_time_row." + item).css('display', '');
|
||||||
|
|
||||||
$("#background_row_1").css('display', 'none');
|
$("#background_row_1").css('display', 'none');
|
||||||
$("#background_row_1." + item).css('display', '');
|
$("#background_row_1." + item).css('display', '');
|
||||||
|
|
||||||
@ -1860,6 +1882,55 @@ function setPercentileBar(id_data, values) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setEventsBar(id_data, values) {
|
||||||
|
var url_hack_metaconsole = '';
|
||||||
|
if (is_metaconsole()) {
|
||||||
|
url_hack_metaconsole = '../../';
|
||||||
|
}
|
||||||
|
|
||||||
|
parameter = Array();
|
||||||
|
|
||||||
|
parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"});
|
||||||
|
parameter.push ({name: "action", value: "get_module_events"});
|
||||||
|
parameter.push ({name: "id_agent", value: values['id_agent']});
|
||||||
|
parameter.push ({name: "id_agent_module", value: values['module']});
|
||||||
|
if (is_metaconsole()) {
|
||||||
|
parameter.push ({name: "id_metaconsole", value: id_metaconsole});
|
||||||
|
}
|
||||||
|
parameter.push ({name: "period", value: values['event_max_time_row']});
|
||||||
|
parameter.push ({name: "id_visual_console", value: id_visual_console});
|
||||||
|
jQuery.ajax({
|
||||||
|
url: get_url_ajax(),
|
||||||
|
data: parameter,
|
||||||
|
type: "POST",
|
||||||
|
dataType: 'json',
|
||||||
|
success: function (data) {
|
||||||
|
if (data['no_data'] == true) {
|
||||||
|
if (values['width'] == "0" || values['height'] == "0") {
|
||||||
|
$("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/module-events.png');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/module-events.png');
|
||||||
|
$("#" + id_data + " img").css('width', values['width'] + 'px');
|
||||||
|
$("#" + id_data + " img").css('height', values['height'] + 'px');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/module-events.png');
|
||||||
|
|
||||||
|
if($('#text-width').val() == 0 || $('#text-height').val() == 0){
|
||||||
|
$("#" + id_data + " img").css('width', '300px');
|
||||||
|
$("#" + id_data + " img").css('height', '180px');
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$("#" + id_data + " img").css('width', $('#text-width').val()+'px');
|
||||||
|
$("#" + id_data + " img").css('height', $('#text-height').val()+'px');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function setPercentileBubble(id_data, values) {
|
function setPercentileBubble(id_data, values) {
|
||||||
metaconsole = $("input[name='metaconsole']").val();
|
metaconsole = $("input[name='metaconsole']").val();
|
||||||
|
|
||||||
@ -2175,6 +2246,17 @@ function createItem(type, values, id_data) {
|
|||||||
|
|
||||||
set_static_graph_status(id_data, values['image']);
|
set_static_graph_status(id_data, values['image']);
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 'auto_sla_graph':
|
||||||
|
var sizeStyle = '';
|
||||||
|
var imageSize = '';
|
||||||
|
item = $('<div id="' + id_data + '" class="item auto_sla_graph" style="text-align: left; position: absolute; display: inline-block; ' + sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
|
||||||
|
'<table><tr><td></td></tr><tr><td><span id="text_' + id_data + '" class="text">' + values['label'] + '</span></td></tr><tr><td></td></tr></table>' +
|
||||||
|
'<img class="image" id="image_' + id_data + '" src="images/spinner.gif" />' +
|
||||||
|
'</div>'
|
||||||
|
);
|
||||||
|
|
||||||
|
setEventsBar(id_data, values);
|
||||||
break;
|
break;
|
||||||
case 'percentile_bar':
|
case 'percentile_bar':
|
||||||
case 'percentile_item':
|
case 'percentile_item':
|
||||||
@ -2500,13 +2582,13 @@ function updateDB_visual(type, idElement , values, event, top, left) {
|
|||||||
set_static_graph_status(idElement, values['image']);
|
set_static_graph_status(idElement, values['image']);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
case 'percentile_item':
|
case 'percentile_item':
|
||||||
case 'simple_value':
|
case 'simple_value':
|
||||||
case 'label':
|
case 'label':
|
||||||
case 'icon':
|
case 'icon':
|
||||||
case 'module_graph':
|
case 'module_graph':
|
||||||
|
case 'auto_sla_graph':
|
||||||
|
|
||||||
if (type == 'simple_value') {
|
if (type == 'simple_value') {
|
||||||
setModuleValue(idElement,
|
setModuleValue(idElement,
|
||||||
values.process_simple_value,
|
values.process_simple_value,
|
||||||
@ -2669,7 +2751,8 @@ function updateDB(type, idElement , values, event) {
|
|||||||
update_user_line(type, idElement, top, left);
|
update_user_line(type, idElement, top, left);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
console.log(values);
|
||||||
|
console.log(idElement);
|
||||||
if ((typeof(values['mov_left']) != 'undefined') &&
|
if ((typeof(values['mov_left']) != 'undefined') &&
|
||||||
(typeof(values['mov_top']) != 'undefined')) {
|
(typeof(values['mov_top']) != 'undefined')) {
|
||||||
top = parseInt($("#" + idElement)
|
top = parseInt($("#" + idElement)
|
||||||
@ -2730,8 +2813,6 @@ function updateDB(type, idElement , values, event) {
|
|||||||
function copyDB(idItem) {
|
function copyDB(idItem) {
|
||||||
metaconsole = $("input[name='metaconsole']").val();
|
metaconsole = $("input[name='metaconsole']").val();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
parameter = Array();
|
parameter = Array();
|
||||||
parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"});
|
parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"});
|
||||||
parameter.push ({name: "action", value: "copy"});
|
parameter.push ({name: "action", value: "copy"});
|
||||||
@ -2902,6 +2983,15 @@ function eventsItems(drag) {
|
|||||||
activeToolboxButton('delete_item', true);
|
activeToolboxButton('delete_item', true);
|
||||||
activeToolboxButton('show_grid', false);
|
activeToolboxButton('show_grid', false);
|
||||||
}
|
}
|
||||||
|
if ($(divParent).hasClass('auto_sla_graph')) {
|
||||||
|
creationItem = null;
|
||||||
|
selectedItem = 'auto_sla_graph';
|
||||||
|
idItem = $(divParent).attr('id');
|
||||||
|
activeToolboxButton('copy_item', true);
|
||||||
|
activeToolboxButton('edit_item', true);
|
||||||
|
activeToolboxButton('delete_item', true);
|
||||||
|
activeToolboxButton('show_grid', false);
|
||||||
|
}
|
||||||
if ($(divParent).hasClass('group_item')) {
|
if ($(divParent).hasClass('group_item')) {
|
||||||
creationItem = null;
|
creationItem = null;
|
||||||
selectedItem = 'group_item';
|
selectedItem = 'group_item';
|
||||||
@ -3042,6 +3132,9 @@ function eventsItems(drag) {
|
|||||||
if ($(event.target).hasClass('static_graph')) {
|
if ($(event.target).hasClass('static_graph')) {
|
||||||
selectedItem = 'static_graph';
|
selectedItem = 'static_graph';
|
||||||
}
|
}
|
||||||
|
if ($(event.target).hasClass('auto_sla_graph')) {
|
||||||
|
selectedItem = 'auto_sla_graph';
|
||||||
|
}
|
||||||
if ($(event.target).hasClass('group_item')) {
|
if ($(event.target).hasClass('group_item')) {
|
||||||
selectedItem = 'group_item';
|
selectedItem = 'group_item';
|
||||||
}
|
}
|
||||||
@ -3340,6 +3433,10 @@ function click_button_toolbox(id) {
|
|||||||
toolbuttonActive = creationItem = 'module_graph';
|
toolbuttonActive = creationItem = 'module_graph';
|
||||||
toggle_item_palette();
|
toggle_item_palette();
|
||||||
break;
|
break;
|
||||||
|
case 'auto_sla_graph':
|
||||||
|
toolbuttonActive = creationItem = 'auto_sla_graph';
|
||||||
|
toggle_item_palette();
|
||||||
|
break;
|
||||||
case 'simple_value':
|
case 'simple_value':
|
||||||
toolbuttonActive = creationItem = 'simple_value';
|
toolbuttonActive = creationItem = 'simple_value';
|
||||||
toggle_item_palette();
|
toggle_item_palette();
|
||||||
@ -3396,7 +3493,7 @@ function click_button_toolbox(id) {
|
|||||||
activeToolboxButton('icon', false);
|
activeToolboxButton('icon', false);
|
||||||
activeToolboxButton('service', false);
|
activeToolboxButton('service', false);
|
||||||
activeToolboxButton('group_item', false);
|
activeToolboxButton('group_item', false);
|
||||||
|
activeToolboxButton('auto_sla_graph', false);
|
||||||
activeToolboxButton('copy_item', false);
|
activeToolboxButton('copy_item', false);
|
||||||
activeToolboxButton('edit_item', false);
|
activeToolboxButton('edit_item', false);
|
||||||
activeToolboxButton('delete_item', false);
|
activeToolboxButton('delete_item', false);
|
||||||
@ -3426,6 +3523,7 @@ function click_button_toolbox(id) {
|
|||||||
activeToolboxButton('label', true);
|
activeToolboxButton('label', true);
|
||||||
activeToolboxButton('icon', true);
|
activeToolboxButton('icon', true);
|
||||||
activeToolboxButton('group_item', true);
|
activeToolboxButton('group_item', true);
|
||||||
|
activeToolboxButton('auto_sla_graph', true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'save_visualmap':
|
case 'save_visualmap':
|
||||||
@ -3632,4 +3730,4 @@ function showGrid() {
|
|||||||
|
|
||||||
eventsItems();
|
eventsItems();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -152,6 +152,11 @@ foreach ($layoutDatas as $layoutData) {
|
|||||||
html_print_image('images/chart_curve.png', true,
|
html_print_image('images/chart_curve.png', true,
|
||||||
array('title' => __('Module Graph')));
|
array('title' => __('Module Graph')));
|
||||||
break;
|
break;
|
||||||
|
case AUTO_SLA_GRAPH:
|
||||||
|
$table->data[$i + 1]['icon'] =
|
||||||
|
html_print_image('images/auto_sla_graph.png', true,
|
||||||
|
array('title' => __('Auto SLA Graph')));
|
||||||
|
break;
|
||||||
case SIMPLE_VALUE:
|
case SIMPLE_VALUE:
|
||||||
$table->data[$i + 1]['icon'] =
|
$table->data[$i + 1]['icon'] =
|
||||||
html_print_image('images/binary.png', true,
|
html_print_image('images/binary.png', true,
|
||||||
@ -465,6 +470,7 @@ foreach ($layoutDatas as $layoutData) {
|
|||||||
switch ($layoutData['type']) {
|
switch ($layoutData['type']) {
|
||||||
case LINE_ITEM:
|
case LINE_ITEM:
|
||||||
case BOX_ITEM:
|
case BOX_ITEM:
|
||||||
|
case AUTO_SLA_GRAPH:
|
||||||
$table->data[$i + 2][4] = "";
|
$table->data[$i + 2][4] = "";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
BIN
pandora_console/images/auto_sla_graph.disabled.png
Normal file
BIN
pandora_console/images/auto_sla_graph.disabled.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 410 B |
BIN
pandora_console/images/auto_sla_graph.png
Normal file
BIN
pandora_console/images/auto_sla_graph.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 410 B |
BIN
pandora_console/images/console/signes/module-events.png
Normal file
BIN
pandora_console/images/console/signes/module-events.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.9 KiB |
@ -95,6 +95,7 @@ $top = get_parameter('top', null);
|
|||||||
$agent = get_parameter('agent', null);
|
$agent = get_parameter('agent', null);
|
||||||
$id_module = get_parameter('module', null);
|
$id_module = get_parameter('module', null);
|
||||||
$period = get_parameter('period', null);
|
$period = get_parameter('period', null);
|
||||||
|
$event_max_time_row = get_parameter('event_max_time_row', null);
|
||||||
$width = get_parameter('width', null);
|
$width = get_parameter('width', null);
|
||||||
$height = get_parameter('height', null);
|
$height = get_parameter('height', null);
|
||||||
$parent = get_parameter('parent', null);
|
$parent = get_parameter('parent', null);
|
||||||
@ -139,7 +140,39 @@ switch ($action) {
|
|||||||
echo json_encode($return);
|
echo json_encode($return);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'get_module_events':
|
||||||
|
$data = array ();
|
||||||
|
|
||||||
|
$date = get_system_time ();
|
||||||
|
$datelimit = $date - $event_max_time_row;
|
||||||
|
|
||||||
|
$events = db_get_row_filter ('tevento',
|
||||||
|
array ('id_agente' => $id_agent,
|
||||||
|
'id_agentmodule' => $id_module,
|
||||||
|
'utimestamp > ' . $datelimit,
|
||||||
|
'utimestamp < ' . $date), 'criticity, utimestamp');
|
||||||
|
|
||||||
|
$return = array();
|
||||||
|
if (!$events) {
|
||||||
|
$return['no_data'] = true;
|
||||||
|
if (!empty($id_metaconsole)) {
|
||||||
|
$connection = db_get_row_filter ('tmetaconsole_setup',
|
||||||
|
$id_metaconsole);
|
||||||
|
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$return['url'] = true;
|
||||||
|
if (!empty($id_metaconsole)) {
|
||||||
|
metaconsole_restore_db();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$return['no_data'] = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
echo json_encode($return);
|
||||||
|
break;
|
||||||
|
|
||||||
case 'get_image_sparse':
|
case 'get_image_sparse':
|
||||||
//Metaconsole db connection
|
//Metaconsole db connection
|
||||||
@ -424,12 +457,14 @@ switch ($action) {
|
|||||||
$values['period'] = $period;
|
$values['period'] = $period;
|
||||||
$values['width'] = $width;
|
$values['width'] = $width;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
case 'percentile_bar':
|
case 'percentile_bar':
|
||||||
case 'percentile_item':
|
case 'percentile_item':
|
||||||
case 'static_graph':
|
case 'static_graph':
|
||||||
case 'module_graph':
|
case 'module_graph':
|
||||||
case 'label':
|
case 'label':
|
||||||
case 'icon':
|
case 'icon':
|
||||||
|
case 'auto_sla_graph':
|
||||||
default:
|
default:
|
||||||
if ($type == 'label') {
|
if ($type == 'label') {
|
||||||
$values['type'] = LABEL;
|
$values['type'] = LABEL;
|
||||||
@ -504,6 +539,18 @@ switch ($action) {
|
|||||||
$values['border_color'] = $line_color;
|
$values['border_color'] = $line_color;
|
||||||
break;
|
break;
|
||||||
// -------------------------------------------------
|
// -------------------------------------------------
|
||||||
|
case 'auto_sla_graph':
|
||||||
|
$values['type'] = AUTO_SLA_GRAPH;
|
||||||
|
if ($event_max_time_row !== null) {
|
||||||
|
$values['period'] = $event_max_time_row;
|
||||||
|
}
|
||||||
|
if ($width !== null) {
|
||||||
|
$values['width'] = $width;
|
||||||
|
}
|
||||||
|
if ($height !== null) {
|
||||||
|
$values['height'] = $height;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'box_item':
|
case 'box_item':
|
||||||
$values['border_width'] = $border_width;
|
$values['border_width'] = $border_width;
|
||||||
$values['border_color'] = $border_color;
|
$values['border_color'] = $border_color;
|
||||||
@ -622,7 +669,7 @@ switch ($action) {
|
|||||||
if (($item_in_db['parent_item'] == 0) && ($values['parent_item'] != 0)) {
|
if (($item_in_db['parent_item'] == 0) && ($values['parent_item'] != 0)) {
|
||||||
$new_line = 1;
|
$new_line = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = db_process_sql_update('tlayout_data', $values,
|
$result = db_process_sql_update('tlayout_data', $values,
|
||||||
array('id' => $id_element));
|
array('id' => $id_element));
|
||||||
|
|
||||||
@ -659,6 +706,7 @@ switch ($action) {
|
|||||||
case 'simple_value':
|
case 'simple_value':
|
||||||
case 'label':
|
case 'label':
|
||||||
case 'icon':
|
case 'icon':
|
||||||
|
case 'auto_sla_graph':
|
||||||
$elementFields = db_get_row_filter('tlayout_data',
|
$elementFields = db_get_row_filter('tlayout_data',
|
||||||
array('id' => $id_element));
|
array('id' => $id_element));
|
||||||
|
|
||||||
@ -710,6 +758,8 @@ switch ($action) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
|
case 'auto_sla_graph':
|
||||||
|
$elementFields['event_max_time_row'] = $elementFields['period'];
|
||||||
case 'percentile_item':
|
case 'percentile_item':
|
||||||
case 'percentile_bar':
|
case 'percentile_bar':
|
||||||
$elementFields['width_percentile'] = $elementFields['width'];
|
$elementFields['width_percentile'] = $elementFields['width'];
|
||||||
@ -869,6 +919,12 @@ switch ($action) {
|
|||||||
}
|
}
|
||||||
$values['period'] = $period;
|
$values['period'] = $period;
|
||||||
break;
|
break;
|
||||||
|
case 'auto_sla_graph':
|
||||||
|
$values['type'] = AUTO_SLA_GRAPH;
|
||||||
|
$values['period'] = $event_max_time_row;
|
||||||
|
$values['width'] = $width;
|
||||||
|
$values['height'] = $height;
|
||||||
|
break;
|
||||||
case 'percentile_item':
|
case 'percentile_item':
|
||||||
case 'percentile_bar':
|
case 'percentile_bar':
|
||||||
if ($type_percentile == 'percentile') {
|
if ($type_percentile == 'percentile') {
|
||||||
@ -985,8 +1041,6 @@ switch ($action) {
|
|||||||
echo json_encode($return);
|
echo json_encode($return);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
case 'delete':
|
case 'delete':
|
||||||
if (db_process_sql_delete('tlayout_data', array('id' => $id_element, 'id_layout' => $id_visual_console)) === false) {
|
if (db_process_sql_delete('tlayout_data', array('id' => $id_element, 'id_layout' => $id_visual_console)) === false) {
|
||||||
$return['correct'] = 0;
|
$return['correct'] = 0;
|
||||||
|
@ -185,6 +185,7 @@ define('AGENT_STATUS_WARNING', 2);
|
|||||||
define('STATIC_GRAPH', 0);
|
define('STATIC_GRAPH', 0);
|
||||||
define('PERCENTILE_BAR', 3);
|
define('PERCENTILE_BAR', 3);
|
||||||
define('MODULE_GRAPH', 1);
|
define('MODULE_GRAPH', 1);
|
||||||
|
define('AUTO_SLA_GRAPH', 14);
|
||||||
define('SIMPLE_VALUE', 2);
|
define('SIMPLE_VALUE', 2);
|
||||||
define('LABEL', 4);
|
define('LABEL', 4);
|
||||||
define('ICON', 5);
|
define('ICON', 5);
|
||||||
|
@ -3679,6 +3679,108 @@ function graph_graphic_agentevents ($id_agent, $width, $height, $period = 0, $ho
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Print a static graph with event data of agents
|
||||||
|
*
|
||||||
|
* @param integer id_agent Agent ID
|
||||||
|
* @param integer width pie graph width
|
||||||
|
* @param integer height pie graph height
|
||||||
|
* @param integer period time period
|
||||||
|
* @param string homeurl
|
||||||
|
* @param bool return or echo the result
|
||||||
|
*/
|
||||||
|
function graph_graphic_moduleevents ($id_agent, $id_module, $width, $height, $period = 0, $homeurl, $return = false) {
|
||||||
|
global $config;
|
||||||
|
global $graphic_type;
|
||||||
|
|
||||||
|
$data = array ();
|
||||||
|
|
||||||
|
$resolution = $config['graph_res'] * ($period * 2 / $width); // Number of "slices" we want in graph
|
||||||
|
$interval = (int) ($period / $resolution);
|
||||||
|
$date = get_system_time ();
|
||||||
|
$datelimit = $date - $period;
|
||||||
|
$periodtime = floor ($period / $interval);
|
||||||
|
$time = array ();
|
||||||
|
$data = array ();
|
||||||
|
$legend = array();
|
||||||
|
$full_legend = array();
|
||||||
|
|
||||||
|
$cont = 0;
|
||||||
|
for ($i = 0; $i < $interval; $i++) {
|
||||||
|
$bottom = $datelimit + ($periodtime * $i);
|
||||||
|
if (! $graphic_type) {
|
||||||
|
if ($config['flash_charts']) {
|
||||||
|
$name = date('H:i:s', $bottom);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$name = date('H\h', $bottom);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$name = $bottom;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show less values in legend
|
||||||
|
if ($cont == 0 or $cont % 2)
|
||||||
|
$legend[$cont] = $name;
|
||||||
|
|
||||||
|
$full_legend[$cont] = $name;
|
||||||
|
|
||||||
|
$top = $datelimit + ($periodtime * ($i + 1));
|
||||||
|
|
||||||
|
$event = db_get_row_filter ('tevento',
|
||||||
|
array ('id_agente' => $id_agent,
|
||||||
|
'id_agentmodule' => $id_module,
|
||||||
|
'utimestamp > '.$bottom,
|
||||||
|
'utimestamp < '.$top), 'criticity, utimestamp');
|
||||||
|
|
||||||
|
if (!empty($event['utimestamp'])) {
|
||||||
|
$data[$cont]['utimestamp'] = $periodtime;
|
||||||
|
switch ($event['criticity']) {
|
||||||
|
case EVENT_CRIT_WARNING:
|
||||||
|
$data[$cont]['data'] = 2;
|
||||||
|
break;
|
||||||
|
case EVENT_CRIT_CRITICAL:
|
||||||
|
$data[$cont]['data'] = 3;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$data[$cont]['data'] = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$data[$cont]['utimestamp'] = $periodtime;
|
||||||
|
$data[$cont]['data'] = 1;
|
||||||
|
}
|
||||||
|
$cont++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$colors = array(1 => COL_NORMAL, 2 => COL_WARNING, 3 => COL_CRITICAL, 4 => COL_UNKNOWN);
|
||||||
|
|
||||||
|
// Draw slicebar graph
|
||||||
|
if ($config['flash_charts']) {
|
||||||
|
$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);
|
||||||
|
|
||||||
|
// Draw legend
|
||||||
|
$out .= "<br>";
|
||||||
|
$out .= " ";
|
||||||
|
foreach ($legend as $hour) {
|
||||||
|
$out .= "<span style='font-size: 6pt'>" . $hour . "</span>";
|
||||||
|
$out .= " ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($return) {
|
||||||
|
return $out;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo $out;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Prints an error image
|
// Prints an error image
|
||||||
function fs_error_image ($width = 300, $height = 110) {
|
function fs_error_image ($width = 300, $height = 110) {
|
||||||
global $config;
|
global $config;
|
||||||
|
@ -156,6 +156,7 @@ function visual_map_print_item($mode = "read", $layoutData,
|
|||||||
$wimg ='70';
|
$wimg ='70';
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
|
case 14:
|
||||||
if (get_parameter('action') == 'edit') {
|
if (get_parameter('action') == 'edit') {
|
||||||
$himg = '30';
|
$himg = '30';
|
||||||
$wimg = '150';
|
$wimg = '150';
|
||||||
@ -376,6 +377,9 @@ function visual_map_print_item($mode = "read", $layoutData,
|
|||||||
$link = true;
|
$link = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case AUTO_SLA_GRAPH:
|
||||||
|
$link = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (!empty($element_enterprise)) {
|
if (!empty($element_enterprise)) {
|
||||||
@ -391,7 +395,6 @@ function visual_map_print_item($mode = "read", $layoutData,
|
|||||||
$is_a_service = false;
|
$is_a_service = false;
|
||||||
$is_a_link_to_other_visualconsole = false;
|
$is_a_link_to_other_visualconsole = false;
|
||||||
|
|
||||||
|
|
||||||
if (enterprise_installed()) {
|
if (enterprise_installed()) {
|
||||||
$id_service = services_service_from_module
|
$id_service = services_service_from_module
|
||||||
($layoutData['id_agente_modulo']);
|
($layoutData['id_agente_modulo']);
|
||||||
@ -404,9 +407,6 @@ function visual_map_print_item($mode = "read", $layoutData,
|
|||||||
$is_a_link_to_other_visualconsole = true;
|
$is_a_link_to_other_visualconsole = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($is_a_service) {
|
if ($is_a_service) {
|
||||||
if (empty($layoutData['id_metaconsole'])) {
|
if (empty($layoutData['id_metaconsole'])) {
|
||||||
$url = $config['homeurl'] .
|
$url = $config['homeurl'] .
|
||||||
@ -458,6 +458,36 @@ function visual_map_print_item($mode = "read", $layoutData,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
break;
|
||||||
|
case AUTO_SLA_GRAPH:
|
||||||
|
$e_period = $layoutData['period'];
|
||||||
|
$date = get_system_time ();
|
||||||
|
$datelimit = $date - $e_period;
|
||||||
|
|
||||||
|
$time_format = "Y/m/d H:i:s";
|
||||||
|
|
||||||
|
$timestamp_init = date($time_format, $datelimit);
|
||||||
|
$timestamp_end = date($time_format, $date);
|
||||||
|
|
||||||
|
$timestamp_init_aux = explode(" ", $timestamp_init);
|
||||||
|
$timestamp_end_aux = explode(" ", $timestamp_end);
|
||||||
|
|
||||||
|
$date_from = $timestamp_init_aux[0];
|
||||||
|
$time_from = $timestamp_init_aux[1];
|
||||||
|
|
||||||
|
$date_to = $timestamp_end_aux[0];
|
||||||
|
$time_to = $timestamp_end_aux[1];
|
||||||
|
|
||||||
|
if (empty($layout_data['id_metaconsole'])) {
|
||||||
|
$url = $config['homeurl'] . "index.php?sec=eventos&sec2=operation/events/events&id_agent=" . $layoutData['id_agent'] .
|
||||||
|
"&module_search_hidden=" . $layoutData['id_agente_modulo'] . "&date_from=" . $date_from . "&time_from=" . $time_from .
|
||||||
|
"&date_to=" . $date_to . "&time_to=" . $time_to . "&status=-1";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$url = "index.php?sec=eventos&sec2=operation/events/events&id_agent=" . $layoutData['id_agent'] .
|
||||||
|
"&module_search_hidden=" . $layoutData['id_agente_modulo'] . "&date_from=" . $date_from . "&time_from=" . $time_from .
|
||||||
|
"&date_to=" . $date_to . "&time_to=" . $time_to . "&status=-1";
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case GROUP_ITEM:
|
case GROUP_ITEM:
|
||||||
$is_a_link_to_other_visualconsole = false;
|
$is_a_link_to_other_visualconsole = false;
|
||||||
@ -1037,8 +1067,6 @@ function visual_map_print_item($mode = "read", $layoutData,
|
|||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
}
|
}
|
||||||
|
|
||||||
//$img = str_replace('>', 'class="image" id="image_' . $id . '" />', $img);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case LABEL:
|
case LABEL:
|
||||||
$z_index = 4 + 1;
|
$z_index = 4 + 1;
|
||||||
@ -1046,6 +1074,61 @@ function visual_map_print_item($mode = "read", $layoutData,
|
|||||||
case BOX_ITEM:
|
case BOX_ITEM:
|
||||||
$z_index = 1;
|
$z_index = 1;
|
||||||
break;
|
break;
|
||||||
|
case AUTO_SLA_GRAPH:
|
||||||
|
if ((get_parameter('action') == 'edit') || (get_parameter('operation') == 'edit_visualmap')) {
|
||||||
|
if($width == 0 || $height == 0){
|
||||||
|
if ($layoutData['id_metaconsole'] != 0) {
|
||||||
|
$img = '<img src="../../images/console/signes/module-events.png">';
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$img = '<img src="images/console/signes/module-events.png">';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if ($layoutData['id_metaconsole'] != 0) {
|
||||||
|
$img = '<img src="../../images/console/signes/module-events.png" style="width:'.$width.'px;height:'. $height.'px;">';
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$img = '<img src="images/console/signes/module-events.png" style="width:'.$width.'px;height:'. $height.'px;">';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if ($width == 0 || $height == 0) {
|
||||||
|
if ($layoutData['label_position']=='left') {
|
||||||
|
$img = '<div style="float:left;height:'.$himg.'px;">' .
|
||||||
|
$img = graph_graphic_moduleevents ($layoutData['id_agent'], $layoutData['id_agente_modulo'], 500, 50, $layoutData['period'], '', true);
|
||||||
|
}
|
||||||
|
elseif ($layoutData['label_position']=='right') {
|
||||||
|
$img = '<div style="float:right;height:'.$himg.'px;">' .
|
||||||
|
$img = graph_graphic_moduleevents ($layoutData['id_agent'], $layoutData['id_agente_modulo'], 500, 50, $layoutData['period'], '', true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$img = graph_graphic_moduleevents ($layoutData['id_agent'], $layoutData['id_agente_modulo'], 500, 50, $layoutData['period'], '', true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if ($layoutData['label_position']=='left') {
|
||||||
|
$img = '<div style="float:left;height:'.$himg.'px;">' .
|
||||||
|
$img = graph_graphic_moduleevents ($layoutData['id_agent'], $layoutData['id_agente_modulo'], $width, $height, $layoutData['period'], '', true);
|
||||||
|
}
|
||||||
|
elseif ($layoutData['label_position']=='right') {
|
||||||
|
$img = '<div style="float:right;height:'.$himg.'px;">' .
|
||||||
|
$img = graph_graphic_moduleevents ($layoutData['id_agent'], $layoutData['id_agente_modulo'], $width, $height, $layoutData['period'], '', true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$img = graph_graphic_moduleevents ($layoutData['id_agent'], $layoutData['id_agente_modulo'], $width, $height, $layoutData['period'], '', true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Restore db connection
|
||||||
|
if ($layoutData['id_metaconsole'] != 0) {
|
||||||
|
metaconsole_restore_db();
|
||||||
|
}
|
||||||
|
|
||||||
|
$z_index = 2 + 1;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$class = "item ";
|
$class = "item ";
|
||||||
@ -1053,6 +1136,9 @@ function visual_map_print_item($mode = "read", $layoutData,
|
|||||||
case STATIC_GRAPH:
|
case STATIC_GRAPH:
|
||||||
$class .= "static_graph";
|
$class .= "static_graph";
|
||||||
break;
|
break;
|
||||||
|
case AUTO_SLA_GRAPH:
|
||||||
|
$class .= "auto_sla_graph";
|
||||||
|
break;
|
||||||
case GROUP_ITEM:
|
case GROUP_ITEM:
|
||||||
$class .= "group_item";
|
$class .= "group_item";
|
||||||
break;
|
break;
|
||||||
@ -1386,6 +1472,20 @@ function visual_map_print_item($mode = "read", $layoutData,
|
|||||||
echo io_safe_output($text);
|
echo io_safe_output($text);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case AUTO_SLA_GRAPH:
|
||||||
|
if ($layoutData['label_position']=='up') {
|
||||||
|
echo io_safe_output($text);
|
||||||
|
}
|
||||||
|
|
||||||
|
echo $img;
|
||||||
|
|
||||||
|
if ($layoutData['label_position']=='down') {
|
||||||
|
echo io_safe_output($text);
|
||||||
|
}
|
||||||
|
elseif($layoutData['label_position']=='left' || $layoutData['label_position']=='right') {
|
||||||
|
echo io_safe_output($text);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case SIMPLE_VALUE:
|
case SIMPLE_VALUE:
|
||||||
case SIMPLE_VALUE_MAX:
|
case SIMPLE_VALUE_MAX:
|
||||||
case SIMPLE_VALUE_MIN:
|
case SIMPLE_VALUE_MIN:
|
||||||
@ -1458,7 +1558,6 @@ function visual_map_print_item($mode = "read", $layoutData,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Restore db connection
|
//Restore db connection
|
||||||
if ($layoutData['id_metaconsole'] != 0) {
|
if ($layoutData['id_metaconsole'] != 0) {
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
@ -1583,8 +1682,6 @@ function visual_map_get_simple_value_type($process_simple_value) {
|
|||||||
function visual_map_get_simple_value($type, $id_module, $period = SECONDS_1DAY) {
|
function visual_map_get_simple_value($type, $id_module, $period = SECONDS_1DAY) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$unit_text = db_get_sql ('SELECT unit
|
$unit_text = db_get_sql ('SELECT unit
|
||||||
FROM tagente_modulo WHERE id_agente_modulo = ' . $id_module);
|
FROM tagente_modulo WHERE id_agente_modulo = ' . $id_module);
|
||||||
$unit_text = trim(io_safe_output($unit_text));
|
$unit_text = trim(io_safe_output($unit_text));
|
||||||
@ -1593,8 +1690,6 @@ function visual_map_get_simple_value($type, $id_module, $period = SECONDS_1DAY)
|
|||||||
case SIMPLE_VALUE:
|
case SIMPLE_VALUE:
|
||||||
$value = db_get_value ('datos', 'tagente_estado',
|
$value = db_get_value ('datos', 'tagente_estado',
|
||||||
'id_agente_modulo', $id_module);
|
'id_agente_modulo', $id_module);
|
||||||
|
|
||||||
|
|
||||||
if ($value === false) {
|
if ($value === false) {
|
||||||
$value = __('Unknown');
|
$value = __('Unknown');
|
||||||
|
|
||||||
@ -2768,6 +2863,10 @@ function visual_map_create_internal_name_item($label = null, $type, $image, $age
|
|||||||
case MODULE_GRAPH:
|
case MODULE_GRAPH:
|
||||||
$text = __('Module graph');
|
$text = __('Module graph');
|
||||||
break;
|
break;
|
||||||
|
case 'auto_sla_graph':
|
||||||
|
case AUTO_SLA_GRAPH:
|
||||||
|
$text = __('Auto SLA Graph');
|
||||||
|
break;
|
||||||
case 'percentile_bar':
|
case 'percentile_bar':
|
||||||
case PERCENTILE_BAR:
|
case PERCENTILE_BAR:
|
||||||
$text = __('Percentile bar');
|
$text = __('Percentile bar');
|
||||||
@ -2879,6 +2978,9 @@ function visual_map_type_in_js($type) {
|
|||||||
case MODULE_GRAPH:
|
case MODULE_GRAPH:
|
||||||
return 'module_graph';
|
return 'module_graph';
|
||||||
break;
|
break;
|
||||||
|
case AUTO_SLA_GRAPH:
|
||||||
|
return 'auto_sla_graph';
|
||||||
|
break;
|
||||||
case SIMPLE_VALUE:
|
case SIMPLE_VALUE:
|
||||||
return 'simple_value';
|
return 'simple_value';
|
||||||
break;
|
break;
|
||||||
|
@ -54,6 +54,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
|||||||
'static_graph' => __('Static Graph'),
|
'static_graph' => __('Static Graph'),
|
||||||
'percentile_item' => __('Percentile Item'),
|
'percentile_item' => __('Percentile Item'),
|
||||||
'module_graph' => __('Graph'),
|
'module_graph' => __('Graph'),
|
||||||
|
'auto_sla_graph' => __('Auto SLA Graph'),
|
||||||
'simple_value' => __('Simple value') . ui_print_help_tip(__("To use 'label'field, you should write
|
'simple_value' => __('Simple value') . ui_print_help_tip(__("To use 'label'field, you should write
|
||||||
a text to replace '(_VALUE_)' and the value of the module will be printed at the end."), true),
|
a text to replace '(_VALUE_)' and the value of the module will be printed at the end."), true),
|
||||||
'label' => __('Label'),
|
'label' => __('Label'),
|
||||||
@ -153,7 +154,6 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
|||||||
html_print_input_text('height_module_graph', 180, '', 3, 5, true) .
|
html_print_input_text('height_module_graph', 180, '', 3, 5, true) .
|
||||||
'</td>';
|
'</td>';
|
||||||
|
|
||||||
|
|
||||||
$form_items['label_row'] = array();
|
$form_items['label_row'] = array();
|
||||||
$form_items['label_row']['items'] = array('label',
|
$form_items['label_row']['items'] = array('label',
|
||||||
'static_graph',
|
'static_graph',
|
||||||
@ -162,7 +162,8 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
|||||||
'module_graph',
|
'module_graph',
|
||||||
'simple_value',
|
'simple_value',
|
||||||
'datos',
|
'datos',
|
||||||
'group_item');
|
'group_item',
|
||||||
|
'auto_sla_graph');
|
||||||
$form_items['label_row']['html'] =
|
$form_items['label_row']['html'] =
|
||||||
'<td align="left" valign="top" style="">' . __('Label') . '
|
'<td align="left" valign="top" style="">' . __('Label') . '
|
||||||
|
|
||||||
@ -276,7 +277,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
|||||||
$form_items['agent_row'] = array();
|
$form_items['agent_row'] = array();
|
||||||
$form_items['agent_row']['items'] = array('static_graph',
|
$form_items['agent_row']['items'] = array('static_graph',
|
||||||
'percentile_bar', 'percentile_item', 'module_graph',
|
'percentile_bar', 'percentile_item', 'module_graph',
|
||||||
'simple_value', 'datos');
|
'simple_value', 'datos', 'auto_sla_graph');
|
||||||
$form_items['agent_row']['html'] = '<td align="left">' .
|
$form_items['agent_row']['html'] = '<td align="left">' .
|
||||||
__('Agent') . '</td>';
|
__('Agent') . '</td>';
|
||||||
$params = array();
|
$params = array();
|
||||||
@ -306,28 +307,38 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
|||||||
ui_print_agent_autocomplete_input($params) .
|
ui_print_agent_autocomplete_input($params) .
|
||||||
'</td>';
|
'</td>';
|
||||||
|
|
||||||
|
|
||||||
$form_items['module_row'] = array();
|
$form_items['module_row'] = array();
|
||||||
$form_items['module_row']['items'] = array('static_graph',
|
$form_items['module_row']['items'] = array('static_graph',
|
||||||
'percentile_bar', 'percentile_item', 'module_graph',
|
'percentile_bar', 'percentile_item', 'module_graph',
|
||||||
'simple_value', 'datos');
|
'simple_value', 'datos', 'auto_sla_graph');
|
||||||
$form_items['module_row']['html'] = '<td align="left">' .
|
$form_items['module_row']['html'] = '<td align="left">' .
|
||||||
__('Module') . '</td>
|
__('Module') . '</td>
|
||||||
<td align="left">' .
|
<td align="left">' .
|
||||||
html_print_select(array(), 'module', '', '', __('Any'), 0, true). '<div id="data_image_container" style="display:none;"><span id="data_image_check_label" style="margin-left:20px;">'.__("Data image").': </span><span id="data_image_check">Off</span><span id="data_image_width_label"> - Width: </span><input style="margin-left:5px;width:40px;" type="number" min="0" id="data_image_width" value="100"></input></div>
|
html_print_select(array(), 'module', '', '', __('Any'), 0, true) . '<div id="data_image_container" style="display:none;"><span id="data_image_check_label" style="margin-left:20px;">'.__("Data image").': </span><span id="data_image_check">Off</span><span id="data_image_width_label"> - Width: </span><input style="margin-left:5px;width:40px;" type="number" min="0" id="data_image_width" value="100"></input></div>
|
||||||
</td>';
|
</td>';
|
||||||
|
|
||||||
|
$event_times = array(86400 => __('24h'),
|
||||||
|
28800 => __('8h'),
|
||||||
|
7200 => __('2h'),
|
||||||
|
3600 => __('1h'),);
|
||||||
|
$form_items['event_max_time_row'] = array();
|
||||||
|
$form_items['event_max_time_row']['items'] = array('auto_sla_graph');
|
||||||
|
$form_items['event_max_time_row']['html'] = '<td align="left">' .
|
||||||
|
__('Max. Time') . '</td>
|
||||||
|
<td align="left">' .
|
||||||
|
html_print_select($event_times, 'event_max_time_row', '', '', 0, 86400, true, false, false) .
|
||||||
|
'</td>';
|
||||||
|
|
||||||
|
$form_items['type_graph'] = array();
|
||||||
$form_items['type_graph'] = array();
|
$form_items['type_graph']['items'] = array(
|
||||||
$form_items['type_graph']['items'] = array(
|
'Line',
|
||||||
'Line',
|
'Area');
|
||||||
'Area');
|
$form_items['type_graph']['html'] = '<td align="left"><span>' .
|
||||||
$form_items['type_graph']['html'] = '<td align="left"><span>' .
|
__('Type of graph') . '</span></td>
|
||||||
__('Type of graph') . '</span></td>
|
<td align="left">'. html_print_select (
|
||||||
<td align="left">'. html_print_select (
|
array ('line' => __('Line'),
|
||||||
array ('line' => __('Line'),
|
'area' => __('Area')),
|
||||||
'area' => __('Area')),
|
'type_graph', '', '', 0, 'area', true, false, false) . '</td>';
|
||||||
'type_graph', '', '', 0, 'area', true, false, false) . '</td>';
|
|
||||||
|
|
||||||
$own_info = get_user_info($config['id_user']);
|
$own_info = get_user_info($config['id_user']);
|
||||||
if (!$own_info['is_admin'] && !check_acl ($config['id_user'], 0, "PM"))
|
if (!$own_info['is_admin'] && !check_acl ($config['id_user'], 0, "PM"))
|
||||||
@ -499,7 +510,8 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
|||||||
$form_items_advance['position_row'] = array();
|
$form_items_advance['position_row'] = array();
|
||||||
$form_items_advance['position_row']['items'] = array('static_graph',
|
$form_items_advance['position_row']['items'] = array('static_graph',
|
||||||
'percentile_bar', 'percentile_item', 'module_graph',
|
'percentile_bar', 'percentile_item', 'module_graph',
|
||||||
'simple_value', 'label', 'icon', 'datos', 'box_item');
|
'simple_value', 'label', 'icon', 'datos', 'box_item',
|
||||||
|
'auto_sla_graph');
|
||||||
$form_items_advance['position_row']['html'] = '
|
$form_items_advance['position_row']['html'] = '
|
||||||
<td align="left">' . __('Position') . '</td>
|
<td align="left">' . __('Position') . '</td>
|
||||||
<td align="left">(' . html_print_input_text('left', '0', '', 3, 5, true) .
|
<td align="left">(' . html_print_input_text('left', '0', '', 3, 5, true) .
|
||||||
@ -510,7 +522,8 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
|||||||
$form_items_advance['size_row'] = array();
|
$form_items_advance['size_row'] = array();
|
||||||
$form_items_advance['size_row']['items'] = array(
|
$form_items_advance['size_row']['items'] = array(
|
||||||
'group_item', 'background',
|
'group_item', 'background',
|
||||||
'static_graph', 'icon datos');
|
'static_graph', 'icon datos',
|
||||||
|
'auto_sla_graph');
|
||||||
$form_items_advance['size_row']['html'] = '<td align="left">' .
|
$form_items_advance['size_row']['html'] = '<td align="left">' .
|
||||||
__('Size') .
|
__('Size') .
|
||||||
ui_print_help_tip (
|
ui_print_help_tip (
|
||||||
@ -527,7 +540,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
|||||||
$form_items_advance['parent_row']['items'] = array(
|
$form_items_advance['parent_row']['items'] = array(
|
||||||
'group_item', 'static_graph',
|
'group_item', 'static_graph',
|
||||||
'percentile_bar', 'percentile_item', 'module_graph',
|
'percentile_bar', 'percentile_item', 'module_graph',
|
||||||
'simple_value', 'label', 'icon', 'datos');
|
'simple_value', 'label', 'icon', 'datos', 'auto_sla_graph');
|
||||||
$form_items_advance['parent_row']['html'] = '<td align="left">' .
|
$form_items_advance['parent_row']['html'] = '<td align="left">' .
|
||||||
__('Parent') . '</td>
|
__('Parent') . '</td>
|
||||||
<td align="left">' .
|
<td align="left">' .
|
||||||
@ -654,6 +667,7 @@ function visual_map_editor_print_toolbox() {
|
|||||||
visual_map_print_button_editor('static_graph', __('Static Graph'), 'left', false, 'camera_min', true);
|
visual_map_print_button_editor('static_graph', __('Static Graph'), 'left', false, 'camera_min', true);
|
||||||
visual_map_print_button_editor('percentile_item', __('Percentile Item'), 'left', false, 'percentile_item_min', true);
|
visual_map_print_button_editor('percentile_item', __('Percentile Item'), 'left', false, 'percentile_item_min', true);
|
||||||
visual_map_print_button_editor('module_graph', __('Module Graph'), 'left', false, 'graph_min', true);
|
visual_map_print_button_editor('module_graph', __('Module Graph'), 'left', false, 'graph_min', true);
|
||||||
|
visual_map_print_button_editor('auto_sla_graph', __('Auto SLA Graph'), 'left', false, 'auto_sla_graph_min', true);
|
||||||
visual_map_print_button_editor('simple_value', __('Simple Value'), 'left', false, 'binary_min', true);
|
visual_map_print_button_editor('simple_value', __('Simple Value'), 'left', false, 'binary_min', true);
|
||||||
visual_map_print_button_editor('label', __('Label'), 'left', false, 'label_min', true);
|
visual_map_print_button_editor('label', __('Label'), 'left', false, 'label_min', true);
|
||||||
visual_map_print_button_editor('icon', __('Icon'), 'left', false, 'icon_min', true);
|
visual_map_print_button_editor('icon', __('Icon'), 'left', false, 'icon_min', true);
|
||||||
@ -672,7 +686,6 @@ function visual_map_editor_print_toolbox() {
|
|||||||
|
|
||||||
$text_autosave = html_print_input_hidden ('auto_save', true, true);
|
$text_autosave = html_print_input_hidden ('auto_save', true, true);
|
||||||
visual_map_print_item_toolbox('auto_save', $text_autosave, 'right');
|
visual_map_print_item_toolbox('auto_save', $text_autosave, 'right');
|
||||||
//visual_map_print_button_editor('save_visualmap', __('Save'), 'right', true, 'save_min', true);
|
|
||||||
visual_map_print_button_editor('show_grid', __('Show grid'), 'right', true, 'grid_min', true);
|
visual_map_print_button_editor('show_grid', __('Show grid'), 'right', true, 'grid_min', true);
|
||||||
visual_map_print_button_editor('edit_item', __('Update item'), 'right', true, 'config_min', true);
|
visual_map_print_button_editor('edit_item', __('Update item'), 'right', true, 'config_min', true);
|
||||||
visual_map_print_button_editor('delete_item', __('Delete item'), 'right', true, 'delete_min', true);
|
visual_map_print_button_editor('delete_item', __('Delete item'), 'right', true, 'delete_min', true);
|
||||||
|
@ -638,7 +638,11 @@ function pandoraFlotSlicebar(graph_id, values, datacolor, labels, legend, acumul
|
|||||||
|
|
||||||
var stack = 0, bars = true, lines = false, steps = false;
|
var stack = 0, bars = true, lines = false, steps = false;
|
||||||
|
|
||||||
var options = {
|
var regex = /visual_console/;
|
||||||
|
var match = regex.exec(window.location.href);
|
||||||
|
|
||||||
|
if (match == null) {
|
||||||
|
var options = {
|
||||||
series: {
|
series: {
|
||||||
stack: stack,
|
stack: stack,
|
||||||
shadowSize: 0.1,
|
shadowSize: 0.1,
|
||||||
@ -665,69 +669,99 @@ function pandoraFlotSlicebar(graph_id, values, datacolor, labels, legend, acumul
|
|||||||
show: false
|
show: false
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var options = {
|
||||||
|
series: {
|
||||||
|
stack: stack,
|
||||||
|
shadowSize: 0.1,
|
||||||
|
color: '#ddd'
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
hoverable: false,
|
||||||
|
clickable: false,
|
||||||
|
borderWidth:1,
|
||||||
|
borderColor: '',
|
||||||
|
tickColor: '#fff'
|
||||||
|
},
|
||||||
|
xaxes: [ {
|
||||||
|
tickFormatter: xFormatter,
|
||||||
|
color: '',
|
||||||
|
tickSize: intervaltick,
|
||||||
|
tickLength: 0
|
||||||
|
} ],
|
||||||
|
yaxes: [ {
|
||||||
|
show: false,
|
||||||
|
tickLength: 0
|
||||||
|
}],
|
||||||
|
legend: {
|
||||||
|
show: false
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
var plot = $.plot($('#'+graph_id), datas, options );
|
var plot = $.plot($('#'+graph_id), datas, options );
|
||||||
|
|
||||||
// Events
|
if (match == null) {
|
||||||
$('#'+graph_id).bind('plothover', function (event, pos, item) {
|
// Events
|
||||||
if (item) {
|
$('#'+graph_id).bind('plothover', function (event, pos, item) {
|
||||||
var from = legend[item.seriesIndex];
|
if (item) {
|
||||||
var to = legend[item.seriesIndex+1];
|
var from = legend[item.seriesIndex];
|
||||||
|
var to = legend[item.seriesIndex+1];
|
||||||
|
|
||||||
if (to == undefined) {
|
if (to == undefined) {
|
||||||
to = '>';
|
to = '>';
|
||||||
}
|
|
||||||
|
|
||||||
$('#extra_'+graph_id).text(from+'-'+to);
|
|
||||||
var extra_height = parseInt($('#extra_'+graph_id).css('height').split('px')[0]);
|
|
||||||
var extra_width = parseInt($('#extra_'+graph_id).css('width').split('px')[0]);
|
|
||||||
$('#extra_'+graph_id).css('left',pos.pageX-(extra_width/4)+'px');
|
|
||||||
//$('#extra_'+graph_id).css('top',plot.offset().top-extra_height-5+'px');
|
|
||||||
$('#extra_'+graph_id).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#'+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();
|
|
||||||
|
|
||||||
if (full_legend != "") {
|
|
||||||
newdate = full_legend[item.seriesIndex];
|
|
||||||
newdate2 = full_legend[item.seriesIndex+1];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
var month = dateObj.getUTCMonth() + 1; //months from 1-12
|
|
||||||
var day = dateObj.getUTCDate();
|
|
||||||
var year = dateObj.getUTCFullYear();
|
|
||||||
newdate = year + "/" + month + "/" + day;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!to){
|
|
||||||
to= '23:59';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (full_legend != "") {
|
|
||||||
if (newdate2 == undefined) {
|
|
||||||
window.location='index.php?sec=eventos&sec2=operation/events/events&id_agent='+id_agent+'&date_from='+newdate+'&time_from='+from+'&status=-1';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
window.location='index.php?sec=eventos&sec2=operation/events/events&id_agent='+id_agent+'&date_from='+newdate+'&time_from='+from+'&date_to='+newdate2+'&time_to='+to+'&status=-1';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$('#extra_'+graph_id).text(from+'-'+to);
|
||||||
|
var extra_height = parseInt($('#extra_'+graph_id).css('height').split('px')[0]);
|
||||||
|
var extra_width = parseInt($('#extra_'+graph_id).css('width').split('px')[0]);
|
||||||
|
$('#extra_'+graph_id).css('left',pos.pageX-(extra_width/4)+'px');
|
||||||
|
//$('#extra_'+graph_id).css('top',plot.offset().top-extra_height-5+'px');
|
||||||
|
$('#extra_'+graph_id).show();
|
||||||
}
|
}
|
||||||
else {
|
});
|
||||||
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('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();
|
||||||
|
|
||||||
|
if (full_legend != "") {
|
||||||
|
newdate = full_legend[item.seriesIndex];
|
||||||
|
newdate2 = full_legend[item.seriesIndex+1];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var month = dateObj.getUTCMonth() + 1; //months from 1-12
|
||||||
|
var day = dateObj.getUTCDate();
|
||||||
|
var year = dateObj.getUTCFullYear();
|
||||||
|
newdate = year + "/" + month + "/" + day;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!to){
|
||||||
|
to= '23:59';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (full_legend != "") {
|
||||||
|
if (newdate2 == undefined) {
|
||||||
|
window.location='index.php?sec=eventos&sec2=operation/events/events&id_agent='+id_agent+'&date_from='+newdate+'&time_from='+from+'&status=-1';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
window.location='index.php?sec=eventos&sec2=operation/events/events&id_agent='+id_agent+'&date_from='+newdate+'&time_from='+from+'&date_to='+newdate2+'&time_to='+to+'&status=-1';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
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);
|
||||||
$('#'+graph_id).bind('mouseout',resetInteractivity);
|
}
|
||||||
|
|
||||||
// Reset interactivity styles
|
// Reset interactivity styles
|
||||||
function resetInteractivity() {
|
function resetInteractivity() {
|
||||||
|
@ -781,6 +781,12 @@ input.percentile_item_min {
|
|||||||
input.percentile_item_min[disabled] {
|
input.percentile_item_min[disabled] {
|
||||||
background: #fefefe url(../../images/percentile_item.disabled.png) no-repeat center !important;
|
background: #fefefe url(../../images/percentile_item.disabled.png) no-repeat center !important;
|
||||||
}
|
}
|
||||||
|
input.auto_sla_graph_min {
|
||||||
|
background: #fefefe url(../../images/auto_sla_graph.png) no-repeat center !important;
|
||||||
|
}
|
||||||
|
input.auto_sla_graph_min[disabled] {
|
||||||
|
background: #fefefe url(../../images/auto_sla_graph.disabled.png) no-repeat center !important;
|
||||||
|
}
|
||||||
input.binary_min {
|
input.binary_min {
|
||||||
background: #fefefe url(../../images/binary.png) no-repeat center !important;
|
background: #fefefe url(../../images/binary.png) no-repeat center !important;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user