feat: add demo site config

This commit is contained in:
engigu
2025-12-25 21:46:06 +08:00
parent 9bf9e5b5b8
commit 9c77601215
9 changed files with 67 additions and 6 deletions
@@ -72,6 +72,12 @@ func (tc *TerminalController) HandleWebSocket(c *gin.Context) {
}
defer conn.Close()
// 演示模式下禁用终端
if constant.DemoMode {
conn.WriteMessage(websocket.TextMessage, []byte("\r\n\033[1;33m[演示模式] 终端功能已禁用\033[0m\r\n"))
return
}
// Windows 使用 pipe 模式,Unix 使用 PTY 模式
if runtime.GOOS == "windows" {
tc.handlePipeMode(conn)