fix syncronize using worker and add duration syncronize
This commit is contained in:
@@ -19,7 +19,16 @@ class SyncronizeTask {
|
||||
"table-import-datasources"
|
||||
);
|
||||
this.table = new gridjs.Grid({
|
||||
columns: ["ID", "Message", "Response", "Status", "Created"],
|
||||
columns: [
|
||||
"ID",
|
||||
"Message",
|
||||
"Response",
|
||||
"Status",
|
||||
"Started",
|
||||
"Duration",
|
||||
"Finished",
|
||||
"Created",
|
||||
],
|
||||
search: {
|
||||
server: {
|
||||
url: (prev, keyword) => `${prev}?search=${keyword}`,
|
||||
@@ -49,6 +58,9 @@ class SyncronizeTask {
|
||||
item.message,
|
||||
item.response_body,
|
||||
item.status,
|
||||
item.start_time,
|
||||
item.duration,
|
||||
item.finish_time,
|
||||
item.created_at,
|
||||
]),
|
||||
total: (data) => data.meta.total,
|
||||
@@ -148,8 +160,11 @@ class SyncronizeTask {
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error("Fetch error:", err);
|
||||
alert("An error occurred during synchronization" + err.message);
|
||||
this.toastMessage.innerText =
|
||||
err.message || "Failed to syncronize something wrong!";
|
||||
this.toast.show();
|
||||
button.disabled = false;
|
||||
spinner.classList.add("d-none");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user