mirror of https://github.com/1Panel-dev/1Panel
feat: 应用商店增加版本控制 (#2068)
parent
6a8bd490bf
commit
f546ffee90
|
@ -67,7 +67,8 @@ type LocalAppInstallDefine struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type ExtraProperties struct {
|
type ExtraProperties struct {
|
||||||
Tags []Tag `json:"tags"`
|
Tags []Tag `json:"tags"`
|
||||||
|
Version string `json:"version"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AppProperty struct {
|
type AppProperty struct {
|
||||||
|
|
|
@ -670,6 +670,21 @@ func (a AppService) GetAppUpdate() (*response.AppUpdateRes, error) {
|
||||||
res.CanUpdate = true
|
res.CanUpdate = true
|
||||||
return res, err
|
return res, err
|
||||||
}
|
}
|
||||||
|
if err = getAppFromRepo(fmt.Sprintf("%s/%s/1panel.json.zip", global.CONF.System.AppRepo, global.CONF.System.Mode)); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
listFile := path.Join(constant.ResourceDir, "1panel.json")
|
||||||
|
content, err := os.ReadFile(listFile)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
list := &dto.AppList{}
|
||||||
|
if err = json.Unmarshal(content, list); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if list.Extra.Version != "" && !common.CompareVersion(setting.SystemVersion, list.Extra.Version) {
|
||||||
|
return nil, buserr.New("ErrVersionTooLow")
|
||||||
|
}
|
||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,7 @@ ErrContainerNotFound: '{{ .name }} container does not exist'
|
||||||
ErrContainerMsg: '{{ .name }} container is abnormal, please check the log on the container page for details'
|
ErrContainerMsg: '{{ .name }} container is abnormal, please check the log on the container page for details'
|
||||||
ErrAppBackup: '{{ .name }} application backup failed err {{.err}}'
|
ErrAppBackup: '{{ .name }} application backup failed err {{.err}}'
|
||||||
ErrImagePull: '{{ .name }} image pull failed err {{.err}}'
|
ErrImagePull: '{{ .name }} image pull failed err {{.err}}'
|
||||||
|
ErrVersionTooLow: 'The current 1Panel version is too low to update the app store, please upgrade the version'
|
||||||
|
|
||||||
#file
|
#file
|
||||||
ErrFileCanNotRead: "File can not read"
|
ErrFileCanNotRead: "File can not read"
|
||||||
|
|
|
@ -46,6 +46,7 @@ ErrContainerNotFound: '{{ .name }} 容器不存在'
|
||||||
ErrContainerMsg: '{{ .name }} 容器異常,具體請在容器頁面查看日誌'
|
ErrContainerMsg: '{{ .name }} 容器異常,具體請在容器頁面查看日誌'
|
||||||
ErrAppBackup: '{{ .name }} 應用備份失敗 err {{.err}}'
|
ErrAppBackup: '{{ .name }} 應用備份失敗 err {{.err}}'
|
||||||
ErrImagePull: '{{ .name }} 鏡像拉取失敗 err {{.err}}'
|
ErrImagePull: '{{ .name }} 鏡像拉取失敗 err {{.err}}'
|
||||||
|
ErrVersionTooLow: '當前 1Panel 版本過低,無法更新應用商店,請升級版本之後操作'
|
||||||
|
|
||||||
#file
|
#file
|
||||||
ErrFileCanNotRead: "此文件不支持預覽"
|
ErrFileCanNotRead: "此文件不支持預覽"
|
||||||
|
|
|
@ -46,6 +46,7 @@ ErrContainerNotFound: '{{ .name }} 容器不存在'
|
||||||
ErrContainerMsg: '{{ .name }} 容器异常,具体请在容器页面查看日志'
|
ErrContainerMsg: '{{ .name }} 容器异常,具体请在容器页面查看日志'
|
||||||
ErrAppBackup: '{{ .name }} 应用备份失败 err {{.err}}'
|
ErrAppBackup: '{{ .name }} 应用备份失败 err {{.err}}'
|
||||||
ErrImagePull: '镜像拉取失败 {{.err}}'
|
ErrImagePull: '镜像拉取失败 {{.err}}'
|
||||||
|
ErrVersionTooLow: '当前 1Panel 版本过低,无法更新应用商店,请升级版本之后操作'
|
||||||
|
|
||||||
#file
|
#file
|
||||||
ErrFileCanNotRead: "此文件不支持预览"
|
ErrFileCanNotRead: "此文件不支持预览"
|
||||||
|
|
Loading…
Reference in New Issue