MQ exceptions, warning message on mq issues

This commit is contained in:
fbsanchez 2021-07-05 20:56:40 +02:00
parent f52d389327
commit 8365b47be7
2 changed files with 40 additions and 77 deletions

View File

@ -1,3 +1,4 @@
/* globals $, get_php_value, infoMessage */
/**
* -------------------------------------
* Connection Check
@ -97,62 +98,3 @@ function showConnectionMessage(conn = true, msg = "") {
infoMessage(data, "message_dialog_connection");
}
}
function infoMessage(data, idMsg) {
var title = data.title;
var err_messge = data.text;
if (idMsg == null) {
idMsg = uniqId();
}
if ($("#" + idMsg).length === 0) {
$("body").append('<div title="' + title + '" id="' + idMsg + '"></div>');
$("#" + idMsg).empty();
}
$("#err_msg").empty();
$("#err_msg").html("\n\n" + err_messge);
$("#" + idMsg)
.dialog({
height: 250,
width: 528,
opacity: 1,
modal: true,
position: {
my: "center",
at: "center",
of: window,
collision: "fit"
},
title: data.title,
buttons: [
{
class:
"ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-next",
text: "Retry",
click: function(e) {
handleConnection();
}
},
{
class:
"ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-cancel",
text: "Close",
click: function() {
$(this).dialog("close");
}
}
],
open: function(event, ui) {
$(".ui-widget-overlay").addClass("error-modal-opened");
},
close: function(event, ui) {
$(".ui-widget-overlay").removeClass("error-modal-opened");
closed = true;
}
})
.show();
}

View File

@ -577,6 +577,9 @@ function generalShowMsg(data, idMsg) {
function infoMessage(data, idMsg) {
var title = data.title;
var err_messge = data.text;
// False or null: Show all buttons and classic behaviour,
// if true, show an OK button and message from data.text.
var simple = data.simple;
if (idMsg == null) {
idMsg = uniqId();
@ -590,6 +593,41 @@ function infoMessage(data, idMsg) {
$("#err_msg").empty();
$("#err_msg").html("\n\n" + err_messge);
var buttons = [];
if (simple == null || simple == false) {
buttons = [
{
class:
"ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-next",
text: "Retry",
click: function(e) {
handleConnection();
}
},
{
class:
"ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-cancel",
text: "Close",
click: function() {
$(this).dialog("close");
}
}
];
} else {
$("#" + idMsg).append($("#err_msg"));
buttons = [
{
class:
"ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-next",
text: "Ok",
click: function(e) {
$("#" + idMsg).dialog("close");
}
}
];
}
$("#" + idMsg)
.dialog({
height: 250,
@ -603,24 +641,7 @@ function infoMessage(data, idMsg) {
collision: "fit"
},
title: data.title,
buttons: [
{
class:
"ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-next",
text: "Retry",
click: function(e) {
handleConnection();
}
},
{
class:
"ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-cancel",
text: "Close",
click: function() {
$(this).dialog("close");
}
}
],
buttons: buttons,
open: function(event, ui) {
$(".ui-widget-overlay").addClass("error-modal-opened");