mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-09-05 22:25:49 +08:00
feat: 编辑应用 cpu 和内存限制增加校验 (#1205)
This commit is contained in:
parent
763f450f43
commit
2207711400
2 changed files with 8 additions and 4 deletions
|
@ -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>({});
|
||||
|
||||
|
|
|
@ -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…
Add table
Reference in a new issue