diff --git a/static/css/components/header.css b/static/css/components/header.css index 0eb2237a..b04e1cea 100644 --- a/static/css/components/header.css +++ b/static/css/components/header.css @@ -31,7 +31,7 @@ align-items: center; text-decoration: none; color: var(--text-color); - gap: 8px; + gap: 2px; } .app-logo { diff --git a/static/js/components/CheckpointCard.js b/static/js/components/CheckpointCard.js deleted file mode 100644 index 3a2292c9..00000000 --- a/static/js/components/CheckpointCard.js +++ /dev/null @@ -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'); -} \ No newline at end of file diff --git a/static/js/components/LoraCard.js b/static/js/components/LoraCard.js deleted file mode 100644 index e200724f..00000000 --- a/static/js/components/LoraCard.js +++ /dev/null @@ -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 }; \ No newline at end of file diff --git a/static/js/components/checkpointModal/index.js b/static/js/components/checkpointModal/index.js deleted file mode 100644 index 8feaf8a2..00000000 --- a/static/js/components/checkpointModal/index.js +++ /dev/null @@ -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'); -} \ No newline at end of file diff --git a/static/js/components/loraModal/index.js b/static/js/components/loraModal/index.js deleted file mode 100644 index 5a2467de..00000000 --- a/static/js/components/loraModal/index.js +++ /dev/null @@ -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'); -} \ No newline at end of file diff --git a/static/js/components/shared/ModelCard.js b/static/js/components/shared/ModelCard.js index 7c4409e5..5e015dc1 100644 --- a/static/js/components/shared/ModelCard.js +++ b/static/js/components/shared/ModelCard.js @@ -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; diff --git a/static/js/core.js b/static/js/core.js index 674b484a..9a268217 100644 --- a/static/js/core.js +++ b/static/js/core.js @@ -68,7 +68,7 @@ export class AppCore { const pageType = this.getPageType(); // Initialize virtual scroll for pages that need it - if (['loras', 'recipes', 'checkpoints'].includes(pageType)) { + if (['loras', 'recipes', 'checkpoints', 'embeddings'].includes(pageType)) { initializeInfiniteScroll(pageType); } diff --git a/static/js/loras.js b/static/js/loras.js index 5587d2e6..c26a25c6 100644 --- a/static/js/loras.js +++ b/static/js/loras.js @@ -1,6 +1,6 @@ import { appCore } from './core.js'; import { state } from './state/index.js'; -import { updateCardsForBulkMode } from './components/LoraCard.js'; +import { updateCardsForBulkMode } from './components/shared/ModelCard.js'; import { bulkManager } from './managers/BulkManager.js'; import { moveManager } from './managers/MoveManager.js'; import { LoraContextMenu } from './components/ContextMenu/index.js'; diff --git a/static/js/managers/BulkManager.js b/static/js/managers/BulkManager.js index e0dd72bf..fc6b21e6 100644 --- a/static/js/managers/BulkManager.js +++ b/static/js/managers/BulkManager.js @@ -1,6 +1,6 @@ import { state } from '../state/index.js'; import { showToast, copyToClipboard, sendLoraToWorkflow } from '../utils/uiHelpers.js'; -import { updateCardsForBulkMode } from '../components/LoraCard.js'; +import { updateCardsForBulkMode } from '../components/shared/ModelCard.js'; import { modalManager } from './ModalManager.js'; export class BulkManager { diff --git a/static/js/utils/infiniteScroll.js b/static/js/utils/infiniteScroll.js index da652014..49e4d759 100644 --- a/static/js/utils/infiniteScroll.js +++ b/static/js/utils/infiniteScroll.js @@ -1,14 +1,13 @@ import { state, getCurrentPageState } from '../state/index.js'; import { VirtualScroller } from './VirtualScroller.js'; -import { createLoraCard, setupLoraCardEventDelegation } from '../components/LoraCard.js'; -import { createCheckpointCard, setupCheckpointCardEventDelegation } from '../components/CheckpointCard.js'; +import { createModelCard, setupModelCardEventDelegation } from '../components/shared/ModelCard.js'; import { getModelApiClient } from '../api/baseModelApi.js'; import { showToast } from './uiHelpers.js'; // Function to dynamically import the appropriate card creator based on page type async function getCardCreator(pageType) { if (pageType === 'loras') { - return createLoraCard; + return (model) => createModelCard(model, 'lora'); } else if (pageType === 'recipes') { // Import the RecipeCard module const { RecipeCard } = await import('../components/RecipeCard.js'); @@ -23,7 +22,9 @@ async function getCardCreator(pageType) { return recipeCard.element; }; } else if (pageType === 'checkpoints') { - return createCheckpointCard; + return (model) => createModelCard(model, 'checkpoint'); + } else if (pageType === 'embeddings') { + return (model) => createModelCard(model, 'embedding'); } return null; } @@ -64,9 +65,11 @@ export async function initializeInfiniteScroll(pageType = 'loras') { // Setup event delegation for lora cards if on the loras page if (pageType === 'loras') { - setupLoraCardEventDelegation(); + setupModelCardEventDelegation('lora'); } else if (pageType === 'checkpoints') { - setupCheckpointCardEventDelegation(); + setupModelCardEventDelegation('checkpoint'); + } else if (pageType === 'embeddings') { + setupModelCardEventDelegation('embedding'); } } diff --git a/templates/components/header.html b/templates/components/header.html index 2e7f7be3..0c8d7386 100644 --- a/templates/components/header.html +++ b/templates/components/header.html @@ -3,7 +3,7 @@
- LoRA Manager + oRA Manager