From 7dabc03a08375488632b42440fb46edeed3c2a34 Mon Sep 17 00:00:00 2001 From: zyssyz123 <916125788@qq.com> Date: Tue, 10 Feb 2026 12:08:23 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20When=20the=20user=20is=20a=20non-san?= =?UTF-8?q?dbox=20user=20and=20has=20a=20paid=20balance,=20the=20=E2=80=A6?= =?UTF-8?q?=20(#32173)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- api/services/workspace_service.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/api/services/workspace_service.py b/api/services/workspace_service.py index 3ee41c2e8d..84a8b03329 100644 --- a/api/services/workspace_service.py +++ b/api/services/workspace_service.py @@ -1,6 +1,7 @@ from flask_login import current_user from configs import dify_config +from enums.cloud_plan import CloudPlan from extensions.ext_database import db from models.account import Tenant, TenantAccountJoin, TenantAccountRole from services.account_service import TenantService @@ -53,7 +54,12 @@ class WorkspaceService: from services.credit_pool_service import CreditPoolService paid_pool = CreditPoolService.get_pool(tenant_id=tenant.id, pool_type="paid") - if paid_pool: + # if the tenant is not on the sandbox plan and the paid pool is not full, use the paid pool + if ( + feature.billing.subscription.plan != CloudPlan.SANDBOX + and paid_pool is not None + and (paid_pool.quota_limit == -1 or paid_pool.quota_limit > paid_pool.quota_used) + ): tenant_info["trial_credits"] = paid_pool.quota_limit tenant_info["trial_credits_used"] = paid_pool.quota_used else: From 1819bd72efc47bf2ab176a55dbdf32ead9e039ec Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Tue, 10 Feb 2026 13:55:42 +0800 Subject: [PATCH 2/2] refactor: import component css in globals.css (#32180) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- web/app/components/base/badge/index.tsx | 1 - web/app/components/base/premium-badge/index.tsx | 1 - web/app/styles/globals.css | 5 +++-- web/eslint.config.mjs | 4 ++++ web/tailwind-common-config.ts | 5 +++++ web/tailwind-css-plugin.ts | 4 +++- 6 files changed, 15 insertions(+), 5 deletions(-) diff --git a/web/app/components/base/badge/index.tsx b/web/app/components/base/badge/index.tsx index 9120b28ea6..62029c3058 100644 --- a/web/app/components/base/badge/index.tsx +++ b/web/app/components/base/badge/index.tsx @@ -3,7 +3,6 @@ import type { CSSProperties, ReactNode } from 'react' import { cva } from 'class-variance-authority' import * as React from 'react' import { cn } from '@/utils/classnames' -import './index.css' enum BadgeState { Warning = 'warning', diff --git a/web/app/components/base/premium-badge/index.tsx b/web/app/components/base/premium-badge/index.tsx index 50a5832a28..297e05fe42 100644 --- a/web/app/components/base/premium-badge/index.tsx +++ b/web/app/components/base/premium-badge/index.tsx @@ -4,7 +4,6 @@ import { cva } from 'class-variance-authority' import * as React from 'react' import { Highlight } from '@/app/components/base/icons/src/public/common' import { cn } from '@/utils/classnames' -import './index.css' const PremiumBadgeVariants = cva( 'premium-badge', diff --git a/web/app/styles/globals.css b/web/app/styles/globals.css index b7bb89e11c..cf183cad4e 100644 --- a/web/app/styles/globals.css +++ b/web/app/styles/globals.css @@ -1,15 +1,16 @@ @import "preflight.css"; - @import '../../themes/light.css'; @import '../../themes/dark.css'; @import "../../themes/manual-light.css"; @import "../../themes/manual-dark.css"; @import "./monaco-sticky-fix.css"; -@import "../components/base/button/index.css"; @import "../components/base/action-button/index.css"; +@import "../components/base/badge/index.css"; +@import "../components/base/button/index.css"; @import "../components/base/modal/index.css"; +@import "../components/base/premium-badge/index.css"; @tailwind base; @tailwind components; diff --git a/web/eslint.config.mjs b/web/eslint.config.mjs index 62a2db2caf..cf7825fc61 100644 --- a/web/eslint.config.mjs +++ b/web/eslint.config.mjs @@ -7,6 +7,10 @@ import sonar from 'eslint-plugin-sonarjs' import storybook from 'eslint-plugin-storybook' import dify from './eslint-rules/index.js' +// Enable Tailwind CSS IntelliSense mode for ESLint runs +// See: tailwind-css-plugin.ts +process.env.TAILWIND_MODE ??= 'ESLINT' + export default antfu( { react: { diff --git a/web/tailwind-common-config.ts b/web/tailwind-common-config.ts index 3d592cda89..a1898fbcef 100644 --- a/web/tailwind-common-config.ts +++ b/web/tailwind-common-config.ts @@ -182,6 +182,11 @@ const config = { }), cssAsPlugin([ path.resolve(_dirname, './app/styles/globals.css'), + path.resolve(_dirname, './app/components/base/action-button/index.css'), + path.resolve(_dirname, './app/components/base/badge/index.css'), + path.resolve(_dirname, './app/components/base/button/index.css'), + path.resolve(_dirname, './app/components/base/modal/index.css'), + path.resolve(_dirname, './app/components/base/premium-badge/index.css'), ]), ], // https://github.com/tailwindlabs/tailwindcss/discussions/5969 diff --git a/web/tailwind-css-plugin.ts b/web/tailwind-css-plugin.ts index bbe0d69421..4c7acb3069 100644 --- a/web/tailwind-css-plugin.ts +++ b/web/tailwind-css-plugin.ts @@ -7,9 +7,11 @@ import { parse } from 'postcss' import { objectify } from 'postcss-js' export const cssAsPlugin: (cssPath: string[]) => PluginCreator = (cssPath: string[]) => { - if (process.env.NODE_ENV === 'production') { + const isTailwindCSSIntelliSenseMode = 'TAILWIND_MODE' in process.env + if (!isTailwindCSSIntelliSenseMode) { return () => {} } + return ({ addUtilities, addComponents, addBase }) => { const jssList = cssPath.map(p => objectify(parse(readFileSync(p, 'utf8'))))