changeset 328:d74e12cfeba3

integration refactoring->mainline
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 21 Jun 2019 11:51:41 +0200
parents e694970cd263 (current diff) 39dd8b84b20f (diff)
children d1e1e2963c24
files
diffstat 5 files changed, 18 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/Plugin/DicomWebClient.cpp	Thu Jun 20 23:13:25 2019 +0200
+++ b/Plugin/DicomWebClient.cpp	Fri Jun 21 11:51:41 2019 +0200
@@ -86,7 +86,7 @@
     answer = Json::objectValue;
     answer["ID"] = jobId;
     answer["Path"] = OrthancPlugins::RemoveMultipleSlashes
-      ("../../" + OrthancPlugins::Configuration::GetOrthancApiRoot() + "/jobs/" + jobId);
+      ("../" + OrthancPlugins::Configuration::GetOrthancApiRoot() + "/jobs/" + jobId);
   }
 
   std::string s = answer.toStyledString();
--- a/Plugin/OrthancExplorer.js	Thu Jun 20 23:13:25 2019 +0200
+++ b/Plugin/OrthancExplorer.js	Fri Jun 21 11:51:41 2019 +0200
@@ -32,7 +32,7 @@
       }
 
       // Launch the dialog
-      $('#dialog').simpledialog2({
+      $(document).simpledialog2({
         mode: 'blank',
         animate: false,
         headerText: 'Choose target',
--- a/Plugin/Plugin.cpp	Thu Jun 20 23:13:25 2019 +0200
+++ b/Plugin/Plugin.cpp	Fri Jun 21 11:51:41 2019 +0200
@@ -559,7 +559,7 @@
           <ServeEmbeddedFolder<Orthanc::EmbeddedResources::JAVASCRIPT_LIBS> >
           (root + "app/libs/(.*)", true);
 
-        OrthancPlugins::RegisterRestCallback<GetClientInformation>(root + "app/info", true);
+        OrthancPlugins::RegisterRestCallback<GetClientInformation>(root + "info", true);
 
         OrthancPlugins::RegisterRestCallback<RetrieveInstanceRendered>(root + "studies/([^/]*)/series/([^/]*)/instances/([^/]*)/rendered", true);
 
--- a/WebApplication/app.js	Thu Jun 20 23:13:25 2019 +0200
+++ b/WebApplication/app.js	Fri Jun 21 11:51:41 2019 +0200
@@ -27,7 +27,7 @@
     }
   },
   data: {
-    orthancExplorerUri: '../../../',
+    orthancApiRoot: '../../../',
     previewFailure: true,
     preview: DEFAULT_PREVIEW,
     showTruncatedStudies: false,
@@ -136,9 +136,13 @@
         app.Clear();
       });
     axios
-      .get('../info')
+      .get('../../info')
       .then(response => {
-        app.orthancExplorerUri = response.data.OrthancApiRoot + '../../';
+        app.orthancApiRoot = response.data.OrthancApiRoot;
+        if (!app.orthancApiRoot.endsWith('/')) {
+          app.orthancApiRoot += '/';
+        }
+        app.orthancApiRoot += '../../';  // To be at the same level as "info"
       });
   },
   methods: {
@@ -247,15 +251,15 @@
       app.$refs['study-details'].show();
     },
     RetrieveStudy: function(study) {
+      var base = '../../servers/';
       axios
-        .post('../../servers/' + app.activeServer + '/wado', {
+        .post(base + app.activeServer + '/wado', {
           'Uri' : '/studies/' + study[DICOM_TAG_STUDY_INSTANCE_UID].Value
         })
         .then(response => {
           app.jobLevel = 'study';
           app.jobId = response.data.ID;
-          // The "replace()" below removes the possible trailing slash
-          app.jobUri = app.orthancExplorerUri.replace(/\/$/, '') + '/' + response.data.Path;
+          app.jobUri = base + response.data.Path;
           app.$refs['retrieve-job'].show();
           app.RefreshJobDetails();
         });
@@ -311,15 +315,16 @@
       app.$refs['series-details'].show();
     },
     RetrieveSeries: function(series) {
+      var base = '../../servers/';
       axios
-        .post('../../servers/' + app.activeServer + '/wado', {
+        .post(base + app.activeServer + '/wado', {
           'Uri' : ('/studies/' + app.currentStudy + 
                    '/series/' + series[DICOM_TAG_SERIES_INSTANCE_UID].Value)
         })
         .then(response => {
           app.jobLevel = 'series';
           app.jobId = response.data.ID;
-          app.jobUri = app.orthancExplorerUri + '/' + response.data.Path;
+          app.jobUri = base + response.data.Path;
           app.$refs['retrieve-job'].show();
           app.RefreshJobDetails();
         });
--- a/WebApplication/index.html	Thu Jun 20 23:13:25 2019 +0200
+++ b/WebApplication/index.html	Fri Jun 21 11:51:41 2019 +0200
@@ -38,7 +38,7 @@
               you can search the content of remote DICOMweb servers
               (QIDO-RS), then locally retrieve the DICOM
               studies/series of interest
-              (WADO-RS). <a :href="orthancExplorerUri"
+              (WADO-RS). <a :href="orthancApiRoot"
               target="_blank">Orthanc Explorer</a> can be used to send
               DICOM resources to remote DICOMweb servers (STOW-RS).
             </p>
@@ -47,7 +47,7 @@
                  href="https://book.orthanc-server.com/plugins/dicomweb.html"
                  target="_blank" role="button">Open documentation</a>
               <a class="btn btn-primary btn-lg"
-                 :href="orthancExplorerUri"
+                 :href="orthancApiRoot"
                  target="_blank" role="button">Open Orthanc Explorer</a>
             </p>
           </div>