From 3dc91f8d469db9056cab741e1af357baf22537a4 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 22 Oct 2014 16:37:07 +0800 Subject: [PATCH] l --- output/outputs.go | 4 ++-- static/js/wide.js | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/output/outputs.go b/output/outputs.go index 1436d76..f595645 100644 --- a/output/outputs.go +++ b/output/outputs.go @@ -115,7 +115,7 @@ func RunHandler(w http.ResponseWriter, r *http.Request) { glog.V(3).Infof("Session [%s] is running [id=%d, file=%s]", sid, runningId, filePath) - // 在读取程序输出前先返回一次,使前端获取到 run 状态与 pid + // 在读取程序输出前先返回一次,使前端获取到 run 状态以及对应的 pid if nil != session.OutputWS[sid] { wsChannel := session.OutputWS[sid] @@ -289,7 +289,7 @@ func BuildHandler(w http.ResponseWriter, r *http.Request) { if 0 == count { // 说明构建成功,没有错误信息输出 // 设置下一次执行命令(前端会根据这个发送请求) - channelRet["nextCmd"] = args["nextCmd"] + channelRet["nextCmd"] = "run" go func() { // 运行 go install,生成的库用于 gocode lib-path cmd := exec.Command("go", "install") diff --git a/static/js/wide.js b/static/js/wide.js index 95826a0..f735aa2 100644 --- a/static/js/wide.js +++ b/static/js/wide.js @@ -501,6 +501,15 @@ var wide = { return false; } + if ($(".menu li.run").hasClass("disabled")) { + return false; + } + + if ($(".toolbars .ico-stop").length === 1) { + wide.stop(); + return false; + } + var request = newWideRequest(); request.file = currentPath; request.code = wide.curEditor.getValue();