mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-25 14:25:23 +00:00
fix: Add error handling in VariableCreateUpdateForm and wrap text in ItemValue
This commit is contained in:
@@ -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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -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>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user