fix: Add error handling in VariableCreateUpdateForm and wrap text in ItemValue

This commit is contained in:
wangruidong
2024-11-20 10:54:15 +08:00
committed by w940853815
parent 35e2273603
commit 03e07ee280
2 changed files with 10 additions and 6 deletions

View File

@@ -55,6 +55,7 @@ export default {
rules: [ rules: [
{ {
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
try {
const lines = value.split('\n') const lines = value.split('\n')
const regex = /^[^:]+:[^:]+$/ const regex = /^[^:]+:[^:]+$/
for (const line of lines) { for (const line of lines) {
@@ -62,6 +63,9 @@ export default {
callback(new Error(this.$t('ExtraArgsFormatError'))) callback(new Error(this.$t('ExtraArgsFormatError')))
} }
} }
} catch (e) {
callback(new Error(this.$t('ExtraArgsFormatError')))
}
callback() callback()
} }
} }

View File

@@ -92,7 +92,7 @@ export default {
) )
} }
return ( return (
<span title={this.displayValue}>{this.displayValue}</span> <span style='white-space: pre-wrap;' title={this.displayValue}>{this.displayValue}</span>
) )
} }
} }