mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-03-22 02:51:50 +00:00
✨ feat: 后台服务器备注 close #72
This commit is contained in:
@@ -4,7 +4,8 @@ import "time"
|
||||
|
||||
const CtxKeyAuthorizedUser = "ckau"
|
||||
|
||||
const CtxKeyOauth2State = "cko2s"
|
||||
const CacheKeyOauth2State = "p:a:state"
|
||||
const CacheKeyServicePage = "p:c:service"
|
||||
|
||||
type Common struct {
|
||||
ID uint64 `gorm:"primary_key"`
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user