mirror of
https://gitee.com/dromara/mayfly-go
synced 2026-01-03 05:06:36 +08:00
fix: 修复机器列表查询与放开vnc
This commit is contained in:
@@ -5,6 +5,10 @@ import (
|
||||
"mayfly-go/internal/machine/domain/repository"
|
||||
"mayfly-go/pkg/base"
|
||||
"mayfly-go/pkg/model"
|
||||
"mayfly-go/pkg/utils/collx"
|
||||
"strings"
|
||||
|
||||
"github.com/may-fly/cast"
|
||||
)
|
||||
|
||||
type machineRepoImpl struct {
|
||||
@@ -23,11 +27,12 @@ func (m *machineRepoImpl) GetMachineList(condition *entity.MachineQuery, pagePar
|
||||
Like("name", condition.Name).
|
||||
In("code", condition.Codes).
|
||||
Like("code", condition.Code).
|
||||
In("id", condition.Ids)
|
||||
Eq("protocol", condition.Protocol)
|
||||
|
||||
// 只查询ssh服务器
|
||||
if condition.Ssh == entity.MachineProtocolSsh {
|
||||
qd.Eq("protocol", entity.MachineProtocolSsh)
|
||||
if condition.Ids != "" {
|
||||
qd.In("id", collx.ArrayMap[string, uint64](strings.Split(condition.Ids, ","), func(val string) uint64 {
|
||||
return cast.ToUint64(val)
|
||||
}))
|
||||
}
|
||||
|
||||
return m.PageByCond(qd, pageParam, toEntity)
|
||||
|
||||
Reference in New Issue
Block a user