-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -64,7 +64,7 @@
-
+
@@ -75,7 +75,7 @@
-
+
@@ -85,7 +85,7 @@
-
+
@@ -99,12 +99,12 @@
-
@@ -136,7 +136,7 @@ import {ElMessage} from 'element-plus'
import {do_test_case, user_config} from "@/api/api";
export default {
- name: 'sendTest',
+ name: 'doTest',
components: {
AllHeader,
Menu,
@@ -144,31 +144,31 @@ export default {
data() {
return {
labelPosition: ref('right'),
- configName: '',
- projectName: '',
- userPassword: '',
- yamlData: baseYamlData,
- testIP: '',
- testPassword: '',
- message: '',
- iterations: {
- stream: '',
- lmbench: '',
- unixbench: '',
- fio: '',
- iozone: '',
- jvm2008: '',
- cpu2006: '',
- cpu2006_loongarch64: '',
- cpu2017: '',
+ formData: {
+ configName: '',
+ projectName: '',
+ userPassword: '',
+ yamlData: baseYamlData,
+ testIP: '',
+ testPassword: '',
+ message: '',
+ iterations: {
+ stream: '',
+ lmbench: '',
+ unixbench: '',
+ fio: '',
+ iozone: '',
+ jvm2008: '',
+ cpu2006: '',
+ cpu2006_loongarch64: '',
+ cpu2017: '',
+ },
},
- machineOptions: [],
yamlDialog: false,
- yamlType: '',
-
configDialog: false,
configNameDialog: false,
+ yamlType: '',
configID: 0,
configData: '',
configDatas: [],
@@ -178,55 +178,51 @@ export default {
this.getData()
},
methods: {
- getData() {
- if (this.$route.query.configID) {
- this.configID = this.$route.query.configID
- }
-
- this.machineOptions = [
- {label: '172.29.220.100', value: '172.29.220.100'},
- {label: '172.29.220.101', value: '172.29.220.101'},
- ]
- },
+ getData() {},
+ //展示yaml文件
showYaml(yamlType) {
this.yamlDialog = true
this.yamlType = yamlType
},
+ //关闭对话框
closeInfo() {
this.yamlDialog = false
this.configDialog = false
},
- changeYaml(yamlData) {
- this.yamlData = yamlData
+ //修改yaml文件
+ putYaml(yamlData) {
+ this.formData.yamlData = yamlData
this.yamlDialog = false;
},
+ //一键摸底
doBase() {
- this.iterations.stream = 50
- this.iterations.lmbench = 3
- this.iterations.unixbench = 3
- this.iterations.fio = 3
- this.iterations.iozone = 0
- this.iterations.jvm2008 = 1
- this.iterations.cpu2006 = 1
- this.iterations.cpu2017 = 0
- this.yamlData = baseYamlData
+ this.formData.iterations.stream = 50
+ this.formData.iterations.lmbench = 3
+ this.formData.iterations.unixbench = 3
+ this.formData.iterations.fio = 3
+ this.formData.iterations.iozone = 0
+ this.formData.iterations.jvm2008 = 1
+ this.formData.iterations.cpu2006 = 1
+ this.formData.iterations.cpu2017 = 0
+ this.formData.yamlData = baseYamlData
},
- lastTest(){
+ //最后一次测试数据
+ lastTest() {
user_config('get', {configID: 0}).then(response => {
const config = response.data.data[0]
this.configID = config.id
- this.configName = config.config_name
- this.projectName = config.project_name
- this.userPassword = config.user_password
- this.iterations.stream = config.stream_number
- this.iterations.lmbench = config.lmbench_number
- this.iterations.unixbench = config.unixbench_number
- this.iterations.fio = config.fio_number
- this.iterations.iozone = config.iozone_number
- this.iterations.jvm2008 = config.jvm2008_number
- this.iterations.cpu2006 = config.cpu2006_number
- this.iterations.cpu2017 = config.cpu2017_number
- this.yamlData = {
+ this.formData.configName = config.config_name
+ this.formData.projectName = config.project_name
+ this.formData.userPassword = config.user_password
+ this.formData.iterations.stream = config.stream_number
+ this.formData.iterations.lmbench = config.lmbench_number
+ this.formData.iterations.unixbench = config.unixbench_number
+ this.formData.iterations.fio = config.fio_number
+ this.formData.iterations.iozone = config.iozone_number
+ this.formData.iterations.jvm2008 = config.jvm2008_number
+ this.formData.iterations.cpu2006 = config.cpu2006_number
+ this.formData.iterations.cpu2017 = config.cpu2017_number
+ this.formData.yamlData = {
stream: config.stream_config,
lmbench: config.lmbench_config,
unixbench: config.unixbench_config,
@@ -237,17 +233,19 @@ export default {
cpu2006_loongarch64: config.cpu2006_loongarch64_config,
cpu2017: config.cpu2017_config,
}
- this.testIP = config.test_ip
- this.testPassword = config.test_password
- this.message = config.message
+ this.formData.testIP = config.test_ip
+ this.formData.testPassword = config.test_password
+ this.formData.message = config.message
})
},
-
+ //选中配置列表
select() {
- user_config('get').then(response => {this.configDatas = response.data.data})
+ user_config('get').then(response => {
+ this.configDatas = response.data.data
+ })
this.configDialog = true
},
-
+ //选择框只能单选
handleSelection(val) {
this.configData = val[0];
if (val.length > 1) {
@@ -255,52 +253,55 @@ export default {
this.$refs.configTable.toggleRowSelection(val.pop());
}
},
-
+ //选中配置
selectConfig() {
- this.projectName = this.configData.project_name
- this.userPassword = this.configData.user_password
- this.iterations.stream = this.configData.stream_number
- this.iterations.lmbench = this.configData.lmbench_number
- this.iterations.unixbench = this.configData.unixbench_number
- this.iterations.fio = this.configData.fio_number
- this.iterations.iozone = this.configData.iozone_number
- this.iterations.jvm2008 = this.configData.jvm2008_number
- this.iterations.cpu2006 = this.configData.cpu2006_number
- this.iterations.cpu2017 = this.configData.cpu2017_number
- this.yamlData.stream = this.configData.stream_config
- this.yamlData.lmbench = this.configData.lmbench_config
- this.yamlData.unixbench = this.configData.unixbench_config
- this.yamlData.fio = this.configData.fio_config
- this.yamlData.iozone = this.configData.iozone_config
- this.yamlData.cpu2006 = this.configData.cpu2006_config
- this.yamlData.cpu2006_loongarch64_config = this.configData.cpu2006_loongarch64_config_config
- this.yamlData.cpu2017 = this.configData.cpu2017_config
- this.testIP = this.configData.test_ip
- this.testPassword = this.configData.test_password
- this.message = this.configData.message
+ this.configID = this.configData.id
+ this.formData.configName = this.configData.config_name
+ this.formData.projectName = this.configData.project_name
+ this.formData.userPassword = this.configData.user_password
+ this.formData.iterations.stream = this.configData.stream_number
+ this.formData.iterations.lmbench = this.configData.lmbench_number
+ this.formData.iterations.unixbench = this.configData.unixbench_number
+ this.formData.iterations.fio = this.configData.fio_number
+ this.formData.iterations.iozone = this.configData.iozone_number
+ this.formData.iterations.jvm2008 = this.configData.jvm2008_number
+ this.formData.iterations.cpu2006 = this.configData.cpu2006_number
+ this.formData.iterations.cpu2017 = this.configData.cpu2017_number
+ this.formData.yamlData.stream = this.configData.stream_config
+ this.formData.yamlData.lmbench = this.configData.lmbench_config
+ this.formData.yamlData.unixbench = this.configData.unixbench_config
+ this.formData.yamlData.fio = this.configData.fio_config
+ this.formData.yamlData.iozone = this.configData.iozone_config
+ this.formData.yamlData.cpu2006 = this.configData.cpu2006_config
+ this.formData.yamlData.cpu2006_loongarch64_config = this.configData.cpu2006_loongarch64_config_config
+ this.formData.yamlData.cpu2017 = this.configData.cpu2017_config
+ this.formData.testIP = this.configData.test_ip
+ this.formData.testPassword = this.configData.test_password
+ this.formData.message = this.configData.message
this.configDialog = false
},
-
+ //更新配置
update() {
if (this.check()) {
+ console.log(this.configID)
if (this.configID) {
const formData = {
id: this.configID,
- config_name: this.configName,
- project_name: this.projectName,
- test_ip: this.testIP,
- test_password: this.testPassword,
- user_password: this.userPassword,
- stream: this.iterations.stream,
- lmbench: this.iterations.lmbench,
- unixbench: this.iterations.unixbench,
- fio: this.iterations.fio,
- iozone: this.iterations.iozone,
- jvm2008: this.iterations.jvm2008,
- cpu2006: this.iterations.cpu2006,
- cpu2017: this.iterations.cpu2017,
- yaml: this.yamlData,
- message: this.message
+ config_name: this.formData.configName,
+ project_name: this.formData.projectName,
+ test_ip: this.formData.testIP,
+ test_password: this.formData.testPassword,
+ user_password: this.formData.userPassword,
+ stream: this.formData.iterations.stream,
+ lmbench: this.formData.iterations.lmbench,
+ unixbench: this.formData.iterations.unixbench,
+ fio: this.formData.iterations.fio,
+ iozone: this.formData.iterations.iozone,
+ jvm2008: this.formData.iterations.jvm2008,
+ cpu2006: this.formData.iterations.cpu2006,
+ cpu2017: this.formData.iterations.cpu2017,
+ yaml: this.formData.yamlData,
+ message: this.formData.message,
}
user_config('put', formData).then(response => {
ElMessage({message: response.data.message, type: 'success'})
@@ -308,89 +309,92 @@ export default {
}
}
},
-
+ //新增配置
add() {
if (this.check()) {
this.configNameDialog = true
const formData = {
- config_name: this.configName,
- project_name: this.projectName,
- test_ip: this.testIP,
- test_password: this.testPassword,
- user_password: this.userPassword,
- stream: this.iterations.stream,
- lmbench: this.iterations.lmbench,
- unixbench: this.iterations.unixbench,
- fio: this.iterations.fio,
- iozone: this.iterations.iozone,
- jvm2008: this.iterations.jvm2008,
- cpu2006: this.iterations.cpu2006,
- cpu2017: this.iterations.cpu2017,
- yaml: this.yamlData,
- message: this.message
+ config_name: this.formData.configName,
+ project_name: this.formData.projectName,
+ test_ip: this.formData.testIP,
+ test_password: this.formData.testPassword,
+ user_password: this.formData.userPassword,
+ stream: this.formData.iterations.stream,
+ lmbench: this.formData.iterations.lmbench,
+ unixbench: this.formData.iterations.unixbench,
+ fio: this.formData.iterations.fio,
+ iozone: this.formData.iterations.iozone,
+ jvm2008: this.formData.iterations.jvm2008,
+ cpu2006: this.formData.iterations.cpu2006,
+ cpu2017: this.formData.iterations.cpu2017,
+ yaml: this.formData.yamlData,
+ message: this.formData.message
}
user_config('post', formData).then(response => {
ElMessage({message: response.data.message, type: 'success'})
})
}
},
+ //发起测试
sendTest() {
if (this.check()) {
const formData = {
- config_name: this.configName,
- project_name: this.projectName,
- test_ip: this.testIP,
- test_password: this.testPassword,
- user_password: this.userPassword,
- stream: this.iterations.stream,
- lmbench: this.iterations.lmbench,
- unixbench: this.iterations.unixbench,
- fio: this.iterations.fio,
- iozone: this.iterations.iozone,
- jvm2008: this.iterations.jvm2008,
- cpu2006: this.iterations.cpu2006,
- cpu2017: this.iterations.cpu2017,
- yaml: this.yamlData,
- message: this.message
+ config_name: this.formData.configName,
+ project_name: this.formData.projectName,
+ test_ip: this.formData.testIP,
+ test_password: this.formData.testPassword,
+ user_password: this.formData.userPassword,
+ stream: this.formData.iterations.stream,
+ lmbench: this.formData.iterations.lmbench,
+ unixbench: this.formData.iterations.unixbench,
+ fio: this.formData.iterations.fio,
+ iozone: this.formData.iterations.iozone,
+ jvm2008: this.formData.iterations.jvm2008,
+ cpu2006: this.formData.iterations.cpu2006,
+ cpu2017: this.formData.iterations.cpu2017,
+ yaml: this.formData.yamlData,
+ message: this.formData.message
}
do_test_case(formData).then(response => {
console.log(response.data)
- this.projectName = ''
- this.testIP = ''
- this.testPassword = ''
- this.userPassword = ''
- this.iterations.stream = ''
- this.iterations.lmbench = ''
- this.iterations.unixbench = ''
- this.iterations.fio = ''
- this.iterations.iozone = ''
- this.iterations.jvm2008 = ''
- this.iterations.cpu2006 = ''
- this.iterations.cpu2017 = ''
- this.yamlData = ''
- this.message = ''
+ this.formData.configName = ''
+ this.formData.projectName = ''
+ this.formData.testIP = ''
+ this.formData.testPassword = ''
+ this.formData.userPassword = ''
+ this.formData.iterations.stream = ''
+ this.formData.iterations.lmbench = ''
+ this.formData.iterations.unixbench = ''
+ this.formData.iterations.fio = ''
+ this.formData.iterations.iozone = ''
+ this.formData.iterations.jvm2008 = ''
+ this.formData.iterations.cpu2006 = ''
+ this.formData.iterations.cpu2017 = ''
+ this.formData.yamlData = ''
+ this.formData.message = ''
});
ElMessage({message: '发起测试完成', type: 'success'});
}
},
+ //验证数据
check() {
- if (!this.projectName) {
+ if (!this.formData.projectName) {
ElMessage({message: "项目名称不能为空", type: 'error'});
return false;
}
- if (!this.userPassword) {
+ if (!this.formData.userPassword) {
ElMessage({message: "kytuning用户密码不能为空", type: 'error'});
return false;
}
const iterations = {
- stream: this.iterations.stream !== '' ? parseInt(this.iterations.stream) : 0,
- lmbench: this.iterations.lmbench !== '' ? parseInt(this.iterations.lmbench) : 0,
- unixbench: this.iterations.unixbench !== '' ? parseInt(this.iterations.unixbench) : 0,
- fio: this.iterations.fio !== '' ? parseInt(this.iterations.fio) : 0,
- iozone: this.iterations.iozone !== '' ? parseInt(this.iterations.iozone) : 0,
- jvm2008: this.iterations.jvm2008 !== '' ? parseInt(this.iterations.jvm2008) : 0,
- cpu2006: this.iterations.cpu2006 !== '' ? parseInt(this.iterations.cpu2006) : 0,
- cpu2017: this.iterations.cpu2017 !== '' ? parseInt(this.iterations.cpu2017) : 0,
+ stream: this.formData.iterations.stream !== '' ? parseInt(this.formData.iterations.stream) : 0,
+ lmbench: this.formData.iterations.lmbench !== '' ? parseInt(this.formData.iterations.lmbench) : 0,
+ unixbench: this.formData.iterations.unixbench !== '' ? parseInt(this.formData.iterations.unixbench) : 0,
+ fio: this.formData.iterations.fio !== '' ? parseInt(this.formData.iterations.fio) : 0,
+ iozone: this.formData.iterations.iozone !== '' ? parseInt(this.formData.iterations.iozone) : 0,
+ jvm2008: this.formData.iterations.jvm2008 !== '' ? parseInt(this.formData.iterations.jvm2008) : 0,
+ cpu2006: this.formData.iterations.cpu2006 !== '' ? parseInt(this.formData.iterations.cpu2006) : 0,
+ cpu2017: this.formData.iterations.cpu2017 !== '' ? parseInt(this.formData.iterations.cpu2017) : 0,
};
let result = true
for (const key in iterations) {
@@ -401,7 +405,7 @@ export default {
}
}
//处理可迭代次数
- this.iterations = iterations
+ this.formData.iterations = iterations
return result;
},
testlink() {
diff --git a/templates/front-project/src/views/testViews/TestList.vue b/templates/front-project/src/views/testViews/TestList.vue
index 839b4dd9efd928d80ef31314375ef39b2f97a154..698d8fef30632916a9e0c8345ea48e1e4442bd82 100644
--- a/templates/front-project/src/views/testViews/TestList.vue
+++ b/templates/front-project/src/views/testViews/TestList.vue
@@ -28,7 +28,7 @@
- 日志
+ 日志
删除
@@ -60,7 +60,7 @@
import {ElMessage} from 'element-plus';
import AllHeader from "@/components/common/AllHeader";
import Menu from "@/components/common/AllMenu";
-import {test_case, down_message} from "@/api/api";
+import {test_case} from "@/api/api";
import utils from '@/utils/utils';
export default {
@@ -72,43 +72,19 @@ export default {
mixins: [utils],
data() {
return {
- tableDatas: [],
+ allDatas: [],
};
},
- computed: {
- showData() {
- return this.tableDatas.slice(
- (this.currentPage - 1) * this.pageSize,
- this.currentPage * this.pageSize
- );
- },
- },
created() {
this.getData()
},
methods: {
getData(){
test_case('get', {}).then((response) => {
- this.tableDatas = response.data.data;
- this.total = this.tableDatas.length;
+ this.allDatas = response.data.data;
+ this.total = this.allDatas.length;
});
},
- down(row) {
- down_message({result_log_name: row.result_log_name}).then((response) => {
- const url = window.URL.createObjectURL(new Blob([response.data]))
- const link = document.createElement('a')
- link.href = url
- link.setAttribute('download', 'log.tar')
- document.body.appendChild(link)
- link.click()
- }).catch(error => {
- if (error.code === "ERR_BAD_REQUEST"){ElMessage({message: "下载失败没有找到对应日志", type: 'warning'})}
- console.log(error)
- }).finally(() => {
- // excelDisabled 将被设置为 true,然后立即被设置为 false,禁用的时间非常短,不足以被用户察觉到。
- this.excelDisabled = false;
- });
- },
del(row) {
this.$confirm(`确认删除此行数据吗?`, '提示', {
confirmButtonText: '确定',