mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-03-16 18:54:43 +08:00
feat: 应用商店同步改为异步操作 (#956)
This commit is contained in:
parent
7d4a8782d8
commit
fcd764d521
@ -38,14 +38,15 @@ func (b *BaseApi) SearchApp(c *gin.Context) {
|
|||||||
// @Router /apps/sync [post]
|
// @Router /apps/sync [post]
|
||||||
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFuntions":[],"formatZH":"应用商店同步","formatEN":"App store synchronization"}
|
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFuntions":[],"formatZH":"应用商店同步","formatEN":"App store synchronization"}
|
||||||
func (b *BaseApi) SyncApp(c *gin.Context) {
|
func (b *BaseApi) SyncApp(c *gin.Context) {
|
||||||
appService.SyncAppListFromLocal()
|
go appService.SyncAppListFromLocal()
|
||||||
global.LOG.Infof("sync app list start ...")
|
go func() {
|
||||||
if err := appService.SyncAppListFromRemote(); err != nil {
|
global.LOG.Infof("sync app list start ...")
|
||||||
global.LOG.Errorf("sync app list error [%s]", err.Error())
|
if err := appService.SyncAppListFromRemote(); err != nil {
|
||||||
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
global.LOG.Errorf("sync app list error [%s]", err.Error())
|
||||||
return
|
} else {
|
||||||
}
|
global.LOG.Infof("sync app list success!")
|
||||||
global.LOG.Infof("sync app list success!")
|
}
|
||||||
|
}()
|
||||||
helper.SuccessWithData(c, "")
|
helper.SuccessWithData(c, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1045,6 +1045,7 @@ const message = {
|
|||||||
updateHelper: 'Updating parameters may cause the application to fail to start, please operate with caution',
|
updateHelper: 'Updating parameters may cause the application to fail to start, please operate with caution',
|
||||||
updateWarn: 'Update parameters need to rebuild the application, Do you want to continue? ',
|
updateWarn: 'Update parameters need to rebuild the application, Do you want to continue? ',
|
||||||
busPort: 'Service Port',
|
busPort: 'Service Port',
|
||||||
|
syncStart: 'Start syncing! Please refresh the app store later',
|
||||||
},
|
},
|
||||||
website: {
|
website: {
|
||||||
website: 'Website',
|
website: 'Website',
|
||||||
|
@ -1048,6 +1048,7 @@ const message = {
|
|||||||
updateHelper: '更新参数可能导致应用无法启动,请提前备份并谨慎操作',
|
updateHelper: '更新参数可能导致应用无法启动,请提前备份并谨慎操作',
|
||||||
updateWarn: '更新参数需要重建应用,是否继续?',
|
updateWarn: '更新参数需要重建应用,是否继续?',
|
||||||
busPort: '服务端口',
|
busPort: '服务端口',
|
||||||
|
syncStart: '开始同步!请稍后刷新应用商店',
|
||||||
},
|
},
|
||||||
website: {
|
website: {
|
||||||
website: '网站',
|
website: '网站',
|
||||||
|
@ -147,7 +147,7 @@ const sync = () => {
|
|||||||
loading.value = true;
|
loading.value = true;
|
||||||
SyncApp()
|
SyncApp()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
MsgSuccess(i18n.global.t('app.syncSuccess'));
|
MsgSuccess(i18n.global.t('app.syncStart'));
|
||||||
canUpdate.value = false;
|
canUpdate.value = false;
|
||||||
search(req);
|
search(req);
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user