From 166adc21e4afa0f368476e71bc2131ef1a9c69a4 Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Wed, 12 Jun 2019 12:32:13 +0200 Subject: [PATCH] now you need put an agent or visual console, else you cant create or update a Static Grap --- .../visual_console_builder.editor.js | 111 ++++-------------- 1 file changed, 22 insertions(+), 89 deletions(-) diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index cb72ce58ce..e5f1377be1 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -1,5 +1,3 @@ -/* globals $ */ - // Pandora FMS - http://pandorafms.com // ================================================== // Copyright (c) 2005-2009 Artica Soluciones Tecnologicas @@ -33,8 +31,6 @@ var SIZE_GRID = 16; //Const the size (for width and height) of grid. var img_handler_start; var img_handler_end; -var default_cache_expiration = null; - function toggle_advance_options_palette(close) { if ($("#advance_options").css("display") == "none") { $("#advance_options").css("display", ""); @@ -254,7 +250,12 @@ function update_button_palette_callback() { var values = {}; values = readFields(); - + if (values["map_linked"] == 0) { + if (values["agent"] == "" || values["agent"] == "none") { + dialog_message("#message_alert_no_agent"); + return false; + } + } // TODO VALIDATE DATA switch (selectedItem) { case "background": @@ -678,17 +679,12 @@ function update_button_palette_callback() { return false; } } - var radio_value = $("input[name='radio_choice']:checked").val(); - if (values["agent"] == "" && radio_value == "module_graph") { - dialog_message("#message_alert_no_agent"); - return false; - } - if (values["module"] == 0 && radio_value == "module_graph") { + if (values["module"] == 0) { dialog_message("#message_alert_no_module"); return false; } - if (values["id_custom_graph"] == 0 && radio_value == "custom_graph") { - dialog_message("#message_alert_no_custom_graph"); + if (values["agent"] == "") { + dialog_message("#message_alert_no_agent"); return false; } if ($("input[name=width_module_graph]").val() == "") { @@ -1099,11 +1095,10 @@ function readFields() { var text = tinymce.get("text-label").getContent(); values["label"] = text; - values["percentile_label_color"] = $( - "input[name=percentile_label_color]" - ).val(); - if ($("input[name=percentile_label]").val().length > 0) { + values["percentile_label_color"] = $( + "input[name=percentile_label_color]" + ).val(); values["label"] = "