mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-24 06:32:12 -03:00
feat: Implement context menus for checkpoints and recipes, including metadata refresh and NSFW level management
This commit is contained in:
41
static/js/components/ContextMenu/RecipeContextMenu.js
Normal file
41
static/js/components/ContextMenu/RecipeContextMenu.js
Normal file
@@ -0,0 +1,41 @@
|
||||
import { BaseContextMenu } from './BaseContextMenu.js';
|
||||
import { showToast } from '../../utils/uiHelpers.js';
|
||||
|
||||
export class RecipeContextMenu extends BaseContextMenu {
|
||||
constructor() {
|
||||
super('recipeContextMenu', '.lora-card');
|
||||
}
|
||||
|
||||
handleMenuAction(action) {
|
||||
switch(action) {
|
||||
case 'details':
|
||||
// Show recipe details
|
||||
this.currentCard.click();
|
||||
break;
|
||||
case 'copy':
|
||||
// Copy recipe to clipboard
|
||||
if (window.recipeManager) {
|
||||
window.recipeManager.copyRecipe(this.currentCard.dataset.id);
|
||||
}
|
||||
break;
|
||||
case 'share':
|
||||
// Share recipe
|
||||
if (window.recipeManager) {
|
||||
window.recipeManager.shareRecipe(this.currentCard.dataset.id);
|
||||
}
|
||||
break;
|
||||
case 'delete':
|
||||
// Delete recipe
|
||||
if (this.currentCard.querySelector('.fa-trash')) {
|
||||
this.currentCard.querySelector('.fa-trash').click();
|
||||
}
|
||||
break;
|
||||
case 'edit':
|
||||
// Edit recipe
|
||||
if (window.recipeManager && window.recipeManager.editRecipe) {
|
||||
window.recipeManager.editRecipe(this.currentCard.dataset.id);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user