Merge pull request #433 from SuanmoSuanyangTechnology/feature/form_zy
fix(web): change string regExp
This commit is contained in:
@@ -455,6 +455,7 @@ export const en = {
|
|||||||
recommend: 'Recommend',
|
recommend: 'Recommend',
|
||||||
logoTip: `Supported image formats: JPG, PNG \n Suggested size: square ratio \n Maximum size: ≤ 2MB`,
|
logoTip: `Supported image formats: JPG, PNG \n Suggested size: square ratio \n Maximum size: ≤ 2MB`,
|
||||||
imageSquareRequired: 'Please upload a square image',
|
imageSquareRequired: 'Please upload a square image',
|
||||||
|
nameInvalid: 'Name cannot start or end with a space',
|
||||||
},
|
},
|
||||||
model: {
|
model: {
|
||||||
searchPlaceholder: 'search model…',
|
searchPlaceholder: 'search model…',
|
||||||
@@ -545,7 +546,6 @@ export const en = {
|
|||||||
xinference: "Xinference",
|
xinference: "Xinference",
|
||||||
gpustack: "Gpustack",
|
gpustack: "Gpustack",
|
||||||
bedrock: "Bedrock",
|
bedrock: "Bedrock",
|
||||||
nameInvalid: 'Model name can only contain letters, numbers, underscores and spaces, cannot be empty or pure whitespace',
|
|
||||||
},
|
},
|
||||||
modelNew: {
|
modelNew: {
|
||||||
group: 'Model Group',
|
group: 'Model Group',
|
||||||
|
|||||||
@@ -1034,6 +1034,7 @@ export const zh = {
|
|||||||
recommend: '推荐',
|
recommend: '推荐',
|
||||||
logoTip: `支持图片格式(JPG、PNG)\n 尺寸:正方形比例 \n 文件大小限制:≤ 2MB`,
|
logoTip: `支持图片格式(JPG、PNG)\n 尺寸:正方形比例 \n 文件大小限制:≤ 2MB`,
|
||||||
imageSquareRequired: '请上传正方形比例图片',
|
imageSquareRequired: '请上传正方形比例图片',
|
||||||
|
nameInvalid: '不能是空格开头或结尾',
|
||||||
},
|
},
|
||||||
model: {
|
model: {
|
||||||
searchPlaceholder: '搜索模型…',
|
searchPlaceholder: '搜索模型…',
|
||||||
@@ -1182,7 +1183,6 @@ export const zh = {
|
|||||||
xinference: "Xinference",
|
xinference: "Xinference",
|
||||||
gpustack: "Gpustack",
|
gpustack: "Gpustack",
|
||||||
bedrock: "Bedrock",
|
bedrock: "Bedrock",
|
||||||
nameInvalid: '模型名称只能包含字母、数字、下划线和空格, 不能为空或纯空格',
|
|
||||||
},
|
},
|
||||||
timezones: {
|
timezones: {
|
||||||
'Asia/Shanghai': '中国标准时间 (UTC+8)',
|
'Asia/Shanghai': '中国标准时间 (UTC+8)',
|
||||||
|
|||||||
@@ -45,6 +45,5 @@ export const validateSquareImage = (errorMessage: string = 'Image must be square
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
// - Cannot be empty or pure whitespace
|
// - Cannot start or end with a space
|
||||||
// - Cannot start with a space
|
export const stringRegExp = /^(?!\s).*(?<!\s)$/
|
||||||
export const stringRegExp = /^[a-zA-Z0-9\u4e00-\u9fa5][a-zA-Z0-9\u4e00-\u9fa5\s]*$/
|
|
||||||
Reference in New Issue
Block a user