Merge branch 'feat/enchance-warn-user-time-when-need-upgrade-plan' into deploy/dev
Some checks are pending
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/amd64, build-api-amd64) (push) Waiting to run
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/arm64, build-api-arm64) (push) Waiting to run
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/amd64, build-web-amd64) (push) Waiting to run
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/arm64, build-web-arm64) (push) Waiting to run
Build and Push API & Web / create-manifest (api, DIFY_API_IMAGE_NAME, merge-api-images) (push) Blocked by required conditions
Build and Push API & Web / create-manifest (web, DIFY_WEB_IMAGE_NAME, merge-web-images) (push) Blocked by required conditions

This commit is contained in:
Joel 2025-12-11 15:05:26 +08:00
commit 66713091e2

View File

@ -14,6 +14,7 @@ import Popover from '@/app/components/base/popover'
import { useBoolean } from 'ahooks'
import { useProviderContext } from '@/context/provider-context'
import PlanUpgradeModal from '@/app/components/billing/plan-upgrade-modal'
import { Plan } from '@/app/components/billing/type'
export type ISegmentAddProps = {
importStatus: ProcessStatus | string | undefined
@ -43,8 +44,8 @@ const SegmentAdd: FC<ISegmentAddProps> = ({
setFalse: hidePlanUpgradeModal,
}] = useBoolean(false)
const { plan, enableBilling } = useProviderContext()
const { usage, total } = plan
const canAdd = enableBilling ? (usage.vectorSpace < total.vectorSpace) : true
const { type } = plan
const canAdd = enableBilling ? type !== Plan.sandbox : true
const withNeedUpgradeCheck = useCallback((fn: () => void) => {
return () => {