changeset 4749:1a061bc2d6ca

Clicking on "Send to remote modality" displays the job information to monitor progress
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 08 Jul 2021 14:57:21 +0200
parents 4336642b8cff
children 56ed4c11fc2a b3957ddd88f1
files NEWS OrthancServer/OrthancExplorer/explorer.js
diffstat 2 files changed, 19 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Thu Jul 08 14:42:20 2021 +0200
+++ b/NEWS	Thu Jul 08 14:57:21 2021 +0200
@@ -1,6 +1,11 @@
 Pending changes in the mainline
 ===============================
 
+Orthanc Explorer
+----------------
+
+* Clicking on "Send to remote modality" displays the job information to monitor progress
+
 
 Version 1.9.5 (2021-07-08)
 ==========================
--- a/OrthancServer/OrthancExplorer/explorer.js	Thu Jul 08 14:42:20 2021 +0200
+++ b/OrthancServer/OrthancExplorer/explorer.js	Thu Jul 08 14:57:21 2021 +0200
@@ -1260,19 +1260,23 @@
     }
 
     if (url != '') {
+      /**
+       * In Orthanc <= 1.9.5, synchronous job was used, which caused a
+       * non-intuitive behavior because of AJAX timeouts on large
+       * studies. We now use an asynchronous call.
+       * https://groups.google.com/g/orthanc-users/c/r2LoAp72AWI/m/cVaFXopUBAAJ
+       **/
       $.ajax({
         url: url,
         type: 'POST',
-        dataType: 'text',
-        data: pageData.uuid,
-        async: true,  // Necessary to block UI
-        beforeSend: function() {
-          $.blockUI({ message: $(loading) });
-        },
-        complete: function(s) {
-          $.unblockUI();
-        },
-        success: function(s) {
+        data: JSON.stringify({
+          'Synchronous' : false,
+          'Resources' : [ pageData.uuid ]
+        }),
+        dataType: 'json',
+        async: false,
+        success: function(job) {
+          window.location.assign('explorer.html#job?uuid=' + job.ID);
         },
         error: function() {
           alert('Error during store');