mirror of https://github.com/langgenius/dify.git
feat: add webapp copyright feature
This commit is contained in:
parent
c794ecf101
commit
31086a1fbf
|
@ -55,6 +55,7 @@ class FeatureModel(BaseModel):
|
||||||
can_replace_logo: bool = False
|
can_replace_logo: bool = False
|
||||||
model_load_balancing_enabled: bool = False
|
model_load_balancing_enabled: bool = False
|
||||||
dataset_operator_enabled: bool = False
|
dataset_operator_enabled: bool = False
|
||||||
|
webapp_copyright_enabled: bool = False
|
||||||
|
|
||||||
# pydantic configs
|
# pydantic configs
|
||||||
model_config = ConfigDict(protected_namespaces=())
|
model_config = ConfigDict(protected_namespaces=())
|
||||||
|
@ -86,6 +87,9 @@ class FeatureService:
|
||||||
if dify_config.BILLING_ENABLED and tenant_id:
|
if dify_config.BILLING_ENABLED and tenant_id:
|
||||||
cls._fulfill_params_from_billing_api(features, tenant_id)
|
cls._fulfill_params_from_billing_api(features, tenant_id)
|
||||||
|
|
||||||
|
if dify_config.ENTERPRISE_ENABLED:
|
||||||
|
features.webapp_copyright_enabled = True
|
||||||
|
|
||||||
return features
|
return features
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -123,6 +127,9 @@ class FeatureService:
|
||||||
features.billing.subscription.plan = billing_info["subscription"]["plan"]
|
features.billing.subscription.plan = billing_info["subscription"]["plan"]
|
||||||
features.billing.subscription.interval = billing_info["subscription"]["interval"]
|
features.billing.subscription.interval = billing_info["subscription"]["interval"]
|
||||||
|
|
||||||
|
if features.billing.subscription.plan != "sandbox":
|
||||||
|
features.webapp_copyright_enabled = True
|
||||||
|
|
||||||
if "members" in billing_info:
|
if "members" in billing_info:
|
||||||
features.members.size = billing_info["members"]["size"]
|
features.members.size = billing_info["members"]["size"]
|
||||||
features.members.limit = billing_info["members"]["limit"]
|
features.members.limit = billing_info["members"]["limit"]
|
||||||
|
|
Loading…
Reference in New Issue