Skip to content

Commit f517a06

Browse files
committed
fix(terminal): 修复webkubectl path 路径错误的问题
1 parent 6f05f99 commit f517a06

File tree

4 files changed

+78
-78
lines changed

4 files changed

+78
-78
lines changed

internal/server/server.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ func (e *KubePiSerer) setWebkubectlProxy() {
235235
proxy.ModifyResponse = func(resp *http.Response) error {
236236
if resp.StatusCode == iris.StatusMovedPermanently {
237237
// 重定向重写
238-
if resp.Header.Get("Location") == "/webkubectl/" {
239-
resp.Header.Set("Location", "/webkubectl/root")
238+
if resp.Header.Get("Location") == "/kubepi/webkubectl/" {
239+
resp.Header.Set("Location", "/kubepi/webkubectl/root")
240240
}
241241
}
242242
return nil

thirdparty/gotty/server/server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func (server *Server) Run(ctx context.Context, options ...RunOption) error {
115115
}
116116

117117
counter := newCounter(time.Duration(server.options.Timeout) * time.Second)
118-
path := "/webkubectl/"
118+
path := "/kubepi/webkubectl/"
119119
customPath := os.Getenv("TERMINAL_PATH")
120120
if len(customPath) > 0 {
121121
path = customPath

web/dashboard/package-lock.json

+74-74
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/dashboard/src/business/app-layout/header-components/TerminalEnter.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default {
1717
const clusterName = this.$store.getters.cluster
1818
getTerminalSession(clusterName).then(data => {
1919
const token = data.data.token
20-
const url = `/webkubectl/root?token=${token}`
20+
const url = `/kubepi/webkubectl/root?token=${token}`
2121
open(url, "_black")
2222
})
2323
}

0 commit comments

Comments
 (0)