feat: refactor model API structure to support specific model types with dedicated API clients for Checkpoints, LoRAs, and Embeddings

refactor: consolidate model API client creation into a factory function for better maintainability
feat: implement move operations for LoRAs and handle unsupported operations for Checkpoints and Embeddings
This commit is contained in:
Will Miao
2025-08-04 19:37:53 +08:00
parent 65ec6aacb7
commit 342a722991
29 changed files with 341 additions and 213 deletions

View File

@@ -1,7 +1,7 @@
import { state, getCurrentPageState } from '../state/index.js';
import { VirtualScroller } from './VirtualScroller.js';
import { createModelCard, setupModelCardEventDelegation } from '../components/shared/ModelCard.js';
import { getModelApiClient } from '../api/baseModelApi.js';
import { getModelApiClient } from '../api/modelApiFactory.js';
import { showToast } from './uiHelpers.js';
// Function to dynamically import the appropriate card creator based on page type

View File

@@ -1,5 +1,5 @@
import { modalManager } from '../managers/ModalManager.js';
import { getModelApiClient } from '../api/baseModelApi.js';
import { getModelApiClient } from '../api/modelApiFactory.js';
const apiClient = getModelApiClient();