🚀 dashboard v0.14.4 hide the server from guests

This commit is contained in:
naiba
2022-09-30 22:40:56 +08:00
parent ad4c0a15ab
commit d1f3c47cee
11 changed files with 65 additions and 14 deletions

View File

@@ -306,6 +306,7 @@ type serverForm struct {
Secret string
Tag string
Note string
HideForGuest string
}
func (ma *memberAPI) addOrEditServer(c *gin.Context) {
@@ -321,6 +322,7 @@ func (ma *memberAPI) addOrEditServer(c *gin.Context) {
s.ID = sf.ID
s.Tag = sf.Tag
s.Note = sf.Note
s.HideForGuest = sf.HideForGuest == "on"
if s.ID == 0 {
s.Secret = utils.MD5(fmt.Sprintf("%s%s%d", time.Now(), sf.Name, admin.ID))
s.Secret = s.Secret[:18]