This commit is contained in:
fit2-zhao 2020-12-25 18:00:30 +08:00
commit 76b3624aac
17 changed files with 54 additions and 55 deletions

View File

@ -1,5 +1,6 @@
package io.metersphere.api.controller;
import io.metersphere.api.dto.ApiMonitorRequest;
import io.metersphere.api.dto.ApiMonitorSearch;
import io.metersphere.api.dto.ApiResponseCodeMonitor;
import io.metersphere.api.dto.ApiResponseTimeMonitor;
@ -32,24 +33,24 @@ public class ApiMonitorController {
/**
* 查询响应时间
*/
@GetMapping("/getResponseTime")
public List<ApiResponseTimeMonitor> responseTimeData(@RequestHeader("apiUrl") String url, String startTime, String endTime) {
return apiMonitorService.getApiResponseTimeData(url, startTime, endTime);
@PostMapping("/getResponseTime")
public List<ApiResponseTimeMonitor> responseTimeData(@RequestBody ApiMonitorRequest request) {
return apiMonitorService.getApiResponseTimeData(request.getUrl(), request.getStartTime(), request.getEndTime());
}
/**
* 查询状态码
*/
@GetMapping("/getResponseCode")
public List<ApiResponseCodeMonitor> responseCodeData(@RequestHeader("apiUrl") String url, String startTime, String endTime) {
return apiMonitorService.getApiResponseCodeData(url, startTime, endTime);
@PostMapping("/getResponseCode")
public List<ApiResponseCodeMonitor> responseCodeData(@RequestBody ApiMonitorRequest request) {
return apiMonitorService.getApiResponseCodeData(request.getUrl(), request.getStartTime(), request.getEndTime());
}
/**
* 查询reportId
*/
@GetMapping("/getReportId")
public String searchReportId(@RequestHeader("apiUrl") String url, @RequestParam("startTime") String startTime) {
return apiMonitorService.getReportId(url, startTime);
@PostMapping("/getReportId")
public String searchReportId(@RequestBody ApiMonitorRequest request) {
return apiMonitorService.getReportId(request.getUrl(), request.getStartTime());
}
}

View File

@ -0,0 +1,11 @@
package io.metersphere.api.dto;
import lombok.Data;
@Data
public class ApiMonitorRequest {
private String url;
private String startTime;
private String endTime;
}

View File

@ -377,7 +377,6 @@ public class ApiDefinitionService {
if (item.getName().length() > 255) {
item.setName(item.getName().substring(0, 255));
}
item.setModuleId(request.getModuleId());
createTest(item, batchMapper);
if (i % 300 == 0) {
sqlSession.flushStatements();

@ -1 +1 @@
Subproject commit 79343a2763b014355f91fc21b2356a95ae437973
Subproject commit f27d1609d77f7d6c988d37d709466e844d350e17

View File

@ -48,6 +48,7 @@ related_case_del_fail_prefix=Connected to
related_case_del_fail_suffix=TestCase, please disassociate first
jmx_content_valid=JMX content is invalid
container_delete_fail=The container failed to stop, please try again
load_test_report_file_not_exist=There is no JTL file in the current report, please wait or execute it again to get it
#workspace
workspace_name_is_null=Workspace name cannot be null
workspace_name_already_exists=The workspace name already exists

View File

@ -48,6 +48,7 @@ related_case_del_fail_prefix=已关联到
related_case_del_fail_suffix=测试用例,请先解除关联
jmx_content_valid=JMX 内容无效,请检查
container_delete_fail=容器由于网络原因停止失败,请重试
load_test_report_file_not_exist=当前报告没有JTL文件请等待或重新执行以便获取
#workspace
workspace_name_is_null=工作空间名不能为空
workspace_name_already_exists=工作空间名已存在

View File

@ -48,6 +48,7 @@ related_case_del_fail_prefix=已關聯到
related_case_del_fail_suffix=測試用例,請先解除關聯
jmx_content_valid=JMX 內容無效,請檢查
container_delete_fail=容器由於網絡原因停止失敗,請重試
load_test_report_file_not_exist=當前報告沒有JTL文件請等待或重新執行以便獲取
#workspace
workspace_name_is_null=工作空間名不能為空
workspace_name_already_exists=工作空間名已存在

View File

@ -15,7 +15,7 @@
type="selection"/>
<el-table-column width="40" :resizable="false" align="center">
<template v-slot:default="scope">
<show-more-btn :is-show="scope.row.showMore" :buttons="buttons" :size="selectRows.size"/>
<show-more-btn v-tester :is-show="scope.row.showMore" :buttons="buttons" :size="selectRows.size"/>
</template>
</el-table-column>
<el-table-column :label="$t('commons.name')" width="200" show-overflow-tooltip prop="name">
@ -62,20 +62,20 @@
</template>
<script>
import MsTablePagination from "../../../common/pagination/TablePagination";
import MsTableHeader from "../../../common/components/MsTableHeader";
import MsContainer from "../../../common/components/MsContainer";
import MsMainContainer from "../../../common/components/MsMainContainer";
import MsApiReportStatus from "./ApiReportStatus";
import {_filter, _sort, getCurrentProjectID} from "@/common/js/utils";
import MsTableOperatorButton from "../../../common/components/MsTableOperatorButton";
import ReportTriggerModeItem from "../../../common/tableItem/ReportTriggerModeItem";
import {REPORT_CONFIGS} from "../../../common/components/search/search-components";
import {ApiEvent, LIST_CHANGE} from "@/business/components/common/head/ListEvent";
import ShowMoreBtn from "../../../track/case/components/ShowMoreBtn";
import MsApiReportDetail from "./ApiReportDetail";
import MsTablePagination from "../../../common/pagination/TablePagination";
import MsTableHeader from "../../../common/components/MsTableHeader";
import MsContainer from "../../../common/components/MsContainer";
import MsMainContainer from "../../../common/components/MsMainContainer";
import MsApiReportStatus from "./ApiReportStatus";
import {_filter, _sort, getCurrentProjectID} from "@/common/js/utils";
import MsTableOperatorButton from "../../../common/components/MsTableOperatorButton";
import ReportTriggerModeItem from "../../../common/tableItem/ReportTriggerModeItem";
import {REPORT_CONFIGS} from "../../../common/components/search/search-components";
import {ApiEvent, LIST_CHANGE} from "@/business/components/common/head/ListEvent";
import ShowMoreBtn from "../../../track/case/components/ShowMoreBtn";
import MsApiReportDetail from "./ApiReportDetail";
export default {
export default {
components: {
ReportTriggerModeItem,
MsTableOperatorButton,

View File

@ -80,9 +80,8 @@ export default {
this.getResponseCode(this.apiUrl, today1, today2);
},
getResponseTime(apiUrl, startTime, endTime) {
return this.$$get('/api/monitor/getResponseTime',
{'startTime': startTime, 'endTime': endTime},
{'apiUrl': apiUrl}, response => {
return this.$post('/api/monitor/getResponseTime',
{'startTime': startTime, 'endTime': endTime, 'apiUrl': apiUrl}, response => {
Object.values(response.data).forEach(value => {
this.rspTimexAxis.push(value.startTime);
this.rspTimeData.push(value.responseTime);
@ -90,9 +89,8 @@ export default {
});
},
getResponseCode(apiUrl, startTime, endTime) {
return this.$$get('/api/monitor/getResponseCode',
{'startTime': startTime, 'endTime': endTime},
{'apiUrl': this.apiUrl}, response => {
return this.$post('/api/monitor/getResponseCode',
{'startTime': startTime, 'endTime': endTime, 'apiUrl': this.apiUrl}, response => {
Object.values(response.data).forEach(value => {
this.rspCodexAxis.push(value.startTime);
this.rspCodeData.push(value.responseCode);

View File

@ -28,9 +28,7 @@ export default {
methods: {
click(params) {
let startTime = params.name;
this.result = this.$$get('/api/monitor/getReportId', {'startTime': startTime}, {
'apiUrl': this.apiUrl
}, response => {
this.result = this.$post('/api/monitor/getReportId', {'startTime': startTime, 'apiUrl': this.apiUrl}, response => {
this.reportId = response.data;
let reportId = this.reportId
let url = '#/api/report/view/' + reportId;

View File

@ -15,7 +15,7 @@
type="selection"/>
<el-table-column width="40" :resizable="false" align="center">
<template v-slot:default="scope">
<show-more-btn :is-show="scope.row.showMore" :buttons="buttons" :size="selectRows.size"/>
<show-more-btn v-tester :is-show="scope.row.showMore" :buttons="buttons" :size="selectRows.size"/>
</template>
</el-table-column>
<el-table-column :label="$t('commons.name')" width="200" show-overflow-tooltip prop="name">

View File

@ -19,7 +19,7 @@
type="selection"/>
<el-table-column width="40" :resizable="false" align="center">
<template v-slot:default="scope">
<show-more-btn :is-show="scope.row.showMore" :buttons="buttons" :size="selectRows.size"/>
<show-more-btn v-tester :is-show="scope.row.showMore" :buttons="buttons" :size="selectRows.size"/>
</template>
</el-table-column>
<el-table-column

View File

@ -118,12 +118,12 @@
display: inline-block;
}
.ms-main-container {
height: calc(100vh - 80px - 50px);
/deep/ .ms-main-container {
height: calc(100vh - 80px - 53px);
}
.ms-aside-container {
height: calc(100vh - 80px - 51px);
/deep/ .ms-aside-container {
height: calc(100vh - 80px - 53px);
margin-top: 1px;
}
@ -133,4 +133,5 @@
color: dimgray;
}
</style>

@ -1 +1 @@
Subproject commit 8cda5c873cd9985c97adb34efacf507167fa4182
Subproject commit 7d43154a7c19732407a8e9ace8a7d1ea13c91f36

View File

@ -74,20 +74,6 @@ export default {
}
}
Vue.prototype.$$get = function (url, data, header, success) {
let result = {loading: true};
if (!success) {
return axios.get(url, {params: data, headers: header});
} else {
axios.get(url, {params: data, headers: header}).then(response => {
then(success, response, result);
}).catch(error => {
exception(error, result, url);
});
return result;
}
};
Vue.prototype.$get = function (url, success) {
let result = {loading: true};
if (!success) {

View File

@ -126,6 +126,7 @@ export default {
modifier: 'Modifier',
validate: "Validate",
batch_add: "Batch add",
check_project_tip: "Create or select the project first",
date: {
select_date: 'Select date',
start_date: 'Start date',

View File

@ -126,6 +126,7 @@ export default {
modifier: '修改人',
validate: "校驗",
batch_add: "批量添加",
check_project_tip: "請先創建或選擇項目",
date: {
select_date: '選擇日期',
start_date: '開始日期',