diff --git a/internal/web/actions/default/clusters/cluster/node/nodeutils/utils.go b/internal/web/actions/default/clusters/cluster/node/nodeutils/utils.go index 05ba7097..3b2a295d 100644 --- a/internal/web/actions/default/clusters/cluster/node/nodeutils/utils.go +++ b/internal/web/actions/default/clusters/cluster/node/nodeutils/utils.go @@ -60,11 +60,15 @@ func InitNodeInfo(parentAction *actionutils.ParentAction, nodeId int64) (*pb.Nod "name": "DNS设置", "url": prefix + "/settings/dns?" + query, "isActive": menuItem == "dns", + "isOn": len(node.DnsRoutes) > 0, }, { "name": "缓存设置", "url": prefix + "/settings/cache?" + query, "isActive": menuItem == "cache", + "isOn": len(node.CacheDiskDir) > 0 || + (node.MaxCacheDiskCapacity != nil && node.MaxCacheDiskCapacity.Count > 0) || + (node.MaxCacheMemoryCapacity != nil && node.MaxCacheMemoryCapacity.Count > 0), }, } if teaconst.IsPlus { @@ -81,11 +85,13 @@ func InitNodeInfo(parentAction *actionutils.ParentAction, nodeId int64) (*pb.Nod "name": "SSH设置", "url": prefix + "/settings/ssh?" + query, "isActive": menuItem == "ssh", + "isOn": node.NodeLogin != nil, }, { "name": "系统设置", "url": prefix + "/settings/system?" + query, "isActive": menuItem == "system", + "isOn": node.MaxCPU > 0, }, }...) parentAction.Data["leftMenuItems"] = menuItems diff --git a/internal/web/actions/default/clusters/cluster/node/settings/cache/index.go b/internal/web/actions/default/clusters/cluster/node/settings/cache/index.go index c95d93f1..bc493651 100644 --- a/internal/web/actions/default/clusters/cluster/node/settings/cache/index.go +++ b/internal/web/actions/default/clusters/cluster/node/settings/cache/index.go @@ -59,6 +59,7 @@ func (this *IndexAction) RunGet(params struct { var nodeMap = this.Data["node"].(maps.Map) nodeMap["maxCacheDiskCapacity"] = maxCacheDiskCapacity + nodeMap["cacheDiskDir"] = node.CacheDiskDir nodeMap["maxCacheMemoryCapacity"] = maxCacheMemoryCapacity this.Show() @@ -67,6 +68,7 @@ func (this *IndexAction) RunGet(params struct { func (this *IndexAction) RunPost(params struct { NodeId int64 MaxCacheDiskCapacityJSON []byte + CacheDiskDir string MaxCacheMemoryCapacityJSON []byte Must *actions.Must @@ -106,6 +108,7 @@ func (this *IndexAction) RunPost(params struct { _, err := this.RPC().NodeRPC().UpdateNodeCache(this.AdminContext(), &pb.UpdateNodeCacheRequest{ NodeId: params.NodeId, MaxCacheDiskCapacity: pbMaxCacheDiskCapacity, + CacheDiskDir: params.CacheDiskDir, MaxCacheMemoryCapacity: pbMaxCacheMemoryCapacity, }) if err != nil { diff --git a/web/views/@default/clusters/cluster/node/settings/cache/index.html b/web/views/@default/clusters/cluster/node/settings/cache/index.html index cb211152..13000dce 100644 --- a/web/views/@default/clusters/cluster/node/settings/cache/index.html +++ b/web/views/@default/clusters/cluster/node/settings/cache/index.html @@ -14,6 +14,13 @@
缓存能使用的磁盘的最大容量,0表示不限制。
+存放文件缓存的目录,通常填写绝对路径。不填则表示使用集群缓存策略中定义的目录。
+