mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-15 17:40:25 +08:00
v1.4.1
This commit is contained in:
@@ -4,6 +4,13 @@ import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"net"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/db/models/dns"
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/dnsclients/dnstypes"
|
||||
@@ -25,12 +32,6 @@ import (
|
||||
"github.com/iwind/TeaGo/lists"
|
||||
"github.com/iwind/TeaGo/types"
|
||||
stringutil "github.com/iwind/TeaGo/utils/string"
|
||||
"io"
|
||||
"net"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
// NodeVersionCache 节点版本缓存
|
||||
@@ -387,6 +388,7 @@ func (this *NodeService) ListEnabledNodesMatch(ctx context.Context, req *pb.List
|
||||
OfflineDay: node.OfflineDay,
|
||||
IsBackupForCluster: node.IsBackupForCluster,
|
||||
IsBackupForGroup: node.IsBackupForGroup,
|
||||
BypassMobile: node.BypassMobile,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -689,6 +691,7 @@ func (this *NodeService) FindEnabledNode(ctx context.Context, req *pb.FindEnable
|
||||
OfflineDay: node.OfflineDay,
|
||||
IsBackupForCluster: node.IsBackupForCluster,
|
||||
IsBackupForGroup: node.IsBackupForGroup,
|
||||
BypassMobile: node.BypassMobile,
|
||||
}}, nil
|
||||
}
|
||||
|
||||
@@ -1758,6 +1761,21 @@ func (this *NodeService) UpdateNodeSystem(ctx context.Context, req *pb.UpdateNod
|
||||
return this.Success()
|
||||
}
|
||||
|
||||
// UpdateNodeBypassMobile 修改节点过移动
|
||||
func (this *NodeService) UpdateNodeBypassMobile(ctx context.Context, req *pb.UpdateNodeBypassMobile) (*pb.RPCSuccess, error) {
|
||||
_, err := this.ValidateAdmin(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var tx = this.NullTx()
|
||||
err = models.SharedNodeDAO.UpdateNodeBypassMobile(tx, req.NodeId, req.BypassMobile)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return this.Success()
|
||||
}
|
||||
|
||||
// UpdateNodeCache 修改节点缓存设置
|
||||
func (this *NodeService) UpdateNodeCache(ctx context.Context, req *pb.UpdateNodeCacheRequest) (*pb.RPCSuccess, error) {
|
||||
_, err := this.ValidateAdmin(ctx)
|
||||
|
||||
Reference in New Issue
Block a user