diff --git a/mayfly_go_web/src/common/config.ts b/mayfly_go_web/src/common/config.ts index 00525b16..21ff8131 100644 --- a/mayfly_go_web/src/common/config.ts +++ b/mayfly_go_web/src/common/config.ts @@ -15,7 +15,7 @@ const config = { baseWsUrl: `${(window as any).globalConfig.BaseWsUrl || `${location.protocol == 'https:' ? 'wss:' : 'ws:'}//${getBaseApiUrl()}`}/api`, // 系统版本 - version: 'v1.7.5', + version: 'v1.8.0', }; export default config; diff --git a/mayfly_go_web/src/components/terminal/TerminalBody.vue b/mayfly_go_web/src/components/terminal/TerminalBody.vue index fb239cd6..d6df3528 100644 --- a/mayfly_go_web/src/components/terminal/TerminalBody.vue +++ b/mayfly_go_web/src/components/terminal/TerminalBody.vue @@ -119,9 +119,16 @@ function initTerm() { term.open(terminalRef.value); - initSocket(); + // 注册自适应组件 + const fitAddon = new FitAddon(); + state.addon.fit = fitAddon; + term.loadAddon(fitAddon); + fitTerminal(); + // 注册窗口大小监听器 + useEventListener('resize', debounce(fitTerminal, 400)); - // 注册插件 + initSocket(); + // 注册其他插件 loadAddon(); // 注册自定义快捷键 @@ -169,14 +176,6 @@ function initSocket() { } function loadAddon() { - // 注册自适应组件 - const fitAddon = new FitAddon(); - state.addon.fit = fitAddon; - term.loadAddon(fitAddon); - fitTerminal(); - // 注册窗口大小监听器 - useEventListener('resize', debounce(fitTerminal, 400)); - // 注册搜索组件 const searchAddon = new SearchAddon(); state.addon.search = searchAddon; @@ -218,7 +217,7 @@ function loadAddon() { trzsz .uploadFiles(event.dataTransfer.items) .then(() => console.log('upload success')) - .catch((err) => console.log(err)); + .catch((err: any) => console.log(err)); }); } diff --git a/mayfly_go_web/src/views/ops/component/ResourceAuthCertEdit.vue b/mayfly_go_web/src/views/ops/component/ResourceAuthCertEdit.vue index 115a1ea9..1bb3cbbf 100644 --- a/mayfly_go_web/src/views/ops/component/ResourceAuthCertEdit.vue +++ b/mayfly_go_web/src/views/ops/component/ResourceAuthCertEdit.vue @@ -90,6 +90,8 @@ {{ item.username }} + + {{ item.remark }} diff --git a/server/internal/tag/application/resouce_auth_cert.go b/server/internal/tag/application/resouce_auth_cert.go index caf67f20..767d423a 100644 --- a/server/internal/tag/application/resouce_auth_cert.go +++ b/server/internal/tag/application/resouce_auth_cert.go @@ -272,7 +272,7 @@ func (r *resourceAuthCertAppImpl) GetAccountAuthCert(accountId uint64, authCertT }) var authCerts []*entity.ResourceAuthCert - r.GetRepo().ListByWheres(collx.M{ + r.ListByWheres(collx.M{ "name in ?": collx.ArrayDeduplicate(authCertNames), }, &authCerts) @@ -314,7 +314,7 @@ func (r *resourceAuthCertAppImpl) FillAuthCert(resourceType int8, resources ...e return ac.GetCode() }) var acs []*entity.ResourceAuthCert - r.Repo.ListByWheres(collx.M{"resource_code in ?": resourceCodes, "resource_type = ?": resourceType}, &acs) + r.ListByWheres(collx.M{"resource_code in ?": resourceCodes, "resource_type = ?": resourceType}, &acs) r.FillAuthCertByAcs(acs, resources...) } diff --git a/server/internal/tag/application/tag_tree.go b/server/internal/tag/application/tag_tree.go index eacdf73d..57a6f31c 100644 --- a/server/internal/tag/application/tag_tree.go +++ b/server/internal/tag/application/tag_tree.go @@ -394,7 +394,7 @@ func (p *tagTreeAppImpl) DeleteTagByParam(ctx context.Context, param *DelResourc for _, resourceTag := range resourceTags { // 获取所有关联的子标签 var childrenTag []*entity.TagTree - p.Repo.ListByWheres(collx.M{ + p.ListByWheres(collx.M{ "code_path LIKE ?": resourceTag.CodePath + "%", "type = ?": delTagType, }, &childrenTag) diff --git a/server/pkg/base/app.go b/server/pkg/base/app.go index 75795930..3cab6a7f 100644 --- a/server/pkg/base/app.go +++ b/server/pkg/base/app.go @@ -81,6 +81,10 @@ type App[T model.ModelI] interface { // 根据条件查询数据映射至listModels ListByCond(cond any, listModels any, cols ...string) error + // 根据wheres条件进行过滤 + // @param wheres key -> "age > ?" value -> 10等 + ListByWheres(wheres collx.M, listModels any, cols ...string) error + // PageQuery 分页查询 PageQuery(cond any, pageParam *model.PageParam, toModels any) (*model.PageResult[any], error) @@ -210,6 +214,10 @@ func (ai *AppImpl[T, R]) ListByCond(cond any, listModels any, cols ...string) er return ai.GetRepo().ListByCond(cond, listModels, cols...) } +func (ai *AppImpl[T, R]) ListByWheres(wheres collx.M, listModels any, cols ...string) error { + return ai.GetRepo().ListByWheres(wheres, listModels, cols...) +} + // PageQuery 分页查询 func (ai *AppImpl[T, R]) PageQuery(cond any, pageParam *model.PageParam, toModels any) (*model.PageResult[any], error) { return ai.GetRepo().PageQuery(cond, pageParam, toModels) diff --git a/server/pkg/config/app.go b/server/pkg/config/app.go index d978a714..45ba9e7f 100644 --- a/server/pkg/config/app.go +++ b/server/pkg/config/app.go @@ -4,7 +4,7 @@ import "fmt" const ( AppName = "mayfly-go" - Version = "v1.7.5" + Version = "v1.8.0" ) func GetAppInfo() string { diff --git a/server/resources/data/mayfly-go.sqlite b/server/resources/data/mayfly-go.sqlite old mode 100644 new mode 100755 index 005e8aba..d9f2ff67 Binary files a/server/resources/data/mayfly-go.sqlite and b/server/resources/data/mayfly-go.sqlite differ diff --git a/server/resources/script/sql/mayfly-go.sql b/server/resources/script/sql/mayfly-go.sql index d3ec3a0c..970bf136 100644 --- a/server/resources/script/sql/mayfly-go.sql +++ b/server/resources/script/sql/mayfly-go.sql @@ -885,7 +885,8 @@ CREATE TABLE `t_tag_tree` ( `is_deleted` tinyint(8) NOT NULL DEFAULT 0, `delete_time` datetime DEFAULT NULL, PRIMARY KEY (`id`), - KEY `idx_code_path` (`code_path`(100)) USING BTREE + KEY `idx_code_path` (`code_path`(200)) USING BTREE, + KEY `idx_code` (`code`(32)) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='标签树'; -- ---------------------------- diff --git a/server/resources/script/sql/v1.7/v1.7.5.sql b/server/resources/script/sql/v1.8/v1.8.0.sql similarity index 100% rename from server/resources/script/sql/v1.7/v1.7.5.sql rename to server/resources/script/sql/v1.8/v1.8.0.sql