refactor: remove legacy card components and update imports to use shared ModelCard component

This commit is contained in:
Will Miao
2025-07-25 22:00:38 +08:00
parent 1a3751acfa
commit 0d9003dea4
11 changed files with 16 additions and 62 deletions

View File

@@ -1,14 +0,0 @@
// Legacy CheckpointCard.js - now using shared ModelCard component
import {
createModelCard,
setupModelCardEventDelegation
} from './shared/ModelCard.js';
// Re-export functions with original names for backwards compatibility
export function createCheckpointCard(checkpoint) {
return createModelCard(checkpoint, 'checkpoint');
}
export function setupCheckpointCardEventDelegation() {
setupModelCardEventDelegation('checkpoint');
}

View File

@@ -1,17 +0,0 @@
// Legacy LoraCard.js - now using shared ModelCard component
import {
createModelCard,
setupModelCardEventDelegation,
updateCardsForBulkMode
} from './shared/ModelCard.js';
// Re-export functions with original names for backwards compatibility
export function createLoraCard(lora) {
return createModelCard(lora, 'lora');
}
export function setupLoraCardEventDelegation() {
setupModelCardEventDelegation('lora');
}
export { updateCardsForBulkMode };

View File

@@ -1,11 +0,0 @@
/**
* CheckpointModal - Main entry point
*
* Legacy CheckpointModal - now using shared ModelModal component
*/
import { showModelModal } from '../shared/ModelModal.js';
// Re-export function with original name for backwards compatibility
export function showCheckpointModal(checkpoint) {
return showModelModal(checkpoint, 'checkpoint');
}

View File

@@ -1,7 +0,0 @@
// Legacy LoraModal - now using shared ModelModal component
import { showModelModal } from '../shared/ModelModal.js';
// Re-export function with original name for backwards compatibility
export function showLoraModal(lora) {
return showModelModal(lora, 'lora');
}

View File

@@ -48,7 +48,7 @@ function handleModelCardEvent_internal(event, modelType) {
if (event.target.closest('.fa-star')) {
event.stopPropagation();
toggleFavorite(card, modelType);
toggleFavorite(card);
return;
}
@@ -131,7 +131,7 @@ function showBlurredContent(card) {
}
}
async function toggleFavorite(card, modelType) {
async function toggleFavorite(card) {
const starIcon = card.querySelector('.fa-star');
const isFavorite = starIcon.classList.contains('fas');
const newFavoriteState = !isFavorite;