From b0d38d61915cc62edc8fe4a3e4f75d5470308ba4 Mon Sep 17 00:00:00 2001 From: wwx691809 Date: Sat, 20 Jun 2020 17:18:32 +0800 Subject: [PATCH] Judgment of adding infinite string --- mindinsight/ui/src/views/train-manage/scalar.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mindinsight/ui/src/views/train-manage/scalar.vue b/mindinsight/ui/src/views/train-manage/scalar.vue index edd9956..f4f287b 100644 --- a/mindinsight/ui/src/views/train-manage/scalar.vue +++ b/mindinsight/ui/src/views/train-manage/scalar.vue @@ -1869,7 +1869,7 @@ export default { } else if (valueFirst.indexOf(' ') > -1) { this.thresholdErrorMsg = this.$t('scalar.noSpace'); isValidate = false; - } else if (isNaN(valueFirst)) { + } else if (isNaN(valueFirst) || valueFirst.indexOf('Infinity') > -1) { this.thresholdErrorMsg = this.$t('scalar.placeHolderNumber'); isValidate = false; } @@ -1889,6 +1889,9 @@ export default { } else if (isNaN(valueFirst) || isNaN(valueSec)) { this.thresholdErrorMsg = this.$t('scalar.placeHolderNumber'); isValidate = false; + } else if (valueFirst.indexOf('Infinity') > -1 || valueSec.indexOf('Infinity') > -1) { + this.thresholdErrorMsg = this.$t('scalar.placeHolderNumber'); + isValidate = false; } else { if (this.thresholdRelational === this.$t('scalar.or')) { if ( -- GitLab