[域名解析]优化解析状态显示

This commit is contained in:
刘祥超
2020-12-23 16:49:47 +08:00
parent 0844994db8
commit df6e0a59e4
5 changed files with 138 additions and 9 deletions

View File

@@ -685,6 +685,19 @@ func (this *NodeDAO) FindAllEnabledNodesDNSWithClusterId(clusterId int64) (resul
return
}
// 计算一个集群的节点DNS数量
func (this *NodeDAO) CountAllEnabledNodesDNSWithClusterId(clusterId int64) (result int64, err error) {
return this.Query().
State(NodeStateEnabled).
Attr("clusterId", clusterId).
Attr("isOn", true).
Attr("isUp", true).
Result("id", "name", "dnsRoutes", "isOn").
DescPk().
Slice(&result).
Count()
}
// 获取单个节点的DNS信息
func (this *NodeDAO) FindEnabledNodeDNS(nodeId int64) (*Node, error) {
one, err := this.Query().