diff --git a/package.json b/package.json index 3df7df7..b49cea6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "digital-news-live", + "name": "ai-live", "private": true, - "version": "1.0.0", + "version": "1.0.2", "type": "module", "description": "数字人直播间", "scripts": { diff --git a/src/App.tsx b/src/App.tsx index 11e783a..4f55fc6 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2,6 +2,8 @@ import AppRouter from "@/routes"; import {ConfigProvider} from "@/contexts/config"; import {AuthProvider} from "@/contexts/auth"; +console.log(`APP-BUILD-AT: ${AppBuildVersion}`) + function App() { return ( diff --git a/src/components/video/video-list-item.tsx b/src/components/video/video-list-item.tsx index b50ceda..c9712d8 100644 --- a/src/components/video/video-list-item.tsx +++ b/src/components/video/video-list-item.tsx @@ -49,26 +49,20 @@ export const VideoListItem = ( {/*
{index}
*/} {/*}*/}
+ className={`video-item-info relative flex gap-2 flex-1 bg-gray-100 h-[80px] overflow-hidden rounded-lg p-3 shadow-blue-500 ${active ? 'video-item-shadow' : ''}`}>
{video.title || video.video_title}
+ {type == 'create' && video.status == VideoStatus.Generating &&
+ 视频生成中 +
}
-
+
{sortable && (!active ? : )} - {onPlay && - <> - {( - type == 'create' && video.status == VideoStatus.Generating - ) ? : - } - } + {onPlay &&} {editable && <> {onEdit && diff --git a/src/pages/news/index.tsx b/src/pages/news/index.tsx index 1258eb4..74844c7 100644 --- a/src/pages/news/index.tsx +++ b/src/pages/news/index.tsx @@ -50,17 +50,17 @@ export default function NewsIndex() { - setActiveNews(undefined)}> -
-
{activeNews?.title}
-
- {activeNews?.media_name} - {formatTime(activeNews?.publish_time)} -
-
-
-
+ {activeNews && setActiveNews(undefined)}> +
+
{activeNews?.title}
+
+ {activeNews?.media_name} + {formatTime(activeNews?.publish_time)} +
+
+
+
}
{ @@ -90,7 +90,7 @@ export default function NewsIndex() { } }}/>
-
+
{ handleViewNewsDetail(item.id) diff --git a/src/pages/video/components/button-push2room.tsx b/src/pages/video/components/button-push2room.tsx index 4e0d0b1..d54fd8f 100644 --- a/src/pages/video/components/button-push2room.tsx +++ b/src/pages/video/components/button-push2room.tsx @@ -4,13 +4,14 @@ import {showErrorToast, showToast} from "@/components/message.ts"; import {push2room, VideoStatus} from "@/service/api/video.ts"; -export default function ButtonPush2Room(props: { ids: Id[]; list: VideoInfo[] }) { +export default function ButtonPush2Room(props: { ids: Id[]; list: VideoInfo[];onSuccess?:()=>void; }) { const [loading, setLoading] = useState(false) const handlePush = () => { setLoading(true) // 只需要已经生成视频的数据id const vids = props.list.filter(v => v.status == VideoStatus.Generated && props.ids.includes(v.id)).map(v => v.id) push2room(vids).then(() => { + props.onSuccess?.() if(props.ids.length == vids.length){ showToast('一键推流成功,已推流至数字人直播间,请前往数字人直播间页面查看!', 'success') }else{ diff --git a/src/pages/video/index.tsx b/src/pages/video/index.tsx index 0763330..700de01 100644 --- a/src/pages/video/index.tsx +++ b/src/pages/video/index.tsx @@ -150,12 +150,12 @@ export default function VideoIndex() { return newArr; }) }} - onPlay={() => playVideo(v, index)} - onEdit={() => { + onPlay={v.status == VideoStatus.Generating ? undefined :() => playVideo(v, index)} + onEdit={v.status == VideoStatus.Generating ? undefined : () => { setEditId(v.article_id) }} - editable={true} - sortable={true} + editable={v.status != VideoStatus.Generating} + sortable={v.status != VideoStatus.Generating} />))} @@ -172,13 +172,13 @@ export default function VideoIndex() { {/* confirmMessage={`是否确定一键推流选中新闻视频?`}*/} {/* onSuccess={loadList}*/} {/*>一键推流*/} - +
预览视频
-
+
{/**/} { const devServerHost = mode == 'test' ? '124.220.14.192' : '192.168.0.231:9999' - const AUTH_TOKEN_KEY = mode == 'production' ? 'digital-person-token' : `digital-person-token_${mode}` + const AUTH_TOKEN_KEY = mode == 'production' ? 'digital-person-token' : `digital-person-token_${mode}` if (mode !== 'production') { - console.log('dev server is', devServerHost,mode) + console.log('dev server is', devServerHost, mode) } return { plugins: [react()], @@ -20,7 +22,8 @@ export default defineConfig(({mode}) => { AUTH_TOKEN_KEY: process.env.AUTH_TOKEN_KEY || AUTH_TOKEN_KEY, AUTHED_PERSON_DATA_KEY: process.env.AUTHED_PERSON_DATA_KEY || 'digital-person-user-info', }), - AppMode: JSON.stringify(mode) + AppMode: JSON.stringify(mode), + AppBuildVersion: JSON.stringify(AppPackage.name + '-' + AppPackage.version + '-' + dayjs().format('YYYYMMDDHH_mmss')) }, resolve: { alias: {