diff --git a/control-plane/src/server.ts b/control-plane/src/server.ts index 2818a78..7a09853 100644 --- a/control-plane/src/server.ts +++ b/control-plane/src/server.ts @@ -150,8 +150,16 @@ async function route(request: IncomingMessage, response: ServerResponse) { ...(body.smartLowPoly !== undefined ? { smart_low_poly: booleanValue(body.smartLowPoly, 'smartLowPoly') } : {}), }) tripoTaskOwners.set(taskId, { userId: keyRecord.userId, model: model.id }) - const task = await tripo.getTask(taskId) - send(response, 202, { task: { ...task, model: model.id } }) + send(response, 202, { + task: { + id: taskId, + provider: 'tripo', + model: model.id, + status: 'queued', + progress: 0, + createdAt: new Date().toISOString(), + }, + }) return } const now = new Date().toISOString() diff --git a/prototype/src/App.vue b/prototype/src/App.vue index ea0397d..0afe3a5 100644 --- a/prototype/src/App.vue +++ b/prototype/src/App.vue @@ -165,7 +165,7 @@ function openAccountSettings() {
- +
diff --git a/prototype/src/services/catalog.ts b/prototype/src/services/catalog.ts index 0932cb9..fd28aac 100644 --- a/prototype/src/services/catalog.ts +++ b/prototype/src/services/catalog.ts @@ -61,10 +61,17 @@ export interface ChatCompletionResult { export interface AsyncTaskResult { id: string model: string - status: 'queued' | 'running' | 'succeeded' - created_at: string - updated_at: string + provider?: string + status: 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled' + progress?: number + created_at?: string + updated_at?: string + createdAt?: string + completedAt?: string result?: { format: string; url: string } + output?: { modelUrl?: string; previewUrl?: string } + creditsConsumed?: number + error?: { code?: number; message?: string } } export class CatalogApiError extends Error { diff --git a/prototype/src/styles.css b/prototype/src/styles.css index e15506b..76d6c84 100644 --- a/prototype/src/styles.css +++ b/prototype/src/styles.css @@ -164,3 +164,34 @@ td strong{font-size:12px} .auth-back,.auth-support,.auth-support button{font-size:11px} .reset-success p{font-size:12px} .sidebar-brand{height:auto;min-height:50px;margin-bottom:24px}.brand-name strong{font-size:14px}.navigation{min-height:0} + +/* Live async 3D task experience */ +.playground-connection{min-height:66px;display:flex;align-items:center;gap:12px;padding:12px 15px;border:1px solid #e2e6ee;border-radius:11px;background:#fff} +.playground-connection>span{width:36px;height:36px;display:grid;place-items:center;flex:0 0 36px;border-radius:10px;color:#785ee8;background:#f0edff} +.playground-connection>div{min-width:0;display:flex;flex:1;flex-direction:column;gap:4px} +.playground-connection strong{color:var(--text);font-size:12px} +.playground-connection small{color:var(--muted);font-size:10px;line-height:1.5} +.playground-connection.ready{border-color:#cce9df;background:#f8fcfa} +.playground-connection.ready>span{color:var(--green);background:var(--green-soft)} +.playground-connection.offline>span{color:var(--orange);background:var(--orange-soft)} +.live-task-result{display:flex;min-height:0;flex:1;flex-direction:column;padding-top:16px} +.task-preview{height:230px;overflow:hidden;display:grid;place-items:center;border:1px solid #e4e7ef;border-radius:13px;background:radial-gradient(circle at 50% 35%,#30356b 0,#171b3d 48%,#0d1127 100%);position:relative} +.task-preview img{width:100%;height:100%;object-fit:contain} +.task-preview>span{display:flex;align-items:center;flex-direction:column;gap:10px;color:#9ea8e8} +.task-preview>span small{color:#aeb7d9;font-size:11px} +.task-preview>em{padding:5px 7px;border:1px solid rgba(255,255,255,.18);border-radius:5px;color:#dfe5ff;font-family:"DM Mono",monospace;font-size:9px;font-style:normal;letter-spacing:.08em;background:rgba(12,16,40,.62);position:absolute;top:10px;left:10px} +.live-task-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:15px} +.live-task-head code{overflow:hidden;color:#667085;font-size:10px;text-overflow:ellipsis;white-space:nowrap} +.live-progress{margin-top:16px} +.live-progress>div{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;color:var(--text-soft);font-size:11px} +.live-progress>span{height:7px;display:block;overflow:hidden;border-radius:10px;background:#edf0f5} +.live-progress i{height:100%;display:block;border-radius:inherit;background:linear-gradient(90deg,#27c4d6,#7350e4);transition:width .35s ease} +.live-task-result>p{margin:13px 0;color:var(--text-soft);font-size:11px;line-height:1.6} +.task-cost{display:flex;align-items:center;justify-content:space-between;margin:0;padding:10px 12px;border-radius:8px;color:var(--muted);font-size:10px;background:var(--soft)} +.task-cost dd{margin:0;color:var(--text);font-weight:700} +.live-task-actions{display:flex;align-items:center;gap:8px;margin-top:auto;padding-top:15px} +.drawer-task-preview{height:230px;overflow:hidden;margin-bottom:14px;border-radius:11px;background:#11152f} +.drawer-task-preview img{width:100%;height:100%;object-fit:contain} + +@media(max-width:900px){.playground-connection{align-items:flex-start;flex-wrap:wrap}.playground-connection>div{min-width:calc(100% - 52px)}.playground-connection>.button{margin-left:48px}.task-preview{height:210px}} +@media(max-width:520px){.playground-connection>.button{width:100%;margin-left:0}.task-preview{height:190px}.live-task-head{align-items:flex-start;flex-direction:column}.live-task-actions{align-items:stretch;flex-wrap:wrap}.live-task-actions .button{flex:1}.request-panel,.response-panel{min-height:520px;padding:16px}} diff --git a/prototype/src/types.ts b/prototype/src/types.ts index a1d9b8b..08f5949 100644 --- a/prototype/src/types.ts +++ b/prototype/src/types.ts @@ -52,6 +52,12 @@ export interface TaskItem { createdAt: string duration: string result: string + provider?: string + prompt?: string + modelUrl?: string + previewUrl?: string + creditsConsumed?: number + remote?: boolean } export interface AdminUser { diff --git a/prototype/src/views/UserConsole.vue b/prototype/src/views/UserConsole.vue index bbedde1..efa9d44 100644 --- a/prototype/src/views/UserConsole.vue +++ b/prototype/src/views/UserConsole.vue @@ -1,5 +1,5 @@