diff --git a/mayfly_go_web/src/components/pagetable/PageTable.vue b/mayfly_go_web/src/components/pagetable/PageTable.vue index 644fbd4a..c92767f8 100644 --- a/mayfly_go_web/src/components/pagetable/PageTable.vue +++ b/mayfly_go_web/src/components/pagetable/PageTable.vue @@ -97,7 +97,7 @@ + + @@ -309,14 +309,15 @@ const state = reactive({ TableQuery.slot("tagPath", "标签", "tagPathSelect"), ], columns: [ - TableColumn.new("tagPath", "标签路径").setSlot("tagPath").setAddWidth(20), + TableColumn.new("tagPath", "标签路径").isSlot().setAddWidth(20), TableColumn.new("name", "名称"), TableColumn.new("host", "host:port").setFormatFunc((data: any, _prop: string) => `${data.host}:${data.port}`), TableColumn.new("type", "类型"), - TableColumn.new("database", "数据库").setSlot("database").setMinWidth(70), + TableColumn.new("database", "数据库").isSlot().setMinWidth(70), TableColumn.new("username", "用户名"), TableColumn.new("remark", "备注"), - TableColumn.new("action", "操作").setSlot("action").setMinWidth(175).fixedRight(), + TableColumn.new("more", "更多").isSlot().setMinWidth(165).fixedRight(), + TableColumn.new("action", "操作").isSlot().setMinWidth(65).fixedRight(), ], datas: [], total: 0, @@ -469,12 +470,12 @@ const getTags = async () => { state.tags = await tagApi.getAccountTags.request(null); }; -const editDb = async (isAdd = false) => { - if (isAdd) { +const editDb = async (data: any) => { + if (!data) { state.dbEditDialog.data = null; state.dbEditDialog.title = '新增数据库资源'; } else { - state.dbEditDialog.data = state.selectionData[0]; + state.dbEditDialog.data = data; state.dbEditDialog.title = '修改数据库资源'; } state.dbEditDialog.visible = true; diff --git a/mayfly_go_web/src/views/ops/machine/MachineList.vue b/mayfly_go_web/src/views/ops/machine/MachineList.vue index bbdaaec8..0c14335e 100644 --- a/mayfly_go_web/src/views/ops/machine/MachineList.vue +++ b/mayfly_go_web/src/views/ops/machine/MachineList.vue @@ -14,8 +14,6 @@ @@ -42,19 +40,17 @@ @@ -199,12 +198,12 @@ const state = reactive({ TableQuery.slot("tagPath", "标签", "tagPathSelect"), ], columns: [ - TableColumn.new("tagPath", "标签路径").setSlot("tagPath").setAddWidth(20), + TableColumn.new("tagPath", "标签路径").isSlot().setAddWidth(20), TableColumn.new("name", "名称"), TableColumn.new("uri", "连接uri"), TableColumn.new("createTime", "创建时间").isTime(), TableColumn.new("creator", "创建人"), - TableColumn.new("action", "操作").setSlot("action").setMinWidth(100).fixedRight(), + TableColumn.new("action", "操作").isSlot().setMinWidth(100).fixedRight(), ], mongoEditDialog: { visible: false, @@ -371,12 +370,12 @@ const getTags = async () => { state.tags = await tagApi.getAccountTags.request(null); }; -const editMongo = async (isAdd = false) => { - if (isAdd) { +const editMongo = async (data: any) => { + if (!data) { state.mongoEditDialog.data = null; state.mongoEditDialog.title = '新增mongo'; } else { - state.mongoEditDialog.data = state.selectionData[0]; + state.mongoEditDialog.data = data; state.mongoEditDialog.title = '修改mongo'; } state.mongoEditDialog.visible = true; diff --git a/mayfly_go_web/src/views/ops/redis/RedisList.vue b/mayfly_go_web/src/views/ops/redis/RedisList.vue index e0a9cb9b..07dce035 100644 --- a/mayfly_go_web/src/views/ops/redis/RedisList.vue +++ b/mayfly_go_web/src/views/ops/redis/RedisList.vue @@ -13,9 +13,6 @@ @@ -28,13 +25,16 @@ + + @@ -168,12 +168,13 @@ const state = reactive({ TableQuery.slot("tagPath", "标签", "tagPathSelect"), ], columns: [ - TableColumn.new("tagPath", "标签路径").setSlot("tagPath").setAddWidth(20), + TableColumn.new("tagPath", "标签路径").isSlot().setAddWidth(20), TableColumn.new("name", "名称"), TableColumn.new("host", "host:port"), TableColumn.new("mode", "mode"), TableColumn.new("remark", "备注"), - TableColumn.new("more", "更多").setSlot("more").setMinWidth(155).fixedRight(), + TableColumn.new("more", "更多").isSlot().setMinWidth(155).fixedRight(), + TableColumn.new("action", "操作").isSlot().setMinWidth(65).fixedRight(), ], detailDialog: { visible: false, @@ -273,12 +274,12 @@ const getTags = async () => { state.tags = await tagApi.getAccountTags.request(null); }; -const editRedis = async (isAdd = false) => { - if (isAdd) { +const editRedis = async (data: any) => { + if (!data) { state.redisEditDialog.data = null; state.redisEditDialog.title = '新增redis'; } else { - state.redisEditDialog.data = state.selectionData[0]; + state.redisEditDialog.data = data; state.redisEditDialog.title = '修改redis'; } state.redisEditDialog.visible = true; diff --git a/mayfly_go_web/src/views/ops/tag/TeamList.vue b/mayfly_go_web/src/views/ops/tag/TeamList.vue index 7283bcdf..d4f174d2 100755 --- a/mayfly_go_web/src/views/ops/tag/TeamList.vue +++ b/mayfly_go_web/src/views/ops/tag/TeamList.vue @@ -19,12 +19,11 @@ @@ -163,7 +162,7 @@ const state = reactive({ TableColumn.new("remark", "备注"), TableColumn.new("createTime", "创建时间").isTime(), TableColumn.new("creator", "创建人"), - TableColumn.new("action", "操作").setSlot("action").setMinWidth(100).fixedRight(), + TableColumn.new("action", "操作").isSlot().setMinWidth(100).fixedRight(), ], total: 0, data: [], diff --git a/mayfly_go_web/src/views/system/account/AccountList.vue b/mayfly_go_web/src/views/system/account/AccountList.vue index 465ab7b6..3ad12387 100755 --- a/mayfly_go_web/src/views/system/account/AccountList.vue +++ b/mayfly_go_web/src/views/system/account/AccountList.vue @@ -6,10 +6,6 @@ @@ -26,14 +22,18 @@ @@ -101,14 +101,14 @@ const state = reactive({ columns: [ TableColumn.new("name", "姓名"), TableColumn.new("username", "用户名"), - TableColumn.new("status", "状态").setSlot("status"), + TableColumn.new("status", "状态").isSlot("status"), TableColumn.new("lastLoginTime", "最后登录时间").isTime(), - TableColumn.new("showmore", "查看更多").setSlot("showmore").setMinWidth(150), + TableColumn.new("showmore", "查看更多").isSlot("showmore").setMinWidth(150), TableColumn.new("creator", "创建账号"), TableColumn.new("createTime", "创建时间").isTime(), TableColumn.new("modifier", "更新账号"), TableColumn.new("updateTime", "更新时间").isTime(), - TableColumn.new("action", "操作").setSlot("action").fixedRight().setMinWidth(200), + TableColumn.new("action", "操作").isSlot("action").fixedRight().setMinWidth(280), ], datas: [], total: 0, @@ -202,16 +202,16 @@ const resetOtpSecret = async (row: any) => { row.otpSecret = "-"; }; -const showRoleEdit = () => { +const showRoleEdit = (data: any) => { state.roleDialog.visible = true; - state.roleDialog.account = state.selectionData[0]; + state.roleDialog.account = data; }; -const editAccount = (isAdd = false) => { - if (isAdd) { +const editAccount = (data: any) => { + if (!data) { state.accountDialog.data = null; } else { - state.accountDialog.data = state.selectionData[0]; + state.accountDialog.data = data; } state.accountDialog.visible = true; }; diff --git a/mayfly_go_web/src/views/system/config/ConfigList.vue b/mayfly_go_web/src/views/system/config/ConfigList.vue index 50b88653..892a22dd 100755 --- a/mayfly_go_web/src/views/system/config/ConfigList.vue +++ b/mayfly_go_web/src/views/system/config/ConfigList.vue @@ -5,9 +5,6 @@ @@ -76,7 +75,7 @@ const state = reactive({ TableColumn.new("remark", "备注"), TableColumn.new("modifier", "更新账号"), TableColumn.new("updateTime", "更新时间").isTime(), - TableColumn.new("action", "操作").setSlot("action").fixedRight().setMinWidth(60), + TableColumn.new("action", "操作").isSlot().fixedRight().setMinWidth(130), ], total: 0, configs: [], diff --git a/mayfly_go_web/src/views/system/role/RoleList.vue b/mayfly_go_web/src/views/system/role/RoleList.vue index 2efe5d39..5476fa1d 100755 --- a/mayfly_go_web/src/views/system/role/RoleList.vue +++ b/mayfly_go_web/src/views/system/role/RoleList.vue @@ -6,10 +6,6 @@ @@ -22,6 +18,12 @@ + + + { const editRole = (data: any) => { if (data) { - state.roleEditDialog.role = data[0]; + state.roleEditDialog.role = data; } else { state.roleEditDialog.role = false; } diff --git a/server/go.mod b/server/go.mod index 9d6802ee..d15abffd 100644 --- a/server/go.mod +++ b/server/go.mod @@ -19,8 +19,8 @@ require ( golang.org/x/crypto v0.10.0 // ssh gopkg.in/yaml.v3 v3.0.1 // gorm - gorm.io/driver/mysql v1.5.0 - gorm.io/gorm v1.25.1 + gorm.io/driver/mysql v1.5.1 + gorm.io/gorm v1.25.2 ) require ( diff --git a/server/internal/machine/api/machine.go b/server/internal/machine/api/machine.go index 3e453c43..37e6e5c9 100644 --- a/server/internal/machine/api/machine.go +++ b/server/internal/machine/api/machine.go @@ -46,7 +46,7 @@ func (m *Machine) Machines(rc *req.Ctx) { } condition.TagIds = tagIds - res := m.MachineApp.GetMachineList(condition, ginx.GetPageParam(rc.GinCtx), new([]vo.MachineVO)) + res := m.MachineApp.GetMachineList(condition, ginx.GetPageParam(rc.GinCtx), new([]*vo.MachineVO)) if res.Total == 0 { rc.ResData = res return diff --git a/server/internal/machine/application/machine.go b/server/internal/machine/application/machine.go index 109020f6..47009495 100644 --- a/server/internal/machine/application/machine.go +++ b/server/internal/machine/application/machine.go @@ -32,7 +32,7 @@ type Machine interface { GetById(id uint64, cols ...string) *entity.Machine // 分页获取机器信息列表 - GetMachineList(condition *entity.MachineQuery, pageParam *model.PageParam, toEntity *[]vo.MachineVO, orderBy ...string) *model.PageResult[*[]vo.MachineVO] + GetMachineList(condition *entity.MachineQuery, pageParam *model.PageParam, toEntity *[]*vo.MachineVO, orderBy ...string) *model.PageResult[*[]*vo.MachineVO] // 获取机器连接 GetCli(id uint64) *machine.Cli @@ -54,7 +54,7 @@ type machineAppImpl struct { } // 分页获取机器信息列表 -func (m *machineAppImpl) GetMachineList(condition *entity.MachineQuery, pageParam *model.PageParam, toEntity *[]vo.MachineVO, orderBy ...string) *model.PageResult[*[]vo.MachineVO] { +func (m *machineAppImpl) GetMachineList(condition *entity.MachineQuery, pageParam *model.PageParam, toEntity *[]*vo.MachineVO, orderBy ...string) *model.PageResult[*[]*vo.MachineVO] { return m.machineRepo.GetMachineList(condition, pageParam, toEntity, orderBy...) } diff --git a/server/internal/machine/domain/repository/machine.go b/server/internal/machine/domain/repository/machine.go index abbfa189..2436e55d 100644 --- a/server/internal/machine/domain/repository/machine.go +++ b/server/internal/machine/domain/repository/machine.go @@ -8,7 +8,7 @@ import ( type Machine interface { // 分页获取机器信息列表 - GetMachineList(condition *entity.MachineQuery, pageParam *model.PageParam, toEntity *[]vo.MachineVO, orderBy ...string) *model.PageResult[*[]vo.MachineVO] + GetMachineList(condition *entity.MachineQuery, pageParam *model.PageParam, toEntity *[]*vo.MachineVO, orderBy ...string) *model.PageResult[*[]*vo.MachineVO] Count(condition *entity.MachineQuery) int64 diff --git a/server/internal/machine/infrastructure/persistence/machine.go b/server/internal/machine/infrastructure/persistence/machine.go index 9e907feb..b6302a5e 100644 --- a/server/internal/machine/infrastructure/persistence/machine.go +++ b/server/internal/machine/infrastructure/persistence/machine.go @@ -16,7 +16,7 @@ func newMachineRepo() repository.Machine { } // 分页获取机器信息列表 -func (m *machineRepoImpl) GetMachineList(condition *entity.MachineQuery, pageParam *model.PageParam, toEntity *[]vo.MachineVO, orderBy ...string) *model.PageResult[*[]vo.MachineVO] { +func (m *machineRepoImpl) GetMachineList(condition *entity.MachineQuery, pageParam *model.PageParam, toEntity *[]*vo.MachineVO, orderBy ...string) *model.PageResult[*[]*vo.MachineVO] { qd := gormx.NewQuery(new(entity.Machine)). Like("ip", condition.Ip). Like("name", condition.Name).