看板增加离线节点数字

This commit is contained in:
GoEdgeLab
2021-09-27 09:23:48 +08:00
parent 5e89bdf594
commit 9e97271083
7 changed files with 45 additions and 16 deletions

View File

@@ -33,7 +33,9 @@ func (this *AdvancedHelper) BeforeAction(actionPtr actions.ActionWrapper) (goNex
if configloaders.AllowModule(adminId, configloaders.AdminModuleCodeSetting) {
tabbar.Add("数据库", "", "/settings/database", "", this.tab == "database")
tabbar.Add("API节点", "", "/api", "", this.tab == "apiNodes")
tabbar.Add("用户节点", "", "/settings/userNodes", "", this.tab == "userNodes")
if teaconst.IsPlus {
tabbar.Add("用户节点", "", "/settings/userNodes", "", this.tab == "userNodes")
}
tabbar.Add("日志数据库", "", "/db", "", this.tab == "dbNodes")
if teaconst.IsPlus {
tabbar.Add("监控节点", "", "/settings/monitorNodes", "", this.tab == "monitorNodes")

View File

@@ -3,6 +3,7 @@ package usernodes
import (
"encoding/json"
"fmt"
teaconst "github.com/TeaOSLab/EdgeAdmin/internal/const"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
@@ -20,6 +21,11 @@ func (this *IndexAction) Init() {
}
func (this *IndexAction) RunGet(params struct{}) {
if !teaconst.IsPlus {
this.RedirectURL("/")
return
}
countResp, err := this.RPC().UserNodeRPC().CountAllEnabledUserNodes(this.AdminContext(), &pb.CountAllEnabledUserNodesRequest{})
if err != nil {
this.ErrorPage(err)