This commit is contained in:
parent
2825d347b4
commit
ea0bf4bae0
|
@ -217,7 +217,7 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
for {
|
for {
|
||||||
r, _, err := errReader.ReadRune()
|
r, _, err := errReader.ReadRune()
|
||||||
|
|
||||||
if nil == session.OutputWS[sid] {
|
if nil != err || nil == session.OutputWS[sid] {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -227,17 +227,15 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
buf = strings.Replace(buf, "<", "<", -1)
|
buf = strings.Replace(buf, "<", "<", -1)
|
||||||
buf = strings.Replace(buf, ">", ">", -1)
|
buf = strings.Replace(buf, ">", ">", -1)
|
||||||
|
|
||||||
if nil == err {
|
channelRet["cmd"] = "run"
|
||||||
channelRet["cmd"] = "run"
|
channelRet["output"] = "<span class='stderr'>" + buf + "</span>"
|
||||||
channelRet["output"] = "<span class='stderr'>" + buf + "</span>"
|
err := wsChannel.WriteJSON(&channelRet)
|
||||||
err := wsChannel.WriteJSON(&channelRet)
|
if nil != err {
|
||||||
if nil != err {
|
logger.Error(err)
|
||||||
logger.Error(err)
|
break
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
wsChannel.Refresh()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wsChannel.Refresh()
|
||||||
}
|
}
|
||||||
}(rand.Int())
|
}(rand.Int())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue