auto-save 2026-05-27 18:08 (~2)

This commit is contained in:
2026-05-27 18:08:07 +08:00
parent dab4bde28f
commit 13d9057318
2 changed files with 12 additions and 11 deletions

View File

@@ -105,7 +105,7 @@
</div> -->
<!-- Generate button | 生成按钮 -->
<button @click="handleGenerate" :disabled="isGenerating || !isConfigured"
<button @click="handleGenerate" :disabled="isGenerating || !canGenerate"
class="w-full flex items-center justify-center gap-2 py-2 px-4 rounded-lg bg-[var(--accent-color)] hover:bg-[var(--accent-hover)] text-white text-sm font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed">
<n-spin v-if="isGenerating" :size="14" />
<template v-else>
@@ -115,6 +115,9 @@
生成视频
</template>
</button>
<div v-if="!canGenerate" class="text-xs text-amber-500 mt-2">
当前环境未配置视频 API只能预览模型比例和时长
</div>
<!-- Error message | 错误信息 -->
<div v-if="error" class="text-xs text-red-500 mt-2">
@@ -164,9 +167,6 @@ const props = defineProps({
// Vue Flow instance | Vue Flow 实例
const { updateNodeInternals } = useVueFlow()
// API config state | API 配置状态
const isConfigured = computed(() => !!modelStore.currentApiKey)
// Video generation hook | 视频生成 hook
const { loading, error, status, video: generatedVideo, progress, createVideoTaskOnly } = useVideoGeneration()
@@ -218,6 +218,7 @@ const imagesByRole = computed(() => {
// Get current model config | 获取当前模型配置
const currentModelConfig = computed(() => getModelConfig(localModel.value))
const canGenerate = computed(() => !!modelStore.currentApiKey && currentModelConfig.value?.available !== false)
// Model options from Pinia store (filtered by provider) | 从 Pinia store 获取模型选项(根据渠道过滤)
const modelOptions = computed(() => modelStore.allVideoModelOptions)