mirror of https://github.com/1Panel-dev/1Panel
feat: Add System Version Restrictions for Applications (#7260)
parent
f320492164
commit
e6a772ebfd
|
@ -92,6 +92,7 @@ type AppProperty struct {
|
||||||
Website string `json:"website"`
|
Website string `json:"website"`
|
||||||
Github string `json:"github"`
|
Github string `json:"github"`
|
||||||
Document string `json:"document"`
|
Document string `json:"document"`
|
||||||
|
Version float64 `json:"version"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AppConfigVersion struct {
|
type AppConfigVersion struct {
|
||||||
|
|
|
@ -851,6 +851,12 @@ func (a AppService) SyncAppListFromRemote() (err error) {
|
||||||
global.LOG.Infof("Starting synchronization of application details...")
|
global.LOG.Infof("Starting synchronization of application details...")
|
||||||
for _, l := range list.Apps {
|
for _, l := range list.Apps {
|
||||||
app := appsMap[l.AppProperty.Key]
|
app := appsMap[l.AppProperty.Key]
|
||||||
|
|
||||||
|
if l.AppProperty.Version > 0 && common.CompareVersion(strconv.FormatFloat(l.AppProperty.Version, 'f', -1, 64), setting.SystemVersion) {
|
||||||
|
delete(appsMap, l.AppProperty.Key)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
_, iconRes, err := httpUtil.HandleGetWithTransport(l.Icon, http.MethodGet, transport, constant.TimeOut20s)
|
_, iconRes, err := httpUtil.HandleGetWithTransport(l.Icon, http.MethodGet, transport, constant.TimeOut20s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue