Przeglądaj źródła

fix(TaskLogs): use correct video URL for modal preview

CaIon 2 miesięcy temu
rodzic
commit
b808b96cce

+ 13 - 12
web/src/components/table/task-logs/TaskLogsColumnDefs.jsx

@@ -371,18 +371,19 @@ export const getTaskLogsColumns = ({
         const isSuccess = record.status === 'SUCCESS';
         const isSuccess = record.status === 'SUCCESS';
         const isUrl = typeof text === 'string' && /^https?:\/\//.test(text);
         const isUrl = typeof text === 'string' && /^https?:\/\//.test(text);
         if (isSuccess && isVideoTask && isUrl) {
         if (isSuccess && isVideoTask && isUrl) {
-          const videoUrl = `/v1/videos/${record.task_id}/content`;
-          return (
-            <a
-              href='#'
-              onClick={(e) => {
-                e.preventDefault();
-                openVideoModal(videoUrl);
-              }}
-            >
-              {t('点击预览视频')}
-            </a>
-          );
+          if (isSuccess && isVideoTask && isUrl) {
+            return (
+              <a
+                href='#'
+                onClick={(e) => {
+                  e.preventDefault();
+                  openVideoModal(text);
+                }}
+              >
+                {t('点击预览视频')}
+              </a>
+            );
+          }
         }
         }
         if (!text) {
         if (!text) {
           return t('无');
           return t('无');