fix bug
This commit is contained in:
@@ -8,14 +8,14 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
// TplVscodeHome 显示 DevStar Home 页面 templates/vscode-home.tmpl
|
||||
TplVscodeHome templates.TplName = "repo/devcontainer/vscode-home"
|
||||
// TplDevstarHome 显示 DevStar Home 页面 templates/vscode-home.tmpl
|
||||
TplDevstarHome templates.TplName = "repo/devcontainer/vscode-home"
|
||||
)
|
||||
|
||||
// VscodeHome 渲染适配于 VSCode 插件的 DevStar Home 页面
|
||||
func VscodeHome(ctx *gitea_web_context.Context) {
|
||||
// DevstarHome 渲染适配于 VSCode 插件的 DevStar Home 页面
|
||||
func DevstarHome(ctx *gitea_web_context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("home")
|
||||
ctx.Resp.Header().Del("X-Frame-Options")
|
||||
//ctx.Resp.Header().Set("Content-Security-Policy", "frame-ancestors *")
|
||||
ctx.HTML(http.StatusOK, TplVscodeHome)
|
||||
ctx.HTML(http.StatusOK, TplDevstarHome)
|
||||
}
|
||||
@@ -1433,8 +1433,7 @@ func registerWebRoutes(m *web.Router) {
|
||||
// 具有code读取权限
|
||||
context.RepoAssignment, reqUnitCodeReader,
|
||||
)
|
||||
m.Get("/devstar-home", devcontainer_web.VscodeHome) // 旧地址,保留兼容性
|
||||
m.Get("/vscode-home", devcontainer_web.VscodeHome)
|
||||
m.Get("/devstar-home", devcontainer_web.DevstarHome)
|
||||
m.Group("/api/devcontainer", func() {
|
||||
// 获取 某用户在某仓库中的 DevContainer 细节(包括SSH连接信息),默认不会等待 (wait = false)
|
||||
// 请求方式: GET /api/devcontainer?repoId=${repoId}&wait=true // 无需传入 userId,直接从 token 中提取
|
||||
|
||||
Reference in New Issue
Block a user