Initial open-source release (MIT): image2api AI gateway
Full Go backend + Vue 3 frontend, OpenAI-compatible API, multi-provider account pools, billing/admin, Docker one-command deploy with auto HTTPS. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
// Reactive draft of the 画图 form fields. Lives at module scope so the
|
||||
// values survive PlaygroundView being unmounted (navigation to 首页/记录 etc.)
|
||||
// and remounted — without this, switching away and back wiped the prompt
|
||||
// and selected model. Per-tab only; not persisted to localStorage.
|
||||
import { reactive } from 'vue'
|
||||
|
||||
export const draft = reactive({
|
||||
mode: '', // 'image' | 'video'
|
||||
modelId: '',
|
||||
prompt: '',
|
||||
ratio: '',
|
||||
resolution: '',
|
||||
duration: '',
|
||||
})
|
||||
|
||||
// Copy fields from a server-side job entry (the `/jobs/mine` payload) into
|
||||
// the draft so a parallel tab can pick up exactly what's being generated.
|
||||
export function applyJobToDraft(entry) {
|
||||
if (!entry) return
|
||||
draft.mode = entry.kind === 'video' ? 'video' : 'image'
|
||||
draft.modelId = entry.model || ''
|
||||
draft.prompt = entry.prompt || ''
|
||||
draft.ratio = entry.ratio || ''
|
||||
draft.resolution = entry.resolution || ''
|
||||
draft.duration = entry.duration || ''
|
||||
}
|
||||
Reference in New Issue
Block a user