🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
✨ feat: add video free quota query endpoint and UI stub
YuTengjing6002863c171e
diff --git a/locales/en-US/video.json b/locales/en-US/video.jsonindex 37936398842..29ed0d9c896 100644--- a/locales/en-US/video.json+++ b/locales/en-US/video.json@@ -15,6 +15,8 @@"generation.actions.errorCopied": "Error Message Copied to Clipboard","generation.actions.errorCopyFailed": "Failed to Copy Error Message","generation.actions.generate": "Generate",+ "generation.freeQuota.exhausted": "🎁 Free quota used up, credits will be consumed",+ "generation.freeQuota.remaining": "🎁 {{remaining}} free videos today","generation.status.failed": "Generation Failed","generation.status.generating": "Generating...","generation.validation.endFrameRequiresStartFrame": "End frame cannot be used without a start frame. Please set a start frame first.",diff --git a/locales/zh-CN/video.json b/locales/zh-CN/video.jsonindex c16d9204266..20c49c20795 100644--- a/locales/zh-CN/video.json+++ b/locales/zh-CN/video.json@@ -15,6 +15,8 @@"generation.actions.errorCopied": "错误信息已复制到剪贴板","generation.actions.errorCopyFailed": "复制遇到了问题。你可以再试一次","generation.actions.generate": "生成",+ "generation.freeQuota.exhausted": "🎁 今日免费次数已用完,将消耗积分",+ "generation.freeQuota.remaining": "🎁 今日剩余 {{remaining}} 次免费","generation.status.failed": "生成遇到了问题。你可以重试,或调整描述后再试","generation.status.generating": "生成中...","generation.validation.endFrameRequiresStartFrame": "不支持单独设置尾帧,请先设置起始帧",diff --git a/src/app/[variants]/(main)/video/features/PromptInput/index.tsx b/src/app/[variants]/(main)/video/features/PromptInput/index.tsxindex 0b89a75ece9..c41e9af7c6c 100644--- a/src/app/[variants]/(main)/video/features/PromptInput/index.tsx+++ b/src/app/[variants]/(main)/video/features/PromptInput/index.tsx@@ -8,6 +8,7 @@ import type { KeyboardEvent } from 'react';import { useEffect, useRef } from 'react';import { useTranslation } from 'react-i18next';+import VideoFreeQuotaInfo from '@/business/client/features/VideoFreeQuotaInfo';import { loginRequired } from '@/components/Error/loginRequiredNotification';import { useIsDark } from '@/hooks/useIsDark';import { useQueryState } from '@/hooks/useQueryParam';@@ -89,42 +90,45 @@ const PromptInput = ({ showTitle = false }: PromptInputProps) => {return (<Flexbox gap={32} width={'100%'}>{showTitle && <PromptTitle />}- <ChatInput- className={cx(styles.container, isDarkMode && styles.container_dark)}- styles={{ body: { padding: 8 } }}- >- <Flexbox align="flex-end" gap={12} height={'100%'} horizontal width={'100%'}>- <TextArea- autoSize={{ maxRows: 6, minRows: 3 }}- onChange={(e) => setValue(e.target.value)}- onKeyDown={handleKeyDown}- placeholder={t('config.prompt.placeholder')}- style={{- borderRadius: 0,- padding: 0,- }}- value={value}- variant={'borderless'}- />- <Button- disabled={!value}- icon={Sparkles}- loading={isCreating}- onClick={handleGenerate}- size={'large'}- style={{- fontWeight: 500,- height: 64,- minWidth: 64,- width: 64,- }}- title={- isCreating ? t('generation.status.generating') : t('generation.actions.generate')- }- type={'primary'}- />- </Flexbox>- </ChatInput>+ <Flexbox gap={8}>+ <ChatInput+ className={cx(styles.container, isDarkMode && styles.container_dark)}+ styles={{ body: { padding: 8 } }}+ >+ <Flexbox horizontal align="flex-end" gap={12} height={'100%'} width={'100%'}>+ <TextArea+ autoSize={{ maxRows: 6, minRows: 3 }}+ placeholder={t('config.prompt.placeholder')}+ value={value}+ variant={'borderless'}+ style={{+ borderRadius: 0,+ padding: 0,+ }}+ onChange={(e) => setValue(e.target.value)}+ onKeyDown={handleKeyDown}+ />+ <Button+ disabled={!value}+ icon={Sparkles}+ loading={isCreating}+ size={'large'}+ type={'primary'}+ style={{+ fontWeight: 500,+ height: 64,+ minWidth: 64,+ width: 64,+ }}+ title={+ isCreating ? t('generation.status.generating') : t('generation.actions.generate')+ }+ onClick={handleGenerate}+ />+ </Flexbox>+ </ChatInput>+ <VideoFreeQuotaInfo />+ </Flexbox></Flexbox>);};diff --git a/src/business/client/features/VideoFreeQuotaInfo.tsx b/src/business/client/features/VideoFreeQuotaInfo.tsxnew file mode 100644index 00000000000..9958fa169d6--- /dev/null+++ b/src/business/client/features/VideoFreeQuotaInfo.tsx@@ -0,0 +1,3 @@+export default function VideoFreeQuotaInfo() {+ return null;+}diff --git a/src/business/server/video-generation/getVideoFreeQuota.ts b/src/business/server/video-generation/getVideoFreeQuota.tsnew file mode 100644index 00000000000..b3d03da1f04--- /dev/null+++ b/src/business/server/video-generation/getVideoFreeQuota.ts@@ -0,0 +1,6 @@+export async function getVideoFreeQuota(+ // eslint-disable-next-line unused-imports/no-unused-vars+ userId: string,+): Promise<{ limit: number; used: number } | null> {+ return null;+}diff --git a/src/locales/default/video.ts b/src/locales/default/video.tsindex bb29f958795..3e282bc01b4 100644--- a/src/locales/default/video.ts+++ b/src/locales/default/video.ts@@ -15,6 +15,8 @@ export default {'generation.actions.errorCopied': 'Error Message Copied to Clipboard','generation.actions.errorCopyFailed': 'Failed to Copy Error Message','generation.actions.generate': 'Generate',+ 'generation.freeQuota.exhausted': '🎁 Free quota used up, credits will be consumed',+ 'generation.freeQuota.remaining': '🎁 {{remaining}} free videos today','generation.validation.endFrameRequiresStartFrame':'End frame cannot be used without a start frame. Please set a start frame first.','generation.status.failed': 'Generation Failed',diff --git a/src/server/routers/lambda/video/index.ts b/src/server/routers/lambda/video/index.tsindex fda694a0568..7064fe07ed7 100644--- a/src/server/routers/lambda/video/index.ts+++ b/src/server/routers/lambda/video/index.ts@@ -3,6 +3,7 @@ import { and, eq } from 'drizzle-orm';import { z } from 'zod';import { chargeBeforeGenerate } from '@/business/server/video-generation/chargeBeforeGenerate';+import { getVideoFreeQuota } from '@/business/server/video-generation/getVideoFreeQuota';import { AsyncTaskModel } from '@/database/models/asyncTask';import {asyncTasks,@@ -238,6 +239,10 @@ export const videoRouter = router({success: true,};}),++ getVideoFreeQuota: authedProcedure.query(async ({ ctx }) => {+ return getVideoFreeQuota(ctx.userId);+ }),});export type VideoRouter = typeof videoRouter;