Skip to content

Commit 425e72b

Browse files
authored
Merge branch 'LinuxSuRen:master' into feat-#529
2 parents d81263e + 296fd40 commit 425e72b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+7051
-1440
lines changed

cmd/extension.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ type extensionOption struct {
3535
os string
3636
arch string
3737
timeout time.Duration
38+
imagePrefix string
3839
}
3940

4041
func createExtensionCommand(ociDownloader downloader.PlatformAwareOCIDownloader) (c *cobra.Command) {
@@ -55,13 +56,15 @@ func createExtensionCommand(ociDownloader downloader.PlatformAwareOCIDownloader)
5556
flags.StringVarP(&opt.os, "os", "", runtime.GOOS, "The OS")
5657
flags.StringVarP(&opt.arch, "arch", "", runtime.GOARCH, "The architecture")
5758
flags.DurationVarP(&opt.timeout, "timeout", "", time.Minute, "The timeout of downloading")
59+
flags.StringVarP(&opt.imagePrefix, "image-prefix", "", "linuxsuren", "The prefix for the image address")
5860
return
5961
}
6062

6163
func (o *extensionOption) runE(cmd *cobra.Command, args []string) (err error) {
6264
o.ociDownloader.WithOS(o.os)
6365
o.ociDownloader.WithArch(o.arch)
6466
o.ociDownloader.WithRegistry(o.registry)
67+
o.ociDownloader.WithImagePrefix(o.imagePrefix)
6568
o.ociDownloader.WithTimeout(o.timeout)
6669
o.ociDownloader.WithContext(cmd.Context())
6770

cmd/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import (
4242
"github.com/linuxsuren/api-testing/pkg/downloader"
4343
"github.com/linuxsuren/api-testing/pkg/logging"
4444
"github.com/linuxsuren/api-testing/pkg/mock"
45+
atestoauth "github.com/linuxsuren/api-testing/pkg/oauth"
4546
template "github.com/linuxsuren/api-testing/pkg/render"
4647
"github.com/linuxsuren/api-testing/pkg/server"
4748
"github.com/linuxsuren/api-testing/pkg/service"
@@ -50,7 +51,6 @@ import (
5051
"github.com/linuxsuren/api-testing/pkg/testing/remote"
5152
"github.com/linuxsuren/api-testing/pkg/util"
5253
fakeruntime "github.com/linuxsuren/go-fake-runtime"
53-
atestoauth "github.com/linuxsuren/api-testing/pkg/oauth"
5454
"github.com/linuxsuren/oauth-hub"
5555

5656
"github.com/prometheus/client_golang/prometheus"
@@ -469,7 +469,7 @@ func debugHandler(mux *runtime.ServeMux, remoteServer server.RunnerServer) {
469469
Name: sub,
470470
})
471471
if err == nil {
472-
w.Header().Set("Content-Type", "application/octet-stream")
472+
w.Header().Set(util.ContentType, "application/octet-stream")
473473
w.Write(data.Data)
474474
} else {
475475
w.WriteHeader(http.StatusBadRequest)

console/atest-ui/package-lock.json

Lines changed: 93 additions & 66 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
Files,
@@ -11,6 +12,7 @@ import { ref, watch } from 'vue'
1112
import { API } from './views/net'
1213
import { Cache } from './views/cache'
1314
import TestingPanel from './views/TestingPanel.vue'
15+
import TestingHistoryPanel from './views/TestingHistoryPanel.vue'
1416
import MockManager from './views/MockManager.vue'
1517
import StoreManager from './views/StoreManager.vue'
1618
import FileManager from './views/FileManager.vue'
@@ -83,6 +85,12 @@ const handleChangeLan = (command: string) => {
8385
}
8486
};
8587
88+
const ID = ref(null);
89+
const toHistoryPanel = ({ ID: selectID, panelName: historyPanelName }) => {
90+
ID.value = selectID;
91+
panelName.value = historyPanelName;
92+
}
93+
8694
</script>
8795

8896
<template>
@@ -106,6 +114,10 @@ const handleChangeLan = (command: string) => {
106114
<el-icon><icon-menu /></el-icon>
107115
<template #title>{{ t('title.testing' )}}</template>
108116
</el-menu-item>
117+
<el-menu-item index="history" test-id="history-menu">
118+
<el-icon><histogram /></el-icon>
119+
<template #title>{{ t('title.history' )}}</template>
120+
</el-menu-item>
109121
<el-menu-item index="mock" test-id="mock-menu">
110122
<el-icon><icon-menu /></el-icon>
111123
<template #title>{{ t('title.mock' )}}</template>
@@ -140,7 +152,8 @@ const handleChangeLan = (command: string) => {
140152
</el-dropdown>
141153
</el-col>
142154
</div>
143-
<TestingPanel v-if="panelName === 'testing'" />
155+
<TestingPanel v-if="panelName === 'testing'" @toHistoryPanel="toHistoryPanel"/>
156+
<TestingHistoryPanel v-else-if="panelName === 'history'" :ID="ID"/>
144157
<MockManager v-else-if="panelName === 'mock'" />
145158
<StoreManager v-else-if="panelName === 'store'" />
146159
<FileManager v-else-if="panelName === 'file'" />

0 commit comments

Comments
 (0)