diff --git a/backend/app/service/app_install.go b/backend/app/service/app_install.go index ab80e9677..3272ac6e5 100644 --- a/backend/app/service/app_install.go +++ b/backend/app/service/app_install.go @@ -61,7 +61,12 @@ func NewIAppInstalledService() IAppInstallService { } func (a *AppInstallService) Page(req request.AppInstalledSearch) (int64, []response.AppInstalledDTO, error) { - var opts []repo.DBOption + var ( + opts []repo.DBOption + total int64 + installs []model.AppInstall + err error + ) if req.Name != "" { opts = append(opts, commonRepo.WithLikeName(req.Name)) @@ -87,15 +92,25 @@ func (a *AppInstallService) Page(req request.AppInstalledSearch) (int64, []respo opts = append(opts, appInstallRepo.WithAppIdsIn(appIds)) } - total, installs, err := appInstallRepo.Page(req.Page, req.PageSize, opts...) - if err != nil { - return 0, nil, err + if req.Update { + installs, err = appInstallRepo.ListBy(opts...) + if err != nil { + return 0, nil, err + } + } else { + total, installs, err = appInstallRepo.Page(req.Page, req.PageSize, opts...) + if err != nil { + return 0, nil, err + } } installDTOs, err := handleInstalled(installs, req.Update) if err != nil { return 0, nil, err } + if req.Update { + total = int64(len(installDTOs)) + } return total, installDTOs, nil } diff --git a/frontend/src/views/app-store/apps/index.vue b/frontend/src/views/app-store/apps/index.vue index 079643a67..1f9785ed8 100644 --- a/frontend/src/views/app-store/apps/index.vue +++ b/frontend/src/views/app-store/apps/index.vue @@ -287,13 +287,6 @@ onMounted(() => { border: none; } } - -.page-button { - float: right; - margin-bottom: 10px; - margin-top: 10px; -} - @media only screen and (min-width: 768px) and (max-width: 1200px) { .app-col-12 { max-width: 50%; diff --git a/frontend/src/views/app-store/index.scss b/frontend/src/views/app-store/index.scss index ac766654e..ab8d82fcc 100644 --- a/frontend/src/views/app-store/index.scss +++ b/frontend/src/views/app-store/index.scss @@ -91,3 +91,9 @@ border: none; } } + +.page-button { + float: right; + margin-bottom: 10px; + margin-top: 10px; +} diff --git a/frontend/src/views/app-store/installed/index.vue b/frontend/src/views/app-store/installed/index.vue index 19ec5d836..90b62f27b 100644 --- a/frontend/src/views/app-store/installed/index.vue +++ b/frontend/src/views/app-store/installed/index.vue @@ -234,6 +234,15 @@ +
+ +
@@ -300,7 +309,7 @@ const tags = ref([]); const activeTag = ref('all'); const searchReq = reactive({ page: 1, - pageSize: 15, + pageSize: 20, name: '', tags: [], update: false,