diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 219c35f3f1..34ff4a0803 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2011-02-17 Miguel de Dios + + * godmode/reporting/visual_console_builder.editor.js, + godmode/reporting/visual_console_builder.editor.php: fixed the panel + propierties for icon in the edition and creation, now it haven't label color + and have preview icon and map link. + 2011-02-16 Juan Manuel Ramon * include/functions_alerts.php: New function get_alert_actions_filter. diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index d60c095a96..fbcfaf9fb0 100644 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -16,6 +16,7 @@ var openPropertiesPanel = false; var idItem = 0; var selectedItem = null; var lines = Array(); +var toolbuttonActive = null function showAdvanceOptions(close) { if ($("#advance_options").css('display') == 'none') { @@ -303,6 +304,8 @@ function actionClick() { activeToolboxButton('delete_item', false); if (creationItem != null) { + //Create a item + activeToolboxButton(creationItem, true); item = creationItem; $("#button_update_row").css('display', 'none'); @@ -311,7 +314,10 @@ function actionClick() { unselectAll(); } else if (selectedItem != null) { + //Edit a item + item = selectedItem; + toolbuttonActive = item; $("#button_create_row").css('display', 'none'); $("#button_update_row").css('display', ''); cleanFields(); @@ -349,8 +355,9 @@ function loadFieldsFromDB(item) { if (key == 'height') $("input[name=height]").val(val); if (key == 'label') $("input[name=label]").val(val); if (key == 'image') { + //Load image preview $("select[name=image]").val(val); - showPreviewStaticGraph(val); + showPreview(val); } if (key == 'pos_x') $("input[name=left]").val(val); if (key == 'pos_y') $("input[name=top]").val(val); @@ -442,6 +449,14 @@ function setAspectRatioBackground(side) { } function hiddenFields(item) { + //The method to hidden and show is + //a row have a id and multiple class + //then the steps is + //- hide the row with ... + // or hide ... + //- unhide the row with ... + // or ... + $(".title_panel_span").css('display', 'none'); $("#title_panel_span_" + item).css('display', 'inline'); @@ -1131,27 +1146,27 @@ function unselectAll() { function click2(id) { switch (id) { case 'static_graph': - creationItem = 'static_graph'; + toolbuttonActive = creationItem = 'static_graph'; actionClick(); break; case 'percentile_bar': - creationItem = 'percentile_bar'; + toolbuttonActive = creationItem = 'percentile_bar'; actionClick(); break; case 'module_graph': - creationItem = 'module_graph'; + toolbuttonActive = creationItem = 'module_graph'; actionClick(); break; case 'simple_value': - creationItem = 'simple_value'; + toolbuttonActive = creationItem = 'simple_value'; actionClick(); break; case 'label': - creationItem = 'label'; + toolbuttonActive = creationItem = 'label'; actionClick(); break; case 'icon': - creationItem = 'icon'; + toolbuttonActive = creationItem = 'icon'; actionClick(); break; @@ -1164,8 +1179,20 @@ function click2(id) { } } +function showPreview(image) { + switch (toolbuttonActive) { + case 'static_graph': + showPreviewStaticGraph(image); + break; + case 'icon': + showPreviewIcon(image); + break; + } +} + function showPreviewStaticGraph(staticGraph) { $("#preview").empty(); + $("#preview").css('text-align', 'right'); if (staticGraph != '') { imgBase = "images/console/icons/" + staticGraph; @@ -1175,3 +1202,13 @@ function showPreviewStaticGraph(staticGraph) { $("#preview").append(""); } } + +function showPreviewIcon(icon) { + $("#preview").empty(); + $("#preview").css('text-align', 'left'); + + if (icon != '') { + imgBase = "images/console/icons/" + icon; + $("#preview").append(""); + } +} diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.php b/pandora_console/godmode/reporting/visual_console_builder.editor.php index 2cef907d37..915d181b52 100644 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.php +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.php @@ -118,9 +118,9 @@ echo '