changeset 2998:adc8e9ccf706

imports: add tries and wait-retry to client
author Thomas Junk <thomas.junk@intevation.de>
date Wed, 10 Apr 2019 16:04:40 +0200
parents 707e1bc24d93
children b3c3c5b5b7c1
files client/src/components/importconfiguration/ImportDetails.vue client/src/components/importconfiguration/ScheduledImports.vue client/src/store/importschedule.js
diffstat 3 files changed, 49 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/importconfiguration/ImportDetails.vue	Wed Apr 10 15:22:35 2019 +0200
+++ b/client/src/components/importconfiguration/ImportDetails.vue	Wed Apr 10 16:04:40 2019 +0200
@@ -47,18 +47,18 @@
     </select>
     <ApprovedGaugeMeasurement
       v-if="Import === $options.IMPORTTYPES.APPROVEDGAUGEMEASUREMENTS"
-      class="mt-3"
+      class="mt-1"
     />
     <WaterwayProfiles
-      class="mt-3"
+      class="mt-1"
       v-if="Import === $options.IMPORTTYPES.WATERWAYPROFILES"
     />
     <SoundingResults
-      class="mt-3"
+      class="mt-1"
       v-if="Import === $options.IMPORTTYPES.SOUNDINGRESULTS"
     />
     <ScheduledImports
-      class="mt-3"
+      class="mt-1"
       v-if="Import && !isOnetime"
     ></ScheduledImports>
     <div v-if="!Import" class="d-flex flex-row w-100 mt-3">
--- a/client/src/components/importconfiguration/ScheduledImports.vue	Wed Apr 10 15:22:35 2019 +0200
+++ b/client/src/components/importconfiguration/ScheduledImports.vue	Wed Apr 10 16:04:40 2019 +0200
@@ -153,7 +153,7 @@
         <div class="flex-column mr-2">
           <div class="flex-row text-left">
             <small class="text-muted">
-              <translate>Simple schedule</translate>
+              <translate>Simple</translate>
             </small>
           </div>
           <div class="flex-flex-row text-left">
@@ -171,6 +171,38 @@
             />
           </div>
         </div>
+        <div class="ml-2 flex-column mr-2">
+          <div class="flex-row text-left">
+            <small class="text-muted">
+              <translate>Tries</translate>
+            </small>
+          </div>
+          <div>
+            <input
+              style="width:100px;"
+              :disabled="!scheduled"
+              v-model="trys"
+              class="ml-1 mr-1 form-control"
+              type="number"
+            />
+          </div>
+        </div>
+        <div class="flex-column mr-2">
+          <div class="flex-row text-left">
+            <small class="text-muted">
+              <translate>Wait to retry</translate>
+            </small>
+          </div>
+          <div>
+            <input
+              style="width:100px;"
+              :disabled="!scheduled"
+              v-model="waitRetry"
+              class="ml-1 mr-1 form-control"
+              type="number"
+            />
+          </div>
+        </div>
       </template>
     </div>
     <template v-if="!directImport || !directImportAvailable">
@@ -644,6 +676,8 @@
       this.depth = this.currentSchedule.depth;
       this.sourceOrganization = this.currentSchedule.sourceOrganization;
       this.directImport = false;
+      this.trys = this.currentSchedule.trys;
+      this.waitRetry = this.currentSchedule.waitRetry;
     },
     isWeekly(cron) {
       return /0 \d{1,2} \d{1,2} \* \* \d{1}/.test(cron);
@@ -833,7 +867,11 @@
         config["max-width"] = this.maxWidth;
         config["source-organization"] = this.sourceOrganization;
       }
-      if (this.scheduled) config["cron"] = cron;
+      if (this.scheduled) {
+        config["cron"] = cron;
+        if (this.waitRetry) config["wait-retry"] = Number(this.waitRetry);
+        if (this.trys) config["trys"] = Number(this.trys);
+      }
       config["send-email"] = this.eMailNotification;
       if (!this.id) {
         data["config"] = config;
--- a/client/src/store/importschedule.js	Wed Apr 10 15:22:35 2019 +0200
+++ b/client/src/store/importschedule.js	Wed Apr 10 16:04:40 2019 +0200
@@ -86,7 +86,9 @@
     minWidth: null,
     maxWidth: null,
     depth: null,
-    sourceOrganization: null
+    sourceOrganization: null,
+    trys: null,
+    waitRetry: null
   };
 };
 
@@ -141,7 +143,8 @@
       if (cron) {
         Vue.set(state.currentSchedule, "scheduled", true);
         Vue.set(state.currentSchedule, "cronString", cron);
-
+        Vue.set(state.currentSchedule, "trys", config["trys"]);
+        Vue.set(state.currentSchedule, "waitRetry", config["wait-retry"]);
         // simple weekly  or monthly?
         if (cron === "0 0 0 * * 0") {
           Vue.set(state.currentSchedule, "simple", "weekly");