mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-04 05:00:25 +08:00
增加UAM(5秒盾)集群设置
This commit is contained in:
@@ -22,7 +22,7 @@ func NewClusterHelper() *ClusterHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *ClusterHelper) BeforeAction(actionPtr actions.ActionWrapper) (goNext bool) {
|
func (this *ClusterHelper) BeforeAction(actionPtr actions.ActionWrapper) (goNext bool) {
|
||||||
action := actionPtr.Object()
|
var action = actionPtr.Object()
|
||||||
if action.Request.Method != http.MethodGet {
|
if action.Request.Method != http.MethodGet {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@@ -57,7 +57,7 @@ func (this *ClusterHelper) BeforeAction(actionPtr actions.ActionWrapper) (goNext
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
tabbar := actionutils.NewTabbar()
|
var tabbar = actionutils.NewTabbar()
|
||||||
tabbar.Add("集群列表", "", "/clusters", "", false)
|
tabbar.Add("集群列表", "", "/clusters", "", false)
|
||||||
if teaconst.IsPlus {
|
if teaconst.IsPlus {
|
||||||
tabbar.Add("集群看板", "", "/clusters/cluster/boards?clusterId="+clusterIdString, "board", selectedTabbar == "board")
|
tabbar.Add("集群看板", "", "/clusters/cluster/boards?clusterId="+clusterIdString, "board", selectedTabbar == "board")
|
||||||
@@ -144,6 +144,8 @@ func (this *ClusterHelper) createSettingMenu(cluster *pb.NodeCluster, info *pb.F
|
|||||||
"isOn": info != nil && info.WebpIsOn,
|
"isOn": info != nil && info.WebpIsOn,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
items = filterMenuItems1(items, info, clusterId, selectedItem)
|
||||||
|
|
||||||
items = append(items, maps.Map{
|
items = append(items, maps.Map{
|
||||||
"name": "-",
|
"name": "-",
|
||||||
})
|
})
|
||||||
@@ -155,21 +157,7 @@ func (this *ClusterHelper) createSettingMenu(cluster *pb.NodeCluster, info *pb.F
|
|||||||
"isOn": info != nil && info.HasMetricItems,
|
"isOn": info != nil && info.HasMetricItems,
|
||||||
})
|
})
|
||||||
|
|
||||||
if teaconst.IsPlus {
|
items = filterMenuItems2(items, info, clusterId, selectedItem)
|
||||||
items = append(items, maps.Map{
|
|
||||||
"name": "阈值设置",
|
|
||||||
"url": "/clusters/cluster/settings/thresholds?clusterId=" + clusterId,
|
|
||||||
"isActive": selectedItem == "threshold",
|
|
||||||
"isOn": info != nil && info.HasThresholds,
|
|
||||||
})
|
|
||||||
|
|
||||||
items = append(items, maps.Map{
|
|
||||||
"name": "消息通知",
|
|
||||||
"url": "/clusters/cluster/settings/message?clusterId=" + clusterId,
|
|
||||||
"isActive": selectedItem == "message",
|
|
||||||
"isOn": info != nil && info.HasMessageReceivers,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
items = append(items, maps.Map{
|
items = append(items, maps.Map{
|
||||||
"name": "-",
|
"name": "-",
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
|
||||||
|
//go:build !plus
|
||||||
|
// +build !plus
|
||||||
|
|
||||||
|
package clusterutils
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||||
|
"github.com/iwind/TeaGo/maps"
|
||||||
|
)
|
||||||
|
|
||||||
|
func filterMenuItems1(items []maps.Map, info *pb.FindEnabledNodeClusterConfigInfoResponse, clusterIdString string, selectedItem string) []maps.Map {
|
||||||
|
return items
|
||||||
|
}
|
||||||
|
|
||||||
|
func filterMenuItems2(items []maps.Map, info *pb.FindEnabledNodeClusterConfigInfoResponse, clusterIdString string, selectedItem string) []maps.Map {
|
||||||
|
return items
|
||||||
|
}
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
<input type="hidden" name="clusterId" :value="clusterId"/>
|
<input type="hidden" name="clusterId" :value="clusterId"/>
|
||||||
<table class="ui table definition selectable">
|
<table class="ui table definition selectable">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="title">启用</td>
|
<td class="title">启用WebP功能</td>
|
||||||
<td>
|
<td>
|
||||||
<checkbox name="isOn" v-model="webpPolicy.isOn"></checkbox>
|
<checkbox name="isOn" v-model="webpPolicy.isOn"></checkbox>
|
||||||
<p class="comment">选中后,表示当前集群下的服务可以使用WebP转换功能。</p>
|
<p class="comment">选中后,表示当前集群下的服务可以使用WebP转换功能。</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user