Skip to content

Commit

Permalink
feat: Add System Version Restrictions for Applications (#7260)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengkunwang223 authored Dec 5, 2024
1 parent f320492 commit e6a772e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions backend/app/dto/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 6 additions & 0 deletions backend/app/service/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e6a772e

Please sign in to comment.