mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-21 21:22:11 -03:00
feat(context-menu): enhance bulk workflow options with append and replace actions
This commit is contained in:
@@ -217,17 +217,19 @@
|
||||
/* Bulk Context Menu Header */
|
||||
.bulk-context-header {
|
||||
padding: 10px 12px;
|
||||
background: var(--lora-accent);
|
||||
color: var(--lora-text);
|
||||
background: var(--card-bg); /* Use card background for subtlety */
|
||||
color: var(--text-color); /* Use standard text color */
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
border-radius: var(--border-radius-xs) var(--border-radius-xs) 0 0;
|
||||
border-bottom: 1px solid var(--border-color); /* Add subtle separator */
|
||||
}
|
||||
|
||||
.bulk-context-header i {
|
||||
width: 16px;
|
||||
text-align: center;
|
||||
color: var(--lora-accent); /* Accent only the icon for a hint of color */
|
||||
}
|
||||
@@ -27,14 +27,18 @@ export class BulkContextMenu extends BaseContextMenu {
|
||||
|
||||
// Update button visibility based on model type
|
||||
const addTagsItem = this.menu.querySelector('[data-action="add-tags"]');
|
||||
const sendToWorkflowItem = this.menu.querySelector('[data-action="send-to-workflow"]');
|
||||
const sendToWorkflowAppendItem = this.menu.querySelector('[data-action="send-to-workflow-append"]');
|
||||
const sendToWorkflowReplaceItem = this.menu.querySelector('[data-action="send-to-workflow-replace"]');
|
||||
const copyAllItem = this.menu.querySelector('[data-action="copy-all"]');
|
||||
const refreshAllItem = this.menu.querySelector('[data-action="refresh-all"]');
|
||||
const moveAllItem = this.menu.querySelector('[data-action="move-all"]');
|
||||
const deleteAllItem = this.menu.querySelector('[data-action="delete-all"]');
|
||||
|
||||
if (sendToWorkflowItem) {
|
||||
sendToWorkflowItem.style.display = config.sendToWorkflow ? 'flex' : 'none';
|
||||
if (sendToWorkflowAppendItem) {
|
||||
sendToWorkflowAppendItem.style.display = config.sendToWorkflow ? 'flex' : 'none';
|
||||
}
|
||||
if (sendToWorkflowReplaceItem) {
|
||||
sendToWorkflowReplaceItem.style.display = config.sendToWorkflow ? 'flex' : 'none';
|
||||
}
|
||||
if (copyAllItem) {
|
||||
copyAllItem.style.display = config.copyAll ? 'flex' : 'none';
|
||||
@@ -71,8 +75,11 @@ export class BulkContextMenu extends BaseContextMenu {
|
||||
case 'add-tags':
|
||||
bulkManager.showBulkAddTagsModal();
|
||||
break;
|
||||
case 'send-to-workflow':
|
||||
bulkManager.sendAllModelsToWorkflow();
|
||||
case 'send-to-workflow-append':
|
||||
bulkManager.sendAllModelsToWorkflow(false);
|
||||
break;
|
||||
case 'send-to-workflow-replace':
|
||||
bulkManager.sendAllModelsToWorkflow(true);
|
||||
break;
|
||||
case 'copy-all':
|
||||
bulkManager.copyAllModelsSyntax();
|
||||
|
||||
@@ -228,7 +228,7 @@ export class BulkManager {
|
||||
await copyToClipboard(loraSyntaxes.join(', '), `Copied ${loraSyntaxes.length} LoRA syntaxes to clipboard`);
|
||||
}
|
||||
|
||||
async sendAllModelsToWorkflow() {
|
||||
async sendAllModelsToWorkflow(replaceMode = false) {
|
||||
if (state.currentPageType !== MODEL_TYPES.LORA) {
|
||||
showToast('toast.loras.sendOnlyForLoras', {}, 'warning');
|
||||
return;
|
||||
@@ -265,7 +265,7 @@ export class BulkManager {
|
||||
return;
|
||||
}
|
||||
|
||||
await sendLoraToWorkflow(loraSyntaxes.join(', '), false, 'lora');
|
||||
await sendLoraToWorkflow(loraSyntaxes.join(', '), replaceMode, 'lora');
|
||||
}
|
||||
|
||||
showBulkDeleteModal() {
|
||||
|
||||
Reference in New Issue
Block a user