#12097 Fix view summary in discovery task

This commit is contained in:
miguel angel rasteu 2023-09-21 13:06:39 +02:00
parent 963664c1d8
commit 7d5f4f17c6
1 changed files with 21 additions and 7 deletions

View File

@ -25,7 +25,15 @@ function progress_task_list(id, title) {
draggable: true, draggable: true,
closeOnEscape: true, closeOnEscape: true,
width: 800, width: 800,
height: 600, height: "auto",
buttons: [
{
text: "OK",
click: function() {
$(this).dialog("close");
}
}
],
close: function() { close: function() {
if (xhr != null) xhr.abort(); if (xhr != null) xhr.abort();
if (timeoutRef != null) clearTimeout(timeoutRef); if (timeoutRef != null) clearTimeout(timeoutRef);
@ -35,12 +43,18 @@ function progress_task_list(id, title) {
// Function var. // Function var.
var handleFetchTaskList = function(err, data) { var handleFetchTaskList = function(err, data) {
if (err) { if (err) {
console.error(err); let err_text = err.toString();
err_text = err_text.replace("Error: ", "");
err_text =
"<b>Error</b><br/>" + err_text[0].toUpperCase() + err_text.substring(1);
$elem.html(err_text);
} }
if (data.error) { if (data) {
// TODO: Show info about the problem. data = data.replace(
$elem.html(data.error); '<script type="text/javascript" src="http://172.16.0.2/pandora_console/include/javascript/jquery.ui-timepicker-addon.js"></script>',
} else { ""
);
data = JSON.parse(data);
$elem.html(data.html); $elem.html(data.html);
} }
@ -71,7 +85,7 @@ function fetchTaskList(id, callback) {
}, },
type: "POST", type: "POST",
url: $("#ajax-url").val(), url: $("#ajax-url").val(),
dataType: "json", dataType: "text",
success: function(data) { success: function(data) {
callback(null, data); callback(null, data);
}, },