2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 05:31:44 +08:00
Files
panel/internal/route/ws.go
Copilot 8031e53852 feat: 添加容器编排实时进度显示功能 (#1217)
* Initial plan

* feat: 添加容器编排实时进度显示功能

Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com>

* fix: 修复代码审查问题,使用动态路径和安全的字体大小操作

Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com>

* docs: 完成容器编排实时进度显示功能

Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com>

* feat: 容器优化

* fix: 用户关闭命令窗口时杀死正在运行的进程

Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com>

* refactor: 改进 WebSocket 断开检测,支持用户输入转发到 PTY

Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com>

* feat: 启用终端用户输入支持,转发键盘输入到 PTY

Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com>

* feat: 容器优化

* fix: lint

* feat: 添加 PTY 窗口大小调整支持

Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com>

* feat: 支持读取输入

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com>
Co-authored-by: 耗子 <haozi@loli.email>
2026-01-11 18:37:01 +08:00

28 lines
514 B
Go

package route
import (
"github.com/go-chi/chi/v5"
"github.com/acepanel/panel/internal/service"
)
type Ws struct {
ws *service.WsService
}
func NewWs(ws *service.WsService) *Ws {
return &Ws{
ws: ws,
}
}
func (route *Ws) Register(r *chi.Mux) {
r.Route("/api/ws", func(r chi.Router) {
r.Get("/exec", route.ws.Exec)
r.Get("/pty", route.ws.PTY)
r.Get("/ssh", route.ws.Session)
r.Get("/container/{id}", route.ws.ContainerTerminal)
r.Get("/container/image/pull", route.ws.ContainerImagePull)
})
}