failed 2 error

This commit is contained in:
Liang Ding 2014-10-27 23:58:10 +08:00
parent e2ffefd173
commit f439a45ade
5 changed files with 22 additions and 21 deletions

View File

@ -7,7 +7,7 @@
"username": "Username", "username": "Username",
"current_user": "Current User", "current_user": "Current User",
"password": "Password", "password": "Password",
"login_failed": "Login Failed", "login_error": "Login Error",
"run": "Run", "run": "Run",
"debug": "Debug", "debug": "Debug",
"help": "Help", "help": "Help",
@ -86,16 +86,16 @@
"focus_notification": "Focus to Notification", "focus_notification": "Focus to Notification",
"start-build": "START [go build]", "start-build": "START [go build]",
"build-succ": "[go build] SUCCESS", "build-succ": "[go build] SUCCESS",
"build-failed": "[go build] ERROR", "build-error": "[go build] ERROR",
"start-test": "START [go test]", "start-test": "START [go test]",
"test-succ": "[go test] SUCCESS", "test-succ": "[go test] SUCCESS",
"test-failed": "[go test] ERROR", "test-error": "[go test] ERROR",
"start-install": "START [go install]", "start-install": "START [go install]",
"install-succ": "[go install] SUCCESS", "install-succ": "[go install] SUCCESS",
"install-failed": "[go install] ERROR", "install-error": "[go install] ERROR",
"start-get": "START [go get]", "start-get": "START [go get]",
"get-succ": "[go get] SUCCESS", "get-succ": "[go get] SUCCESS",
"get-failed": "[go get] ERROR", "get-error": "[go get] ERROR",
"check_version": "Checking update", "check_version": "Checking update",
"new_version_available": "new version available", "new_version_available": "new version available",
"go_env": "Go", "go_env": "Go",

View File

@ -7,7 +7,7 @@
"username": "用户名", "username": "用户名",
"current_user": "当前用户", "current_user": "当前用户",
"password": "密码", "password": "密码",
"login_failed": "登录失败", "login_error": "登录失败",
"run": "运行", "run": "运行",
"debug": "调试", "debug": "调试",
"help": "帮助", "help": "帮助",
@ -86,16 +86,16 @@
"focus_notification": "焦点切换到通知窗口", "focus_notification": "焦点切换到通知窗口",
"start-build": "开始 [go build]", "start-build": "开始 [go build]",
"build-succ": "[go build] 成功", "build-succ": "[go build] 成功",
"build-failed": "[go build] 失败", "build-error": "[go build] 失败",
"start-test": "开始 [go test]", "start-test": "开始 [go test]",
"test-succ": "[go test] 成功", "test-succ": "[go test] 成功",
"test-failed": "[go test] 失败", "test-error": "[go test] 失败",
"start-install": "开始 [go install]", "start-install": "开始 [go install]",
"install-succ": "[go install] 成功", "install-succ": "[go install] 成功",
"install-failed": "[go install] 失败", "install-error": "[go install] 失败",
"start-get": "开始 [go get]", "start-get": "开始 [go get]",
"get-succ": "[go get] 成功", "get-succ": "[go get] 成功",
"get-failed": "[go get] 失败", "get-error": "[go get] 失败",
"check_version": "正在检查更新", "check_version": "正在检查更新",
"new_version_available": "新版本可用", "new_version_available": "新版本可用",
"go_env": "Go 环境", "go_env": "Go 环境",

View File

@ -326,7 +326,7 @@ func BuildHandler(w http.ResponseWriter, r *http.Request) {
} else { // 构建失败 } else { // 构建失败
// 解析错误信息,返回给编辑器 gutter lint // 解析错误信息,返回给编辑器 gutter lint
errOut := string(buf) errOut := string(buf)
channelRet["output"] = "<span class='build-failed'>" + i18n.Get(locale, "build-failed").(string) + "</span>\n" + errOut channelRet["output"] = "<span class='build-error'>" + i18n.Get(locale, "build-error").(string) + "</span>\n" + errOut
lines := strings.Split(errOut, "\n") lines := strings.Split(errOut, "\n")
@ -480,7 +480,7 @@ func GoTestHandler(w http.ResponseWriter, r *http.Request) {
if !cmd.ProcessState.Success() { if !cmd.ProcessState.Success() {
glog.V(3).Infof("Session [%s] 's running [go test] [runningId=%d] has done (with error)", sid, runningId) glog.V(3).Infof("Session [%s] 's running [go test] [runningId=%d] has done (with error)", sid, runningId)
channelRet["output"] = "<span class='test-failed'>" + i18n.Get(locale, "test-failed").(string) + "</span>\n" + string(buf) channelRet["output"] = "<span class='test-error'>" + i18n.Get(locale, "test-error").(string) + "</span>\n" + string(buf)
} else { } else {
glog.V(3).Infof("Session [%s] 's running [go test] [runningId=%d] has done", sid, runningId) glog.V(3).Infof("Session [%s] 's running [go test] [runningId=%d] has done", sid, runningId)
@ -636,7 +636,7 @@ func GoInstallHandler(w http.ResponseWriter, r *http.Request) {
channelRet["lints"] = lints channelRet["lints"] = lints
channelRet["output"] = "<span class='install-failed'>" + i18n.Get(locale, "install-failed").(string) + "</span>\n" + errOut channelRet["output"] = "<span class='install-error'>" + i18n.Get(locale, "install-error").(string) + "</span>\n" + errOut
} else { } else {
channelRet["output"] = "<span class='install-succ'>" + i18n.Get(locale, "install-succ").(string) + "</span>\n" channelRet["output"] = "<span class='install-succ'>" + i18n.Get(locale, "install-succ").(string) + "</span>\n"
} }
@ -749,7 +749,7 @@ func GoGetHandler(w http.ResponseWriter, r *http.Request) {
if 0 != len(buf) { if 0 != len(buf) {
glog.V(3).Infof("Session [%s] 's running [go get] [runningId=%d] has done (with error)", sid, runningId) glog.V(3).Infof("Session [%s] 's running [go get] [runningId=%d] has done (with error)", sid, runningId)
channelRet["output"] = "<span class='get-failed'>" + i18n.Get(locale, "get-failed").(string) + "</span>\n" + string(buf) channelRet["output"] = "<span class='get-error'>" + i18n.Get(locale, "get-error").(string) + "</span>\n" + string(buf)
} else { } else {
glog.V(3).Infof("Session [%s] 's running [go get] [runningId=%d] has done", sid, runningId) glog.V(3).Infof("Session [%s] 's running [go get] [runningId=%d] has done", sid, runningId)

View File

@ -271,6 +271,7 @@
} }
.bottom-window-group .output { .bottom-window-group .output {
font-family: Consolas, Courier New, monospace;
padding: 0 5px; padding: 0 5px;
line-height: 16px; line-height: 16px;
font-size: 12px; font-size: 12px;
@ -294,10 +295,10 @@
color: rgb(0,153,0); color: rgb(0,153,0);
} }
.bottom-window-group .output .build-failed, .bottom-window-group .output .build-error,
.bottom-window-group .output .test-failed, .bottom-window-group .output .test-error,
.bottom-window-group .output .install-failed, .bottom-window-group .output .install-error,
.bottom-window-group .output .get-failed { .bottom-window-group .output .get-error {
color: red; color: red;
} }

View File

@ -58,7 +58,7 @@
dataType: "json", dataType: "json",
success: function (data) { success: function (data) {
if (!data.succ) { if (!data.succ) {
$("#msg").text('{{.i18n.login_failed}}').show(); $("#msg").text('{{.i18n.login_error}}').show();
return; return;
} }
@ -70,7 +70,7 @@
$("#username").keydown(function (event) { $("#username").keydown(function (event) {
if (event.which === 13) { if (event.which === 13) {
if ($.trim($(this).val()) === "") { if ($.trim($(this).val()) === "") {
$("#msg").text("{{.i18n.login_failed}}").show(); $("#msg").text("{{.i18n.login_error}}").show();
} else { } else {
$("#password").focus(); $("#password").focus();
} }
@ -83,7 +83,7 @@
$("#password").keydown(function (event) { $("#password").keydown(function (event) {
if (event.which === 13) { if (event.which === 13) {
if ($.trim($(this).val()) === "") { if ($.trim($(this).val()) === "") {
$("#msg").text("{{.i18n.login_failed}}").show(); $("#msg").text("{{.i18n.login_error}}").show();
} else { } else {
login(); login();
} }