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;
|
||||
case 'box_item':
|
||||
|
||||
if($('input[name=width_box]').val() == ''){
|
||||
alert('Undefined width');
|
||||
return false;
|
||||
}
|
||||
if($('input[name=height_box]').val() == ''){
|
||||
alert('Undefined height');
|
||||
return false;
|
||||
}
|
||||
if($('input[name=width_box]').val() == ''){
|
||||
alert('Undefined width');
|
||||
return false;
|
||||
}
|
||||
if($('input[name=height_box]').val() == ''){
|
||||
alert('Undefined height');
|
||||
return false;
|
||||
}
|
||||
|
||||
$("#" + idItem + " div").css('background-color', values['fill_color']);
|
||||
$("#" + idItem + " div").css('border-color', values['border_color']);
|
||||
|
@ -295,55 +295,53 @@ function update_button_palette_callback() {
|
|||
case 'group_item':
|
||||
case 'static_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']);
|
||||
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');
|
||||
if($('input[name=width]').val() == ''){
|
||||
alert('Undefined width');
|
||||
return false;
|
||||
}
|
||||
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('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');
|
||||
}
|
||||
$("#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;
|
||||
case 'percentile_bar':
|
||||
case 'percentile_item':
|
||||
|
||||
if($('input[name=width_percentile]').val() == ''){
|
||||
alert('Undefined width');
|
||||
return false;
|
||||
}
|
||||
if($('input[name=height_percentile]').val() == ''){
|
||||
alert('Undefined height');
|
||||
return false;
|
||||
}
|
||||
|
||||
if($('input[name=width_percentile]').val() == ''){
|
||||
alert('Undefined width');
|
||||
return false;
|
||||
}
|
||||
if($('input[name=height_percentile]').val() == ''){
|
||||
alert('Undefined height');
|
||||
return false;
|
||||
}
|
||||
|
||||
$("#text_" + idItem).html(values['label']);
|
||||
$("#image_" + idItem).attr("src", "images/spinner.gif");
|
||||
|
@ -354,50 +352,57 @@ function update_button_palette_callback() {
|
|||
setPercentileBar(idItem, values);
|
||||
}
|
||||
|
||||
|
||||
|
||||
break;
|
||||
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'))
|
||||
|| 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;
|
||||
|
||||
if($('#dir_items').html() == 'horizontal'){
|
||||
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;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($('#dir_items').html() == 'vertical'){
|
||||
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');
|
||||
return false;
|
||||
|
||||
|
||||
if($('#dir_items').html() == 'vertical'){
|
||||
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');
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($('input[name=width_module_graph]').val() == ''){
|
||||
alert('Undefined width');
|
||||
return false;
|
||||
}
|
||||
if($('input[name=height_module_graph]').val() == ''){
|
||||
alert('Undefined height');
|
||||
return false;
|
||||
}
|
||||
if($('#custom_graph_row').css('display') != 'none' && $("#custom_graph option:selected").html() == 'None'){
|
||||
|
||||
if($('input[name=width_module_graph]').val() == ''){
|
||||
alert('Undefined width');
|
||||
return false;
|
||||
}
|
||||
if($('input[name=height_module_graph]').val() == ''){
|
||||
alert('Undefined height');
|
||||
return false;
|
||||
}
|
||||
if($('#custom_graph_row').css('display') != 'none' && $("#custom_graph option:selected").html() == 'None'){
|
||||
alert('Undefined graph');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$("#text_" + idItem).html(values['label']);
|
||||
$("#image_" + idItem).attr("src", "images/spinner.gif");
|
||||
setModuleGraph(idItem);
|
||||
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':
|
||||
//checkpoint
|
||||
if(($('#text-label_ifr').contents().find('#tinymce p').html() == '_VALUE_' ||
|
||||
|
@ -430,42 +435,41 @@ function update_button_palette_callback() {
|
|||
$("#text_" + idItem).html(values['label']);
|
||||
break;
|
||||
case 'icon':
|
||||
|
||||
if($('input[name=width]').val() == ''){
|
||||
alert('Undefined width');
|
||||
return false;
|
||||
}
|
||||
if($('input[name=height]').val() == ''){
|
||||
alert('Undefined height');
|
||||
return false;
|
||||
}
|
||||
$("#image_" + idItem).attr('src', "images/spinner.gif");
|
||||
if ((values['width'] == 0) || (values['height'] == 0)) {
|
||||
if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
|
||||
if($('input[name=width]').val() == ''){
|
||||
alert('Undefined width');
|
||||
return false;
|
||||
}
|
||||
if($('input[name=height]').val() == ''){
|
||||
alert('Undefined height');
|
||||
return false;
|
||||
}
|
||||
$("#image_" + idItem).attr('src', "images/spinner.gif");
|
||||
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('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('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');
|
||||
}
|
||||
$("#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";
|
||||
set_image("image", idItem, image);
|
||||
break;
|
||||
|
@ -585,9 +589,10 @@ function readFields() {
|
|||
values['parent'] = $("select[name=parent]").val();
|
||||
values['map_linked'] = $("select[name=map_linked]").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['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['value_show'] = $("input[name=value_show]:checked").val();
|
||||
values['enable_link'] = $("input[name=enable_link]").is(':checked') ? 1 : 0;
|
||||
|
@ -657,6 +662,16 @@ function create_button_palette_callback() {
|
|||
validate = false;
|
||||
}
|
||||
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':
|
||||
if ((values['label'] == '')) {
|
||||
alert($("#message_alert_no_label").html());
|
||||
|
@ -932,6 +947,7 @@ function toggle_item_palette() {
|
|||
activeToolboxButton('group_item', true);
|
||||
activeToolboxButton('box_item', true);
|
||||
activeToolboxButton('line_item', true);
|
||||
activeToolboxButton('auto_sla_graph', true);
|
||||
|
||||
if (typeof(enterprise_activeToolboxButton) == 'function') {
|
||||
enterprise_activeToolboxButton(true);
|
||||
|
@ -951,6 +967,7 @@ function toggle_item_palette() {
|
|||
|
||||
activeToolboxButton('static_graph', false);
|
||||
activeToolboxButton('module_graph', false);
|
||||
activeToolboxButton('auto_sla_graph', false);
|
||||
activeToolboxButton('simple_value', false);
|
||||
activeToolboxButton('label', false);
|
||||
activeToolboxButton('icon', false);
|
||||
|
@ -1091,6 +1108,8 @@ function loadFieldsFromDB(item) {
|
|||
fill_parent_select(idItem);
|
||||
|
||||
jQuery.each(data, function(key, val) {
|
||||
if (key == 'event_max_time_row')
|
||||
$("select[name=event_max_time_row]").val(val);
|
||||
if (key == 'background')
|
||||
$("#background_image").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." + 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." + 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) {
|
||||
metaconsole = $("input[name='metaconsole']").val();
|
||||
|
||||
|
@ -2175,6 +2246,17 @@ function createItem(type, values, id_data) {
|
|||
|
||||
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;
|
||||
case 'percentile_bar':
|
||||
case 'percentile_item':
|
||||
|
@ -2500,13 +2582,13 @@ function updateDB_visual(type, idElement , values, event, top, left) {
|
|||
set_static_graph_status(idElement, values['image']);
|
||||
|
||||
}
|
||||
break;
|
||||
case 'percentile_item':
|
||||
case 'simple_value':
|
||||
case 'label':
|
||||
case 'icon':
|
||||
case 'module_graph':
|
||||
|
||||
|
||||
case 'auto_sla_graph':
|
||||
if (type == 'simple_value') {
|
||||
setModuleValue(idElement,
|
||||
values.process_simple_value,
|
||||
|
@ -2669,7 +2751,8 @@ function updateDB(type, idElement , values, event) {
|
|||
update_user_line(type, idElement, top, left);
|
||||
break;
|
||||
default:
|
||||
|
||||
console.log(values);
|
||||
console.log(idElement);
|
||||
if ((typeof(values['mov_left']) != 'undefined') &&
|
||||
(typeof(values['mov_top']) != 'undefined')) {
|
||||
top = parseInt($("#" + idElement)
|
||||
|
@ -2730,8 +2813,6 @@ function updateDB(type, idElement , values, event) {
|
|||
function copyDB(idItem) {
|
||||
metaconsole = $("input[name='metaconsole']").val();
|
||||
|
||||
|
||||
|
||||
parameter = Array();
|
||||
parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"});
|
||||
parameter.push ({name: "action", value: "copy"});
|
||||
|
@ -2902,6 +2983,15 @@ function eventsItems(drag) {
|
|||
activeToolboxButton('delete_item', true);
|
||||
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')) {
|
||||
creationItem = null;
|
||||
selectedItem = 'group_item';
|
||||
|
@ -3042,6 +3132,9 @@ function eventsItems(drag) {
|
|||
if ($(event.target).hasClass('static_graph')) {
|
||||
selectedItem = 'static_graph';
|
||||
}
|
||||
if ($(event.target).hasClass('auto_sla_graph')) {
|
||||
selectedItem = 'auto_sla_graph';
|
||||
}
|
||||
if ($(event.target).hasClass('group_item')) {
|
||||
selectedItem = 'group_item';
|
||||
}
|
||||
|
@ -3340,6 +3433,10 @@ function click_button_toolbox(id) {
|
|||
toolbuttonActive = creationItem = 'module_graph';
|
||||
toggle_item_palette();
|
||||
break;
|
||||
case 'auto_sla_graph':
|
||||
toolbuttonActive = creationItem = 'auto_sla_graph';
|
||||
toggle_item_palette();
|
||||
break;
|
||||
case 'simple_value':
|
||||
toolbuttonActive = creationItem = 'simple_value';
|
||||
toggle_item_palette();
|
||||
|
@ -3396,7 +3493,7 @@ function click_button_toolbox(id) {
|
|||
activeToolboxButton('icon', false);
|
||||
activeToolboxButton('service', false);
|
||||
activeToolboxButton('group_item', false);
|
||||
|
||||
activeToolboxButton('auto_sla_graph', false);
|
||||
activeToolboxButton('copy_item', false);
|
||||
activeToolboxButton('edit_item', false);
|
||||
activeToolboxButton('delete_item', false);
|
||||
|
@ -3426,6 +3523,7 @@ function click_button_toolbox(id) {
|
|||
activeToolboxButton('label', true);
|
||||
activeToolboxButton('icon', true);
|
||||
activeToolboxButton('group_item', true);
|
||||
activeToolboxButton('auto_sla_graph', true);
|
||||
}
|
||||
break;
|
||||
case 'save_visualmap':
|
||||
|
@ -3632,4 +3730,4 @@ function showGrid() {
|
|||
|
||||
eventsItems();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -152,6 +152,11 @@ foreach ($layoutDatas as $layoutData) {
|
|||
html_print_image('images/chart_curve.png', true,
|
||||
array('title' => __('Module Graph')));
|
||||
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:
|
||||
$table->data[$i + 1]['icon'] =
|
||||
html_print_image('images/binary.png', true,
|
||||
|
@ -465,6 +470,7 @@ foreach ($layoutDatas as $layoutData) {
|
|||
switch ($layoutData['type']) {
|
||||
case LINE_ITEM:
|
||||
case BOX_ITEM:
|
||||
case AUTO_SLA_GRAPH:
|
||||
$table->data[$i + 2][4] = "";
|
||||
break;
|
||||
default:
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 410 B |
Binary file not shown.
After Width: | Height: | Size: 410 B |
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);
|
||||
$id_module = get_parameter('module', null);
|
||||
$period = get_parameter('period', null);
|
||||
$event_max_time_row = get_parameter('event_max_time_row', null);
|
||||
$width = get_parameter('width', null);
|
||||
$height = get_parameter('height', null);
|
||||
$parent = get_parameter('parent', null);
|
||||
|
@ -139,7 +140,39 @@ switch ($action) {
|
|||
echo json_encode($return);
|
||||
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':
|
||||
//Metaconsole db connection
|
||||
|
@ -424,12 +457,14 @@ switch ($action) {
|
|||
$values['period'] = $period;
|
||||
$values['width'] = $width;
|
||||
}
|
||||
break;
|
||||
case 'percentile_bar':
|
||||
case 'percentile_item':
|
||||
case 'static_graph':
|
||||
case 'module_graph':
|
||||
case 'label':
|
||||
case 'icon':
|
||||
case 'auto_sla_graph':
|
||||
default:
|
||||
if ($type == 'label') {
|
||||
$values['type'] = LABEL;
|
||||
|
@ -504,6 +539,18 @@ switch ($action) {
|
|||
$values['border_color'] = $line_color;
|
||||
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':
|
||||
$values['border_width'] = $border_width;
|
||||
$values['border_color'] = $border_color;
|
||||
|
@ -622,7 +669,7 @@ switch ($action) {
|
|||
if (($item_in_db['parent_item'] == 0) && ($values['parent_item'] != 0)) {
|
||||
$new_line = 1;
|
||||
}
|
||||
|
||||
|
||||
$result = db_process_sql_update('tlayout_data', $values,
|
||||
array('id' => $id_element));
|
||||
|
||||
|
@ -659,6 +706,7 @@ switch ($action) {
|
|||
case 'simple_value':
|
||||
case 'label':
|
||||
case 'icon':
|
||||
case 'auto_sla_graph':
|
||||
$elementFields = db_get_row_filter('tlayout_data',
|
||||
array('id' => $id_element));
|
||||
|
||||
|
@ -710,6 +758,8 @@ switch ($action) {
|
|||
}
|
||||
|
||||
switch ($type) {
|
||||
case 'auto_sla_graph':
|
||||
$elementFields['event_max_time_row'] = $elementFields['period'];
|
||||
case 'percentile_item':
|
||||
case 'percentile_bar':
|
||||
$elementFields['width_percentile'] = $elementFields['width'];
|
||||
|
@ -869,6 +919,12 @@ switch ($action) {
|
|||
}
|
||||
$values['period'] = $period;
|
||||
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_bar':
|
||||
if ($type_percentile == 'percentile') {
|
||||
|
@ -985,8 +1041,6 @@ switch ($action) {
|
|||
echo json_encode($return);
|
||||
break;
|
||||
|
||||
|
||||
|
||||
case 'delete':
|
||||
if (db_process_sql_delete('tlayout_data', array('id' => $id_element, 'id_layout' => $id_visual_console)) === false) {
|
||||
$return['correct'] = 0;
|
||||
|
|
|
@ -185,6 +185,7 @@ define('AGENT_STATUS_WARNING', 2);
|
|||
define('STATIC_GRAPH', 0);
|
||||
define('PERCENTILE_BAR', 3);
|
||||
define('MODULE_GRAPH', 1);
|
||||
define('AUTO_SLA_GRAPH', 14);
|
||||
define('SIMPLE_VALUE', 2);
|
||||
define('LABEL', 4);
|
||||
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
|
||||
function fs_error_image ($width = 300, $height = 110) {
|
||||
global $config;
|
||||
|
|
|
@ -156,6 +156,7 @@ function visual_map_print_item($mode = "read", $layoutData,
|
|||
$wimg ='70';
|
||||
break;
|
||||
case 3:
|
||||
case 14:
|
||||
if (get_parameter('action') == 'edit') {
|
||||
$himg = '30';
|
||||
$wimg = '150';
|
||||
|
@ -376,6 +377,9 @@ function visual_map_print_item($mode = "read", $layoutData,
|
|||
$link = true;
|
||||
}
|
||||
|
||||
break;
|
||||
case AUTO_SLA_GRAPH:
|
||||
$link = true;
|
||||
break;
|
||||
default:
|
||||
if (!empty($element_enterprise)) {
|
||||
|
@ -391,7 +395,6 @@ function visual_map_print_item($mode = "read", $layoutData,
|
|||
$is_a_service = false;
|
||||
$is_a_link_to_other_visualconsole = false;
|
||||
|
||||
|
||||
if (enterprise_installed()) {
|
||||
$id_service = services_service_from_module
|
||||
($layoutData['id_agente_modulo']);
|
||||
|
@ -404,9 +407,6 @@ function visual_map_print_item($mode = "read", $layoutData,
|
|||
$is_a_link_to_other_visualconsole = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if ($is_a_service) {
|
||||
if (empty($layoutData['id_metaconsole'])) {
|
||||
$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;
|
||||
case GROUP_ITEM:
|
||||
$is_a_link_to_other_visualconsole = false;
|
||||
|
@ -1037,8 +1067,6 @@ function visual_map_print_item($mode = "read", $layoutData,
|
|||
metaconsole_restore_db();
|
||||
}
|
||||
|
||||
//$img = str_replace('>', 'class="image" id="image_' . $id . '" />', $img);
|
||||
|
||||
break;
|
||||
case LABEL:
|
||||
$z_index = 4 + 1;
|
||||
|
@ -1046,6 +1074,61 @@ function visual_map_print_item($mode = "read", $layoutData,
|
|||
case BOX_ITEM:
|
||||
$z_index = 1;
|
||||
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 ";
|
||||
|
@ -1053,6 +1136,9 @@ function visual_map_print_item($mode = "read", $layoutData,
|
|||
case STATIC_GRAPH:
|
||||
$class .= "static_graph";
|
||||
break;
|
||||
case AUTO_SLA_GRAPH:
|
||||
$class .= "auto_sla_graph";
|
||||
break;
|
||||
case GROUP_ITEM:
|
||||
$class .= "group_item";
|
||||
break;
|
||||
|
@ -1386,6 +1472,20 @@ function visual_map_print_item($mode = "read", $layoutData,
|
|||
echo io_safe_output($text);
|
||||
}
|
||||
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_MAX:
|
||||
case SIMPLE_VALUE_MIN:
|
||||
|
@ -1458,7 +1558,6 @@ function visual_map_print_item($mode = "read", $layoutData,
|
|||
|
||||
}
|
||||
|
||||
|
||||
//Restore db connection
|
||||
if ($layoutData['id_metaconsole'] != 0) {
|
||||
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) {
|
||||
global $config;
|
||||
|
||||
|
||||
|
||||
$unit_text = db_get_sql ('SELECT unit
|
||||
FROM tagente_modulo WHERE id_agente_modulo = ' . $id_module);
|
||||
$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:
|
||||
$value = db_get_value ('datos', 'tagente_estado',
|
||||
'id_agente_modulo', $id_module);
|
||||
|
||||
|
||||
if ($value === false) {
|
||||
$value = __('Unknown');
|
||||
|
||||
|
@ -2768,6 +2863,10 @@ function visual_map_create_internal_name_item($label = null, $type, $image, $age
|
|||
case MODULE_GRAPH:
|
||||
$text = __('Module graph');
|
||||
break;
|
||||
case 'auto_sla_graph':
|
||||
case AUTO_SLA_GRAPH:
|
||||
$text = __('Auto SLA Graph');
|
||||
break;
|
||||
case 'percentile_bar':
|
||||
case PERCENTILE_BAR:
|
||||
$text = __('Percentile bar');
|
||||
|
@ -2879,6 +2978,9 @@ function visual_map_type_in_js($type) {
|
|||
case MODULE_GRAPH:
|
||||
return 'module_graph';
|
||||
break;
|
||||
case AUTO_SLA_GRAPH:
|
||||
return 'auto_sla_graph';
|
||||
break;
|
||||
case SIMPLE_VALUE:
|
||||
return 'simple_value';
|
||||
break;
|
||||
|
|
|
@ -54,6 +54,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
|||
'static_graph' => __('Static Graph'),
|
||||
'percentile_item' => __('Percentile Item'),
|
||||
'module_graph' => __('Graph'),
|
||||
'auto_sla_graph' => __('Auto SLA Graph'),
|
||||
'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),
|
||||
'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) .
|
||||
'</td>';
|
||||
|
||||
|
||||
$form_items['label_row'] = array();
|
||||
$form_items['label_row']['items'] = array('label',
|
||||
'static_graph',
|
||||
|
@ -162,7 +162,8 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
|||
'module_graph',
|
||||
'simple_value',
|
||||
'datos',
|
||||
'group_item');
|
||||
'group_item',
|
||||
'auto_sla_graph');
|
||||
$form_items['label_row']['html'] =
|
||||
'<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']['items'] = array('static_graph',
|
||||
'percentile_bar', 'percentile_item', 'module_graph',
|
||||
'simple_value', 'datos');
|
||||
'simple_value', 'datos', 'auto_sla_graph');
|
||||
$form_items['agent_row']['html'] = '<td align="left">' .
|
||||
__('Agent') . '</td>';
|
||||
$params = array();
|
||||
|
@ -306,28 +307,38 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
|||
ui_print_agent_autocomplete_input($params) .
|
||||
'</td>';
|
||||
|
||||
|
||||
$form_items['module_row'] = array();
|
||||
$form_items['module_row']['items'] = array('static_graph',
|
||||
'percentile_bar', 'percentile_item', 'module_graph',
|
||||
'simple_value', 'datos');
|
||||
'simple_value', 'datos', 'auto_sla_graph');
|
||||
$form_items['module_row']['html'] = '<td align="left">' .
|
||||
__('Module') . '</td>
|
||||
<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>';
|
||||
|
||||
$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']['items'] = array(
|
||||
'Line',
|
||||
'Area');
|
||||
$form_items['type_graph']['html'] = '<td align="left"><span>' .
|
||||
__('Type of graph') . '</span></td>
|
||||
<td align="left">'. html_print_select (
|
||||
array ('line' => __('Line'),
|
||||
'area' => __('Area')),
|
||||
'type_graph', '', '', 0, 'area', true, false, false) . '</td>';
|
||||
$form_items['type_graph'] = array();
|
||||
$form_items['type_graph']['items'] = array(
|
||||
'Line',
|
||||
'Area');
|
||||
$form_items['type_graph']['html'] = '<td align="left"><span>' .
|
||||
__('Type of graph') . '</span></td>
|
||||
<td align="left">'. html_print_select (
|
||||
array ('line' => __('Line'),
|
||||
'area' => __('Area')),
|
||||
'type_graph', '', '', 0, 'area', true, false, false) . '</td>';
|
||||
|
||||
$own_info = get_user_info($config['id_user']);
|
||||
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']['items'] = array('static_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'] = '
|
||||
<td align="left">' . __('Position') . '</td>
|
||||
<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']['items'] = array(
|
||||
'group_item', 'background',
|
||||
'static_graph', 'icon datos');
|
||||
'static_graph', 'icon datos',
|
||||
'auto_sla_graph');
|
||||
$form_items_advance['size_row']['html'] = '<td align="left">' .
|
||||
__('Size') .
|
||||
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(
|
||||
'group_item', 'static_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">' .
|
||||
__('Parent') . '</td>
|
||||
<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('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('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('label', __('Label'), 'left', false, 'label_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);
|
||||
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('edit_item', __('Update item'), 'right', true, 'config_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 options = {
|
||||
var regex = /visual_console/;
|
||||
var match = regex.exec(window.location.href);
|
||||
|
||||
if (match == null) {
|
||||
var options = {
|
||||
series: {
|
||||
stack: stack,
|
||||
shadowSize: 0.1,
|
||||
|
@ -665,69 +669,99 @@ function pandoraFlotSlicebar(graph_id, values, datacolor, labels, legend, acumul
|
|||
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 );
|
||||
|
||||
// Events
|
||||
$('#'+graph_id).bind('plothover', function (event, pos, item) {
|
||||
if (item) {
|
||||
var from = legend[item.seriesIndex];
|
||||
var to = legend[item.seriesIndex+1];
|
||||
if (match == null) {
|
||||
// Events
|
||||
$('#'+graph_id).bind('plothover', function (event, pos, item) {
|
||||
if (item) {
|
||||
var from = legend[item.seriesIndex];
|
||||
var to = legend[item.seriesIndex+1];
|
||||
|
||||
if (to == undefined) {
|
||||
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';
|
||||
if (to == undefined) {
|
||||
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();
|
||||
}
|
||||
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
|
||||
function resetInteractivity() {
|
||||
|
|
|
@ -781,6 +781,12 @@ input.percentile_item_min {
|
|||
input.percentile_item_min[disabled] {
|
||||
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 {
|
||||
background: #fefefe url(../../images/binary.png) no-repeat center !important;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue