From 487eac3b917246bb2af47eb780c1af75d9042352 Mon Sep 17 00:00:00 2001 From: Joel Date: Mon, 13 Oct 2025 11:27:50 +0800 Subject: [PATCH] chore: add banner permission --- web/app/components/explore/app-list/index.tsx | 10 +++++++--- web/types/feature.ts | 4 ++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/web/app/components/explore/app-list/index.tsx b/web/app/components/explore/app-list/index.tsx index d40ced8784..55a07e96aa 100644 --- a/web/app/components/explore/app-list/index.tsx +++ b/web/app/components/explore/app-list/index.tsx @@ -24,6 +24,7 @@ import { useImportDSL } from '@/hooks/use-import-dsl' import DSLConfirmModal from '@/app/components/app/create-from-dsl-modal/dsl-confirm-modal' import Banner from '../banner' import Button from '../../base/button' +import { useGlobalPublicStore } from '@/context/global-public-context' type AppsProps = { onSuccess?: () => void @@ -38,6 +39,7 @@ const Apps = ({ onSuccess, }: AppsProps) => { const { t } = useTranslation() + const { systemFeatures } = useGlobalPublicStore() const { hasEditPermission } = useContext(ExploreContext) const allCategoriesEn = t('explore.apps.allCategories', { lng: 'en' }) @@ -151,9 +153,11 @@ const Apps = ({
-
- -
+ {systemFeatures.enable_explore_banner && ( +
+ +
+ )}
diff --git a/web/types/feature.ts b/web/types/feature.ts index 56fe0c0484..432cd32ce5 100644 --- a/web/types/feature.ts +++ b/web/types/feature.ts @@ -59,6 +59,8 @@ export type SystemFeatures = { allow_email_code_login: boolean allow_email_password_login: boolean } + enable_trial_app: boolean + enable_explore_banner: boolean } export const defaultSystemFeatures: SystemFeatures = { @@ -98,6 +100,8 @@ export const defaultSystemFeatures: SystemFeatures = { allow_email_code_login: false, allow_email_password_login: false, }, + enable_trial_app: false, + enable_explore_banner: false, } export enum DatasetAttr {