diff --git a/frontend/src/views/container/container/operate/index.vue b/frontend/src/views/container/container/operate/index.vue
index 0015f5dc1..fa3c18a10 100644
--- a/frontend/src/views/container/container/operate/index.vue
+++ b/frontend/src/views/container/container/operate/index.vue
@@ -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],
diff --git a/frontend/src/views/container/container/upgrade/index.vue b/frontend/src/views/container/container/upgrade/index.vue
index 4c0c75ca5..87d2da760 100644
--- a/frontend/src/views/container/container/upgrade/index.vue
+++ b/frontend/src/views/container/container/upgrade/index.vue
@@ -20,7 +20,7 @@
{{ form.imageName }}:{{ form.oldTag }}
-
+
{
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) => {