fix: 修改部分校验规则 (#2512)

pull/2513/head
ssongliu 1 year ago committed by GitHub
parent cd376b2e97
commit 6d578e53ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -328,7 +328,7 @@ const handleClose = () => {
const rules = reactive({
name: [Rules.requiredInput, Rules.containerName],
image: [Rules.requiredInput],
image: [Rules.imageName],
cpuShares: [Rules.integerNumberWith0, checkNumberRange(0, 262144)],
nanoCPUs: [Rules.floatNumber],
memory: [Rules.floatNumber],

@ -20,7 +20,7 @@
</el-tooltip>
<el-tag v-else>{{ form.imageName }}:{{ form.oldTag }}</el-tag>
</el-form-item>
<el-form-item prop="newTag" :rules="Rules.requiredInput">
<el-form-item prop="newTag" :rules="Rules.imageName">
<template #label>
<el-tooltip
placement="top-start"

@ -139,10 +139,15 @@ const onCopy = async () => {
const loadMfaCodeBefore = async (formEl: FormInstance | undefined) => {
if (!formEl) return;
formEl.validate(async (valid) => {
if (!valid) return;
loadMfaCode();
});
const result = await formEl.validateField('interval', callback);
if (!result) {
return;
}
const result2 = await formEl.validateField('title', callback);
if (!result2) {
return;
}
loadMfaCode();
};
const loadMfaCode = async () => {
let param = {
@ -154,6 +159,14 @@ const loadMfaCode = async () => {
qrImage.value = res.data.qrImage;
};
function callback(error: any) {
if (error) {
return error.message;
} else {
return;
}
}
const onBind = async (formEl: FormInstance | undefined) => {
if (!formEl) return;
formEl.validate(async (valid) => {

Loading…
Cancel
Save