Etemplate: If long task response is an object, stringify the object so we can see what it says

This commit is contained in:
nathangray 2020-06-29 14:08:02 -06:00
parent b057f95a5a
commit 57d03110e4
2 changed files with 13 additions and 2 deletions

View File

@ -638,12 +638,17 @@ var et2_dialog = /** @class */ (function (_super) {
// Early exit
return;
default:
if (response) {
if (response && typeof response === "string") {
totals.success++;
jQuery("<div class='message'></div>")
.text(response)
.appendTo(log);
}
else {
jQuery("<div class='message error'></div>")
.text(JSON.stringify(response))
.appendTo(log);
}
}
// Scroll to bottom
var height = log[0].scrollHeight;

View File

@ -788,12 +788,18 @@ export class et2_dialog extends et2_widget {
// Early exit
return;
default:
if (response) {
if (response && typeof response === "string") {
totals.success++;
jQuery("<div class='message'></div>")
.text(response)
.appendTo(log);
}
else
{
jQuery("<div class='message error'></div>")
.text(JSON.stringify(response))
.appendTo(log);
}
}
// Scroll to bottom
let height = log[0].scrollHeight;