Fixed error window in visual console

Former-commit-id: 757fb0daa0a56b517a88063dedbe5cbf51cdf73e
This commit is contained in:
Daniel Maya 2019-05-16 16:04:38 +02:00
parent 0173c856af
commit f1705af9f6
2 changed files with 19 additions and 5 deletions

View File

@ -674,12 +674,17 @@ function update_button_palette_callback() {
return false; return false;
} }
} }
if (values["module"] == 0) { 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") {
dialog_message("#message_alert_no_module"); dialog_message("#message_alert_no_module");
return false; return false;
} }
if (values["agent"] == "") { if (values["id_custom_graph"] == 0 && radio_value == "custom_graph") {
dialog_message("#message_alert_no_agent"); dialog_message("#message_alert_no_custom_graph");
return false; return false;
} }
if ($("input[name=width_module_graph]").val() == "") { if ($("input[name=width_module_graph]").val() == "") {
@ -1425,11 +1430,12 @@ function create_button_palette_callback() {
break; break;
case "module_graph": case "module_graph":
if (values["module"] == 0) { var radio_value = $("input[name='radio_choice']:checked").val();
if (values["module"] == 0 && radio_value == "module_graph") {
dialog_message("#message_alert_no_module"); dialog_message("#message_alert_no_module");
validate = false; validate = false;
} }
if (values["id_custom_graph"] == 0) { if (values["id_custom_graph"] == 0 && radio_value == "module_graph") {
if (values["agent"] == "") { if (values["agent"] == "") {
dialog_message("#message_alert_no_agent"); dialog_message("#message_alert_no_agent");
validate = false; validate = false;
@ -1439,6 +1445,10 @@ function create_button_palette_callback() {
validate = false; validate = false;
} }
} }
if (values["id_custom_graph"] == 0 && radio_value == "custom_graph") {
dialog_message("#message_alert_no_custom_graph");
validate = false;
}
if ( if (
values["height_module_graph"] == "" || values["height_module_graph"] == "" ||
values["height_module_graph"] == 0 values["height_module_graph"] == 0

View File

@ -1386,6 +1386,10 @@ function visual_map_editor_print_hack_translate_strings()
echo "<p style='text-align: center;font-weight: bold;'>".__('Could not be save.').'</p>'; echo "<p style='text-align: center;font-weight: bold;'>".__('Could not be save.').'</p>';
echo '</div>'; echo '</div>';
echo "<div id='message_alert_no_custom_graph' title='".__('Visual Console Builder Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('No custom graph defined.').'</p>';
echo '</div>';
} }