From 4de6177e3a5e442a14d4c195f4a0f6cc2d34c802 Mon Sep 17 00:00:00 2001
From: Will Miao <13051207myq@gmail.com>
Date: Fri, 31 Jan 2025 21:02:22 +0800
Subject: [PATCH] Update trigger words display and enhance click feedback for
Lora cards
---
static/js/script.js | 12 +++++++++---
templates/loras.html | 1 +
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/static/js/script.js b/static/js/script.js
index b89c4f75..83a13c23 100644
--- a/static/js/script.js
+++ b/static/js/script.js
@@ -233,7 +233,7 @@ function showLoraModal(lora) {
`).join('')}
- ` : '
@@ -562,11 +562,17 @@ document.querySelectorAll('.lora-card').forEach(card => {
};
}
- // 为没有元数据的卡片添加点击反馈
+ // 为卡片添加点击反馈,根据不同情况显示不同的提示
card.addEventListener('click', () => {
const meta = JSON.parse(card.dataset.meta || '{}');
+ const fromCivitai = card.dataset.from_civitai === 'True';
+
if (Object.keys(meta).length === 0) {
- showToast('This model is not available on Civitai. No additional information to display.', 'info');
+ if (fromCivitai) {
+ showToast('Model is available on Civitai. Please click "Fetch" to retrieve metadata.', 'info');
+ } else {
+ showToast('This model is not available on Civitai. No additional information to display.', 'info');
+ }
}
});
});
diff --git a/templates/loras.html b/templates/loras.html
index b7ed9c24..516970a5 100644
--- a/templates/loras.html
+++ b/templates/loras.html
@@ -93,6 +93,7 @@
data-file_name="{{ lora.file_name }}"
data-folder="{{ lora.folder }}"
data-modified="{{ lora.modified }}"
+ data-from_civitai="{{ lora.from_civitai }}"
data-meta="{{ lora.civitai | default({}) | tojson | forceescape }}">
{% if lora.preview_url.endswith('.mp4') or lora.preview_url.endswith('.webm') %}