From 4dee84a4593f1b1a33f5b8431dd834af9599f50e Mon Sep 17 00:00:00 2001 From: callmeyan Date: Tue, 8 Apr 2025 22:39:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=EF=B8=8F=20=E7=9B=B4=E6=92=AD?= =?UTF-8?q?=E9=97=B4=E9=A1=B5=E8=B0=83=E6=95=B4=E9=94=81=E5=AE=9A=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E7=8A=B6=E6=80=81=E5=8F=8A=E9=80=BB=E8=BE=91=20-=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=9B=B4=E6=92=AD=E8=A7=86=E9=A2=91=E5=9B=9E?= =?UTF-8?q?=E6=BB=9A=E5=8A=9F=E8=83=BD=20-=20=E4=BC=98=E5=8C=96=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E6=A8=A1=E5=BC=8F=E6=93=8D=E4=BD=9C=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/video/video-list-item.tsx | 8 +- src/i18n/translations/en-US.json | 5 + src/i18n/translations/zh-CN.json | 5 + src/pages/live/index.tsx | 127 ++++++++++++++--------- src/pages/live/style.module.scss | 23 ++++ src/pages/video/index.tsx | 2 +- 6 files changed, 119 insertions(+), 51 deletions(-) diff --git a/src/components/video/video-list-item.tsx b/src/components/video/video-list-item.tsx index 4a8c5d0..24389f0 100644 --- a/src/components/video/video-list-item.tsx +++ b/src/components/video/video-list-item.tsx @@ -19,7 +19,8 @@ import {saveAs} from "file-saver"; type Props = { video: VideoInfo | LiveVideoInfo, - additionOperation?: React.ReactNode; + additionOperationBefore?: React.ReactNode; + additionOperationAfter?: React.ReactNode; editable?: boolean; downloadVisible?: boolean; sortable?: boolean; @@ -45,7 +46,7 @@ export const VideoListItem = ( id, video, onRemove,removeIcon, checked,playing, onCheckedChange, onEdit, active, editable,downloadVisible, className, sortable, type, index,onItemClick, - additionOperation,onRegenerate,hideCheckBox + additionOperationAfter,additionOperationBefore,onRegenerate,hideCheckBox }: Props) => { const { attributes, listeners, @@ -132,6 +133,7 @@ export const VideoListItem = ( }} style={{fontSize: '1.1em'}}> } + {additionOperationBefore} {editable && !generating && <> {onEdit && + + ):(
+ {t('live.edit_locked')} + +
)}
- handleAllCheckedChange()}/> + handleAllCheckedChange()}/>
@@ -308,7 +331,7 @@ export default function LiveIndex() { } }}> - {videoData.map((v, index) => ( + {videoData.filter(v=>(!(delIds.includes(v.id) || rollbackIds.includes(v.id)))).map((v, index) => ( processDeleteVideo([v.id])} - editable={!editable && state.playId != v.id} + editable={editable && state.playId != v.id} sortable={editable && state.playId != v.id} + additionOperationBefore={<> + {editable && state.playId != v.id && } + title={t('video.live_rollback_confirm_title')} + onConfirm={() => handleRollback(v)} + >} + } />))} diff --git a/src/pages/live/style.module.scss b/src/pages/live/style.module.scss index 5ba3fb7..4ace97c 100644 --- a/src/pages/live/style.module.scss +++ b/src/pages/live/style.module.scss @@ -1,3 +1,26 @@ .videoListContainer{ +} +@mixin btnDefault{ + border-radius: 20px; + padding: 2px 16px; + height: auto; +} +.btn{ + @include btnDefault; + background: #4096FF; + color:#fff; + border: 1px solid #4096FF; + &:hover{ + background: #337acc; + } +} + +.btnDefault{ + @include btnDefault; + color:#00000099; + border: 1px solid #00000099; + &:hover{ + background: #00000011; + } } \ No newline at end of file diff --git a/src/pages/video/index.tsx b/src/pages/video/index.tsx index 1ea4cdd..17fa707 100644 --- a/src/pages/video/index.tsx +++ b/src/pages/video/index.tsx @@ -185,7 +185,7 @@ export default function VideoIndex() {
-
+