-
Notifications
You must be signed in to change notification settings - Fork 512
[feat] Add async model upload with WebSocket progress tracking #7746
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1613978
38e0877
13b6f2f
aff8e34
25b146d
70cd736
fb835c7
50995cc
3c575ce
57c91e5
81c5336
af13d4e
4615430
df355de
c5f936b
2fc3526
2be1fe7
df75437
06660b9
f45257c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,36 @@ | ||
| <template> | ||
| <div class="flex flex-1 flex-col gap-6 text-sm text-muted-foreground"> | ||
| <!-- Uploading State --> | ||
| <div | ||
| v-if="status === 'uploading'" | ||
| class="flex flex-1 flex-col items-center justify-center gap-2" | ||
| > | ||
| <i | ||
| class="icon-[lucide--loader-circle] animate-spin text-6xl text-muted-foreground" | ||
| /> | ||
| <div class="text-center"> | ||
| <p class="m-0 font-bold"> | ||
| {{ $t('assetBrowser.uploadingModel') }} | ||
| </p> | ||
| <!-- Processing State (202 async download in progress) --> | ||
| <div v-if="result === 'processing'" class="flex flex-col gap-2"> | ||
| <p class="m-0 font-bold"> | ||
| {{ $t('assetBrowser.processingModel') }} | ||
| </p> | ||
| <p class="m-0"> | ||
| {{ $t('assetBrowser.processingModelDescription') }} | ||
| </p> | ||
|
|
||
| <div | ||
| class="flex flex-row items-center gap-3 p-4 bg-modal-card-background rounded-lg" | ||
| > | ||
| <img | ||
| v-if="previewImage" | ||
| :src="previewImage" | ||
| :alt="metadata?.filename || metadata?.name || 'Model preview'" | ||
| class="w-14 h-14 rounded object-cover flex-shrink-0" | ||
| /> | ||
| <div class="flex flex-col justify-center items-start gap-1 flex-1"> | ||
| <p class="text-base-foreground m-0"> | ||
| {{ metadata?.filename || metadata?.name }} | ||
| </p> | ||
| <p class="text-sm text-muted m-0"> | ||
| {{ modelType }} | ||
| </p> | ||
| </div> | ||
| </div> | ||
|
Comment on lines
+12
to
29
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Consider extracting duplicated preview card markup. The model preview card structure (image + metadata) is duplicated between the processing and success states. While functional, consider extracting this into a reusable component to follow DRY principles. Also applies to: 41-59 🤖 Prompt for AI Agents |
||
| </div> | ||
|
|
||
| <!-- Success State --> | ||
| <div v-else-if="status === 'success'" class="flex flex-col gap-2"> | ||
| <div v-else-if="result === 'success'" class="flex flex-col gap-2"> | ||
| <p class="m-0 font-bold"> | ||
| {{ $t('assetBrowser.modelUploaded') }} | ||
| </p> | ||
|
|
@@ -47,7 +61,7 @@ | |
|
|
||
| <!-- Error State --> | ||
| <div | ||
| v-else-if="status === 'error'" | ||
| v-else-if="result === 'error'" | ||
| class="flex flex-1 flex-col items-center justify-center gap-6" | ||
| > | ||
| <i class="icon-[lucide--x-circle] text-6xl text-error" /> | ||
|
|
@@ -66,8 +80,8 @@ | |
| <script setup lang="ts"> | ||
| import type { AssetMetadata } from '@/platform/assets/schemas/assetSchema' | ||
|
|
||
| defineProps<{ | ||
| status: 'idle' | 'uploading' | 'success' | 'error' | ||
| const { result } = defineProps<{ | ||
| result: 'processing' | 'success' | 'error' | ||
| error?: string | ||
| metadata?: AssetMetadata | ||
| modelType?: string | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Consider including asset name in complete/failed messages for consistency.
The
inProgressmessage includes{assetName}, butcompleteandfailedmessages don't. This creates an inconsistency compared to thedeletionmessages above (lines 2345-2347), which include the asset name in all states.Including the asset name in all download states would provide better user feedback, especially when multiple downloads are running simultaneously:
💡 Suggested improvement for consistency
"download": { - "complete": "Download complete", - "failed": "Download failed", + "complete": "{assetName} download complete", + "failed": "{assetName} download failed", "inProgress": "Downloading {assetName}..." },🤖 Prompt for AI Agents