mirror of
https://github.com/lzh-1625/go_process_manager.git
synced 2025-10-05 07:56:50 +08:00
update
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/lzh-1625/go_process_manager/internal/app/eum"
|
||||
"github.com/lzh-1625/go_process_manager/internal/app/logic"
|
||||
"github.com/lzh-1625/go_process_manager/internal/app/model"
|
||||
"github.com/lzh-1625/go_process_manager/internal/app/repository"
|
||||
@@ -63,7 +64,7 @@ func (p *procApi) StartProcess(ctx *gin.Context, req struct {
|
||||
logic.ProcessCtlLogic.AddProcess(req.Uuid, proc)
|
||||
return nil
|
||||
}
|
||||
if prod.State.State == 1 {
|
||||
if prod.State.State == eum.ProcessStateStart {
|
||||
return errors.New("process is currently running")
|
||||
}
|
||||
prod.ResetRestartTimes()
|
||||
|
@@ -74,7 +74,7 @@ func (w *wsApi) WebsocketHandle(ctx *gin.Context, req model.WebsocketHandleReq)
|
||||
wsLock: sync.Mutex{},
|
||||
}
|
||||
proc.ReadCache(wci)
|
||||
if proc.State.State == 1 {
|
||||
if proc.State.State == eum.ProcessStateStart {
|
||||
proc.SetTerminalSize(req.Cols, req.Rows)
|
||||
w.startWsConnect(wci, cancel, proc, hasOprPermission(ctx, req.Uuid, eum.OperationTerminalWrite))
|
||||
proc.AddConn(reqUser, wci)
|
||||
@@ -112,7 +112,7 @@ func (w *wsApi) WebsocketShareHandle(ctx *gin.Context, req model.WebsocketHandle
|
||||
if proc.HasWsConn(guestName) {
|
||||
return errors.New("connection already exists")
|
||||
}
|
||||
if proc.State.State != 1 {
|
||||
if proc.State.State != eum.ProcessStateStart {
|
||||
return errors.New("process not is running")
|
||||
}
|
||||
if !proc.VerifyControl() {
|
||||
|
Reference in New Issue
Block a user