diff --git a/backend/app/api/v1/entry.go b/backend/app/api/v1/entry.go
index 7eeffca7e..1879a9d5a 100644
--- a/backend/app/api/v1/entry.go
+++ b/backend/app/api/v1/entry.go
@@ -12,7 +12,7 @@ var (
authService = service.ServiceGroupApp.AuthService
dashboardService = service.ServiceGroupApp.DashboardService
- appService = service.ServiceGroupApp.AppService
+ appService = service.NewIAppService()
appInstallService = service.ServiceGroupApp.AppInstallService
containerService = service.ServiceGroupApp.ContainerService
diff --git a/backend/app/service/app.go b/backend/app/service/app.go
index 4e90c8dd2..cc466326f 100644
--- a/backend/app/service/app.go
+++ b/backend/app/service/app.go
@@ -5,6 +5,7 @@ import (
"encoding/base64"
"encoding/json"
"github.com/1Panel-dev/1Panel/backend/buserr"
+ "github.com/1Panel-dev/1Panel/backend/utils/git"
"os"
"path"
"strings"
@@ -103,6 +104,17 @@ func (a AppService) PageApp(req request.AppSearch) (interface{}, error) {
}
res.Tags = tags
+ setting, err := NewISettingService().GetSettingInfo()
+ if err != nil {
+ return nil, err
+ }
+ repoInfo, err := git.CheckAndGetInfo(global.CONF.System.AppRepoOwner, global.CONF.System.AppRepoName)
+ if err != nil {
+ return nil, err
+ }
+ if common.CompareVersion(repoInfo.Version, setting.AppStoreVersion) {
+ res.CanUpdate = true
+ }
return res, nil
}
diff --git a/backend/init/business/business.go b/backend/init/business/business.go
index 6e8ffa570..a25cc6a33 100644
--- a/backend/init/business/business.go
+++ b/backend/init/business/business.go
@@ -14,8 +14,7 @@ func Init() {
if common.CompareVersion(setting.AppStoreVersion, "0.0") {
return
}
- appService := service.AppService{}
- if err := appService.SyncAppList(); err != nil {
+ if err := service.NewIAppService().SyncAppList(); err != nil {
global.LOG.Errorf("sync app error: %s", err.Error())
}
}
diff --git a/frontend/src/views/app-store/apps/index.vue b/frontend/src/views/app-store/apps/index.vue
index d15705263..35da0da9c 100644
--- a/frontend/src/views/app-store/apps/index.vue
+++ b/frontend/src/views/app-store/apps/index.vue
@@ -40,7 +40,9 @@
- {{ $t('app.syncAppList') }}
+
+ {{ $t('app.syncAppList') }}
+
@@ -113,6 +115,7 @@ let loading = ref(false);
let activeTag = ref('all');
let showDetail = ref(false);
let appId = ref(0);
+let canUpdate = ref(false);
const getColor = (index: number) => {
return colorArr[index];
@@ -123,6 +126,7 @@ const search = async (req: App.AppReq) => {
await SearchApp(req)
.then((res) => {
apps.value = res.data.items;
+ canUpdate.value = res.data.canUpdate;
})
.finally(() => {
loading.value = false;