Mercurial > gemma
changeset 5659:f20cfafaedf5 fix_wait-retry_check
Fixed check for waitRetry in schedule configuration.
author | Sascha Wilde <wilde@sha-bang.de> |
---|---|
date | Fri, 27 Oct 2023 16:48:08 +0200 |
parents | f1f3ba19207e |
children | dd20ee7cc9d8 |
files | client/src/components/importconfiguration/ScheduledImports.vue |
diffstat | 1 files changed, 11 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 Fri Oct 27 16:48:08 2023 +0200 @@ -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,15 @@ } }, methods: { + checkMinimum() { + if (m = /^\s*((\d+)h)?\s*((\d+)m)?\s*((\d+)s)?\s*$/.exec(this.waitRetry)) { + 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"); },