mdtrooper 85c3f27936 2013-02-04 Miguel de Dios <miguel.dedios@artica.es>
* include/javascript/pandora_alerts.js: cleaned source code style.
	
	* include/functions_graph.php: added lost function
	"graph_events_validated".
	
	Fixes: #3603110




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7566 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-04 10:22:56 +00:00

28 lines
708 B
JavaScript

var original_command = "";
function parse_alert_command (command) {
var nfield = 1;
$('.fields').each(function() {
// Only render values different from ''
if ($(this).val() == '') {
return;
}
var field = '_field' + nfield+'_';
nfield++;
var regex = new RegExp(field,"gi");
command = command.replace (regex, $(this).val());
});
return command;
}
function render_command_preview (original_command) {
$("#textarea_command_preview").text (parse_alert_command (original_command));
}
function render_command_description (command_description) {
if(command_description != '') {
command_description = '<br>'+command_description;
}
$("#command_description").html(command_description);
}