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