Visual console improvements - Add: font style/size setting - map size setting - back color map - graph function a type graph line/area - Improve wizard - Back graph color... #110

This commit is contained in:
enriquecd 2016-11-16 18:58:27 +01:00
parent 534b7eb05a
commit 76c1f7cd82
12 changed files with 253 additions and 58 deletions

View File

@ -51,11 +51,11 @@ $pure = get_parameter('pure', 0);
switch ($action) { switch ($action) {
case 'new': case 'new':
if (!defined('METACONSOLE')) { if (!defined('METACONSOLE')) {
echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting/visual_console_builder&tab=" . $activeTab . "' enctype='multipart/form-data'>"; echo "<form id='back' method='post' action='index.php?sec=reporting&sec2=godmode/reporting/visual_console_builder&tab=" . $activeTab . "' enctype='multipart/form-data'>";
html_print_input_hidden('action', 'save'); html_print_input_hidden('action', 'save');
} }
else { else {
echo '<form action="index.php?operation=edit_visualmap&sec=screen&sec2=screens/screens&action=visualmap&pure=' . $pure . '" method="post" enctype="multipart/form-data">'; echo '<form id="back" action="index.php?operation=edit_visualmap&sec=screen&sec2=screens/screens&action=visualmap&pure=' . $pure . '" method="post" enctype="multipart/form-data">';
html_print_input_hidden('action2', 'save'); html_print_input_hidden('action2', 'save');
} }
@ -63,22 +63,22 @@ switch ($action) {
case 'update': case 'update':
case 'save': case 'save':
if (!defined('METACONSOLE')) { if (!defined('METACONSOLE')) {
echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting/visual_console_builder&tab=" . $activeTab . "&id_visual_console=" . $idVisualConsole . "' enctype='multipart/form-data'>"; echo "<form id='back' method='post' action='index.php?sec=reporting&sec2=godmode/reporting/visual_console_builder&tab=" . $activeTab . "&id_visual_console=" . $idVisualConsole . "' enctype='multipart/form-data'>";
html_print_input_hidden('action', 'update'); html_print_input_hidden('action', 'update');
} }
else { else {
//echo '<form action="index.php?operation=edit_visualmap&sec=screen&sec2=screens/screens&action=visualmap&pure=' . $pure . '" method="post">'; //echo '<form action="index.php?operation=edit_visualmap&sec=screen&sec2=screens/screens&action=visualmap&pure=' . $pure . '" method="post">';
echo "<form action='index.php?sec=screen&sec2=screens/screens&tab=" . $activeTab . "&id_visual_console=" . $idVisualConsole . "&id_visualmap=" . $idVisualConsole . "&action=visualmap' method='post' enctype='multipart/form-data'>"; echo "<form id='back' action='index.php?sec=screen&sec2=screens/screens&tab=" . $activeTab . "&id_visual_console=" . $idVisualConsole . "&id_visualmap=" . $idVisualConsole . "&action=visualmap' method='post' enctype='multipart/form-data'>";
html_print_input_hidden('action2', 'update'); html_print_input_hidden('action2', 'update');
} }
break; break;
case 'edit': case 'edit':
if (!defined('METACONSOLE')) { if (!defined('METACONSOLE')) {
echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting/visual_console_builder&tab=" . $activeTab . "&id_visual_console=" . $idVisualConsole . "' enctype='multipart/form-data'>"; echo "<form id='back' method='post' action='index.php?sec=reporting&sec2=godmode/reporting/visual_console_builder&tab=" . $activeTab . "&id_visual_console=" . $idVisualConsole . "' enctype='multipart/form-data'>";
html_print_input_hidden('action', 'update'); html_print_input_hidden('action', 'update');
} }
else { else {
echo "<form action='index.php?operation=edit_visualmap&sec=screen&sec2=screens/screens&tab=" . $activeTab . "&id_visual_console=" . $idVisualConsole . "&action=visualmap' method='post' enctype='multipart/form-data' >"; echo "<form id='back' action='index.php?operation=edit_visualmap&sec=screen&sec2=screens/screens&tab=" . $activeTab . "&id_visual_console=" . $idVisualConsole . "&action=visualmap' method='post' enctype='multipart/form-data' >";
html_print_input_hidden('action2', 'update'); html_print_input_hidden('action2', 'update');
} }
break; break;
@ -120,9 +120,42 @@ $backgrounds_list = array_merge($backgrounds_list,
list_files($config['homedir'] . '/images/console/background/', "png", 1, 0)); list_files($config['homedir'] . '/images/console/background/', "png", 1, 0));
$table->data[2][0] = __('Background'); $table->data[2][0] = __('Background');
$table->data[2][1] = html_print_select($backgrounds_list, 'background', $table->data[2][1] = html_print_select($backgrounds_list, 'background',
$background, '', '', 0, true); $background, '', 'None', 'None.png', true);
$table->data[3][0] = __('Background image'); $table->data[3][0] = __('Background image');
$table->data[3][1] = html_print_input_file('background_image',true); $table->data[3][1] = html_print_input_file('background_image',true);
$table->data[4][0] = __('Background color');
if($action == 'new'){
$table->data[4][1] .= html_print_input_text ('background_color', 'white', '', 8, 8, true);
}
else{
$table->data[4][1] .= html_print_input_text ('background_color', $background_color, '', 8, 8, true);
}
$table->data[5][0] = __('Size - (Width x Height)');
$table->data[5][1] = html_print_input_text('width', 1024, '', 10, 10, true , true) .
' x ' .
html_print_input_text('height', 768, '', 10, 10, true, true);
if($action == 'new'){
$table->data[5][1] .= '<button disabled id="getsize" style="margin-left:20px;" value="modsize">Set default size</button>';
}
else{
$table->data[5][1] .= '<button id="getsize" style="margin-left:20px;" value="modsize">Set default size</button>';
}
$table->data[5][1] .= ui_print_help_tip(__("You must define size"), true);
if($action == 'new'){
$table->data[5][1] .= '<button disabled id="modsize" style="margin-left:20px;" value="modsize">Set other size</button><span style="margin-left:20px;" id="modsizetext">Disabled</span>';
}
else{
$table->data[5][1] .= '<button id="modsize" style="margin-left:20px;" value="modsize">Set other size</button><span style="margin-left:20px;" id="modsizetext">Disabled</span>';
}
$table->data[5][2] = '<img id="imagen" style="display:none" src="images/console/background/'.$background.'">';
$table->data[0][3] = $table->data[0][4] = $table->data[0][5] = '';
if ($action == 'new') { if ($action == 'new') {
$textButtonSubmit = __('Save'); $textButtonSubmit = __('Save');
$classButtonSubmit = 'sub wand'; $classButtonSubmit = 'sub wand';
@ -134,10 +167,76 @@ else {
html_print_table($table); html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">'; echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_submit_button ($textButtonSubmit, 'update_layout', false, if($action == 'new'){
'class="' . $classButtonSubmit . '"'); html_print_submit_button ($textButtonSubmit, 'update_layout', true,
echo '</div>'; 'class="' . $classButtonSubmit . '"');
}
else{
html_print_submit_button ($textButtonSubmit, 'update_layout', false,
'class="' . $classButtonSubmit . '"');
}
echo '</div>';
echo "</form>"; echo "</form>";
?> ?>
<script src="include/javascript/jquery.colorpicker.js"></script>
<script>
$(document).ready (function () {
$("#modsize").click(function(event){
event.preventDefault();
if($('input[name=width]').attr('readonly')){
$('input[name=width]').attr('readonly',false);
$('input[name=height]').attr('readonly',false);
$('#modsizetext').html('Enabled');
$('input[name=update_layout]').attr('disabled',false);
}
else{
$('input[name=width]').attr('readonly',true);
$('input[name=height]').attr('readonly',true);
$('#modsizetext').html('Disabled');
$('input[name=update_layout]').attr('enabled',false);
}
$('input[name=width]').val($('#imagen').width());
$('input[name=height]').val($('#imagen').height());
});
$("#getsize").click(function(event){
event.preventDefault();
$('input[name=update_layout]').attr('disabled',false);
$('input[name=width]').val($('#imagen').width());
$('input[name=height]').val($('#imagen').height());
});
$("#background").click(function(event){
$('#imagen').attr('src','images/console/background/'+$('#background').val());
$('input[name=update_layout]').attr('disabled',true);
$("#getsize").attr('disabled',false);
$("#modsize").attr('disabled',false);
});
$("#file-background_image").change(function(event){
$('#back').submit();
});
$("#text-background_color").attachColorPicker();
});
</script>

View File

@ -101,11 +101,13 @@ function visual_map_main() {
$("#custom_graph_row").css('display', 'none'); $("#custom_graph_row").css('display', 'none');
$("#agent_row").css('display', ''); $("#agent_row").css('display', '');
$("#module_row").css('display', ''); $("#module_row").css('display', '');
$("#type_graph").css('display', '');
} }
else { else {
$("#custom_graph_row").css('display', ''); $("#custom_graph_row").css('display', '');
$("#agent_row").css('display', 'none'); $("#agent_row").css('display', 'none');
$("#module_row").css('display', 'none'); $("#module_row").css('display', 'none');
$("#type_graph").css('display', 'none');
} }
} }
}); });
@ -264,7 +266,7 @@ function readFields() {
var text = tinymce.get('text-label').getContent(); var text = tinymce.get('text-label').getContent();
values['label'] = text; values['label'] = text;
values['type_graph'] = $("select[name=type_graph]").val();
values['image'] = $("select[name=image]").val(); values['image'] = $("select[name=image]").val();
values['background_color'] = $("select[name=background_color]").val(); values['background_color'] = $("select[name=background_color]").val();
values['left'] = $("input[name=left]").val(); values['left'] = $("input[name=left]").val();
@ -748,6 +750,15 @@ function loadFieldsFromDB(item) {
.prop("checked", false); .prop("checked", false);
} }
} }
if (key == 'type_graph') {
if (val == "area") {
$("select[name=type_graph]").val(val);
}
else {
$("select[name=type_graph]").val(val);
}
}
if (key == 'image') { if (key == 'image') {
//Load image preview //Load image preview
@ -880,8 +891,8 @@ function loadFieldsFromDB(item) {
$("input[name='radio_choice'][value='custom_graph']") $("input[name='radio_choice'][value='custom_graph']")
.prop('checked', true); .prop('checked', true);
$("input[name='radio_choice']").trigger('change'); $("input[name='radio_choice']").trigger('change');
$("#custom_graph option[value=" + data.id_custom_graph + "]") // $("#custom_graph option[value=" + data.id_custom_graph + "]")
.prop("selected", true); // .prop("selected", true);
} }
else { else {
$("input[name='radio_choice'][value='module_graph']") $("input[name='radio_choice'][value='module_graph']")
@ -1030,6 +1041,9 @@ function hiddenFields(item) {
$("#background_color").css('display', 'none'); $("#background_color").css('display', 'none');
$("#background_color." + item).css('display', ''); $("#background_color." + item).css('display', '');
$("#type_graph").css('display', 'none');
$("#type_graph." + item).css('display', '');
$("#radio_choice_graph").css('display', 'none'); $("#radio_choice_graph").css('display', 'none');
$("#radio_choice_graph." + item).css('display', ''); $("#radio_choice_graph." + item).css('display', '');
@ -1535,8 +1549,8 @@ function createItem(type, values, id_data) {
// Do none // Do none
} }
else { else {
item.css('width', values['width'] + 'px') item.css('width','70' + 'px')
.css('height', values['height'] + 'px'); .css('height', '70' + 'px');
} }
var $image = $('<img></img>') var $image = $('<img></img>')
@ -1545,6 +1559,8 @@ function createItem(type, values, id_data) {
.attr('src', img_src); .attr('src', img_src);
if ((values['width'] == 0) && (values['height'] == 0)) { if ((values['width'] == 0) && (values['height'] == 0)) {
// Do none // Do none
$image.attr('width', '70')
.attr('height', '70');
} }
else { else {
$image.attr('width', values['width']) $image.attr('width', values['width'])
@ -1627,8 +1643,8 @@ function createItem(type, values, id_data) {
break; break;
case 'icon': case 'icon':
if ((values['width'] == 0) && (values['height'] == 0)) { if ((values['width'] == 0) && (values['height'] == 0)) {
sizeStyle = ''; sizeStyle = 'width: ' + '70' + 'px; height: ' + '70' + 'px;';
imageSize = ''; imageSize = 'width="' + '70' + '" height="' + '70' + '"';
} }
else { else {
sizeStyle = 'width: ' + values['width'] + 'px; height: ' + values['height'] + 'px;'; sizeStyle = 'width: ' + values['width'] + 'px; height: ' + values['height'] + 'px;';

View File

@ -198,10 +198,14 @@ ui_require_javascript_file ('encode_decode_base64');
"14pt=.visual_font_size_14pt, " + "14pt=.visual_font_size_14pt, " +
"24pt=.visual_font_size_24pt, " + "24pt=.visual_font_size_24pt, " +
"36pt=.visual_font_size_36pt, " + "36pt=.visual_font_size_36pt, " +
"72pt=.visual_font_size_72pt", "72pt=.visual_font_size_72pt, " +
"96pt=.visual_font_size_96pt, " +
"128pt=.visual_font_size_128pt, " +
"154pt=.visual_font_size_154pt, " +
"196pt=.visual_font_size_196pt",
theme_advanced_toolbar_location : "top", theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left", theme_advanced_toolbar_align : "left",
theme_advanced_buttons1 : "bold,italic, |, justifyleft, justifycenter, justifyright, |,undo, redo, |, image, link, |, forecolor, fontsizeselect, |, code", theme_advanced_buttons1 : "bold,italic, |, justifyleft, justifycenter, justifyright, |,undo, redo, |, image, link, |, fontselect, |, forecolor, fontsizeselect, |, code",
theme_advanced_buttons2 : "", theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "", theme_advanced_buttons3 : "",
theme_advanced_statusbar_location : "none", theme_advanced_statusbar_location : "none",

View File

@ -108,11 +108,11 @@ $table->data = array();
//Background //Background
$table->data[0]['icon'] = ''; $table->data[0]['icon'] = '';
$table->data[0][0] = __('Background'); $table->data[0][0] = '<div style="display:none;">'.__('Background').'</div>';
$table->data[0][1] = html_print_select($backgrounds_list, 'background', $visualConsole['background'], '', 'None', '', true, false, true, '', false, 'width: 120px;'); $table->data[0][1] = '<div style="display:none;">'.html_print_select($backgrounds_list, 'background', $visualConsole['background'], '', 'None', '', true, false, true, '', false, 'width: 120px;').'</div>';
$table->data[0][2] = html_print_input_text('width', $visualConsole['width'], '', 3, 5, true) . $table->data[0][2] = '<div style="display:none;">'.html_print_input_text('width', $visualConsole['width'], '', 3, 5, true) .
' x ' . ' x ' .
html_print_input_text('height', $visualConsole['height'], '', 3, 5, true); html_print_input_text('height', $visualConsole['height'], '', 3, 5, true).'</div>';
$table->data[0][3] = $table->data[0][4] = $table->data[0][5] = ''; $table->data[0][3] = $table->data[0][4] = $table->data[0][5] = '';
$i = 1; $i = 1;
@ -593,7 +593,11 @@ ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/');
"14pt=.visual_font_size_14pt, " + "14pt=.visual_font_size_14pt, " +
"24pt=.visual_font_size_24pt, " + "24pt=.visual_font_size_24pt, " +
"36pt=.visual_font_size_36pt, " + "36pt=.visual_font_size_36pt, " +
"72pt=.visual_font_size_72pt", "72pt=.visual_font_size_72pt, " +
"96pt=.visual_font_size_96pt, " +
"128pt=.visual_font_size_128pt, " +
"154pt=.visual_font_size_154pt, " +
"196pt=.visual_font_size_196pt",
theme_advanced_toolbar_location : "top", theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left", theme_advanced_toolbar_align : "left",
theme_advanced_buttons1 : "bold,italic, |, image, link, |, forecolor, fontsizeselect", theme_advanced_buttons1 : "bold,italic, |, image, link, |, forecolor, fontsizeselect",

View File

@ -103,6 +103,9 @@ switch ($activeTab) {
case 'new': case 'new':
$idGroup = ''; $idGroup = '';
$background = ''; $background = '';
$background_color = '';
$width = '';
$height = '';
$visualConsoleName = ''; $visualConsoleName = '';
break; break;
@ -110,6 +113,9 @@ switch ($activeTab) {
case 'save': case 'save':
$idGroup = (int) get_parameter('id_group'); $idGroup = (int) get_parameter('id_group');
$background = (string) get_parameter('background'); $background = (string) get_parameter('background');
$background_color = (string) get_parameter('background_color');
$width = (int) get_parameter('width');
$height = (int) get_parameter('height');
$visualConsoleName = (string) get_parameter('name'); $visualConsoleName = (string) get_parameter('name');
// ACL for the new visual console // ACL for the new visual console
@ -128,7 +134,10 @@ switch ($activeTab) {
$values = array( $values = array(
'name' => $visualConsoleName, 'name' => $visualConsoleName,
'id_group' => $idGroup, 'id_group' => $idGroup,
'background' => $background 'background' => $background,
'background_color' => $background_color,
'width' => $width,
'height' => $height
); );
$error = $_FILES['background_image']['error']; $error = $_FILES['background_image']['error'];
@ -196,12 +205,13 @@ switch ($activeTab) {
// If the background is changed the size is reseted // If the background is changed the size is reseted
$background_now = $visualConsole['background']; $background_now = $visualConsole['background'];
if ($background_now != $background && $background) { /*if ($background_now != $background && $background) {
$sizeBackground = getimagesize($config['homedir'] . '/images/console/background/' . $background); $sizeBackground = getimagesize($config['homedir'] . '/images/console/background/' . $background);
$values['width'] = $sizeBackground[0]; $values['width'] = $sizeBackground[0];
$values['height'] = $sizeBackground[1]; $values['height'] = $sizeBackground[1];
} }*/
$values['width'] = $width;
$values['height'] = $height;
switch ($action) { switch ($action) {
case 'update': case 'update':
$result = false; $result = false;
@ -261,6 +271,9 @@ switch ($activeTab) {
$visualConsoleName = $visualConsole['name']; $visualConsoleName = $visualConsole['name'];
$idGroup = $visualConsole['id_group']; $idGroup = $visualConsole['id_group'];
$background = $visualConsole['background']; $background = $visualConsole['background'];
$background_color = $visualConsole['background_color'];
$width = $visualConsole['width'];
$height = $visualConsole['height'];
break; break;
} }
break; break;
@ -295,6 +308,7 @@ switch ($activeTab) {
//Update background //Update background
$background = get_parameter('background'); $background = get_parameter('background');
$background_color = get_parameter('background_color');
$width = get_parameter('width'); $width = get_parameter('width');
$height = get_parameter('height'); $height = get_parameter('height');
@ -307,6 +321,7 @@ switch ($activeTab) {
db_process_sql_update('tlayout', db_process_sql_update('tlayout',
array('background' => $background, array('background' => $background,
'background_color' => $background_color,
'width' => $width, 'width' => $width,
'height' => $height), 'height' => $height),
array('id' => $idVisualConsole)); array('id' => $idVisualConsole));
@ -378,11 +393,16 @@ switch ($activeTab) {
case 'wizard': case 'wizard':
$visualConsoleName = $visualConsole['name']; $visualConsoleName = $visualConsole['name'];
$background = $visualConsole['background']; $background = $visualConsole['background'];
$fonts = get_parameter ('fonts');
$fontf = get_parameter ('fontf');
switch ($action) { switch ($action) {
case 'update': case 'update':
$id_agents = get_parameter ('id_agents', array ()); $id_agents = get_parameter ('id_agents', array ());
$name_modules = get_parameter ('module', array ()); $name_modules = get_parameter ('module', array ());
$type = (int)get_parameter('type', STATIC_GRAPH); $type = (int)get_parameter('type', STATIC_GRAPH);
$image = get_parameter ('image'); $image = get_parameter ('image');
$range = (int) get_parameter ("range", 50); $range = (int) get_parameter ("range", 50);
@ -449,7 +469,7 @@ switch ($activeTab) {
$enable_link, $enable_link,
$id_server, $id_server,
$kind_relationship, $kind_relationship,
$item_in_the_map); $item_in_the_map,$fontf,$fonts);
$statusProcessInDB = array('flag' => true, $statusProcessInDB = array('flag' => true,
'message' => $message); 'message' => $message);
@ -516,7 +536,7 @@ switch ($activeTab) {
$enable_link, $enable_link,
$id_server, $id_server,
$kind_relationship, $kind_relationship,
$item_in_the_map); $item_in_the_map,$fontf,$fonts);
} }
@ -574,7 +594,7 @@ switch ($activeTab) {
$enable_link, $enable_link,
$id_server, $id_server,
$kind_relationship, $kind_relationship,
$item_in_the_map); $item_in_the_map,$fontf,$fonts);
} }

View File

@ -136,6 +136,22 @@ $table->data["staticgraph_modulegraph"][1] = __('Width').': ' .
$table->data["staticgraph_modulegraph"][1] .= '&nbsp;&nbsp;&nbsp;' . $table->data["staticgraph_modulegraph"][1] .= '&nbsp;&nbsp;&nbsp;' .
__('Height') . ': ' . __('Height') . ': ' .
html_print_input_text('height', 0, '', 5, 5, true); html_print_input_text('height', 0, '', 5, 5, true);
$fontf = array('comic sans ms' => 'comic sans ms');
$table->rowstyle['all_9'] = 'display: none;';
$table->data['all_9'][0] = __('Font');
$table->colspan['all_9'][1] = "3";
$table->data["all_9"][1] = html_print_select($fontf,
'fontf', '', '', '', '', true);
$fonts = array('4pt' => '4pt','6pt' => '6pt','8pt' => '8pt','14pt' => '14pt','24pt' => '24pt','36pt' => '36pt','72pt' => '72pt','96pt' => '96pt','128pt' => '128pt','154pt' => '154pt','196pt' => '196pt');
$table->rowstyle['all_10'] = 'display: none;';
$table->data['all_10'][0] = __('Font size');
$table->colspan['all_10'][1] = "3";
$table->data["all_10"][1] = html_print_select($fonts,
'fonts', '', '', '', '', true);
$table->rowstyle["modulegraph_simplevalue"] = 'display: none;'; $table->rowstyle["modulegraph_simplevalue"] = 'display: none;';

View File

@ -129,6 +129,7 @@ $line_color = get_parameter('line_color', '');
$get_element_status = get_parameter('get_element_status', 0); $get_element_status = get_parameter('get_element_status', 0);
$enable_link = get_parameter('enable_link', 1); $enable_link = get_parameter('enable_link', 1);
$type_graph = get_parameter('type_graph', 'area');
switch ($action) { switch ($action) {
case 'get_font': case 'get_font':
@ -394,6 +395,7 @@ switch ($action) {
// In Graphs, background color is stored in column image (sorry) // In Graphs, background color is stored in column image (sorry)
if ($type == 'module_graph') { if ($type == 'module_graph') {
$values['image'] = $background_color; $values['image'] = $background_color;
$values['type_graph'] = $type_graph;
} }
switch ($type) { switch ($type) {
@ -574,6 +576,7 @@ switch ($action) {
break; break;
case 'module_graph': case 'module_graph':
unset($values['image']); unset($values['image']);
unset($values['type_graph']);
break; break;
case 'box_item': case 'box_item':
unset($values['border_width']); unset($values['border_width']);
@ -773,6 +776,8 @@ switch ($action) {
$values['id_layout_linked'] = $map_linked; $values['id_layout_linked'] = $map_linked;
$values['parent_item'] = $parent; $values['parent_item'] = $parent;
$values['enable_link'] = $enable_link; $values['enable_link'] = $enable_link;
$values['image'] = $background_color;
$values['type_graph'] = $type_graph;
$values['id_custom_graph'] = $id_custom_graph; $values['id_custom_graph'] = $id_custom_graph;

View File

@ -484,7 +484,7 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events,
$show_alerts = false, $avg_only = 0, $date = 0, $unit = '', $show_alerts = false, $avg_only = 0, $date = 0, $unit = '',
$baseline = 0, $return_data = 0, $show_title = true, $projection = false, $baseline = 0, $return_data = 0, $show_title = true, $projection = false,
$adapt_key = '', $compare = false, $series_suffix = '', $series_suffix_str = '', $adapt_key = '', $compare = false, $series_suffix = '', $series_suffix_str = '',
$show_unknown = false, $percentil = null, $dashboard = false, $vconsole = false) { $show_unknown = false, $percentil = null, $dashboard = false, $vconsole = false,$type_graph='area') {
global $config; global $config;
global $chart; global $chart;
@ -771,7 +771,7 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
$only_image = false, $homeurl = '', $ttl = 1, $projection = false, $only_image = false, $homeurl = '', $ttl = 1, $projection = false,
$adapt_key = '', $compare = false, $show_unknown = false, $adapt_key = '', $compare = false, $show_unknown = false,
$menu = true, $backgroundColor = 'white', $percentil = null, $menu = true, $backgroundColor = 'white', $percentil = null,
$dashboard = false, $vconsole = false) { $dashboard = false, $vconsole = false,$type_graph = 'area') {
global $config; global $config;
global $graphic_type; global $graphic_type;
@ -802,7 +802,7 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
$show_alerts, $avg_only, $date-$period, $unit, $baseline, $show_alerts, $avg_only, $date-$period, $unit, $baseline,
$return_data, $show_title, $projection, $adapt_key, $return_data, $show_title, $projection, $adapt_key,
$compare, $series_suffix, $series_suffix_str, $compare, $series_suffix, $series_suffix_str,
$show_unknown, $percentil, $dashboard, $vconsole); $show_unknown, $percentil, $dashboard, $vconsole,$type_graph);
switch ($compare) { switch ($compare) {
case 'separated': case 'separated':
@ -835,7 +835,7 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
$show_alerts, $avg_only, $show_alerts, $avg_only,
$date, $unit, $baseline, $return_data, $show_title, $date, $unit, $baseline, $return_data, $show_title,
$projection, $adapt_key, $compare, '', '', $show_unknown, $projection, $adapt_key, $compare, '', '', $show_unknown,
$percentil, $dashboard, $vconsole); $percentil, $dashboard, $vconsole,$type_graph);
if ($return_data) { if ($return_data) {
@ -865,7 +865,7 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false)); 'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false));
} }
if ($config['type_module_charts'] === 'area') { if ($type_graph === 'area') {
if ($compare === 'separated') { if ($compare === 'separated') {
return return
area_graph($flash_chart, $chart, $width, $height/2, $color, area_graph($flash_chart, $chart, $width, $height/2, $color,
@ -899,7 +899,7 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
$backgroundColor, $dashboard, $vconsole, $agent_module_id); $backgroundColor, $dashboard, $vconsole, $agent_module_id);
} }
} }
elseif ($config['type_module_charts'] === 'line') { elseif ($type_graph === 'line') {
if ($compare === 'separated') { if ($compare === 'separated') {
return return
line_graph($flash_chart, $chart, $width, $height/2, $color, line_graph($flash_chart, $chart, $width, $height/2, $color,
@ -3931,7 +3931,7 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events,
'url' => ui_get_full_url("/images/logo_vertical_water.png", 'url' => ui_get_full_url("/images/logo_vertical_water.png",
false, false, false)); false, false, false));
if ($config['type_module_charts'] === 'area') { if ($type_graph === 'area') {
if ($compare === 'separated') { if ($compare === 'separated') {
return area_graph($flash_chart, $chart, $width, $height/2, $color, $legend, return area_graph($flash_chart, $chart, $width, $height/2, $color, $legend,
$long_index, ui_get_full_url("images/image_problem.opaque.png", false, false, false), $long_index, ui_get_full_url("images/image_problem.opaque.png", false, false, false),
@ -3953,7 +3953,7 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events,
$chart_extra_data, 0, 0, $adapt_key, false, $series_suffix_str, $menu); $chart_extra_data, 0, 0, $adapt_key, false, $series_suffix_str, $menu);
} }
} }
elseif ($config['type_module_charts'] === 'line') { elseif ($type_graph === 'line') {
if ($compare === 'separated') { if ($compare === 'separated') {
return return
line_graph($flash_chart, $chart, $width, $height/2, $color, line_graph($flash_chart, $chart, $width, $height/2, $color,
@ -4499,7 +4499,7 @@ function grafico_modulo_string ($agent_module_id, $period, $show_events,
'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false)); 'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false));
} }
if ($config['type_module_charts'] === 'area') { if ($type_graph === 'area') {
return area_graph($flash_chart, $chart, $width, $height, $color, return area_graph($flash_chart, $chart, $width, $height, $color,
$legend, array(), '', "", $unit, $homeurl, $legend, array(), '', "", $unit, $homeurl,
$water_mark, $config['fontpath'], $config['font_size'], $unit, $water_mark, $config['fontpath'], $config['font_size'], $unit,

View File

@ -105,6 +105,7 @@ function visual_map_print_item($mode = "read", $layoutData,
$id_module = $layoutData['id_agente_modulo']; $id_module = $layoutData['id_agente_modulo'];
$type = $layoutData['type']; $type = $layoutData['type'];
$period = $layoutData['period']; $period = $layoutData['period'];
$type_graph = $layoutData['type_graph'];
$border_width = $layoutData['border_width']; $border_width = $layoutData['border_width'];
$border_color = $layoutData['border_color']; $border_color = $layoutData['border_color'];
$fill_color = $layoutData['fill_color']; $fill_color = $layoutData['fill_color'];
@ -772,7 +773,7 @@ function visual_map_print_item($mode = "read", $layoutData,
// Show only avg on the visual console // Show only avg on the visual console
$img = custom_graphs_print( $img = custom_graphs_print(
$layoutData['id_custom_graph'], $height, $width, $layoutData['id_custom_graph'], $height, $width,
$period, null, true, 0, $only_image, $layoutData['image'], $period, null, true, 0, false, $layoutData['image'],
array(), '', array(), array(), true, array(), '', array(), array(), true,
false, false, true, 1, false, true); false, false, true, 1, false, true);
} }
@ -782,10 +783,10 @@ function visual_map_print_item($mode = "read", $layoutData,
else else
$homeurl = ''; $homeurl = '';
$img = grafico_modulo_sparse($id_module, $period, 0, $width, $img = grafico_modulo_sparse($id_module, $period, 0,$width,$height,
$height, '', null, false, 1, false, 0, '', 0, 0, '',null,
true, $only_image, $homeurl, 1, false, '', false, false, false, false, 1, false, 0, '', 0, 0, true, false, '', 1, false,
$layoutData['image'], null, false, true); '', false, false, false, $layoutData['image'], null, true, false,$type_graph);
} }
//Restore db connection //Restore db connection
@ -881,8 +882,7 @@ function visual_map_print_item($mode = "read", $layoutData,
case GROUP_ITEM: case GROUP_ITEM:
echo "<div>"; echo "<div>";
if ($layoutData['image'] != null) { if ($layoutData['image'] != null) {
$img_style_title = strip_tags($label); $img_style_title = strip_tags($label);
if ($layoutData['type'] == STATIC_GRAPH) { if ($layoutData['type'] == STATIC_GRAPH) {
@ -1306,7 +1306,7 @@ function visual_map_process_wizard_add_modules ($id_modules, $image,
$process_value, $percentileitem_width, $max_value, $type_percentile, $process_value, $percentileitem_width, $max_value, $type_percentile,
$value_show, $label_type, $type, $enable_link = true, $value_show, $label_type, $type, $enable_link = true,
$id_server = 0, $kind_relationship = VISUAL_MAP_WIZARD_PARENTS_NONE, $id_server = 0, $kind_relationship = VISUAL_MAP_WIZARD_PARENTS_NONE,
$item_in_the_map = 0) { $item_in_the_map = 0,$fontf = 'arial',$fonts = '12pt') {
if (empty ($id_modules)) { if (empty ($id_modules)) {
$return = ui_print_error_message( $return = ui_print_error_message(
@ -1345,15 +1345,15 @@ function visual_map_process_wizard_add_modules ($id_modules, $image,
default: default:
$agent_label = ui_print_truncate_text(agents_get_name ($id_agent), 'agent_small', false, true, false, '…', false); $agent_label = ui_print_truncate_text(agents_get_name ($id_agent), 'agent_small', false, true, false, '…', false);
$module_label = ui_print_truncate_text(modules_get_agentmodule_name($id_module), 'module_small', false, true, false, '…', false); $module_label = ui_print_truncate_text(modules_get_agentmodule_name($id_module), 'module_small', false, true, false, '…', false);
$label = $agent_label . " - " . $module_label; $label = '<p><span class="visual_font_size_'.$fonts.'" style="font-family:'.$fontf.';">'.$agent_label . " - " . $module_label.'</span></p>';
break; break;
case 'module': case 'module':
$module_label = ui_print_truncate_text(modules_get_agentmodule_name($id_module), 'module_small', false, true, false, '…', false); $module_label = ui_print_truncate_text(modules_get_agentmodule_name($id_module), 'module_small', false, true, false, '…', false);
$label = $module_label; $label = '<p><span class="visual_font_size_'.$fonts.'" style="font-family:'.$fontf.';">'.$module_label.'</span></p>';
break; break;
case 'agent': case 'agent':
$agent_label = ui_print_truncate_text(agents_get_name ($id_agent), 'agent_small', false, true, false, '…', false); $agent_label = ui_print_truncate_text(agents_get_name ($id_agent), 'agent_small', false, true, false, '…', false);
$label = $agent_label; $label = '<p><span class="visual_font_size_'.$fonts.'" style="font-family:'.$fontf.';">'.$agent_label.'</span></p>';
break; break;
case 'none': case 'none':
$label = ''; $label = '';
@ -1453,7 +1453,7 @@ function visual_map_process_wizard_add_agents ($id_agents, $image,
$process_value, $percentileitem_width, $max_value, $type_percentile, $process_value, $percentileitem_width, $max_value, $type_percentile,
$value_show, $label_type, $type, $enable_link = 1, $id_server = 0, $value_show, $label_type, $type, $enable_link = 1, $id_server = 0,
$kind_relationship = VISUAL_MAP_WIZARD_PARENTS_NONE, $kind_relationship = VISUAL_MAP_WIZARD_PARENTS_NONE,
$item_in_the_map = 0) { $item_in_the_map = 0,$fontf = 'arial',$fonts = '12pt') {
global $config; global $config;
@ -2049,7 +2049,7 @@ function visual_map_print_visual_map ($id_layout, $show_links = true,
echo "<div style='width: 920px; overflow:auto; margin: 0 auto;'>"; echo "<div style='width: 920px; overflow:auto; margin: 0 auto;'>";
} }
echo '<div id="background_'.$id_layout.'" echo '<div style="background-color:'.$layout["background_color"].';"><div id="background_'.$id_layout.'"
style="margin:0px auto; style="margin:0px auto;
text-align:center; text-align:center;
z-index: 0; z-index: 0;
@ -2108,7 +2108,7 @@ function visual_map_print_visual_map ($id_layout, $show_links = true,
} }
// End main div // End main div
echo "</div>"; echo "</div></div>";

View File

@ -254,7 +254,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
'percentile_bar', 'percentile_item', 'module_graph', 'percentile_bar', 'percentile_item', 'module_graph',
'simple_value', 'datos'); 'simple_value', 'datos');
$form_items['agent_row']['html'] = '<td align="left">' . $form_items['agent_row']['html'] = '<td align="left">' .
__('Agent') . '</td>'; __('Agent') . '</td>';
$params = array(); $params = array();
$params['return'] = true; $params['return'] = true;
$params['show_helptip'] = true; $params['show_helptip'] = true;
@ -291,6 +291,18 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
<td align="left">' . <td align="left">' .
html_print_select(array(), 'module', '', '', __('Any'), 0, true) . html_print_select(array(), 'module', '', '', __('Any'), 0, true) .
'</td>'; '</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']); $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"))

View File

@ -2374,6 +2374,25 @@ span#plugin_description {
.visual_font_size_72pt, .visual_font_size_72pt > em, .visual_font_size_72pt > strong, .visual_font_size_72pt > strong > span, .visual_font_size_72pt > span { .visual_font_size_72pt, .visual_font_size_72pt > em, .visual_font_size_72pt > strong, .visual_font_size_72pt > strong > span, .visual_font_size_72pt > span {
font-size: 72pt !important; font-size: 72pt !important;
} }
.visual_font_size_96pt, .visual_font_size_96pt > em, .visual_font_size_96pt > strong, .visual_font_size_96pt > strong > span, .visual_font_size_96pt > span {
font-size: 96pt !important;
}
.visual_font_size_128pt, .visual_font_size_128pt > em, .visual_font_size_128pt > strong, .visual_font_size_128pt > strong > span, .visual_font_size_128pt > span {
font-size: 128pt !important;
}
.visual_font_size_154pt, .visual_font_size_154pt > em, .visual_font_size_154pt > strong, .visual_font_size_154pt > strong > span, .visual_font_size_154pt > span {
font-size: 154pt !important;
}
.visual_font_size_196pt, .visual_font_size_196pt > em, .visual_font_size_196pt > strong, .visual_font_size_196pt > strong > span, .visual_font_size_196pt > span {
font-size: 196pt !important;
}
.resize_visual_font_size_8pt, .resize_visual_font_size_8pt > em, .resize_visual_font_size_8pt > strong, .resize_visual_font_size_8pt > strong > span, .resize_visual_font_size_8pt > span { .resize_visual_font_size_8pt, .resize_visual_font_size_8pt > em, .resize_visual_font_size_8pt > strong, .resize_visual_font_size_8pt > strong > span, .resize_visual_font_size_8pt > span {
font-size: 4pt !important; font-size: 4pt !important;
} }

View File

@ -204,7 +204,7 @@ if ($config['pure']) {
<?php <?php
} }
else { else {
visual_map_print_visual_map ($id_layout, true, true, null, null, '', false, $graph_javascript); visual_map_print_visual_map ($id_layout, true, true, null, null, '', false, $graph_javascript, true);
} }
ui_require_javascript_file('wz_jsgraphics'); ui_require_javascript_file('wz_jsgraphics');