diff OrthancServer/OrthancExplorer/explorer.js @ 4750:56ed4c11fc2a openssl-3.x

integration mainline->openssl-3.x
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 08 Jul 2021 14:58:18 +0200
parents c1d6ce00be3f 1a061bc2d6ca
children b2417ac5055a
line wrap: on
line diff
--- a/OrthancServer/OrthancExplorer/explorer.js	Tue Jul 06 09:54:14 2021 +0200
+++ b/OrthancServer/OrthancExplorer/explorer.js	Thu Jul 08 14:58:18 2021 +0200
@@ -1248,19 +1248,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');