refactor(性能测试): 修改编辑资源池页面显示样式

This commit is contained in:
Captain.B 2021-06-22 14:37:54 +08:00 committed by 刘瑞斌
parent 8b8b95631a
commit 70bf87ed33
1 changed files with 110 additions and 105 deletions

View File

@ -2,7 +2,8 @@
<div> <div>
<el-card class="table-card" v-loading="result.loading"> <el-card class="table-card" v-loading="result.loading">
<template v-slot:header> <template v-slot:header>
<ms-table-header :create-permission="['SYSTEM_TEST_POOL:READ+CREATE']" :condition.sync="condition" @search="search" @create="create" <ms-table-header :create-permission="['SYSTEM_TEST_POOL:READ+CREATE']" :condition.sync="condition"
@search="search" @create="create"
:create-tip="$t('test_resource_pool.create_resource_pool')" :create-tip="$t('test_resource_pool.create_resource_pool')"
:title="$t('commons.test_resource_pool')"/> :title="$t('commons.test_resource_pool')"/>
</template> </template>
@ -55,123 +56,127 @@
:close-on-click-modal="false" :close-on-click-modal="false"
:title="form.id ? $t('test_resource_pool.update_resource_pool') : $t('test_resource_pool.create_resource_pool')" :title="form.id ? $t('test_resource_pool.update_resource_pool') : $t('test_resource_pool.create_resource_pool')"
:visible.sync="dialogVisible" width="80%" :visible.sync="dialogVisible" width="80%"
top="5%"
@closed="closeFunc" @closed="closeFunc"
:destroy-on-close="true" :destroy-on-close="true"
v-loading="result.loading" v-loading="result.loading"
> >
<el-form :model="form" label-position="right" label-width="140px" size="small" :rules="rule" <div style="height: 60vh;overflow: auto;">
ref="testResourcePoolForm"> <el-form :model="form" label-position="right" label-width="140px" size="small" :rules="rule"
<el-form-item :label="$t('commons.name')" prop="name"> ref="testResourcePoolForm">
<el-input v-model="form.name" autocomplete="off"/> <el-form-item :label="$t('commons.name')" prop="name">
</el-form-item> <el-input v-model="form.name" autocomplete="off"/>
<el-form-item :label="$t('commons.description')" prop="description"> </el-form-item>
<el-input v-model="form.description" autocomplete="off"/> <el-form-item :label="$t('commons.description')" prop="description">
</el-form-item> <el-input v-model="form.description" autocomplete="off"/>
<el-form-item :label="$t('commons.image')" prop="image"> </el-form-item>
<el-input v-model="form.image"/> <el-form-item :label="$t('commons.image')" prop="image">
</el-form-item> <el-input v-model="form.image"/>
<el-form-item label="JMeter HEAP" prop="HEAP"> </el-form-item>
<el-input v-model="form.heap" placeholder="-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m"/> <el-form-item label="JMeter HEAP" prop="HEAP">
</el-form-item> <el-input v-model="form.heap" placeholder="-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m"/>
<el-form-item label="JMeter GC_ALGO" prop="GC_ALGO"> </el-form-item>
<el-input v-model="form.gcAlgo" placeholder="-XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:G1ReservePercent=20"/> <el-form-item label="JMeter GC_ALGO" prop="GC_ALGO">
</el-form-item> <el-input v-model="form.gcAlgo"
<el-form-item :label="$t('test_resource_pool.type')" prop="type"> placeholder="-XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:G1ReservePercent=20"/>
<el-select v-model="form.type" :placeholder="$t('test_resource_pool.select_pool_type')" </el-form-item>
@change="changeResourceType(form.type)"> <el-form-item :label="$t('test_resource_pool.type')" prop="type">
<el-option key="NODE" value="NODE" label="Node">Node</el-option> <el-select v-model="form.type" :placeholder="$t('test_resource_pool.select_pool_type')"
<el-option key="K8S" value="K8S" label="Kubernetes" v-xpack>Kubernetes</el-option> @change="changeResourceType(form.type)">
</el-select> <el-option key="NODE" value="NODE" label="Node">Node</el-option>
</el-form-item> <el-option key="K8S" value="K8S" label="Kubernetes" v-xpack>Kubernetes</el-option>
<div v-for="(item,index) in infoList " :key="index"> </el-select>
<div class="node-line" v-if="form.type === 'K8S'" v-xpack> </el-form-item>
<el-row> <div v-for="(item,index) in infoList " :key="index">
<el-col> <div class="node-line" v-if="form.type === 'K8S'" v-xpack>
<el-form-item label="Master URL" <el-row>
:rules="requiredRules"> <el-col>
<el-input v-model="item.masterUrl" autocomplete="new-password"/> <el-form-item label="Master URL"
</el-form-item> :rules="requiredRules">
</el-col> <el-input v-model="item.masterUrl" autocomplete="new-password"/>
</el-row> </el-form-item>
<el-row> </el-col>
<el-col> </el-row>
<el-form-item label="Token" <el-row>
:rules="requiredRules"> <el-col>
<el-input v-model="item.token" type="password" show-password autocomplete="new-password"/> <el-form-item label="Token"
</el-form-item> :rules="requiredRules">
</el-col> <el-input v-model="item.token" type="password" show-password autocomplete="new-password"/>
</el-row> </el-form-item>
<el-row> </el-col>
<el-col> </el-row>
<el-form-item label="Namespace" <el-row>
:rules="requiredRules"> <el-col>
<el-input v-model="item.namespace" type="text"/> <el-form-item label="Namespace"
</el-form-item> :rules="requiredRules">
</el-col> <el-input v-model="item.namespace" type="text"/>
</el-row> </el-form-item>
<el-row> </el-col>
<el-col :span="12"> </el-row>
<el-form-item :label="$t('test_resource_pool.max_threads')" <el-row>
:rules="requiredRules"> <el-col :span="12">
<el-input-number v-model="item.maxConcurrency" :min="1" :max="1000000000"/> <el-form-item :label="$t('test_resource_pool.max_threads')"
</el-form-item> :rules="requiredRules">
</el-col> <el-input-number v-model="item.maxConcurrency" :min="1" :max="1000000000"/>
<el-col :span="12"> </el-form-item>
<el-form-item :label="$t('test_resource_pool.pod_thread_limit')" </el-col>
:rules="requiredRules"> <el-col :span="12">
<el-input-number v-model="item.podThreadLimit" :min="1" :max="1000000"/> <el-form-item :label="$t('test_resource_pool.pod_thread_limit')"
</el-form-item> :rules="requiredRules">
</el-col> <el-input-number v-model="item.podThreadLimit" :min="1" :max="1000000"/>
</el-row> </el-form-item>
<el-row> </el-col>
<el-col> </el-row>
<el-form-item label="nodeSelector"> <el-row>
<el-input v-model="item.nodeSelector" placeholder='{"disktype": "ssd",...}'/> <el-col>
</el-form-item> <el-form-item label="nodeSelector">
</el-col> <el-input v-model="item.nodeSelector" placeholder='{"disktype": "ssd",...}'/>
</el-row> </el-form-item>
</div> </el-col>
<div class="node-line" v-if="form.type === 'NODE'"> </el-row>
<el-row> </div>
<el-col :span="6"> <div class="node-line" v-if="form.type === 'NODE'">
<el-form-item label="IP" :rules="requiredRules"> <el-row>
<el-input v-model="item.ip" autocomplete="off"/> <el-col :span="6">
</el-form-item> <el-form-item label="IP" :rules="requiredRules">
</el-col> <el-input v-model="item.ip" autocomplete="off"/>
<el-col :span="4"> </el-form-item>
<el-form-item label="Port" label-width="60px" :rules="requiredRules"> </el-col>
<el-input-number v-model="item.port" :min="1" :max="65535"></el-input-number> <el-col :span="4">
</el-form-item> <el-form-item label="Port" label-width="60px" :rules="requiredRules">
</el-col> <el-input-number v-model="item.port" :min="1" :max="65535"></el-input-number>
<el-col :span="4"> </el-form-item>
<el-form-item label="Monitor" label-width="100px" :rules="requiredRules"> </el-col>
<el-input-number v-model="item.monitorPort" :min="1" :max="65535"></el-input-number> <el-col :span="4">
</el-form-item> <el-form-item label="Monitor" label-width="100px" :rules="requiredRules">
</el-col> <el-input-number v-model="item.monitorPort" :min="1" :max="65535"></el-input-number>
<el-col :span="6"> </el-form-item>
<el-form-item :label="$t('test_resource_pool.max_threads')" </el-col>
:rules="requiredRules" <el-col :span="6">
style="padding-left: 20px"> <el-form-item :label="$t('test_resource_pool.max_threads')"
<el-input-number v-model="item.maxConcurrency" :min="1" :max="1000000000"></el-input-number> :rules="requiredRules"
</el-form-item> style="padding-left: 20px">
</el-col> <el-input-number v-model="item.maxConcurrency" :min="1" :max="1000000000"></el-input-number>
<el-col :offset="2" :span="2"> </el-form-item>
</el-col>
<el-col :offset="2" :span="2">
<span class="box"> <span class="box">
<el-button @click="addResourceInfo()" type="success" size="mini" circle> <el-button @click="addResourceInfo()" type="success" size="mini" circle>
<font-awesome-icon :icon="['fas', 'plus']"/> <font-awesome-icon :icon="['fas', 'plus']"/>
</el-button> </el-button>
</span> </span>
<span class="box"> <span class="box">
<el-button @click="removeResourceInfo(index)" type="danger" size="mini" circle> <el-button @click="removeResourceInfo(index)" type="danger" size="mini" circle>
<font-awesome-icon :icon="['fas', 'minus']"/> <font-awesome-icon :icon="['fas', 'minus']"/>
</el-button> </el-button>
</span> </span>
</el-col> </el-col>
</el-row> </el-row>
</div>
</div> </div>
</div>
</el-form> </el-form>
</div>
<template v-slot:footer> <template v-slot:footer>
<ms-dialog-footer <ms-dialog-footer
v-if="form.id" v-if="form.id"
@ -441,7 +446,7 @@ export default {
} else { } else {
this.updatePoolStatus(row); this.updatePoolStatus(row);
} }
}) });
} }
}, },
checkHaveTestUsePool(row) { checkHaveTestUsePool(row) {
@ -449,7 +454,7 @@ export default {
this.$get('/testresourcepool/check/use/' + row.id, result => { this.$get('/testresourcepool/check/use/' + row.id, result => {
this.updatePool = result.data; this.updatePool = result.data;
resolve(); resolve();
}) });
}); });
}, },
updatePoolStatus(row) { updatePoolStatus(row) {