changeset 5662:949f399d0e71

Merged fix_wait-retry_check
author Sascha Wilde <wilde@sha-bang.de>
date Wed, 29 Nov 2023 12:16:41 +0100
parents f1f3ba19207e (current diff) 216366f1067b (diff)
children a26d2afe0c01
files
diffstat 1 files changed, 18 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/importconfiguration/ScheduledImports.vue	Fri Oct 06 18:59:27 2023 +0200
+++ b/client/src/components/importconfiguration/ScheduledImports.vue	Wed Nov 29 12:16:41 2023 +0100
@@ -424,9 +424,8 @@
               </div>
               <div>
                 <input
-                  type="number"
-                  min="5"
                   :disabled="!retry"
+                  v-on:change="checkMinimum"
                   style="width:120px;"
                   v-model="waitRetry"
                   v-tooltip.bottom="ttWaitRetry"
@@ -680,7 +679,7 @@
         "Time between retries. Valid units are 's' , 'm' and 'h' "
       )}<div style="text-align:left;">${this.$gettext(
         "Examples:"
-      )}<ul><li>${this.$gettext("60 for 60 Seconds ")}
+      )}<ul><li>${this.$gettext("60s for 60 Seconds ")}
       </li><li> ${this.$gettext("30m for 30 Minutes")}</li><li> ${this.$gettext(
         "2h45m for for two hours and 45 Minutes"
       )}</li><li>${this.$gettext("At least 5 Seconds ")}
@@ -702,6 +701,22 @@
     }
   },
   methods: {
+    checkMinimum() {
+      let m = /^((\d+)h)?((\d+)m)?((\d+)s)?$/.exec(this.waitRetry);
+      if (m) {
+        let s = 0;
+        if (m[2]) {
+          s += m[2] * 3600;
+        }
+        if (m[4]) {
+          s += m[4] * 60;
+        }
+        if (m[6]) {
+          s += m[6];
+        }
+        if (s < 5) this.waitRetry = "5s";
+      }
+    },
     back() {
       this.$store.commit("importschedule/setListMode");
     },