Show client error on ES connection failure, fixes #13

This commit is contained in:
2019-12-21 20:52:16 -05:00
parent 0eefbac7b4
commit d051f541e2
6 changed files with 22 additions and 6 deletions

1
web/js/7_jquery.toast.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -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);
});
};