mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-22 13:42:12 -03:00
refactor(localization): update toast messages in various components and managers for better user feedback
57 lines
2.1 KiB
JavaScript
57 lines
2.1 KiB
JavaScript
// CheckpointsControls.js - Specific implementation for the Checkpoints page
|
|
import { PageControls } from './PageControls.js';
|
|
import { getModelApiClient, resetAndReload } from '../../api/modelApiFactory.js';
|
|
import { showToast } from '../../utils/uiHelpers.js';
|
|
import { downloadManager } from '../../managers/DownloadManager.js';
|
|
|
|
/**
|
|
* CheckpointsControls class - Extends PageControls for Checkpoint-specific functionality
|
|
*/
|
|
export class CheckpointsControls extends PageControls {
|
|
constructor() {
|
|
// Initialize with 'checkpoints' page type
|
|
super('checkpoints');
|
|
|
|
// Register API methods specific to the Checkpoints page
|
|
this.registerCheckpointsAPI();
|
|
}
|
|
|
|
/**
|
|
* Register Checkpoint-specific API methods
|
|
*/
|
|
registerCheckpointsAPI() {
|
|
const checkpointsAPI = {
|
|
// Core API functions
|
|
loadMoreModels: async (resetPage = false, updateFolders = false) => {
|
|
return await getModelApiClient().loadMoreWithVirtualScroll(resetPage, updateFolders);
|
|
},
|
|
|
|
resetAndReload: async (updateFolders = false) => {
|
|
return await resetAndReload(updateFolders);
|
|
},
|
|
|
|
refreshModels: async (fullRebuild = false) => {
|
|
return await getModelApiClient().refreshModels(fullRebuild);
|
|
},
|
|
|
|
// Add fetch from Civitai functionality for checkpoints
|
|
fetchFromCivitai: async () => {
|
|
return await getModelApiClient().fetchCivitaiMetadata();
|
|
},
|
|
|
|
// Add show download modal functionality
|
|
showDownloadModal: () => {
|
|
downloadManager.showDownloadModal();
|
|
},
|
|
|
|
// No clearCustomFilter implementation is needed for checkpoints
|
|
// as custom filters are currently only used for LoRAs
|
|
clearCustomFilter: async () => {
|
|
showToast('toast.filters.noCustomFilterToClear', {}, 'info');
|
|
}
|
|
};
|
|
|
|
// Register the API
|
|
this.registerAPI(checkpointsAPI);
|
|
}
|
|
} |