mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-09-01 17:10:24 +08:00
feat: Turn off certain features of quota popup for self-hosting (#703)
* feat: Turn off certain features of quota popup for self-hosting This commit introduces a new variable, NEXT_PUBLIC_SELFHOSTED, that alters the behavior of the quota popup. Downstream consumers of the application may have their own quota-checking logic, and the front-end reacts to the 429 error by displaying the quota popup. In the case of a self-hosted version of the app, it is inappropriate to ask for sponsorship or provide a hyperlink to the public version of the tool to apply for an increased quota. An alternative string translation is provided with an empty message for adopter customization. To use this feature, compile with NEXT_PUBLIC_SELFHOSTED=true and those parts of the quota popup will be omitted. The downstream consumer is still expected to customize the internationalized strings for the popup content to be appropriate to their organization on their local forks. Signed-off-by: Bryon Nevis <bryon.nevis@intel.com> * refactor: improve readability and provide sensible selfhosted defaults - Extract nested ternary expressions into quotaMessage and tipHtml variables - Combine two separate !isSelfHosted conditional blocks into one - Replace null tipSelfHosted with meaningful default strings across all locales --------- Signed-off-by: Bryon Nevis <bryon.nevis@intel.com> Co-authored-by: dayuan.jiang <jdy.toh@gmail.com>
This commit is contained in:
@@ -135,3 +135,10 @@ AI_MODEL=global.anthropic.claude-sonnet-4-5-20250929-v1:0
|
||||
# Allow private/internal URLs for reverse proxy setups (default: true)
|
||||
# Set to "false" to block private IPs, localhost, and internal hostnames
|
||||
# ALLOW_PRIVATE_URLS=false
|
||||
|
||||
# Self-hosted deployment (Optional)
|
||||
# Self-hosted users may implement custom quota-management solutions,
|
||||
# which triggers the client UI to display messages suggesting self-hosting or sponsorship.
|
||||
# This switch allows self-hosted users to provide custom messages in response to a 429 code,
|
||||
# in messageTokenSelfHosted, messageApiSelfHosted, and tipSelfHosted translation strings.
|
||||
# NEXT_PUBLIC_SELFHOSTED=true
|
||||
|
||||
Reference in New Issue
Block a user