diff --git a/inventory/setting.go b/inventory/setting.go index 44f935de..7fd2cabe 100644 --- a/inventory/setting.go +++ b/inventory/setting.go @@ -668,6 +668,7 @@ var DefaultSettings = map[string]string{ "encrypt_master_key_vault": "setting", "encrypt_master_key_file": "", "show_encryption_status": "1", + "show_desktop_app_promotion": "1", } var RedactedSettings = map[string]struct{}{ diff --git a/pkg/setting/provider.go b/pkg/setting/provider.go index 7c156638..37a107ff 100644 --- a/pkg/setting/provider.go +++ b/pkg/setting/provider.go @@ -319,7 +319,8 @@ func (s *settingProvider) FileViewers(ctx context.Context) []types.ViewerGroup { func (s *settingProvider) AppSetting(ctx context.Context) *AppSetting { return &AppSetting{ - Promotion: s.getBoolean(ctx, "show_app_promotion", false), + Promotion: s.getBoolean(ctx, "show_app_promotion", false), + DesktopPromotion: s.getBoolean(ctx, "show_desktop_app_promotion", false), } } diff --git a/pkg/setting/types.go b/pkg/setting/types.go index 9a51273e..77d83458 100644 --- a/pkg/setting/types.go +++ b/pkg/setting/types.go @@ -192,7 +192,8 @@ const ( ) type AppSetting struct { - Promotion bool + Promotion bool + DesktopPromotion bool } type EmailTemplate struct { diff --git a/service/basic/site.go b/service/basic/site.go index 1a61b469..6fb7276a 100644 --- a/service/basic/site.go +++ b/service/basic/site.go @@ -59,7 +59,8 @@ type SiteConfig struct { ThumbExts []string `json:"thumb_exts,omitempty"` // App settings - AppPromotion bool `json:"app_promotion,omitempty"` + AppPromotion bool `json:"app_promotion,omitempty"` + DesktopAppPromotion bool `json:"desktop_app_promotion,omitempty"` //EmailActive bool `json:"emailActive"` //QQLogin bool `json:"QQLogin"` @@ -128,7 +129,8 @@ func (s *GetSettingService) GetSiteConfig(c *gin.Context) (*SiteConfig, error) { case "app": appSetting := settings.AppSetting(c) return &SiteConfig{ - AppPromotion: appSetting.Promotion, + AppPromotion: appSetting.Promotion, + DesktopAppPromotion: appSetting.DesktopPromotion, }, nil case "thumb": // Return supported thumbnail extensions from enabled generators.