Skip to content

Commit 95adf09

Browse files
authored
feat: add History api and ui (#524)
1 parent 4aadd06 commit 95adf09

31 files changed

+6944
-1392
lines changed

console/atest-ui/package-lock.json

Lines changed: 93 additions & 67 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

console/atest-ui/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@
1717
},
1818
"dependencies": {
1919
"@vueuse/core": "^10.11.0",
20+
"codemirror": "^5.65.17",
21+
"diff-match-patch": "^1.0.5",
2022
"element-plus": "^2.3.7",
2123
"intro.js": "^7.0.1",
2224
"jsonlint-mod": "^1.7.6",
2325
"jsonpath-plus": "^7.2.0",
2426
"skywalking-client-js": "^0.10.0",
2527
"vue": "^3.3.4",
26-
"vue-codemirror": "^6.1.1",
28+
"vue-codemirror": "^5.1.0",
2729
"vue-i18n": "^9.2.2",
2830
"vue-json-viewer": "^3.0.4",
2931
"vue-router": "^4.2.2"

console/atest-ui/src/App.vue

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import {
33
Document,
44
Menu as IconMenu,
5+
Histogram,
56
Location,
67
Share,
78
ArrowDown
@@ -10,6 +11,7 @@ import { ref, watch } from 'vue'
1011
import { API } from './views/net'
1112
import { Cache } from './views/cache'
1213
import TestingPanel from './views/TestingPanel.vue'
14+
import TestingHistoryPanel from './views/TestingHistoryPanel.vue'
1315
import MockManager from './views/MockManager.vue'
1416
import StoreManager from './views/StoreManager.vue'
1517
import SecretManager from './views/SecretManager.vue'
@@ -81,6 +83,12 @@ const handleChangeLan = (command: string) => {
8183
}
8284
};
8385
86+
const ID = ref(null);
87+
const toHistoryPanel = ({ ID: selectID, panelName: historyPanelName }) => {
88+
ID.value = selectID;
89+
panelName.value = historyPanelName;
90+
}
91+
8492
</script>
8593

8694
<template>
@@ -104,6 +112,10 @@ const handleChangeLan = (command: string) => {
104112
<el-icon><icon-menu /></el-icon>
105113
<template #title>{{ t('title.testing' )}}</template>
106114
</el-menu-item>
115+
<el-menu-item index="history" test-id="history-menu">
116+
<el-icon><histogram /></el-icon>
117+
<template #title>{{ t('title.history' )}}</template>
118+
</el-menu-item>
107119
<el-menu-item index="mock" test-id="mock-menu">
108120
<el-icon><icon-menu /></el-icon>
109121
<template #title>{{ t('title.mock' )}}</template>
@@ -134,7 +146,8 @@ const handleChangeLan = (command: string) => {
134146
</el-dropdown>
135147
</el-col>
136148
</div>
137-
<TestingPanel v-if="panelName === 'testing'" />
149+
<TestingPanel v-if="panelName === 'testing'" @toHistoryPanel="toHistoryPanel"/>
150+
<TestingHistoryPanel v-else-if="panelName === 'history'" :ID="ID"/>
138151
<MockManager v-else-if="panelName === 'mock'" />
139152
<StoreManager v-else-if="panelName === 'store'" />
140153
<SecretManager v-else-if="panelName === 'secret'" />

console/atest-ui/src/locales/en.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@
2222
"generateCode": "Generate Code",
2323
"sendWithParam": "Send With Parameter",
2424
"fullScreen": "Full Screen",
25-
"cancelFullScreen": "Cancel Full Screen"
25+
"cancelFullScreen": "Cancel Full Screen",
26+
"viewHistory": "View History Test Case Result",
27+
"revert": "Revert",
28+
"goToHistory": "Go to History",
29+
"deleteAllHistory": "Delete All History"
2630
},
2731
"title": {
2832
"createTestSuite": "Create Test Suite",
@@ -38,6 +42,7 @@
3842
"apiRequestParameter": "API Request Parameter",
3943
"codeGenerator": "Code Generator",
4044
"testing": "Testing",
45+
"history": "Testing History",
4146
"mock": "Mock",
4247
"welcome": "Welcome",
4348
"secrets": "Secrets",
@@ -49,7 +54,8 @@
4954
"filter": "Filter Keyword",
5055
"noParameter": "No Parameter",
5156
"testsuite": "Test Suite:",
52-
"apiAddress": "API Address:"
57+
"apiAddress": "API Address:",
58+
"runningAt": "Running At:"
5359
},
5460
"field": {
5561
"name": "Name",

0 commit comments

Comments
 (0)