mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-04 18:59:08 +01:00
add windowid
This commit is contained in:
parent
a5fedb3668
commit
862014bd82
@ -141,6 +141,7 @@ func WriteJsonSuccess(w http.ResponseWriter, data interface{}) {
|
|||||||
|
|
||||||
type runCommandParams struct {
|
type runCommandParams struct {
|
||||||
SessionId string `json:"sessionid"`
|
SessionId string `json:"sessionid"`
|
||||||
|
WindowId string `json:"windowid"`
|
||||||
Command string `json:"command"`
|
Command string `json:"command"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -174,7 +175,7 @@ func HandleRunCommand(w http.ResponseWriter, r *http.Request) {
|
|||||||
WriteJsonError(w, fmt.Errorf("invalid emtpty command"))
|
WriteJsonError(w, fmt.Errorf("invalid emtpty command"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
rtnLine := sstore.MakeNewLineCmd(commandStr)
|
rtnLine := sstore.MakeNewLineCmd(params.SessionId, params.WindowId, commandStr)
|
||||||
runPacket := packet.MakeRunPacket()
|
runPacket := packet.MakeRunPacket()
|
||||||
runPacket.SessionId = params.SessionId
|
runPacket.SessionId = params.SessionId
|
||||||
runPacket.CmdId = rtnLine.CmdId
|
runPacket.CmdId = rtnLine.CmdId
|
||||||
|
@ -12,6 +12,8 @@ const LineTypeCmd = "cmd"
|
|||||||
const LineTypeText = "text"
|
const LineTypeText = "text"
|
||||||
|
|
||||||
type LineType struct {
|
type LineType struct {
|
||||||
|
SessionId string `json:"sessionid"`
|
||||||
|
WindowId string `json:"windowid"`
|
||||||
LineId int `json:"lineid"`
|
LineId int `json:"lineid"`
|
||||||
Ts int64 `json:"ts"`
|
Ts int64 `json:"ts"`
|
||||||
UserId string `json:"userid"`
|
UserId string `json:"userid"`
|
||||||
@ -22,8 +24,10 @@ type LineType struct {
|
|||||||
CmdRemote string `json:"cmdremote,omitempty"`
|
CmdRemote string `json:"cmdremote,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func MakeNewLineCmd(cmdText string) *LineType {
|
func MakeNewLineCmd(sessionId string, windowId string, cmdText string) *LineType {
|
||||||
rtn := &LineType{}
|
rtn := &LineType{}
|
||||||
|
rtn.SessionId = sessionId
|
||||||
|
rtn.WindowId = windowId
|
||||||
rtn.LineId = NextLineId
|
rtn.LineId = NextLineId
|
||||||
NextLineId++
|
NextLineId++
|
||||||
rtn.Ts = time.Now().UnixMilli()
|
rtn.Ts = time.Now().UnixMilli()
|
||||||
@ -34,8 +38,10 @@ func MakeNewLineCmd(cmdText string) *LineType {
|
|||||||
return rtn
|
return rtn
|
||||||
}
|
}
|
||||||
|
|
||||||
func MakeNewLineText(text string) *LineType {
|
func MakeNewLineText(sessionId string, windowId string, text string) *LineType {
|
||||||
rtn := &LineType{}
|
rtn := &LineType{}
|
||||||
|
rtn.SessionId = sessionId
|
||||||
|
rtn.WindowId = windowId
|
||||||
rtn.LineId = NextLineId
|
rtn.LineId = NextLineId
|
||||||
NextLineId++
|
NextLineId++
|
||||||
rtn.Ts = time.Now().UnixMilli()
|
rtn.Ts = time.Now().UnixMilli()
|
||||||
|
Loading…
Reference in New Issue
Block a user