refactor(工作台): 删除工作台不用的接口以及文件

This commit is contained in:
guoyuqi 2023-03-13 17:49:15 +08:00 committed by fit2-zhao
parent 82301b2786
commit 191f15491c
13 changed files with 3 additions and 467 deletions

View File

@ -1,10 +1,5 @@
import {get, post} from "metersphere-frontend/src/plugins/request"
export function getApiModules(projectId, protocol, currentVersion) {
let url = '/api/module/list/' + projectId + '/' + protocol + (currentVersion ? '/' + currentVersion : '');
return get(url);
}
export function getApiModuleByProjectIdAndProtocol(projectId, protocol) {
let url = '/api/module/list/' + projectId + '/' + protocol;
return get(url);

View File

@ -1,9 +1,5 @@
import {get, post} from 'metersphere-frontend/src/plugins/request';
export function getEnvironmentPages(goPage, pageSize, param) {
return post(`/environment/list/${goPage}/${pageSize}`, param);
}
export function getEnvironments(projectId) {
return get(`/environment/list/${projectId}`);
}
@ -16,18 +12,10 @@ export function getEnvironmentGroupPages(goPage, pageSize, param) {
return post(`/environment/group/list/${goPage}/${pageSize}`, param);
}
export function getAllEnvironmentGroups(param) {
return post('/environment/group/get/all', param);
}
export function copyEnvironmentGroup(groupId) {
return get(`/environment/group/copy/${groupId}`);
}
export function delEnvironmentGroup(groupId) {
return get(`/environment/group/delete/${groupId}`);
}
export function modifyEnvironmentGroup(group) {
return post('/environment/group/modify', group);
}

View File

@ -1,26 +0,0 @@
import {get, post} from "metersphere-frontend/src/plugins/request"
export function apiCountByProjectId(projectId) {
return get('/home/api/count/' + projectId);
}
export function countApiCoverageByProjectId(projectId) {
return get('/home/api/coverage/' + projectId);
}
export function apiCaseCountByProjectId(projectId) {
return get('/home/api/case/count/' + projectId);
}
export function scheduleTaskCountByProjectId(projectId) {
return get('/home/schedule/task/count/' + projectId);
}
export function apiRunningTask(id, params) {
return post('/home/running/task/' + id, params);
}
export function databaseValidate(params) {
return post('/home/database/validate', params);
}

View File

@ -1,24 +0,0 @@
import {getUUID} from "metersphere-frontend/src/utils";
import {get, request} from "metersphere-frontend/src/plugins/request"
export function uploadMarkDownImg(file) {
let param = {
id: getUUID().substring(0, 8)
};
file.prefix = param.id;
param.fileName = file.name.substring(file.name.lastIndexOf('.'));
let config = {
method: 'POST',
url: '/plugin/add',
data: param,
headers: {
'Content-Type': undefined
}
};
return request(config);
}
export function deleteMarkDownImg(file) {
return get('/resource/md/delete/' + file[1].name);
}

View File

@ -1,29 +1,12 @@
import {get, post} from "metersphere-frontend/src/plugins/request"
import {getIssueTemplate} from "metersphere-frontend/src/api/custom-field-template";
import {hasLicense} from "metersphere-frontend/src/utils/permission";
import {getCurrentProjectID} from "metersphere-frontend/src/utils/token";
import {getUUID} from "metersphere-frontend/src/utils";
import {getCurrentProject} from "@/api/project";
export function getJiraIssueType(param) {
return post('/issues/jira/issuetype', param);
}
export function getIssues(page) {
return post(`issues/list/${page.currentPage}/${page.pageSize}`, page.condition);
}
export function syncIssues(success) {
let url = 'issues/sync/';
if (hasLicense()) {
url = 'xpack/issue/sync/';
}
// 浏览器默认策略请求同一个url可能导致 stalled 时间过长加个uuid防止请求阻塞
url = url + getCurrentProjectID() + "?stamp=" + getUUID();
return get(url, success);
}
export function getDashboardIssues(page) {
return post(`issues/dashboard/list/${page.currentPage}/${page.pageSize}`, page.condition);
}

View File

@ -1,7 +0,0 @@
import {post} from "metersphere-frontend/src/plugins/request"
export function saveLicense(data) {
return post("/samples/license/save", data)
}

View File

@ -1,226 +1,5 @@
import {get, post, request} from "metersphere-frontend/src/plugins/request"
export function getDashboardHeatmap() {
return get('/performance/dashboard/tests')
}
export function getRecentTests(condition) {
return post('/performance/recent/5', condition)
}
export function getRecentReports(condition) {
return post('/performance/report/recent/5', condition)
}
export function getReportCount(testId) {
return get(`/performance/test/report-count/${testId}`)
}
export function getPerformanceVersions(testId) {
return get(`/performance/versions/${testId}`)
}
export function deleteCurrentVersionTest(test) {
return get(`performance/delete/${test.versionId}/${test.refId}`);
}
import {post} from "metersphere-frontend/src/plugins/request"
export function searchTests(goPage, pageSize, condition) {
return post(`/performance/list/${goPage}/${pageSize}`, condition)
}
export function copyTest(test) {
return post(`/performance/copy`, {id: test.id})
}
export function runTest(test) {
return post('/performance/run', {id: test.id, triggerMode: 'MANUAL'})
}
export function deleteTest(data) {
return post(`/performance/delete`, data)
}
export function deleteTestBatch(data) {
return post(`/performance/delete/batch`, data)
}
export function getTest(id) {
return get(`/performance/get/${id}`)
}
export function getFollows(id) {
return get(`/performance/test/follow/${id}`)
}
export function getTestVersionHistory(id) {
return get(`/performance/versions/${id}`)
}
export function getTestByVersion(versionId, refId) {
return get(`/performance/get/${versionId}/${refId}`)
}
export function syncScenario(param) {
return get(`/performance/sync/scenario`, param)
}
export function saveSchedule(param) {
let url = '/performance/schedule/create';
if (param.id) {
url = '/performance/schedule/update';
}
return post(url, param);
}
export function saveTest(test, formData) {
let savePath = "/performance/save"
let editPath = "/performance/edit"
let url = test.id ? editPath : savePath;
let config = {
method: 'POST',
url: url,
data: formData,
headers: {
'Content-Type': undefined
}
}
return request(config);
}
export function saveFollows(testId, param) {
return post(`/performance/test/update/follows/${testId}`, param)
}
export function getFiles(id) {
return get(`/performance/file/metadata/${id}`)
}
export function getMetadataById(id) {
return get(`/performance/file/getMetadataById/${id}`)
}
export function getResourcePools(isShare) {
let url = '/testresourcepool/list/quota/valid';
if (isShare) {
url = '/share/testresourcepool/list/quota/valid';
}
return get(url);
}
export function getLoadConfig(testId, reportId, isShare) {
let url = '';
if (testId) {
url = '/performance/get-load-config/' + testId;
}
if (reportId) {
url = '/performance/report/get-load-config/' + reportId;
}
if (!url) {
return;
}
if (isShare) {
url = '/share/performance/report/get-load-config/' + reportId;
}
return get(url);
}
export function getJmxContent(testId, reportId, isShare) {
let url = '';
if (testId) {
url = '/performance/get-jmx-content/' + testId;
}
if (reportId) {
url = '/performance/report/get-jmx-content/' + reportId;
}
if (!url) {
return;
}
if (isShare) {
url = '/share/performance/report/get-jmx-content/' + reportId;
}
return get(url)
}
export function getAdvancedConfig(type, testId, reportId, isShare, shareId) {
let url = '/performance/get-advanced-config/' + testId;
if (type) {
url = '/performance/report/get-advanced-config/' + reportId;
}
if (isShare) {
url = '/share/performance/report/get-advanced-config/' + shareId + '/' + reportId;
}
return get(url);
}
export function getJmxContents(jmxIds) {
return post('/performance/export/jmx', jmxIds)
}
export function downloadFile(url, file) {
let data = {
name: file.name,
id: file.id,
};
let config = {
url: url,
method: 'post',
data: data,
responseType: 'blob'
};
return request(config);
}
export function getProjectFiles(type, projectId, currentPage, pageSize, condition) {
return post(`/performance/project/${type}/${projectId}/${currentPage}/${pageSize}`, condition)
}
export function getNoticeTasks(testId) {
return get(`/notice/search/message/${testId}`);
}
export function getProjectFileByName(projectId, data) {
return post(`/performance/file/${projectId}/getMetadataByName`, data)
}
export function uploadFiles(projectId, formData) {
let url = `/project/upload/files/${projectId}`;
let options = {
method: 'POST',
url: url,
data: formData,
headers: {
'Content-Type': undefined
}
};
return request(options);
}
export function updateFile(fileId, formData) {
let url = `/project/upload/file/${fileId}`;
let options = {
method: 'POST',
url: url,
data: formData,
headers: {
'Content-Type': undefined
}
};
return request(options);
}
export function deleteFile(fileId) {
return get(`/project/delete/file/${fileId}`)
}
export function listSchedule(data) {
return post('/performance/list/schedule', data)
}
export function updateSchedule(schedule) {
return post('/performance/schedule/update', schedule);
}

View File

@ -9,10 +9,6 @@ export function getProject(id) {
return get(`/project/get/${id}`)
}
export function getProjectMemberSize(id) {
return get(`/project/member/size/${id}`)
}
export function versionEnableByProjectId(projectId) {
return get('/project/version/enable/' + projectId);
}

View File

@ -4,151 +4,11 @@ export function getScenarioById(scenarioId) {
return get("/api/automation/get/" + scenarioId);
}
export function getScenarioWithBLOBsById(scenarioId) {
return get("/api/automation/scenario-details/" + scenarioId);
}
export function getScenarioList(currentPage, pageSize, condition) {
let url = "/api/automation/list/" + currentPage + "/" + pageSize;
return post(url, condition);
}
export function getScenarioByTrash(condition) {
return post("/api/automation/list/all/trash", condition);
}
export function getScenarioByProjectId(projectId) {
return get("/api/automation/env-project-ids/" + projectId);
}
export function checkScenarioEnv(scenarioId) {
return get("/api/automation/env-valid" + scenarioId);
}
export function execStop(reportId) {
return get("/api/automation/stop/" + reportId);
}
export function execBatchStop(res) {
return post("/api/automation/stop/batch", res);
}
export function getFollowByScenarioId(scenarioId) {
return get("/api/automation/follow/" + scenarioId);
}
export function getScenarioVersions(scenarioId) {
return get("/api/automation/versions/" + scenarioId);
}
export function delByScenarioId(scenarioId) {
return get("/api/automation/delete/" + scenarioId);
}
export function delByScenarioIdAndRefId(scenarioId, refId) {
return get("/api/automation/delete/" + scenarioId + "/" + refId);
}
export function deleteBatchByCondition(params) {
return post("/api/automation/del-batch", params);
}
export function apiScenarioAll(params) {
return post("/api/automation/id/all", params);
}
export function getApiScenarios(params) {
return post("/api/automation/get-scenario-list", params);
}
export function getReference(params) {
return post("/api/automation/getReference", params);
}
export function genPerformanceTestJmx(params) {
return post("/api/automation/gen-jmx", params);
}
export function apiScenarioEnv(params) {
return post("/api/automation/env", params);
}
export function getApiScenarioProjectIdByConditions(params) {
return post("/api/automation/list-project-ids", params);
}
export function createSchedule(params) {
return post("/api/automation/schedule/create", params);
}
export function updateSchedule(params) {
return post("/api/automation/schedule/update", params);
}
export function setScenarioDomain(params) {
return post("/api/automation/set-domain", params);
}
export function listWithIds(params) {
return post("/api/automation/list-blobs", params);
}
export function getApiScenarioEnv(params) {
return post("/api/automation/scenario-env", params);
}
export function batchEditScenario(params) {
return post("/api/automation/batch/edit", params);
}
export function batchCopyScenario(params) {
return post("/api/automation/batch/copy", params);
}
export function updateScenarioEnv(params) {
return post("/api/automation/batch/update/env", params);
}
export function scenarioPlan(params) {
return post("/api/automation/scenario/plan", params);
}
export function runBatch(params) {
return post("/api/automation/run/batch", params);
}
export function scenarioRun(params) {
return post("/api/automation/run", params);
}
export function scenarioReduction(params) {
return post("/api/automation/reduction", params);
}
export function scenarioAllIds(params) {
return post("/api/automation/id/all", params);
}
export function checkBeforeDelete(params) {
return post("/api/automation/get-del-details", params);
}
export function removeScenarioToGcByBatch(params) {
return post("/api/automation/move-gc-batch", params);
}
export function exportScenario(params) {
return post("/api/automation/export", params);
}
export function batchGenPerformanceTestJmx(params) {
return post("/api/automation/gen-jmx-batch", params);
}
export function updateScenarioFollows(id, params) {
return post("/api/automation/update/follows/" + id, params);
}
export function getScenarioReference(params) {
return post("/api/automation/getReference", params);
}

View File

@ -1,6 +1,4 @@
import {post,get} from "metersphere-frontend/src/plugins/request";
import {getCurrentProjectID} from "metersphere-frontend/src/utils/token";
export function getPlanStageOption(projectID) {
return get('/test/plan/get/stage/option/' + projectID);

View File

@ -1,6 +0,0 @@
import {get} from 'metersphere-frontend/src/plugins/request'
export function listUsers(page, size) {
return get(`/samples/user-management/list/${page}/${size}`)
}

View File

@ -1,5 +1,5 @@
/* 前后端不分离的登录方式 */
import {get, post, put} from "metersphere-frontend/src/plugins/request"
import {get} from "metersphere-frontend/src/plugins/request"
export function getProjectMember() {

View File

@ -1,4 +1,4 @@
import {post,get} from "metersphere-frontend/src/plugins/request"
import {get} from "metersphere-frontend/src/plugins/request"
export function getMyCreatedCaseGroupContMap(param) {
return get('/workstation/creat_case_count/list/'+param);