This commit is contained in:
parent
2bb0a92ddb
commit
524d022787
|
@ -8,7 +8,7 @@
|
||||||
"GoFormat": "gofmt",
|
"GoFormat": "gofmt",
|
||||||
"FontFamily": "Helvetica",
|
"FontFamily": "Helvetica",
|
||||||
"FontSize": "13px",
|
"FontSize": "13px",
|
||||||
"Theme": "black",
|
"Theme": "default",
|
||||||
"Editor": {
|
"Editor": {
|
||||||
"FontFamily": "Consolas, 'Courier New', monospace",
|
"FontFamily": "Consolas, 'Courier New', monospace",
|
||||||
"FontSize": "13px",
|
"FontSize": "13px",
|
||||||
|
@ -17,9 +17,7 @@
|
||||||
"TabSize": "4"
|
"TabSize": "4"
|
||||||
},
|
},
|
||||||
"LatestSessionContent": {
|
"LatestSessionContent": {
|
||||||
"FileTree": [
|
"FileTree": [],
|
||||||
"D:\\GoGoGo\\src"
|
|
||||||
],
|
|
||||||
"Files": [],
|
"Files": [],
|
||||||
"CurrentFile": ""
|
"CurrentFile": ""
|
||||||
}
|
}
|
||||||
|
|
25
conf/wide.go
25
conf/wide.go
|
@ -287,31 +287,6 @@ func GetUser(username string) *User {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save saves Wide and all users' configurations.
|
|
||||||
func Save() bool {
|
|
||||||
// Wide, XXX: does we need to save wide.json?
|
|
||||||
bytes, err := json.MarshalIndent(Wide, "", " ")
|
|
||||||
|
|
||||||
if nil != err {
|
|
||||||
logger.Error(err)
|
|
||||||
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
if err = ioutil.WriteFile("conf/wide.json", bytes, 0644); nil != err {
|
|
||||||
logger.Error(err)
|
|
||||||
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// Users
|
|
||||||
for _, user := range Users {
|
|
||||||
user.Save()
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// initCustomizedConfs initializes the user customized configurations.
|
// initCustomizedConfs initializes the user customized configurations.
|
||||||
func initCustomizedConfs() {
|
func initCustomizedConfs() {
|
||||||
for _, user := range Users {
|
for _, user := range Users {
|
||||||
|
|
|
@ -334,7 +334,7 @@ func addUser(username, password, email string) string {
|
||||||
newUser := conf.NewUser(username, password, email, workspace)
|
newUser := conf.NewUser(username, password, email, workspace)
|
||||||
conf.Users = append(conf.Users, newUser)
|
conf.Users = append(conf.Users, newUser)
|
||||||
|
|
||||||
if !conf.Save() {
|
if !newUser.Save() {
|
||||||
return userCreateError
|
return userCreateError
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
<li><a href="https://www.gitbook.io/book/88250/wide-user-guide" target="_blank">{{.i18n.help}}</a></li>
|
<li><a href="https://www.gitbook.io/book/88250/wide-user-guide" target="_blank">{{.i18n.help}}</a></li>
|
||||||
<li><a href="https://github.com/b3log/wide/issues/new" target="_blank">{{.i18n.report_issues}}</a></li>
|
<li><a href="https://github.com/b3log/wide/issues/new" target="_blank">{{.i18n.report_issues}}</a></li>
|
||||||
<li><button class="btn btn-red" onclick="window.open('http://b3log.org/services')">{{.i18n.pricing}}</button></li>
|
<li><button class="btn btn-red" onclick="window.open('http://b3log.org/services')">{{.i18n.pricing}}</button></li>
|
||||||
<li><button class="btn" onclick="window.open('/signup')">{{.i18n.sign_up}}</button></li>
|
<li><button class="btn" onclick="window.location.href = '/signup'">{{.i18n.sign_up}}</button></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
<li><a href="https://www.gitbook.io/book/88250/wide-user-guide" target="_blank">{{.i18n.help}}</a></li>
|
<li><a href="https://www.gitbook.io/book/88250/wide-user-guide" target="_blank">{{.i18n.help}}</a></li>
|
||||||
<li><a href="https://github.com/b3log/wide/issues/new" target="_blank">{{.i18n.report_issues}}</a></li>
|
<li><a href="https://github.com/b3log/wide/issues/new" target="_blank">{{.i18n.report_issues}}</a></li>
|
||||||
<li><button class="btn btn-red" onclick="window.open('http://b3log.org/services')">{{.i18n.pricing}}</button></li>
|
<li><button class="btn btn-red" onclick="window.open('http://b3log.org/services')">{{.i18n.pricing}}</button></li>
|
||||||
<li><button class="btn" onclick="window.open('/login')">{{.i18n.sign_up}}</button></li>
|
<li><button class="btn" onclick="window.location.href = '/login'">{{.i18n.login}}</button></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue