mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-08-08 15:56:43 +08:00
首页图表可查看用户组下的在线数、网络吞吐量
This commit is contained in:
@@ -32,6 +32,11 @@ type ValData struct {
|
||||
Note string `json:"note"`
|
||||
}
|
||||
|
||||
type GroupNameId struct {
|
||||
Id int `json:"id"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
// type Group struct {
|
||||
// Id int `json:"id" xorm:"pk autoincr not null"`
|
||||
// Name string `json:"name" xorm:"varchar(60) not null unique"`
|
||||
@@ -64,6 +69,20 @@ func GetGroupNames() []string {
|
||||
return names
|
||||
}
|
||||
|
||||
func GetGroupNamesIds() []GroupNameId {
|
||||
var datas []Group
|
||||
err := Find(&datas, 0, 0)
|
||||
if err != nil {
|
||||
base.Error(err)
|
||||
return nil
|
||||
}
|
||||
var names []GroupNameId
|
||||
for _, v := range datas {
|
||||
names = append(names, GroupNameId{Id: v.Id, Name: v.Name})
|
||||
}
|
||||
return names
|
||||
}
|
||||
|
||||
func SetGroup(g *Group) error {
|
||||
var err error
|
||||
if g.Name == "" {
|
||||
|
Reference in New Issue
Block a user