Merge remote-tracking branch 'refs/remotes/origin/master' into 1.5.3-dev
This commit is contained in:
commit
2b790ce300
|
@ -67,6 +67,14 @@ func PreferenceHandler(w http.ResponseWriter, r *http.Request) {
|
|||
user := conf.GetUser(username)
|
||||
|
||||
if "GET" == r.Method {
|
||||
tmpLinux := user.GoBuildArgsForLinux
|
||||
tmpWindows := user.GoBuildArgsForWindows
|
||||
tmpDarwin := user.GoBuildArgsForDarwin
|
||||
|
||||
user.GoBuildArgsForLinux = strings.Replace(user.GoBuildArgsForLinux, `"`, `"`, -1)
|
||||
user.GoBuildArgsForWindows = strings.Replace(user.GoBuildArgsForWindows, `"`, `"`, -1)
|
||||
user.GoBuildArgsForDarwin = strings.Replace(user.GoBuildArgsForDarwin, `"`, `"`, -1)
|
||||
|
||||
model := map[string]interface{}{"conf": conf.Wide, "i18n": i18n.GetAll(user.Locale), "user": user,
|
||||
"ver": conf.WideVersion, "goos": runtime.GOOS, "goarch": runtime.GOARCH, "gover": runtime.Version(),
|
||||
"locales": i18n.GetLocalesNames(), "gofmts": util.Go.GetGoFormats(),
|
||||
|
@ -78,11 +86,18 @@ func PreferenceHandler(w http.ResponseWriter, r *http.Request) {
|
|||
logger.Error(err)
|
||||
http.Error(w, err.Error(), 500)
|
||||
|
||||
user.GoBuildArgsForLinux = tmpLinux
|
||||
user.GoBuildArgsForWindows = tmpWindows
|
||||
user.GoBuildArgsForDarwin = tmpDarwin
|
||||
return
|
||||
}
|
||||
|
||||
t.Execute(w, model)
|
||||
|
||||
user.GoBuildArgsForLinux = tmpLinux
|
||||
user.GoBuildArgsForWindows = tmpWindows
|
||||
user.GoBuildArgsForDarwin = tmpDarwin
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue