Initial commit (code only without large binaries)
This commit is contained in:
24
EdgeUser/internal/web/actions/default/servers/cache/utils.go
vendored
Normal file
24
EdgeUser/internal/web/actions/default/servers/cache/utils.go
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
|
||||
|
||||
package cache
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeUser/internal/rpc"
|
||||
"github.com/TeaOSLab/EdgeUser/internal/web/actions/actionutils"
|
||||
)
|
||||
|
||||
func InitMenu(parent *actionutils.ParentAction) error {
|
||||
rpcClient, err := rpc.SharedRPC()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
countTasksResp, err := rpcClient.HTTPCacheTaskRPC().CountDoingHTTPCacheTasks(parent.UserContext(), &pb.CountDoingHTTPCacheTasksRequest{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
parent.Data["countDoingTasks"] = countTasksResp.Count
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user