mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-26 07:35:44 -03:00
checkpoint
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import { showToast } from '../utils/uiHelpers.js';
|
import { showToast } from '../utils/uiHelpers.js';
|
||||||
import { modalManager } from '../managers/ModalManager.js';
|
import { modalManager } from '../managers/ModalManager.js';
|
||||||
|
import { resetAndReload } from '../api/loraApi.js';
|
||||||
import { state } from '../state/index.js';
|
import { state } from '../state/index.js';
|
||||||
|
|
||||||
export function createLoraCard(lora) {
|
export function createLoraCard(lora) {
|
||||||
@@ -201,6 +202,13 @@ window.saveUsageTips = async function(filePath) {
|
|||||||
const content = document.querySelector('.usage-tips-content').textContent;
|
const content = document.querySelector('.usage-tips-content').textContent;
|
||||||
try {
|
try {
|
||||||
await saveModelMetadata(filePath, { usage_tips: content });
|
await saveModelMetadata(filePath, { usage_tips: content });
|
||||||
|
|
||||||
|
// Update the corresponding lora card's dataset
|
||||||
|
const loraCard = document.querySelector(`.lora-card[data-filepath="${filePath}"]`);
|
||||||
|
if (loraCard) {
|
||||||
|
loraCard.dataset.usage_tips = content;
|
||||||
|
}
|
||||||
|
|
||||||
showToast('Usage tips saved successfully', 'success');
|
showToast('Usage tips saved successfully', 'success');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showToast('Failed to save usage tips', 'error');
|
showToast('Failed to save usage tips', 'error');
|
||||||
@@ -211,6 +219,13 @@ window.saveNotes = async function(filePath) {
|
|||||||
const content = document.querySelector('.notes-content').textContent;
|
const content = document.querySelector('.notes-content').textContent;
|
||||||
try {
|
try {
|
||||||
await saveModelMetadata(filePath, { notes: content });
|
await saveModelMetadata(filePath, { notes: content });
|
||||||
|
|
||||||
|
// Update the corresponding lora card's dataset
|
||||||
|
const loraCard = document.querySelector(`.lora-card[data-filepath="${filePath}"]`);
|
||||||
|
if (loraCard) {
|
||||||
|
loraCard.dataset.notes = content;
|
||||||
|
}
|
||||||
|
|
||||||
showToast('Notes saved successfully', 'success');
|
showToast('Notes saved successfully', 'success');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showToast('Failed to save notes', 'error');
|
showToast('Failed to save notes', 'error');
|
||||||
|
|||||||
Reference in New Issue
Block a user