From 7c4c956be0c3c4c2f76f181e356779003bc8f998 Mon Sep 17 00:00:00 2001
From: log
Date: Thu, 25 Jun 2026 22:21:07 +0800
Subject: [PATCH] fix: replace favicon.ico with icon.png to resolve build error

---
 video-claw/video-claw/frontend/components/TopBar.tsx |   88 ++++++++++++++++++++++++++++++++++++++------
 1 files changed, 76 insertions(+), 12 deletions(-)

diff --git a/video-claw/video-claw/frontend/components/TopBar.tsx b/video-claw/video-claw/frontend/components/TopBar.tsx
index cb50952..e22f640 100644
--- a/video-claw/video-claw/frontend/components/TopBar.tsx
+++ b/video-claw/video-claw/frontend/components/TopBar.tsx
@@ -1,10 +1,16 @@
-'use client';
+'use client';
 
 import React, { useState, useRef, useEffect } from 'react';
 import { CheckCircle, Circle, Loader, Edit3, AlertCircle, Square, Zap, Settings2, ChevronDown } from 'lucide-react';
 import clsx from 'clsx';
-import { VIDEO_RATIOS, VIDEO_RESOLUTIONS, type ProviderGroup } from '@/config/models';
-import { fetchModelGroupsByType } from '@/lib/modelRegistry';
+import {
+  VIDEO_RATIOS,
+  VIDEO_RESOLUTIONS,
+  VIDEO_GENERATION_MODES,
+  type ProviderGroup,
+  type VideoGenerationMode,
+} from '@/config/models';
+import { fetchModelGroupsByType, fetchVideoModelGroupsByAbility } from '@/lib/modelRegistry';
 
 export type StageStatus = 'pending' | 'running' | 'waiting' | 'completed' | 'error' | 'stopped';
 
@@ -25,6 +31,10 @@
   image_t2i_model: string;
   image_it2i_model: string;
   video_model: string;
+  video_first_frame_model: string;
+  video_start_end_model: string;
+  video_reference_model: string;
+  video_generation_mode: VideoGenerationMode;
   video_ratio: string;
   video_resolution: string;
   enable_concurrency: boolean;
@@ -49,7 +59,7 @@
   modelConfig?: ModelConfig;
   /** 模型配置变更 */
   onModelConfigChange?: (config: ModelConfig) => void;
-  /** 项目状态(如 running, waiting, completed, completed, idle, error 等) */
+  /** 项目状态(如 running, waiting, completed, stopped, idle, error 等) */
   projectStatus?: string;
 }
 
@@ -94,7 +104,9 @@
   const [vlmProviders, setVlmProviders] = useState<ProviderGroup[]>([]);
   const [t2iProviders, setT2iProviders] = useState<ProviderGroup[]>([]);
   const [i2iProviders, setI2iProviders] = useState<ProviderGroup[]>([]);
-  const [videoProviders, setVideoProviders] = useState<ProviderGroup[]>([]);
+  const [firstFrameVideoProviders, setFirstFrameVideoProviders] = useState<ProviderGroup[]>([]);
+  const [startEndVideoProviders, setStartEndVideoProviders] = useState<ProviderGroup[]>([]);
+  const [referenceVideoProviders, setReferenceVideoProviders] = useState<ProviderGroup[]>([]);
 
   useEffect(() => {
     const handler = (e: MouseEvent) => {
@@ -118,14 +130,54 @@
     fetchModelGroupsByType('i2i')
       .then(groups => { if (!cancelled) setI2iProviders(groups); })
       .catch(() => {});
-    fetchModelGroupsByType('video')
-      .then(groups => { if (!cancelled) setVideoProviders(groups); })
+    fetchVideoModelGroupsByAbility('first_frame_i2v')
+      .then(groups => { if (!cancelled) setFirstFrameVideoProviders(groups); })
+      .catch(() => {});
+    fetchVideoModelGroupsByAbility('start_end_frame_i2v')
+      .then(groups => { if (!cancelled) setStartEndVideoProviders(groups); })
+      .catch(() => {});
+    fetchVideoModelGroupsByAbility('reference_to_video')
+      .then(groups => { if (!cancelled) setReferenceVideoProviders(groups); })
       .catch(() => {});
     return () => { cancelled = true; };
   }, []);
 
   const update = (key: keyof ModelConfig, val: string | boolean) => {
     onChange({ ...config, [key]: val });
+  };
+
+  const activeVideoModel =
+    config.video_generation_mode === 'start_end_frame'
+      ? config.video_start_end_model
+      : config.video_generation_mode === 'reference'
+        ? config.video_reference_model
+        : config.video_first_frame_model;
+  const activeVideoProviders =
+    config.video_generation_mode === 'start_end_frame'
+      ? startEndVideoProviders
+      : config.video_generation_mode === 'reference'
+        ? referenceVideoProviders
+        : firstFrameVideoProviders;
+  const activeVideoLabel = VIDEO_GENERATION_MODES.find(item => item.id === config.video_generation_mode)?.label || '首帧生视频';
+
+  const updateVideoMode = (mode: VideoGenerationMode) => {
+    const nextModel =
+      mode === 'start_end_frame'
+        ? config.video_start_end_model
+        : mode === 'reference'
+          ? config.video_reference_model
+          : config.video_first_frame_model;
+    onChange({ ...config, video_generation_mode: mode, video_model: nextModel });
+  };
+
+  const updateActiveVideoModel = (model: string) => {
+    if (config.video_generation_mode === 'start_end_frame') {
+      onChange({ ...config, video_start_end_model: model, video_model: model });
+    } else if (config.video_generation_mode === 'reference') {
+      onChange({ ...config, video_reference_model: model, video_model: model });
+    } else {
+      onChange({ ...config, video_first_frame_model: model, video_model: model });
+    }
   };
 
   return (
@@ -164,8 +216,20 @@
             <ProviderSelect value={config.image_it2i_model} providers={i2iProviders} onChange={v => update('image_it2i_model', v)} />
           </label>
           <label className="flex flex-col gap-1">
-            <span className="text-[10px] text-gray-400 font-medium">视频模型</span>
-            <ProviderSelect value={config.video_model} providers={videoProviders} onChange={v => update('video_model', v)} />
+            <span className="text-[10px] text-gray-400 font-medium">视频生成方式</span>
+            <select
+              value={config.video_generation_mode}
+              onChange={e => updateVideoMode(e.target.value as VideoGenerationMode)}
+              className="bg-gray-50 border border-gray-200 rounded-lg px-2 py-1.5 text-xs text-gray-700 outline-none w-full"
+            >
+              {VIDEO_GENERATION_MODES.map(item => (
+                <option key={item.id} value={item.id}>{item.label}</option>
+              ))}
+            </select>
+          </label>
+          <label className="flex flex-col gap-1">
+            <span className="text-[10px] text-gray-400 font-medium">{activeVideoLabel}模型</span>
+            <ProviderSelect value={activeVideoModel} providers={activeVideoProviders} onChange={updateActiveVideoModel} />
           </label>
           <label className="flex flex-col gap-1">
             <span className="text-[10px] text-gray-400 font-medium">视频比例</span>
@@ -272,13 +336,13 @@
         className="flex items-center gap-2 mr-6 hover:opacity-80 transition-opacity flex-shrink-0"
       >
         <img
-          src="/logo.jpg"
+          src="/logo.png"
           alt="Logo"
-          className="w-8 h-8 rounded-lg object-contain"
+          className="w-8 h-8 rounded-lg object-contain bg-black"
         />
         <div className="flex flex-col leading-tight">
           <span className="font-bold text-sm text-gray-800 tracking-tight">
-            Video-Claw
+            StoriAI
           </span>
         </div>
       </button>

--
Gitblit v1.8.0