mirror of
https://github.com/simon987/sist2.git
synced 2025-12-12 06:58:54 +00:00
Show client error on ES connection failure, fixes #13
This commit is contained in:
1
web/js/7_jquery.toast.min.js
vendored
Normal file
1
web/js/7_jquery.toast.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -19,6 +19,19 @@ if (localStorage.getItem("mode") === null) {
|
||||
mode = localStorage.getItem("mode")
|
||||
}
|
||||
|
||||
function showEsError() {
|
||||
$.toast({
|
||||
heading: "Elasticsearch connection error",
|
||||
text: "sist2 web module encountered an error while connecting " +
|
||||
"to Elasticsearch. See server logs for more information.",
|
||||
stack: false,
|
||||
bgColor: "#a94442",
|
||||
textColor: "#f2dede",
|
||||
position: 'bottom-right',
|
||||
hideAfter: false
|
||||
});
|
||||
}
|
||||
|
||||
jQuery["jsonPost"] = function (url, data) {
|
||||
return jQuery.ajax({
|
||||
url: url,
|
||||
@@ -26,6 +39,7 @@ jQuery["jsonPost"] = function (url, data) {
|
||||
data: JSON.stringify(data),
|
||||
contentType: "application/json"
|
||||
}).fail(err => {
|
||||
showEsError();
|
||||
console.log(err);
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user