mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-25 15:15:44 -03:00
checkpoint
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import { showToast } from './utils/uiHelpers.js';
|
||||
import { state } from './state/index.js';
|
||||
import { initializeCommonComponents } from './common.js';
|
||||
import { ImportManager } from './managers/ImportManager.js';
|
||||
|
||||
class RecipeManager {
|
||||
constructor() {
|
||||
@@ -10,6 +11,9 @@ class RecipeManager {
|
||||
this.sortBy = 'date';
|
||||
this.filterParams = {};
|
||||
|
||||
// Initialize ImportManager
|
||||
this.importManager = new ImportManager();
|
||||
|
||||
this.init();
|
||||
}
|
||||
|
||||
@@ -43,6 +47,15 @@ class RecipeManager {
|
||||
}, 300);
|
||||
});
|
||||
}
|
||||
|
||||
// Import button
|
||||
const importButton = document.querySelector('button[onclick="importRecipes()"]');
|
||||
if (importButton) {
|
||||
importButton.onclick = (e) => {
|
||||
e.preventDefault();
|
||||
this.importManager.showImportModal();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
async loadRecipes() {
|
||||
@@ -198,12 +211,25 @@ class RecipeManager {
|
||||
// - Recipe details view
|
||||
// - Recipe tag filtering
|
||||
// - Recipe search and filters
|
||||
|
||||
// Add a method to handle recipe import
|
||||
importRecipes() {
|
||||
this.importManager.showImportModal();
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize components
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
initializeCommonComponents();
|
||||
window.recipeManager = new RecipeManager();
|
||||
|
||||
// Make importRecipes function available globally
|
||||
window.importRecipes = () => {
|
||||
window.recipeManager.importRecipes();
|
||||
};
|
||||
|
||||
// Expose ImportManager instance globally for the import modal event handlers
|
||||
window.importManager = window.recipeManager.importManager;
|
||||
});
|
||||
|
||||
// Export for use in other modules
|
||||
|
||||
Reference in New Issue
Block a user