From 6c25a03b26c2df50d98411d84479ea981bf27e16 Mon Sep 17 00:00:00 2001 From: tt <1109394634@qq.com> Date: Tue, 20 Feb 2024 19:11:05 +0800 Subject: [PATCH] update --- .env.production | 1 + messages/en.json | 1 + messages/zh.json | 1 + src/app/[locale]/PageComponent.tsx | 4 ++++ src/app/[locale]/page.tsx | 1 + src/components/Header.tsx | 5 +++-- 6 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.env.production b/.env.production index 541efb7..aafb53e 100644 --- a/.env.production +++ b/.env.production @@ -1,6 +1,7 @@ # 网站 URL NEXT_PUBLIC_SITE_URL=https://sorawebui.com +# openai config OPENAI_API_KEY=sk-XXXXXX OPENAI_API_BASE_URL=https://fake-sora-api.sorawebui.com OPENAI_API_MODEL=sora-1.0-turbo diff --git a/messages/en.json b/messages/en.json index f8ffc5e..bd3eb50 100644 --- a/messages/en.json +++ b/messages/en.json @@ -6,6 +6,7 @@ "title": "Sora Webui", "description": "A browser interface for OpenAI Sora, generate text-to-video simply.", "loadingText": "Loading...", + "generateText": "Generating...", "buttonText": "Generate", "placeholderText": "Type or paste text here...", "loginText": "Log in", diff --git a/messages/zh.json b/messages/zh.json index 51f9101..8abba80 100644 --- a/messages/zh.json +++ b/messages/zh.json @@ -6,6 +6,7 @@ "title": "Sora Webui", "description": "OpenAI Sora 的浏览器界面,可轻松生成文本到视频。", "loadingText": "加载中...", + "generateText": "生成中...", "buttonText": "生成", "placeholderText": "在此处输入或粘贴文本...", "loginText": "登录", diff --git a/src/app/[locale]/PageComponent.tsx b/src/app/[locale]/PageComponent.tsx index fedc326..7620004 100644 --- a/src/app/[locale]/PageComponent.tsx +++ b/src/app/[locale]/PageComponent.tsx @@ -14,6 +14,7 @@ const PageComponent = ({ title: '', description: '', loadingText: '', + generateText: '', buttonText: '', placeholderText: '', loginText: '', @@ -47,6 +48,9 @@ const PageComponent = ({ const result = await response.json(); setShowLoadingModal(false); if (result.data) { + if (!result.data[0].revised_prompt) { + return + } const video = { revised_prompt: result.data[0].revised_prompt, url: result.data[0].url diff --git a/src/app/[locale]/page.tsx b/src/app/[locale]/page.tsx index b884d9d..343741b 100644 --- a/src/app/[locale]/page.tsx +++ b/src/app/[locale]/page.tsx @@ -11,6 +11,7 @@ export default async function IndexPage({params: {locale = ''}}) { title: t('title'), description: t('description'), loadingText: t('loadingText'), + generateText: t('generateText'), buttonText: t('buttonText'), placeholderText: t('placeholderText'), loginText: t('loginText'), diff --git a/src/components/Header.tsx b/src/components/Header.tsx index c6eb7c5..78b6876 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -33,7 +33,8 @@ export default function Header({ page = '', currentLanguageText = { loginText: 'Log in', - loadingText: 'Loading' + loadingText: 'Loading', + generateText: 'Generating', }, }) { const {showLoadingModal, setShowLoadingModal} = useCommonContext(); @@ -62,7 +63,7 @@ export default function Header({ return (
- +