feat: 后台服务器备注 close #72

This commit is contained in:
naiba
2021-01-20 19:24:59 +08:00
parent 29bc810a8f
commit ec17948fe4
12 changed files with 83 additions and 66 deletions

View File

@@ -11,8 +11,9 @@ import (
type Server struct {
Common
Name string
Tag string
Tag string // 分组名
Secret string `json:"-"`
Note string `json:"-"` // 管理员可见备注
DisplayIndex int // 展示权重,越大越靠前
Host *Host `gorm:"-"`
@@ -24,5 +25,5 @@ type Server struct {
}
func (s Server) Marshal() template.JS {
return template.JS(fmt.Sprintf(`{"ID":%d,"Name":"%s","Secret":"%s"}`, s.ID, s.Name, s.Secret))
return template.JS(fmt.Sprintf(`{"ID":%d,"Name":"%s","Secret":"%s","DisplayIndex":%d,"Tag":"%s","Note":"%s"}`, s.ID, s.Name, s.Secret, s.DisplayIndex, s.Tag, s.Note))
}