feat: enhance bulk operations panel styling and update downloadExampleImages method to accept optional modelTypes parameter

This commit is contained in:
Will Miao
2025-08-15 15:58:33 +08:00
parent 3cd57a582c
commit 25139ca922
4 changed files with 10 additions and 13 deletions

View File

@@ -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);

View File

@@ -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) => {

View File

@@ -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) {

View File

@@ -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');