mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-06 10:00:24 +08:00
访问日志搜索增加域名和IP搜索
This commit is contained in:
@@ -204,7 +204,7 @@ func (this *DBNodeService) FindAllDBNodeTables(ctx context.Context, req *pb.Find
|
||||
lowerTableName := strings.ToLower(one.GetString("TABLE_NAME"))
|
||||
canDelete := false
|
||||
canClean := false
|
||||
if strings.HasPrefix(lowerTableName, "edgehttpaccesslogs_") {
|
||||
if strings.HasPrefix(lowerTableName, "edgehttpaccesslogs_") || strings.HasPrefix(lowerTableName, "edgensaccesslogs_") {
|
||||
canDelete = true
|
||||
canClean = true
|
||||
} else if lists.ContainsString([]string{"edgemessages", "edgelogs", "edgenodelogs"}, lowerTableName) {
|
||||
@@ -254,8 +254,8 @@ func (this *DBNodeService) DeleteDBNodeTable(ctx context.Context, req *pb.Delete
|
||||
}()
|
||||
|
||||
// 检查是否能够删除
|
||||
if !strings.HasPrefix(strings.ToLower(req.DbNodeTable), "edgehttpaccesslogs_") {
|
||||
return nil, errors.New("forbidden to delete the table")
|
||||
if !strings.HasPrefix(strings.ToLower(req.DbNodeTable), "edgehttpaccesslogs_") && !strings.HasPrefix(strings.ToLower(req.DbNodeTable), "edgensaccesslogs_") {
|
||||
return nil, errors.New("unable to delete the table")
|
||||
}
|
||||
|
||||
_, err = db.Exec("DROP TABLE `" + req.DbNodeTable + "`")
|
||||
|
||||
Reference in New Issue
Block a user