mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-24 22:52:12 -03:00
Add file name copy functionality to Lora modal
This commit is contained in:
@@ -914,3 +914,29 @@ body.modal-open {
|
|||||||
.add-preset-btn:hover {
|
.add-preset-btn:hover {
|
||||||
opacity: 0.9;
|
opacity: 0.9;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* File name copy styles */
|
||||||
|
.file-name-wrapper {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
cursor: pointer;
|
||||||
|
padding: 4px;
|
||||||
|
border-radius: var(--border-radius-xs);
|
||||||
|
transition: background-color 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-name-wrapper:hover {
|
||||||
|
background: oklch(var(--lora-accent) / 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-name-wrapper i {
|
||||||
|
color: var(--text-color);
|
||||||
|
opacity: 0.5;
|
||||||
|
transition: opacity 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-name-wrapper:hover i {
|
||||||
|
opacity: 1;
|
||||||
|
color: var(--lora-accent);
|
||||||
|
}
|
||||||
@@ -149,7 +149,10 @@ export function showLoraModal(lora) {
|
|||||||
</div>
|
</div>
|
||||||
<div class="info-item">
|
<div class="info-item">
|
||||||
<label>File Name</label>
|
<label>File Name</label>
|
||||||
<span id="file-name">${lora.file_name || 'N/A'}</span>
|
<div class="file-name-wrapper" onclick="copyFileName('${lora.file_name}')">
|
||||||
|
<span id="file-name">${lora.file_name || 'N/A'}</span>
|
||||||
|
<i class="fas fa-copy" title="Copy file name"></i>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="info-item">
|
<div class="info-item">
|
||||||
<label>Location</label>
|
<label>Location</label>
|
||||||
@@ -206,6 +209,17 @@ export function showLoraModal(lora) {
|
|||||||
setupShowcaseScroll(); // Add this line
|
setupShowcaseScroll(); // Add this line
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 添加复制文件名的函数
|
||||||
|
window.copyFileName = async function(fileName) {
|
||||||
|
try {
|
||||||
|
await navigator.clipboard.writeText(fileName);
|
||||||
|
showToast('File name copied', 'success');
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Copy failed:', err);
|
||||||
|
showToast('Copy failed', 'error');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
function setupEditableFields() {
|
function setupEditableFields() {
|
||||||
const editableFields = document.querySelectorAll('.editable-field [contenteditable]');
|
const editableFields = document.querySelectorAll('.editable-field [contenteditable]');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user