mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 01:05:39 +02:00
Added structure to new item
This commit is contained in:
parent
db11068838
commit
ce72e5a5af
@ -434,6 +434,19 @@ function update_button_palette_callback() {
|
|||||||
|
|
||||||
setEventsBar(idItem, values);
|
setEventsBar(idItem, values);
|
||||||
break;
|
break;
|
||||||
|
case 'donut_graph':
|
||||||
|
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");
|
||||||
|
|
||||||
|
setDonutsGraph(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_' ||
|
||||||
@ -699,6 +712,12 @@ function create_button_palette_callback() {
|
|||||||
validate = false;
|
validate = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'donut_graph':
|
||||||
|
if ((values['agent'] == '')) {
|
||||||
|
alert($("#message_alert_no_agent").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());
|
||||||
@ -975,6 +994,7 @@ function toggle_item_palette() {
|
|||||||
activeToolboxButton('box_item', true);
|
activeToolboxButton('box_item', true);
|
||||||
activeToolboxButton('line_item', true);
|
activeToolboxButton('line_item', true);
|
||||||
activeToolboxButton('auto_sla_graph', true);
|
activeToolboxButton('auto_sla_graph', true);
|
||||||
|
activeToolboxButton('donut_graph', true);
|
||||||
|
|
||||||
if (typeof(enterprise_activeToolboxButton) == 'function') {
|
if (typeof(enterprise_activeToolboxButton) == 'function') {
|
||||||
enterprise_activeToolboxButton(true);
|
enterprise_activeToolboxButton(true);
|
||||||
@ -995,6 +1015,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('auto_sla_graph', false);
|
||||||
|
activeToolboxButton('donut_graph', false);
|
||||||
activeToolboxButton('simple_value', false);
|
activeToolboxButton('simple_value', false);
|
||||||
activeToolboxButton('label', false);
|
activeToolboxButton('label', false);
|
||||||
activeToolboxButton('icon', false);
|
activeToolboxButton('icon', false);
|
||||||
@ -2348,6 +2369,17 @@ function createItem(type, values, id_data) {
|
|||||||
|
|
||||||
setEventsBar(id_data, values);
|
setEventsBar(id_data, values);
|
||||||
break;
|
break;
|
||||||
|
case 'donut_graph':
|
||||||
|
var sizeStyle = '';
|
||||||
|
var imageSize = '';
|
||||||
|
item = $('<div id="' + id_data + '" class="item donut_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></td></tr><tr><td></td></tr></table>' +
|
||||||
|
'<img class="image" id="image_' + id_data + '" src="images/spinner.gif" />' +
|
||||||
|
'</div>'
|
||||||
|
);
|
||||||
|
|
||||||
|
setDonutsGraph(id_data, values);
|
||||||
|
break;
|
||||||
case 'percentile_bar':
|
case 'percentile_bar':
|
||||||
case 'percentile_item':
|
case 'percentile_item':
|
||||||
var sizeStyle = '';
|
var sizeStyle = '';
|
||||||
@ -2679,6 +2711,7 @@ function updateDB_visual(type, idElement , values, event, top, left) {
|
|||||||
case 'icon':
|
case 'icon':
|
||||||
case 'module_graph':
|
case 'module_graph':
|
||||||
case 'auto_sla_graph':
|
case 'auto_sla_graph':
|
||||||
|
case 'donut_graph':
|
||||||
if (type == 'simple_value') {
|
if (type == 'simple_value') {
|
||||||
setModuleValue(idElement,
|
setModuleValue(idElement,
|
||||||
values.process_simple_value,
|
values.process_simple_value,
|
||||||
@ -3093,6 +3126,15 @@ function eventsItems(drag) {
|
|||||||
activeToolboxButton('delete_item', true);
|
activeToolboxButton('delete_item', true);
|
||||||
activeToolboxButton('show_grid', false);
|
activeToolboxButton('show_grid', false);
|
||||||
}
|
}
|
||||||
|
if ($(divParent).hasClass('donut_graph')) {
|
||||||
|
creationItem = null;
|
||||||
|
selectedItem = 'donut_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';
|
||||||
@ -3293,6 +3335,9 @@ function eventsItems(drag) {
|
|||||||
if ($(event.target).hasClass('auto_sla_graph')) {
|
if ($(event.target).hasClass('auto_sla_graph')) {
|
||||||
selectedItem = 'auto_sla_graph';
|
selectedItem = 'auto_sla_graph';
|
||||||
}
|
}
|
||||||
|
if ($(event.target).hasClass('donut_graph')) {
|
||||||
|
selectedItem = 'donut_graph';
|
||||||
|
}
|
||||||
if ($(event.target).hasClass('group_item')) {
|
if ($(event.target).hasClass('group_item')) {
|
||||||
selectedItem = 'group_item';
|
selectedItem = 'group_item';
|
||||||
}
|
}
|
||||||
@ -3617,6 +3662,10 @@ function click_button_toolbox(id) {
|
|||||||
toolbuttonActive = creationItem = 'auto_sla_graph';
|
toolbuttonActive = creationItem = 'auto_sla_graph';
|
||||||
toggle_item_palette();
|
toggle_item_palette();
|
||||||
break;
|
break;
|
||||||
|
case 'donut_graph':
|
||||||
|
toolbuttonActive = creationItem = 'donut_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();
|
||||||
@ -3674,6 +3723,7 @@ function click_button_toolbox(id) {
|
|||||||
activeToolboxButton('service', false);
|
activeToolboxButton('service', false);
|
||||||
activeToolboxButton('group_item', false);
|
activeToolboxButton('group_item', false);
|
||||||
activeToolboxButton('auto_sla_graph', false);
|
activeToolboxButton('auto_sla_graph', false);
|
||||||
|
activeToolboxButton('donut_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);
|
||||||
@ -3704,6 +3754,7 @@ function click_button_toolbox(id) {
|
|||||||
activeToolboxButton('icon', true);
|
activeToolboxButton('icon', true);
|
||||||
activeToolboxButton('group_item', true);
|
activeToolboxButton('group_item', true);
|
||||||
activeToolboxButton('auto_sla_graph', true);
|
activeToolboxButton('auto_sla_graph', true);
|
||||||
|
activeToolboxButton('donut_graph', true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'save_visualmap':
|
case 'save_visualmap':
|
||||||
|
@ -197,6 +197,7 @@ define('SERVICE', 10); //Enterprise Item.
|
|||||||
define('GROUP_ITEM', 11);
|
define('GROUP_ITEM', 11);
|
||||||
define('BOX_ITEM', 12);
|
define('BOX_ITEM', 12);
|
||||||
define('LINE_ITEM', 13);
|
define('LINE_ITEM', 13);
|
||||||
|
define('DONUT_GRAPH', 17);
|
||||||
//Some styles
|
//Some styles
|
||||||
define('MIN_WIDTH', 300);
|
define('MIN_WIDTH', 300);
|
||||||
define('MIN_HEIGHT', 120);
|
define('MIN_HEIGHT', 120);
|
||||||
|
@ -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'),
|
||||||
|
'donut_graph' => __('Donut graph'),
|
||||||
'auto_sla_graph' => __('Auto SLA 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),
|
||||||
@ -277,7 +278,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', 'auto_sla_graph');
|
'simple_value', 'datos', 'auto_sla_graph', 'donut_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();
|
||||||
@ -310,7 +311,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
|||||||
$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', 'auto_sla_graph');
|
'simple_value', 'datos', 'auto_sla_graph', 'donut_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">' .
|
||||||
@ -446,12 +447,6 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
|||||||
html_print_radio_button_extended('value_show', 'value', ('Value'), 'value', false, '', '', true) .
|
html_print_radio_button_extended('value_show', 'value', ('Value'), 'value', false, '', '', true) .
|
||||||
'</td>';
|
'</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$form_items['period_row'] = array();
|
|
||||||
$form_items['period_row']['items'] = array('module_graph', 'simple_value', 'datos');
|
|
||||||
$form_items['period_row']['html'] = '<td align="left">' . __('Period') . '</td>
|
|
||||||
<td align="left">' . html_print_extended_select_for_time ('period', SECONDS_5MINUTES, '', '', '', false, true) . '</td>';
|
|
||||||
|
|
||||||
$form_items['show_statistics_row'] = array();
|
$form_items['show_statistics_row'] = array();
|
||||||
$form_items['show_statistics_row']['items'] = array('group_item');
|
$form_items['show_statistics_row']['items'] = array('group_item');
|
||||||
@ -530,7 +525,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
|||||||
$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');
|
'auto_sla_graph', 'donut_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 (
|
||||||
@ -674,6 +669,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('donut_graph', __('Donut Graph'), 'left', false, 'donut_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('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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user