Skip to content

Let's use AI to Earn!

fix(web): Video generation fix and optimize (#230)

布莱恩·奥夫托·杰森张56a8dd3a6eb9
diff --git a/project/web/@types/resources.d.ts b/project/web/@types/resources.d.ts
index bb8fbcf8..bee58964 100644
--- a/project/web/@types/resources.d.ts
+++ b/project/web/@types/resources.d.ts
@@ -1416,6 +1416,7 @@ interface Resources {
credits: '积分'
getImageModelsFailed: '获取图片生成模型失败'
getVideoModelsFailed: '获取视频生成模型失败'
+ videoLoadedSuccess: '视频已加载'
}
}
'notification': {
diff --git a/project/web/src/app/[lng]/accounts/components/AddAccountModal/index.tsx b/project/web/src/app/[lng]/accounts/components/AddAccountModal/index.tsx
index eae28d94..beaea313 100644
--- a/project/web/src/app/[lng]/accounts/components/AddAccountModal/index.tsx
+++ b/project/web/src/app/[lng]/accounts/components/AddAccountModal/index.tsx
@@ -273,10 +273,8 @@ const AddAccountModal = memo(
setTimeout(async () => {
try {
await getAccountList()
- console.log('账号列表已刷新')
}
catch (error) {
- console.error('刷新账号列表失败:', error)
}
}, 2000) // 等待3秒让授权完成
}
diff --git a/project/web/src/app/[lng]/accounts/plat/BilibiliLogin.ts b/project/web/src/app/[lng]/accounts/plat/BilibiliLogin.ts
index 748028fc..fc280998 100644
--- a/project/web/src/app/[lng]/accounts/plat/BilibiliLogin.ts
+++ b/project/web/src/app/[lng]/accounts/plat/BilibiliLogin.ts
@@ -47,14 +47,14 @@ export function bilibiliLogin(taskId: any): Promise<any> {
// 检查是否达到最大轮询次数
if (pollCount >= maxPollCount) {
- console.log('达到最大轮询次数,停止轮询')
+
return true
}
// return false;
}
catch (error) {
- console.error('检查授权状态失败:', error)
+
return false
}
}
@@ -65,7 +65,7 @@ export function bilibiliLogin(taskId: any): Promise<any> {
if (isSuccess) {
clearInterval(interval)
if (pollCount >= maxPollCount) {
- reject(new Error('授权超时,已达到最大轮询次数'))
+ reject(new Error('timeout, max poll count reached'))
}
}
}, 2000)
@@ -74,7 +74,7 @@ export function bilibiliLogin(taskId: any): Promise<any> {
setTimeout(() => {
clearInterval(interval)
// message.error('授权超时,请重试');
- reject(new Error('授权超时'))
+ reject(new Error('timeout'))
}, 5 * 60 * 1000)
}
catch (e) {
diff --git a/project/web/src/app/[lng]/accounts/plat/FacebookLogin.ts b/project/web/src/app/[lng]/accounts/plat/FacebookLogin.ts
index a09ac797..3b5bfe35 100644
--- a/project/web/src/app/[lng]/accounts/plat/FacebookLogin.ts
+++ b/project/web/src/app/[lng]/accounts/plat/FacebookLogin.ts
@@ -40,7 +40,6 @@ export function facebookLogin(taskId: any): Promise<any> {
pollCount++
const authRess: any = await checkMetaAuthApi(taskId)
const authRes = authRess
- console.log('authRes', authRes)
if (authRes?.code === 0 && authRes?.data.status == 1) {
// 授权成功,不再直接刷新账户列表
// 而是触发页面选择弹窗
@@ -50,14 +49,14 @@ export function facebookLogin(taskId: any): Promise<any> {
// 检查是否达到最大轮询次数
if (pollCount >= maxPollCount) {
- console.log('达到最大轮询次数,停止轮询')
+
return true
}
// return false;
}
catch (error) {
- console.error('检查授权状态失败:', error)
+
return false
}
}
@@ -68,7 +67,7 @@ export function facebookLogin(taskId: any): Promise<any> {
if (isSuccess) {
clearInterval(interval)
if (pollCount >= maxPollCount) {
- reject(new Error('授权超时,已达到最大轮询次数'))
+ reject(new Error('timeout, max poll count reached'))
}
}
}, 2000)
@@ -77,7 +76,7 @@ export function facebookLogin(taskId: any): Promise<any> {
setTimeout(() => {
clearInterval(interval)
// message.error('授权超时,请重试');
- reject(new Error('授权超时'))
+ reject(new Error('timeout'))
}, 5 * 60 * 1000)
}
catch (e) {
diff --git a/project/web/src/app/[lng]/accounts/plat/InstagramLogin.ts b/project/web/src/app/[lng]/accounts/plat/InstagramLogin.ts
index 539c2110..d417a767 100644
--- a/project/web/src/app/[lng]/accounts/plat/InstagramLogin.ts
+++ b/project/web/src/app/[lng]/accounts/plat/InstagramLogin.ts
@@ -37,7 +37,6 @@ export function instagramLogin(taskId: any): Promise<any> {
pollCount++
const authRess: any = await checkMetaAuthApi(taskId)
const authRes = authRess
- console.log('authRes', authRes)
if (authRes?.code === 0 && authRes?.data.status == 1) {
// message.success('授权成功');
// useAccountStore
@@ -49,14 +48,14 @@ export function instagramLogin(taskId: any): Promise<any> {
// 检查是否达到最大轮询次数
if (pollCount >= maxPollCount) {
- console.log('达到最大轮询次数,停止轮询')
+
return true
}
// return false;
}
catch (error) {
- console.error('检查授权状态失败:', error)
+
return false
}
}
@@ -67,7 +66,7 @@ export function instagramLogin(taskId: any): Promise<any> {
if (isSuccess) {
clearInterval(interval)
if (pollCount >= maxPollCount) {
- reject(new Error('授权超时,已达到最大轮询次数'))
+ reject(new Error('timeout, max poll count reached'))
}
}
}, 2000)
@@ -76,7 +75,7 @@ export function instagramLogin(taskId: any): Promise<any> {
setTimeout(() => {
clearInterval(interval)
// message.error('授权超时,请重试');
- reject(new Error('授权超时'))
+ reject(new Error('timeout'))
}, 5 * 60 * 1000)
}
catch (e) {
diff --git a/project/web/src/app/[lng]/accounts/plat/LinkedinLogin.ts b/project/web/src/app/[lng]/accounts/plat/LinkedinLogin.ts
index c72b24fc..e68fbe06 100644
--- a/project/web/src/app/[lng]/accounts/plat/LinkedinLogin.ts
+++ b/project/web/src/app/[lng]/accounts/plat/LinkedinLogin.ts
@@ -59,14 +59,14 @@ export function linkedinLogin(taskId: any): Promise<any> {
if (isSuccess) {
clearInterval(interval)
if (pollCount >= maxPollCount) {
- reject(new Error('授权超时,已达到最大轮询次数'))
+ reject(new Error('timeout, max poll count reached'))
}
}
}, 2000)
setTimeout(() => {
clearInterval(interval)
- reject(new Error('授权超时'))
+ reject(new Error('timeout'))
}, 5 * 60 * 1000)
}
catch (e) {
diff --git a/project/web/src/app/[lng]/accounts/plat/PinterestLogin.ts b/project/web/src/app/[lng]/accounts/plat/PinterestLogin.ts
index 8e560690..e52989bd 100644
--- a/project/web/src/app/[lng]/accounts/plat/PinterestLogin.ts
+++ b/project/web/src/app/[lng]/accounts/plat/PinterestLogin.ts
@@ -37,7 +37,6 @@ export function pinterestLogin(taskId: any): Promise<any> {
pollCount++
const authRess: any = await checkPinterestAuthApi(taskId)
const authRes = authRess
- console.log('authRes', authRes)
if (authRes?.code === 0 && authRes?.data.status == 1) {
// message.success('授权成功');
// useAccountStore
@@ -49,14 +48,13 @@ export function pinterestLogin(taskId: any): Promise<any> {
// 检查是否达到最大轮询次数
if (pollCount >= maxPollCount) {
- console.log('达到最大轮询次数,停止轮询')
return true
}
// return false;
}
catch (error) {
- console.error('检查授权状态失败:', error)
+
return false
}
}
@@ -67,7 +65,7 @@ export function pinterestLogin(taskId: any): Promise<any> {
if (isSuccess) {
clearInterval(interval)
if (pollCount >= maxPollCount) {
- reject(new Error('授权超时,已达到最大轮询次数'))
+ reject(new Error('timeout, max poll count reached'))
}
}
}, 2000)
@@ -76,7 +74,7 @@ export function pinterestLogin(taskId: any): Promise<any> {
setTimeout(() => {
clearInterval(interval)
// message.error('授权超时,请重试');
- reject(new Error('授权超时'))
+ reject(new Error('timeout'))
}, 5 * 60 * 1000)
}
catch (e) {
diff --git a/project/web/src/app/[lng]/accounts/plat/ThreadsLogin.ts b/project/web/src/app/[lng]/accounts/plat/ThreadsLogin.ts
index 7da69999..fa16cc3d 100644
--- a/project/web/src/app/[lng]/accounts/plat/ThreadsLogin.ts
+++ b/project/web/src/app/[lng]/accounts/plat/ThreadsLogin.ts
@@ -38,7 +38,6 @@ export function threadsLogin(taskId: any): Promise<any> {
pollCount++
const authRess: any = await checkMetaAuthApi(taskId)
const authRes = authRess
- console.log('authRes', authRes)
if (authRes?.code === 0 && authRes?.data.status == 1) {
// message.success('授权成功');
// useAccountStore
@@ -50,14 +49,14 @@ export function threadsLogin(taskId: any): Promise<any> {
// 检查是否达到最大轮询次数
if (pollCount >= maxPollCount) {
- console.log('达到最大轮询次数,停止轮询')
+
return true
}
// return false;
}
catch (error) {
- console.error('检查授权状态失败:', error)
+
return false
}
}
@@ -68,7 +67,7 @@ export function threadsLogin(taskId: any): Promise<any> {
if (isSuccess) {
clearInterval(interval)
if (pollCount >= maxPollCount) {
- reject(new Error('授权超时,已达到最大轮询次数'))
+ reject(new Error('timeout, max poll count reached'))
}
}
}, 2000)
@@ -77,7 +76,7 @@ export function threadsLogin(taskId: any): Promise<any> {
setTimeout(() => {
clearInterval(interval)
// message.error('授权超时,请重试');
- reject(new Error('授权超时'))
+ reject(new Error('timeout'))
}, 5 * 60 * 1000)
}
catch (e) {
diff --git a/project/web/src/app/[lng]/accounts/plat/TiktokLogin.ts b/project/web/src/app/[lng]/accounts/plat/TiktokLogin.ts
index f080900e..f348bdc4 100644
--- a/project/web/src/app/[lng]/accounts/plat/TiktokLogin.ts
+++ b/project/web/src/app/[lng]/accounts/plat/TiktokLogin.ts
@@ -37,7 +37,6 @@ export function tiktokLogin(taskId: any): Promise<any> {
pollCount++
const authRess: any = await checkTiktokAuthApi(taskId)
const authRes = authRess
- console.log('authRes', authRes)
if (authRes?.code === 0 && authRes?.data.status == 1) {
// message.success('授权成功');
// useAccountStore
@@ -49,14 +48,14 @@ export function tiktokLogin(taskId: any): Promise<any> {
// 检查是否达到最大轮询次数
if (pollCount >= maxPollCount) {
- console.log('达到最大轮询次数,停止轮询')
+
return true
}
// return false;
}
catch (error) {
- console.error('检查授权状态失败:', error)
+
return false
}
}
@@ -67,7 +66,7 @@ export function tiktokLogin(taskId: any): Promise<any> {
if (isSuccess) {
clearInterval(interval)
if (pollCount >= maxPollCount) {
- reject(new Error('授权超时,已达到最大轮询次数'))
+ reject(new Error('timeout, max poll count reached'))
}
}
}, 2000)
@@ -76,7 +75,7 @@ export function tiktokLogin(taskId: any): Promise<any> {
setTimeout(() => {
clearInterval(interval)
// message.error('授权超时,请重试');
- reject(new Error('授权超时'))
+ reject(new Error('timeout'))
}, 5 * 60 * 1000)
}
catch (e) {
diff --git a/project/web/src/app/[lng]/accounts/plat/TwtterLogin.ts b/project/web/src/app/[lng]/accounts/plat/TwtterLogin.ts
index 13b73238..8d7bfe10 100644
--- a/project/web/src/app/[lng]/accounts/plat/TwtterLogin.ts
+++ b/project/web/src/app/[lng]/accounts/plat/TwtterLogin.ts
@@ -37,10 +37,7 @@ export function twitterLogin(taskId: any): Promise<any> {
pollCount++
const authRess: any = await apiCheckTwitterAuth(taskId)
const authRes = authRess
- console.log('authRes', authRes)
if (authRes?.code === 0 && authRes?.data.status == 1) {
- // message.success('授权成功');
- // useAccountStore
const accountStore = useAccountStore.getState()
await accountStore.getAccountList()
resolve(authRes)
@@ -49,14 +46,14 @@ export function twitterLogin(taskId: any): Promise<any> {
// 检查是否达到最大轮询次数
if (pollCount >= maxPollCount) {
- console.log('达到最大轮询次数,停止轮询')
+
return true
}
// return false;
}
catch (error) {
- console.error('检查授权状态失败:', error)
+
return false
}
}
@@ -67,7 +64,7 @@ export function twitterLogin(taskId: any): Promise<any> {
if (isSuccess) {
clearInterval(interval)
if (pollCount >= maxPollCount) {
- reject(new Error('授权超时,已达到最大轮询次数'))
+ reject(new Error('timeout, max poll count reached'))
}
}
}, 2000)
@@ -75,8 +72,7 @@ export function twitterLogin(taskId: any): Promise<any> {
// 5分钟后自动停止轮询
setTimeout(() => {
clearInterval(interval)
- // message.error('授权超时,请重试');
- reject(new Error('授权超时'))
+ reject(new Error('timeout'))
}, 5 * 60 * 1000)
}
catch (e) {
diff --git a/project/web/src/app/[lng]/accounts/plat/WxGzh.ts b/project/web/src/app/[lng]/accounts/plat/WxGzh.ts
index 4af553cd..420c5ac7 100644
--- a/project/web/src/app/[lng]/accounts/plat/WxGzh.ts
+++ b/project/web/src/app/[lng]/accounts/plat/WxGzh.ts
@@ -37,7 +37,6 @@ export function wxGzhLogin(taskId: any): Promise<any> {
pollCount++
const authRess: any = await checkWxGzAuthApi(taskId)
const authRes = authRess
- console.log('authRes', authRes)
if (authRes?.code === 0 && authRes?.data.status == 1) {
// message.success('授权成功');
// useAccountStore
@@ -49,14 +48,14 @@ export function wxGzhLogin(taskId: any): Promise<any> {
// 检查是否达到最大轮询次数
if (pollCount >= maxPollCount) {
- console.log('达到最大轮询次数,停止轮询')
+
return true
}
// return false;
}
catch (error) {
- console.error('检查授权状态失败:', error)
+ console.error('check auth status failed:', error)
return false
}
}
@@ -67,7 +66,7 @@ export function wxGzhLogin(taskId: any): Promise<any> {
if (isSuccess) {
clearInterval(interval)
if (pollCount >= maxPollCount) {
- reject(new Error('授权超时,已达到最大轮询次数'))
+ reject(new Error('timeout, max poll count reached'))
}
}
}, 2000)
@@ -75,8 +74,7 @@ export function wxGzhLogin(taskId: any): Promise<any> {
// 5分钟后自动停止轮询
setTimeout(() => {
clearInterval(interval)
- // message.error('授权超时,请重试');
- reject(new Error('授权超时'))
+ reject(new Error('timeout'))
}, 5 * 60 * 1000)
}
catch (e) {
diff --git a/project/web/src/app/[lng]/accounts/plat/YoutubeLogin.ts b/project/web/src/app/[lng]/accounts/plat/YoutubeLogin.ts
index 0a2ce475..bdaf4c8d 100644
--- a/project/web/src/app/[lng]/accounts/plat/YoutubeLogin.ts
+++ b/project/web/src/app/[lng]/accounts/plat/YoutubeLogin.ts
@@ -37,7 +37,6 @@ export function youtubeLogin(taskId: any): Promise<any> {
pollCount++
const authRess: any = await apiCheckYoutubeAuth(taskId)
const authRes = authRess
- console.log('authRes', authRes)
if (authRes?.code === 0 && authRes?.data.status == 1) {
// message.success('授权成功');
// useAccountStore
@@ -49,14 +48,14 @@ export function youtubeLogin(taskId: any): Promise<any> {
// 检查是否达到最大轮询次数
if (pollCount >= maxPollCount) {
- console.log('达到最大轮询次数,停止轮询')
+ console.log('max poll count, stop polling')
return true
}
// return false;
}
catch (error) {
- console.error('检查授权状态失败:', error)
+ console.error('check auth status failed:', error)
return false
}
}
@@ -67,7 +66,7 @@ export function youtubeLogin(taskId: any): Promise<any> {
if (isSuccess) {
clearInterval(interval)
if (pollCount >= maxPollCount) {
- reject(new Error('授权超时,已达到最大轮询次数'))
+ reject(new Error('timeout, max poll count reached'))
}
}
}, 2000)
@@ -75,8 +74,7 @@ export function youtubeLogin(taskId: any): Promise<any> {
// 5分钟后自动停止轮询
setTimeout(() => {
clearInterval(interval)
- // message.error('授权超时,请重试');
- reject(new Error('授权超时'))
+ reject(new Error('timeout'))
}, 5 * 60 * 1000)
}
catch (e) {
diff --git a/project/web/src/app/[lng]/cgmaterial/cgmaterialPageCore.tsx b/project/web/src/app/[lng]/cgmaterial/cgmaterialPageCore.tsx
index 12755a28..7ab060a3 100644
--- a/project/web/src/app/[lng]/cgmaterial/cgmaterialPageCore.tsx
+++ b/project/web/src/app/[lng]/cgmaterial/cgmaterialPageCore.tsx
@@ -961,18 +961,13 @@ export default function CgMaterialPageCore() {
}
}).filter((record): record is NonNullable<typeof record> => record !== null)
- console.log('构造的导入记录:', records)
- console.log('选中的账户:', selectedAccount)
-
if (records.length === 0) {
message.warning(t('import.noValidRecords' as any))
return
}
// 调用导入接口
- console.log('开始调用导入接口...')
const res = await apiImportPostsRecord(records)
- console.log('导入接口返回结果:', res)
if (res?.code === 0) {
message.success(t('import.importSuccess' as any, { count: records.length }))
diff --git a/project/web/src/app/[lng]/interactive/page.tsx b/project/web/src/app/[lng]/interactive/page.tsx
index ce73574a..fd45b6d4 100644
--- a/project/web/src/app/[lng]/interactive/page.tsx
+++ b/project/web/src/app/[lng]/interactive/page.tsx
@@ -672,7 +672,7 @@ export default function InteractivePage() {
// key="ai-reply"
// onClick={() => openAiModal(commentPost!.id, c.id)}
// >
- // AI回复
+ // AI
// </a>,
].filter(Boolean)}
>
diff --git a/project/web/src/app/[lng]/material/ai-generate/page.tsx b/project/web/src/app/[lng]/material/ai-generate/page.tsx
index ea082f20..cb932a8e 100644
--- a/project/web/src/app/[lng]/material/ai-generate/page.tsx
+++ b/project/web/src/app/[lng]/material/ai-generate/page.tsx
@@ -18,6 +18,57 @@ import { defaultMarkdown, md2CardTemplates } from './md2card'
const { TextArea } = Input
const { Option } = Select
+// Helper function to determine if resolution is landscape or portrait
+const getResolutionOrientation = (resolution: string): 'landscape' | 'portrait' | 'square' => {
+ const match = resolution.match(/(\d+)[x*×](\d+)/)
+ if (!match)
+ return 'square'
+ const width = Number.parseInt(match[1])
+ const height = Number.parseInt(match[2])
+ if (width > height)
+ return 'landscape'
+ if (height > width)
+ return 'portrait'
+ return 'square'
+}
+
+// Resolution icon component
+const ResolutionIcon = ({ orientation }: { orientation: 'landscape' | 'portrait' | 'square' }) => {
+ const containerStyle: React.CSSProperties = {
+ display: 'inline-flex',
+ alignItems: 'center',
+ justifyContent: 'center',
+ width: '28px',
+ marginRight: '8px',
+ verticalAlign: 'middle',
+ }
+
+ const iconStyle: React.CSSProperties = {
+ border: '2px solid currentColor',
+ borderRadius: '2px',
+ }
+
+ if (orientation === 'landscape') {
+ return (
+ <span style={containerStyle}>
+ <span style={{ ...iconStyle, width: '20px', height: '14px' }}></span>
+ </span>
+ )
+ }
+ if (orientation === 'portrait') {
+ return (
+ <span style={containerStyle}>
+ <span style={{ ...iconStyle, width: '14px', height: '20px' }}></span>
+ </span>
+ )
+ }
+ return (
+ <span style={containerStyle}>
+ <span style={{ ...iconStyle, width: '16px', height: '16px' }}></span>
+ </span>
+ )
+}
+
// Sample image URL constants
const SAMPLE_IMAGE_URLS = {
shili21: 'https://aitoearn.s3.ap-southeast-1.amazonaws.com/common/web/shili/image-ai-sample-2-1.webp',
@@ -386,8 +437,6 @@ export default function AIGeneratePage() {
const timeStr = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')} ${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}`
const uploadTitle = modelName ? `${modelName} ${timeStr}` : timeStr
- console.log('开始上传到默认组:', defaultGroupId, mediaUrl)
-
const uploadRes: any = await createMedia({
groupId: defaultGroupId,
url: mediaUrl,
@@ -400,11 +449,9 @@ export default function AIGeneratePage() {
// Mark as uploaded
setUploadedContent(prev => new Set([...prev, mediaUrl]))
message.success(mediaType === 'video' ? t('aiGenerate.videoUploadSuccess') : t('aiGenerate.uploadSuccess'))
- console.log('上传成功')
}
else {
message.error(mediaType === 'video' ? t('aiGenerate.videoUploadFailed') : t('aiGenerate.uploadFailed'))
- console.log('上传失败:', uploadRes)
}
}
catch (error) {
@@ -544,7 +591,7 @@ export default function AIGeneratePage() {
percent = progress > -1 ? Math.round(progress) : Math.round(progress * 100)
}
if (normalized === 'completed') {
- const videoUrl = res.data?.data?.video_url
+ const videoUrl = video_url || res.data?.data?.video_url || res.data?.video_url
setVideoResult(videoUrl)
setVideoProgress(100)
message.success(t('aiGenerate.videoGenerationSuccess'))
@@ -735,14 +782,12 @@ export default function AIGeneratePage() {
}
// Handle history item click
- const handleHistoryItemClick = async (item: any) => {
+ const handleHistoryItemClick = (item: any) => {
if (item.status === 'SUCCESS' && item.data?.video_url) {
setVideoResult(item.data.video_url)
setVideoStatus('completed')
setVideoProgress(100)
-
- // Auto upload to default media group
- await autoUploadToDefaultGroup(item.data.video_url, 'video', item.model || 'Unknown Model', item.prompt || '')
+ message.success(t('aiGenerate.videoLoadedSuccess' as any) || 'Video loaded successfully')
}
else if (item.status === 'PROCESSING') {
setVideoTaskId(item.task_id)
@@ -1283,7 +1328,10 @@ export default function AIGeneratePage() {
const selectedModel = imageModels.find((m: any) => m.name === model)
const sizes = selectedModel?.sizes || ['1024x1024']
return sizes.map((sizeOption: string) => (
- <Option key={sizeOption} value={sizeOption}>{sizeOption}</Option>
+ <Option key={sizeOption} value={sizeOption}>
+ <ResolutionIcon orientation={getResolutionOrientation(sizeOption)} />
+ {sizeOption}
+ </Option>
))
})()}
</Select>
@@ -1557,7 +1605,10 @@ export default function AIGeneratePage() {
const selectedModel = imageEditModels.find((m: any) => m.name === imageEditModel)
const sizes = selectedModel?.sizes || ['1024x1024']
return sizes.map((size: string) => (
- <Option key={size} value={size}>{size}</Option>
+ <Option key={size} value={size}>
+ <ResolutionIcon orientation={getResolutionOrientation(size)} />
+ {size}
+ </Option>
))
})()}
</Select>
@@ -1862,13 +1913,21 @@ export default function AIGeneratePage() {
if (selected?.channel === 'kling' && selected?.pricing) {
const modes = [...new Set(selected.pricing.map((p: any) => p.mode))] as string[]
return modes.map((mode: string) => (
- <Option key={mode} value={mode}>{mode}</Option>
+ <Option key={mode} value={mode}>
+ <ResolutionIcon orientation={getResolutionOrientation(mode)} />
+ {mode}
+ </Option>
))
}
// Other models get from resolutions field
const sizes: string[] = selected?.resolutions || []
- return sizes.map(s => (<Option key={s} value={s}>{s}</Option>))
+ return sizes.map(s => (
+ <Option key={s} value={s}>
+ <ResolutionIcon orientation={getResolutionOrientation(s)} />
+ {s}
+ </Option>
+ ))
})()}
</Select>
@@ -2068,12 +2127,12 @@ export default function AIGeneratePage() {
{videoProgress > 0 && videoProgress < 100 && (<Progress percent={videoProgress} status="active" />)}
</div>
)}
- {/* {videoResult && (
+ {videoResult && (
<div style={{ display:'flex', flexDirection:'column', gap:10 }}>
- <video src={getOssUrl(videoResult)} controls style={{ maxWidth:'100%', borderRadius:8 }} />
- <Button type="primary" onClick={()=>handleUploadToMediaGroup('video')} icon={<UploadOutlined />} style={{ padding:'1px' }}>{t('aiGenerate.uploadToMediaGroup')}</Button>
+ <video src={getOssUrl(videoResult)} controls style={{ maxWidth:'100%', maxHeight:'400px', borderRadius:8 }} />
+ {/* <Button type="primary" onClick={()=>handleUploadToMediaGroup('video')} icon={<UploadOutlined />} style={{ padding:'1px' }}>{t('aiGenerate.uploadToMediaGroup')}</Button> */}
</div>
- )} */}
+ )}
</div>
)
: (
@@ -2215,7 +2274,6 @@ export default function AIGeneratePage() {
width: '100%',
borderRadius: 8,
maxHeight: '200px',
- objectFit: 'cover',
}}
/>
</div>
diff --git a/project/web/src/app/[lng]/register/page.tsx b/project/web/src/app/[lng]/register/page.tsx
index caea89c8..269049f3 100644
--- a/project/web/src/app/[lng]/register/page.tsx
+++ b/project/web/src/app/[lng]/register/page.tsx
@@ -15,18 +15,17 @@ export default function RegisterPage() {
return
}
// TODO: 实现注册逻辑
- console.log('注册:', { email, password })
}
return (
<div className={styles.container}>
<div className={styles.box}>
- <h1 className={styles.title}>注册账号</h1>
+ <h1 className={styles.title}>register account</h1>
<form onSubmit={handleSubmit} className={styles.form}>
<div className={styles.inputGroup}>
<input
type="email"
- placeholder="邮箱"
+ placeholder="email"
value={email}
onChange={e => setEmail(e.target.value)}
className={styles.input}
@@ -36,7 +35,7 @@ export default function RegisterPage() {
<div className={styles.inputGroup}>
<input
type="password"
- placeholder="密码"
+ placeholder="password"
value={password}
onChange={e => setPassword(e.target.value)}
className={styles.input}
@@ -46,7 +45,7 @@ export default function RegisterPage() {
<div className={styles.inputGroup}>
<input
type="password"
- placeholder="确认密码"
+ placeholder="confirm password"
value={confirmPassword}
onChange={e => setConfirmPassword(e.target.value)}
className={styles.input}
@@ -54,12 +53,12 @@ export default function RegisterPage() {
/>
</div>
<button type="submit" className={styles.submitButton}>
- 注册
+ register
</button>
</form>
<div className={styles.links}>
<Link href="/login" className={styles.link}>
- 已有账号?去登录
+ already have an account? login
</Link>
</div>
</div>
diff --git a/project/web/src/app/[lng]/tasks/taskPageCore.tsx b/project/web/src/app/[lng]/tasks/taskPageCore.tsx
index 61a1a845..45219068 100644
--- a/project/web/src/app/[lng]/tasks/taskPageCore.tsx
+++ b/project/web/src/app/[lng]/tasks/taskPageCore.tsx
@@ -1656,7 +1656,7 @@ export default function TaskPageCore() {
whiteSpace: 'nowrap',
}}
>
- {material.title || '无标题'}
+ {material.title || 'no title'}
</div>
<div style={{
fontSize: '12px',
@@ -1666,7 +1666,7 @@ export default function TaskPageCore() {
whiteSpace: 'nowrap',
}}
>
- {material.desc || '无描述'}
+ {material.desc || 'no description'}
</div>
</div>
</div>
@@ -1691,7 +1691,7 @@ export default function TaskPageCore() {
)}
</>
) : (
- <Empty description="暂无草稿素材" />
+ <Empty description="no draft material" />
)}
</Spin>
)}
@@ -1928,7 +1928,7 @@ export default function TaskPageCore() {
>
<Image
src={publishAccount.avatar ? getOssUrl(publishAccount.avatar) : '/default-avatar.png'}
- alt="账号头像"
+ alt="account avatar"
width={32}
height={32}
style={{
@@ -2168,10 +2168,10 @@ export default function TaskPageCore() {
}}
>
{acceptedTaskDetail.status === 'doing'
- ? '任务待完成'
+ ? 'task pending'
: acceptedTaskDetail.status === 'pending'
- ? '任务已完成'
- : `任务状态:${acceptedTaskDetail.status}`}
+ ? 'task completed'
+ : `task status: ${acceptedTaskDetail.status}`}
</span>
</div>
@@ -2181,7 +2181,7 @@ export default function TaskPageCore() {
}}
>
{acceptedTaskDetail.isFirstTimeSubmission && (
- <span style={{ color: '#52c41a' }}>首次提交</span>
+ <span style={{ color: '#52c41a' }}>first submission</span>
)}
</div>
</div>
@@ -2383,7 +2383,7 @@ export default function TaskPageCore() {
</div>
{account.nickname && (
<div>
- 昵称:
+ nickname:
{account.nickname}
</div>
)}
diff --git a/project/web/src/app/i18n/locales/en/material.json b/project/web/src/app/i18n/locales/en/material.json
index d8ee6d4d..fb949250 100644
--- a/project/web/src/app/i18n/locales/en/material.json
+++ b/project/web/src/app/i18n/locales/en/material.json
@@ -201,6 +201,7 @@
"estimatedCreditCost": "Estimated Credit Cost",
"credits": "credits",
"getImageModelsFailed": "Failed to get image generation models",
- "getVideoModelsFailed": "Failed to get video generation models"
+ "getVideoModelsFailed": "Failed to get video generation models",
+ "videoLoadedSuccess": "Video loaded successfully"
}
}
diff --git a/project/web/src/app/i18n/locales/zh-CN/material.json b/project/web/src/app/i18n/locales/zh-CN/material.json
index e6f93ad6..a9741193 100644
--- a/project/web/src/app/i18n/locales/zh-CN/material.json
+++ b/project/web/src/app/i18n/locales/zh-CN/material.json
@@ -201,6 +201,7 @@
"estimatedCreditCost": "预计消耗积分",
"credits": "积分",
"getImageModelsFailed": "获取图片生成模型失败",
- "getVideoModelsFailed": "获取视频生成模型失败"
+ "getVideoModelsFailed": "获取视频生成模型失败",
+ "videoLoadedSuccess": "视频已加载"
}
}