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); z-index: var(--z-overlay);
display: flex; display: flex;
flex-direction: column; 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); transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
opacity: 0; opacity: 0;
} }
@@ -48,6 +50,8 @@
color: var(--text-color); color: var(--text-color);
cursor: pointer; cursor: pointer;
font-size: 14px; font-size: 14px;
white-space: nowrap;
min-height: 36px;
display: flex; display: flex;
align-items: center; align-items: center;
gap: 6px; gap: 6px;
@@ -105,6 +109,8 @@
@media (max-width: 768px) { @media (max-width: 768px) {
.bulk-operations-panel { .bulk-operations-panel {
width: calc(100% - 40px); width: calc(100% - 40px);
min-width: unset;
max-width: unset;
left: 20px; left: 20px;
transform: none; transform: none;
border-radius: var(--border-radius-sm); 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; let ws = null;
await state.loadingManager.showWithProgress(async (loading) => { await state.loadingManager.showWithProgress(async (loading) => {

View File

@@ -281,21 +281,13 @@ function showExampleAccessModal(card, modelType) {
return; 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 // Close the modal
modalManager.closeModal('exampleAccessModal'); modalManager.closeModal('exampleAccessModal');
try { try {
// Use the appropriate model API client to download examples // Use the appropriate model API client to download examples
const apiClient = getModelApiClient(modelType); const apiClient = getModelApiClient(modelType);
await apiClient.downloadExampleImages([modelHash], [modelTypeSingular]); await apiClient.downloadExampleImages([modelHash]);
// Open the example images folder if successful // Open the example images folder if successful
openExampleImagesFolder(modelHash); openExampleImagesFolder(modelHash);

View File

@@ -203,7 +203,6 @@ export class BulkManager {
toggleCardSelection(card) { toggleCardSelection(card) {
const filepath = card.dataset.filepath; const filepath = card.dataset.filepath;
const pageState = getCurrentPageState();
if (card.classList.contains('selected')) { if (card.classList.contains('selected')) {
card.classList.remove('selected'); card.classList.remove('selected');