mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-25 07:05:43 -03:00
feat: refactor API routes for renaming models and update related functions
This commit is contained in:
@@ -2,7 +2,6 @@ import { showToast } from '../utils/uiHelpers.js';
|
||||
import { state, getCurrentPageState } from '../state/index.js';
|
||||
import { modalManager } from './ModalManager.js';
|
||||
import { getStorageItem } from '../utils/storageHelpers.js';
|
||||
import { updateModelCard } from '../utils/cardUpdater.js';
|
||||
|
||||
class MoveManager {
|
||||
constructor() {
|
||||
@@ -151,8 +150,8 @@ class MoveManager {
|
||||
const filename = filePath.substring(filePath.lastIndexOf('/') + 1);
|
||||
// Construct new filepath
|
||||
const newFilePath = `${targetPath}/${filename}`;
|
||||
// Update the card with new filepath
|
||||
updateModelCard(filePath, {filepath: newFilePath});
|
||||
|
||||
state.virtualScroller.updateSingleItem(filePath, {file_path: newFilePath});
|
||||
});
|
||||
}
|
||||
} else {
|
||||
@@ -169,8 +168,8 @@ class MoveManager {
|
||||
const filename = this.currentFilePath.substring(this.currentFilePath.lastIndexOf('/') + 1);
|
||||
// Construct new filepath
|
||||
const newFilePath = `${targetPath}/${filename}`;
|
||||
// Update the card with new filepath
|
||||
updateModelCard(this.currentFilePath, {filepath: newFilePath});
|
||||
|
||||
state.virtualScroller.updateSingleItem(this.currentFilePath, {file_path: newFilePath});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user