2011-02-17 Miguel de Dios <miguel.dedios@artica.es>

* 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.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3889 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2011-02-17 10:34:29 +00:00
parent a3c8eac3a2
commit 9093ed51d6
3 changed files with 55 additions and 11 deletions

View File

@ -1,3 +1,10 @@
2011-02-17 Miguel de Dios <miguel.dedios@artica.es>
* 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 <juanmanuel.ramon@artica.es> 2011-02-16 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_alerts.php: New function get_alert_actions_filter. * include/functions_alerts.php: New function get_alert_actions_filter.

View File

@ -16,6 +16,7 @@ var openPropertiesPanel = false;
var idItem = 0; var idItem = 0;
var selectedItem = null; var selectedItem = null;
var lines = Array(); var lines = Array();
var toolbuttonActive = null
function showAdvanceOptions(close) { function showAdvanceOptions(close) {
if ($("#advance_options").css('display') == 'none') { if ($("#advance_options").css('display') == 'none') {
@ -303,6 +304,8 @@ function actionClick() {
activeToolboxButton('delete_item', false); activeToolboxButton('delete_item', false);
if (creationItem != null) { if (creationItem != null) {
//Create a item
activeToolboxButton(creationItem, true); activeToolboxButton(creationItem, true);
item = creationItem; item = creationItem;
$("#button_update_row").css('display', 'none'); $("#button_update_row").css('display', 'none');
@ -311,7 +314,10 @@ function actionClick() {
unselectAll(); unselectAll();
} }
else if (selectedItem != null) { else if (selectedItem != null) {
//Edit a item
item = selectedItem; item = selectedItem;
toolbuttonActive = item;
$("#button_create_row").css('display', 'none'); $("#button_create_row").css('display', 'none');
$("#button_update_row").css('display', ''); $("#button_update_row").css('display', '');
cleanFields(); cleanFields();
@ -349,8 +355,9 @@ function loadFieldsFromDB(item) {
if (key == 'height') $("input[name=height]").val(val); if (key == 'height') $("input[name=height]").val(val);
if (key == 'label') $("input[name=label]").val(val); if (key == 'label') $("input[name=label]").val(val);
if (key == 'image') { if (key == 'image') {
//Load image preview
$("select[name=image]").val(val); $("select[name=image]").val(val);
showPreviewStaticGraph(val); showPreview(val);
} }
if (key == 'pos_x') $("input[name=left]").val(val); if (key == 'pos_x') $("input[name=left]").val(val);
if (key == 'pos_y') $("input[name=top]").val(val); if (key == 'pos_y') $("input[name=top]").val(val);
@ -442,6 +449,14 @@ function setAspectRatioBackground(side) {
} }
function hiddenFields(item) { 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 <tr id="<id>">...</tr>
// or hide <tr class="title_panel_span">...</tr>
//- unhide the row with <tr id="<id>" class="<item> ...">...</tr>
// or <tr id="title_panel_span_<item>">...</tr>
$(".title_panel_span").css('display', 'none'); $(".title_panel_span").css('display', 'none');
$("#title_panel_span_" + item).css('display', 'inline'); $("#title_panel_span_" + item).css('display', 'inline');
@ -1131,27 +1146,27 @@ function unselectAll() {
function click2(id) { function click2(id) {
switch (id) { switch (id) {
case 'static_graph': case 'static_graph':
creationItem = 'static_graph'; toolbuttonActive = creationItem = 'static_graph';
actionClick(); actionClick();
break; break;
case 'percentile_bar': case 'percentile_bar':
creationItem = 'percentile_bar'; toolbuttonActive = creationItem = 'percentile_bar';
actionClick(); actionClick();
break; break;
case 'module_graph': case 'module_graph':
creationItem = 'module_graph'; toolbuttonActive = creationItem = 'module_graph';
actionClick(); actionClick();
break; break;
case 'simple_value': case 'simple_value':
creationItem = 'simple_value'; toolbuttonActive = creationItem = 'simple_value';
actionClick(); actionClick();
break; break;
case 'label': case 'label':
creationItem = 'label'; toolbuttonActive = creationItem = 'label';
actionClick(); actionClick();
break; break;
case 'icon': case 'icon':
creationItem = 'icon'; toolbuttonActive = creationItem = 'icon';
actionClick(); actionClick();
break; 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) { function showPreviewStaticGraph(staticGraph) {
$("#preview").empty(); $("#preview").empty();
$("#preview").css('text-align', 'right');
if (staticGraph != '') { if (staticGraph != '') {
imgBase = "images/console/icons/" + staticGraph; imgBase = "images/console/icons/" + staticGraph;
@ -1175,3 +1202,13 @@ function showPreviewStaticGraph(staticGraph) {
$("#preview").append("<img src='" + imgBase + ".png' />"); $("#preview").append("<img src='" + imgBase + ".png' />");
} }
} }
function showPreviewIcon(icon) {
$("#preview").empty();
$("#preview").css('text-align', 'left');
if (icon != '') {
imgBase = "images/console/icons/" + icon;
$("#preview").append("<img src='" + imgBase + ".png' />");
}
}

View File

@ -118,9 +118,9 @@ echo '<div id="properties_panel" style="display: none; position: absolute; borde
</tr> </tr>
<tr id="image_row" style="" class="static_graph icon datos"> <tr id="image_row" style="" class="static_graph icon datos">
<td><?php echo __('Image');?></td> <td><?php echo __('Image');?></td>
<td><?php print_select ($images_list, 'image', '', 'showPreviewStaticGraph(this.value);', 'None', '');?></td> <td><?php print_select ($images_list, 'image', '', 'showPreview(this.value);', 'None', '');?></td>
</tr> </tr>
<tr id="preview_row" style="" class="static_graph datos"> <tr id="preview_row" style="" class="static_graph datos icon">
<td colspan="2" style="text-align: right;"><div id="preview" style="text-align: right;"></div></td> <td colspan="2" style="text-align: right;"><div id="preview" style="text-align: right;"></div></td>
</tr> </tr>
<tr id="agent_row" class="static_graph percentile_bar module_graph simple_value datos"> <tr id="agent_row" class="static_graph percentile_bar module_graph simple_value datos">
@ -232,7 +232,7 @@ echo '<div id="properties_panel" style="display: none; position: absolute; borde
?> ?>
</td> </td>
</tr> </tr>
<tr id="map_linked_row" class="static_graph percentile_bar module_graph simple_value label datos"> <tr id="map_linked_row" class="static_graph percentile_bar module_graph simple_value icon label datos">
<td><?php echo __('Map linked');?></td> <td><?php echo __('Map linked');?></td>
<td> <td>
<?php <?php
@ -240,7 +240,7 @@ echo '<div id="properties_panel" style="display: none; position: absolute; borde
?> ?>
</td> </td>
</tr> </tr>
<tr id="label_color_row" class="static_graph percentile_bar module_graph simple_value label icon datos"> <tr id="label_color_row" class="static_graph percentile_bar module_graph simple_value label datos">
<td><?php echo __('Label color');?></td> <td><?php echo __('Label color');?></td>
<td><?php print_input_text_extended ('label_color', '#000000', 'text-'.'label_color', '', 7, 7, false, '', 'class="label_color"', false);?></td> <td><?php print_input_text_extended ('label_color', '#000000', 'text-'.'label_color', '', 7, 7, false, '', 'class="label_color"', false);?></td>
</tr> </tr>