mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-02 20:00:26 +08:00
节点可以单独设置缓存目录
This commit is contained in:
@@ -60,11 +60,15 @@ func InitNodeInfo(parentAction *actionutils.ParentAction, nodeId int64) (*pb.Nod
|
|||||||
"name": "DNS设置",
|
"name": "DNS设置",
|
||||||
"url": prefix + "/settings/dns?" + query,
|
"url": prefix + "/settings/dns?" + query,
|
||||||
"isActive": menuItem == "dns",
|
"isActive": menuItem == "dns",
|
||||||
|
"isOn": len(node.DnsRoutes) > 0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "缓存设置",
|
"name": "缓存设置",
|
||||||
"url": prefix + "/settings/cache?" + query,
|
"url": prefix + "/settings/cache?" + query,
|
||||||
"isActive": menuItem == "cache",
|
"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 {
|
if teaconst.IsPlus {
|
||||||
@@ -81,11 +85,13 @@ func InitNodeInfo(parentAction *actionutils.ParentAction, nodeId int64) (*pb.Nod
|
|||||||
"name": "SSH设置",
|
"name": "SSH设置",
|
||||||
"url": prefix + "/settings/ssh?" + query,
|
"url": prefix + "/settings/ssh?" + query,
|
||||||
"isActive": menuItem == "ssh",
|
"isActive": menuItem == "ssh",
|
||||||
|
"isOn": node.NodeLogin != nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "系统设置",
|
"name": "系统设置",
|
||||||
"url": prefix + "/settings/system?" + query,
|
"url": prefix + "/settings/system?" + query,
|
||||||
"isActive": menuItem == "system",
|
"isActive": menuItem == "system",
|
||||||
|
"isOn": node.MaxCPU > 0,
|
||||||
},
|
},
|
||||||
}...)
|
}...)
|
||||||
parentAction.Data["leftMenuItems"] = menuItems
|
parentAction.Data["leftMenuItems"] = menuItems
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
|
|
||||||
var nodeMap = this.Data["node"].(maps.Map)
|
var nodeMap = this.Data["node"].(maps.Map)
|
||||||
nodeMap["maxCacheDiskCapacity"] = maxCacheDiskCapacity
|
nodeMap["maxCacheDiskCapacity"] = maxCacheDiskCapacity
|
||||||
|
nodeMap["cacheDiskDir"] = node.CacheDiskDir
|
||||||
nodeMap["maxCacheMemoryCapacity"] = maxCacheMemoryCapacity
|
nodeMap["maxCacheMemoryCapacity"] = maxCacheMemoryCapacity
|
||||||
|
|
||||||
this.Show()
|
this.Show()
|
||||||
@@ -67,6 +68,7 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
func (this *IndexAction) RunPost(params struct {
|
func (this *IndexAction) RunPost(params struct {
|
||||||
NodeId int64
|
NodeId int64
|
||||||
MaxCacheDiskCapacityJSON []byte
|
MaxCacheDiskCapacityJSON []byte
|
||||||
|
CacheDiskDir string
|
||||||
MaxCacheMemoryCapacityJSON []byte
|
MaxCacheMemoryCapacityJSON []byte
|
||||||
|
|
||||||
Must *actions.Must
|
Must *actions.Must
|
||||||
@@ -106,6 +108,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
_, err := this.RPC().NodeRPC().UpdateNodeCache(this.AdminContext(), &pb.UpdateNodeCacheRequest{
|
_, err := this.RPC().NodeRPC().UpdateNodeCache(this.AdminContext(), &pb.UpdateNodeCacheRequest{
|
||||||
NodeId: params.NodeId,
|
NodeId: params.NodeId,
|
||||||
MaxCacheDiskCapacity: pbMaxCacheDiskCapacity,
|
MaxCacheDiskCapacity: pbMaxCacheDiskCapacity,
|
||||||
|
CacheDiskDir: params.CacheDiskDir,
|
||||||
MaxCacheMemoryCapacity: pbMaxCacheMemoryCapacity,
|
MaxCacheMemoryCapacity: pbMaxCacheMemoryCapacity,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -14,6 +14,13 @@
|
|||||||
<p class="comment">缓存能使用的磁盘的最大容量,0表示不限制。</p>
|
<p class="comment">缓存能使用的磁盘的最大容量,0表示不限制。</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>磁盘缓存目录</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="cacheDiskDir" maxlength="500" value="" v-model="node.cacheDiskDir"/>
|
||||||
|
<p class="comment">存放文件缓存的目录,通常填写绝对路径。不填则表示使用集群缓存策略中定义的目录。</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>缓存内存容量</td>
|
<td>缓存内存容量</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
Reference in New Issue
Block a user