changeset 311:90b5bc463550 refactoring

error reporting
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 19 Jun 2019 11:59:12 +0200
parents dcaf234698a3
children 7e20ee7bea37
files Resources/CMake/JavaScriptLibraries.cmake WebApplication/app.js WebApplication/index.html
diffstat 3 files changed, 35 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/Resources/CMake/JavaScriptLibraries.cmake	Wed Jun 19 09:08:42 2019 +0200
+++ b/Resources/CMake/JavaScriptLibraries.cmake	Wed Jun 19 11:59:12 2019 +0200
@@ -140,7 +140,9 @@
 file(COPY
   ${BABEL_POLYFILL_SOURCES_DIR}/polyfill.min.js
   ${BOOTSTRAP_VUE_SOURCES_DIR}/dist/bootstrap-vue.min.js
+  ${BOOTSTRAP_VUE_SOURCES_DIR}/dist/bootstrap-vue.min.js.map
   ${CMAKE_CURRENT_BINARY_DIR}/axios-0.19.0/dist/axios.min.js
+  ${CMAKE_CURRENT_BINARY_DIR}/axios-0.19.0/dist/axios.min.map
   ${CMAKE_CURRENT_BINARY_DIR}/bootstrap-4.3.1/dist/js/bootstrap.min.js
   ${CMAKE_CURRENT_BINARY_DIR}/vue-2.6.10/dist/vue.min.js
   DESTINATION
@@ -149,8 +151,10 @@
 
 file(COPY
   ${BOOTSTRAP_VUE_SOURCES_DIR}/dist/bootstrap-vue.min.css
+  ${BOOTSTRAP_VUE_SOURCES_DIR}/dist/bootstrap-vue.min.css.map
   ${CMAKE_CURRENT_BINARY_DIR}/Font-Awesome-4.7.0/css/font-awesome.min.css
   ${CMAKE_CURRENT_BINARY_DIR}/bootstrap-4.3.1/dist/css/bootstrap.min.css
+  ${CMAKE_CURRENT_BINARY_DIR}/bootstrap-4.3.1/dist/css/bootstrap.min.css.map
   DESTINATION
   ${JAVASCRIPT_LIBS_DIR}/css
   )
--- a/WebApplication/app.js	Wed Jun 19 09:08:42 2019 +0200
+++ b/WebApplication/app.js	Wed Jun 19 11:59:12 2019 +0200
@@ -175,13 +175,16 @@
       if ('accessionNumber' in app.lookup) {
         args[DICOM_TAG_ACCESSION_NUMBER] = app.lookup.accessionNumber;
       }
-
+      
       axios
         .post('../../servers/' + app.lookup.server + '/qido', {
           'Uri' : '/studies',
           'Arguments' : args,
         })
-        .then(app.SetStudies);
+        .then(app.SetStudies)
+        .catch(response => {
+          app.$refs['modal-error'].show();
+        })
     },
     Clear: function() {
       app.lookup = {};
@@ -202,7 +205,10 @@
           'Uri' : '/studies',
           'Arguments' : { 'limit' : (app.maxResults + 1).toString() }
         })
-        .then(app.SetStudies);
+        .then(app.SetStudies)
+        .catch(response => {
+          app.$refs['modal-error'].show();
+        });
     },
     OnLookup: function(event) {
       event.preventDefault();
@@ -231,7 +237,10 @@
           'Level': 'Study',
           'StudyInstanceUID': app.studyToDelete[DICOM_TAG_STUDY_INSTANCE_UID].Value
         })
-        .then(app.ExecuteLookup);
+        .then(app.ExecuteLookup)
+        .catch(response => {
+          app.$refs['modal-error'].show();
+        })
     },
 
     
@@ -297,7 +306,7 @@
               .finally(function() {
                 app.$refs['series-preview'].show();
               })
-        });
+        })
     },
     ConfirmDeleteSeries: function(series) {
       app.seriesToDelete = series;
@@ -310,7 +319,10 @@
           'StudyInstanceUID': app.currentStudy,
           'SeriesInstanceUID': app.seriesToDelete[DICOM_TAG_SERIES_INSTANCE_UID].Value
         })
-        .then(app.LoadSeriesOfCurrentStudy);
+        .then(app.LoadSeriesOfCurrentStudy)
+        .catch(response => {
+          app.$refs['modal-error'].show();
+        })
     }
   },
 
--- a/WebApplication/index.html	Wed Jun 19 09:08:42 2019 +0200
+++ b/WebApplication/index.html	Wed Jun 19 11:59:12 2019 +0200
@@ -60,7 +60,18 @@
       </div>
 
 
+      <b-modal ref="modal-error" size="xl" ok-only="true">
+        <template slot="modal-title">
+          Connection error
+        </template>
+        <div class="d-block">
+          <p>
+            There was an error connecting to "{{lookup.server}}" server.
+          </p>
+        </div>
+      </b-modal>
 
+      
       <!-- LOOKUP -->
 
       <div class="row">
@@ -116,7 +127,7 @@
             <b-button title="Retrieve study using WADO-RS"><i class="fa fa-cloud-download"></i></b-button>
             <b-button @click="ConfirmDeleteStudy(data.item)"
                       v-if="serversInfo[lookup.server].HasDelete" title="Delete remote study">
-              <i class="fa fa-times"></i>
+              <i class="fa fa-trash"></i>
             </b-button>
           </template>
         </b-table>
@@ -163,7 +174,7 @@
             <b-button title="Retrieve series using WADO-RS"><i class="fa fa-cloud-download"></i></b-button>
             <b-button @click="ConfirmDeleteSeries(data.item)"
                       v-if="serversInfo[lookup.server].HasDelete" title="Delete remote series">
-              <i class="fa fa-times"></i>
+              <i class="fa fa-trash"></i>
             </b-button>
           </template>
         </b-table>