🎨 Fix #318
This commit is contained in:
parent
f32bc7ab5f
commit
b115e34f15
|
@ -124,7 +124,7 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
oneRuneStr = strings.Replace(oneRuneStr, ">", ">", -1)
|
oneRuneStr = strings.Replace(oneRuneStr, ">", ">", -1)
|
||||||
channelRet["cmd"] = "run"
|
channelRet["cmd"] = "run"
|
||||||
channelRet["output"] = oneRuneStr
|
channelRet["output"] = oneRuneStr
|
||||||
wsChannel := session.OutputWS[sid]
|
wsChannel := session.PlaygroundWS[sid]
|
||||||
if nil != wsChannel {
|
if nil != wsChannel {
|
||||||
wsChannel.WriteJSON(&channelRet)
|
wsChannel.WriteJSON(&channelRet)
|
||||||
wsChannel.Refresh()
|
wsChannel.Refresh()
|
||||||
|
@ -142,8 +142,8 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
oneRuneStr = strings.Replace(oneRuneStr, "<", "<", -1)
|
oneRuneStr = strings.Replace(oneRuneStr, "<", "<", -1)
|
||||||
oneRuneStr = strings.Replace(oneRuneStr, ">", ">", -1)
|
oneRuneStr = strings.Replace(oneRuneStr, ">", ">", -1)
|
||||||
channelRet["cmd"] = "run"
|
channelRet["cmd"] = "run"
|
||||||
channelRet["output"] = "<span class='stderr'>" + oneRuneStr + "</span>"
|
channelRet["output"] = oneRuneStr
|
||||||
wsChannel := session.OutputWS[sid]
|
wsChannel := session.PlaygroundWS[sid]
|
||||||
if nil != wsChannel {
|
if nil != wsChannel {
|
||||||
wsChannel.WriteJSON(&channelRet)
|
wsChannel.WriteJSON(&channelRet)
|
||||||
wsChannel.Refresh()
|
wsChannel.Refresh()
|
||||||
|
@ -157,9 +157,7 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
channelRet["cmd"] = "run-done"
|
channelRet["cmd"] = "run-done"
|
||||||
if 124 == cmd.ProcessState.ExitCode() {
|
if 124 == cmd.ProcessState.ExitCode() {
|
||||||
channelRet["output"] = "<span class='stderr'>run program timeout in 5s</span>\n"
|
channelRet["output"] = "\nrun program timeout in 5s\n"
|
||||||
} else {
|
|
||||||
channelRet["output"] = "\n<span class='stderr'>run program complete</span>\n"
|
|
||||||
}
|
}
|
||||||
if nil != wsChannel {
|
if nil != wsChannel {
|
||||||
wsChannel.WriteJSON(&channelRet)
|
wsChannel.WriteJSON(&channelRet)
|
||||||
|
|
Loading…
Reference in New Issue