Add copy model name toast

This commit is contained in:
Will Miao
2025-02-04 23:34:38 +08:00
parent 2bac420740
commit aedc8f01ef
2 changed files with 2 additions and 1 deletions

View File

@@ -39,7 +39,7 @@ export function createLoraCard(lora) {
</i> </i>
<i class="fas fa-copy" <i class="fas fa-copy"
title="Copy Model Name" title="Copy Model Name"
onclick="event.stopPropagation(); navigator.clipboard.writeText('${lora.file_name}')"> onclick="event.stopPropagation(); navigator.clipboard.writeText('${lora.file_name}').then(() => showToast('Model name copied', 'success')).catch(() => showToast('Copy failed', 'error'))">
</i> </i>
<i class="fas fa-trash" <i class="fas fa-trash"
title="Delete Model" title="Delete Model"

View File

@@ -24,6 +24,7 @@ window.confirmDelete = confirmDelete;
window.closeDeleteModal = closeDeleteModal; window.closeDeleteModal = closeDeleteModal;
window.refreshLoras = refreshLoras; window.refreshLoras = refreshLoras;
window.openCivitai = openCivitai; window.openCivitai = openCivitai;
window.showToast = showToast
// Initialize everything when DOM is ready // Initialize everything when DOM is ready
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {