mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-09-27 03:49:19 +02:00
* godmode/agentes/configurar_agente.php: fixed the default value for "prediction_module" in tagente_module. * include/graphs/functions_flot.php, include/graphs/functions_pchart.php, include/graphs/functions_gd.php, include/graphs/functions_utils.php, include/javascript/pandora_alerts.js, include/javascript/pandora_modules.js, include/javascript/pandora_events.js, include/functions_network_components.php: cleaned source code style. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8535 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
29 lines
710 B
JavaScript
29 lines
710 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);
|
|
}
|