Browse Source

feat: 编辑应用 cpu 和内存限制增加校验 (#1205)

pull/1206/head
zhengkunwang223 2 years ago committed by GitHub
parent
commit
2207711400
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      frontend/src/views/app-store/installed/detail/index.vue
  2. 8
      frontend/src/views/website/website/create/index.vue

4
frontend/src/views/app-store/installed/detail/index.vue

@ -100,7 +100,7 @@ import { reactive, ref } from 'vue';
import Header from '@/components/drawer-header/index.vue';
import { useI18n } from 'vue-i18n';
import { FormInstance } from 'element-plus';
import { Rules } from '@/global/form-rules';
import { Rules, checkNumberRange } from '@/global/form-rules';
import { MsgSuccess } from '@/utils/message';
import i18n from '@/lang';
import { canEditPort } from '@/global/business';
@ -128,6 +128,8 @@ const paramModel = ref<any>({
});
const rules = reactive({
params: {},
cpuQuota: [Rules.requiredInput, checkNumberRange(0, 99999)],
memoryLimit: [Rules.requiredInput, checkNumberRange(0, 9999999999)],
});
const submitModel = ref<any>({});

8
frontend/src/views/website/website/create/index.vue

@ -202,7 +202,7 @@
:placeholder="$t('app.containerNameHelper')"
></el-input>
</el-form-item>
<el-form-item :label="$t('container.cpuQuota')" prop="cpuQuota">
<el-form-item :label="$t('container.cpuQuota')" prop="appinstall.cpuQuota">
<el-input
type="number"
style="width: 40%"
@ -213,7 +213,7 @@
</el-input>
<span class="input-help">{{ $t('container.limitHelper') }}</span>
</el-form-item>
<el-form-item :label="$t('container.memoryLimit')" prop="memoryLimit">
<el-form-item :label="$t('container.memoryLimit')" prop="appinstall.memoryLimit">
<el-input style="width: 40%" v-model.number="website.appinstall.memoryLimit" maxlength="10">
<template #append>
<el-select
@ -302,7 +302,7 @@ import {
CheckAppInstalled,
} from '@/api/modules/app';
import { CreateWebsite, PreCheck } from '@/api/modules/website';
import { Rules } from '@/global/form-rules';
import { Rules, checkNumberRange } from '@/global/form-rules';
import i18n from '@/lang';
import { ElForm, FormInstance } from 'element-plus';
import { reactive, ref } from 'vue';
@ -358,6 +358,8 @@ const rules = ref<any>({
name: [Rules.appName],
appId: [Rules.requiredSelectBusiness],
params: {},
cpuQuota: [Rules.requiredInput, checkNumberRange(0, 99999)],
memoryLimit: [Rules.requiredInput, checkNumberRange(0, 9999999999)],
},
proxyType: [Rules.requiredSelect],
port: [Rules.port],

Loading…
Cancel
Save