From 25139ca9228afd42a33d79d78d5d372d47003e82 Mon Sep 17 00:00:00 2001 From: Will Miao <13051207myq@gmail.com> Date: Fri, 15 Aug 2025 15:58:33 +0800 Subject: [PATCH] feat: enhance bulk operations panel styling and update downloadExampleImages method to accept optional modelTypes parameter --- static/css/components/bulk.css | 8 +++++++- static/js/api/baseModelApi.js | 2 +- static/js/components/shared/ModelCard.js | 12 ++---------- static/js/managers/BulkManager.js | 1 - 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/static/css/components/bulk.css b/static/css/components/bulk.css index 40ec2bf2..e0a618f9 100644 --- a/static/css/components/bulk.css +++ b/static/css/components/bulk.css @@ -12,7 +12,9 @@ z-index: var(--z-overlay); display: flex; flex-direction: column; - min-width: 300px; + min-width: 420px; + max-width: 900px; + width: auto; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); opacity: 0; } @@ -48,6 +50,8 @@ color: var(--text-color); cursor: pointer; font-size: 14px; + white-space: nowrap; + min-height: 36px; display: flex; align-items: center; gap: 6px; @@ -105,6 +109,8 @@ @media (max-width: 768px) { .bulk-operations-panel { width: calc(100% - 40px); + min-width: unset; + max-width: unset; left: 20px; transform: none; border-radius: var(--border-radius-sm); diff --git a/static/js/api/baseModelApi.js b/static/js/api/baseModelApi.js index 03475ce8..6b58145c 100644 --- a/static/js/api/baseModelApi.js +++ b/static/js/api/baseModelApi.js @@ -856,7 +856,7 @@ export class BaseModelApiClient { } } - async downloadExampleImages(modelHashes, modelTypes) { + async downloadExampleImages(modelHashes, modelTypes = null) { let ws = null; await state.loadingManager.showWithProgress(async (loading) => { diff --git a/static/js/components/shared/ModelCard.js b/static/js/components/shared/ModelCard.js index 49ae8952..9e63bfb2 100644 --- a/static/js/components/shared/ModelCard.js +++ b/static/js/components/shared/ModelCard.js @@ -281,22 +281,14 @@ function showExampleAccessModal(card, modelType) { return; } - // Determine model type (singular form) - let modelTypeSingular = 'lora'; - if (modelType === MODEL_TYPES.CHECKPOINT) { - modelTypeSingular = 'checkpoint'; - } else if (modelType === MODEL_TYPES.EMBEDDING) { - modelTypeSingular = 'embedding'; - } - // Close the modal modalManager.closeModal('exampleAccessModal'); try { // Use the appropriate model API client to download examples const apiClient = getModelApiClient(modelType); - await apiClient.downloadExampleImages([modelHash], [modelTypeSingular]); - + await apiClient.downloadExampleImages([modelHash]); + // Open the example images folder if successful openExampleImagesFolder(modelHash); } catch (error) { diff --git a/static/js/managers/BulkManager.js b/static/js/managers/BulkManager.js index f5c2f796..78030810 100644 --- a/static/js/managers/BulkManager.js +++ b/static/js/managers/BulkManager.js @@ -203,7 +203,6 @@ export class BulkManager { toggleCardSelection(card) { const filepath = card.dataset.filepath; - const pageState = getCurrentPageState(); if (card.classList.contains('selected')) { card.classList.remove('selected');