Skip to content

Commit e6a772e

Browse files
feat: Add System Version Restrictions for Applications (#7260)
1 parent f320492 commit e6a772e

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

backend/app/dto/app.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ type AppProperty struct {
9292
Website string `json:"website"`
9393
Github string `json:"github"`
9494
Document string `json:"document"`
95+
Version float64 `json:"version"`
9596
}
9697

9798
type AppConfigVersion struct {

backend/app/service/app.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,12 @@ func (a AppService) SyncAppListFromRemote() (err error) {
851851
global.LOG.Infof("Starting synchronization of application details...")
852852
for _, l := range list.Apps {
853853
app := appsMap[l.AppProperty.Key]
854+
855+
if l.AppProperty.Version > 0 && common.CompareVersion(strconv.FormatFloat(l.AppProperty.Version, 'f', -1, 64), setting.SystemVersion) {
856+
delete(appsMap, l.AppProperty.Key)
857+
continue
858+
}
859+
854860
_, iconRes, err := httpUtil.HandleGetWithTransport(l.Icon, http.MethodGet, transport, constant.TimeOut20s)
855861
if err != nil {
856862
return err

0 commit comments

Comments
 (0)