mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-19 07:20:25 +08:00
[节点]可以设置节点区域
This commit is contained in:
@@ -137,6 +137,7 @@ func (this *NodeAction) RunGet(params struct {
|
||||
status.IsActive = status.IsActive && time.Now().Unix()-status.UpdatedAt <= 60 // N秒之内认为活跃
|
||||
}
|
||||
|
||||
// 分组
|
||||
var groupMap maps.Map = nil
|
||||
if node.Group != nil {
|
||||
groupMap = maps.Map{
|
||||
@@ -145,6 +146,15 @@ func (this *NodeAction) RunGet(params struct {
|
||||
}
|
||||
}
|
||||
|
||||
// 区域
|
||||
var regionMap maps.Map = nil
|
||||
if node.Region != nil {
|
||||
regionMap = maps.Map{
|
||||
"id": node.Region.Id,
|
||||
"name": node.Region.Name,
|
||||
}
|
||||
}
|
||||
|
||||
this.Data["node"] = maps.Map{
|
||||
"id": node.Id,
|
||||
"name": node.Name,
|
||||
@@ -169,7 +179,8 @@ func (this *NodeAction) RunGet(params struct {
|
||||
"connectionCount": status.ConnectionCount,
|
||||
},
|
||||
|
||||
"group": groupMap,
|
||||
"group": groupMap,
|
||||
"region": regionMap,
|
||||
}
|
||||
|
||||
this.Show()
|
||||
|
||||
Reference in New Issue
Block a user