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"`
|
||||
Github string `json:"github"`
|
||||
Document string `json:"document"`
|
||||
Version float64 `json:"version"`
|
||||
}
|
||||
|
||||
type AppConfigVersion struct {
|
||||
|
|
|
@ -851,6 +851,12 @@ func (a AppService) SyncAppListFromRemote() (err error) {
|
|||
global.LOG.Infof("Starting synchronization of application details...")
|
||||
for _, l := range list.Apps {
|
||||
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)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue