mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-21 21:22:11 -03:00
feat: Update API routes for LoRA management and enhance folder handling
This commit is contained in:
@@ -87,7 +87,7 @@ export class DownloadManager {
|
||||
throw new Error('Invalid Civitai URL format');
|
||||
}
|
||||
|
||||
const response = await fetch(`/api/civitai/versions/${this.modelId}`);
|
||||
const response = await fetch(`/api/loras/civitai/versions/${this.modelId}`);
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json().catch(() => ({}));
|
||||
if (errorData && errorData.error && errorData.error.includes('Model type mismatch')) {
|
||||
@@ -254,7 +254,7 @@ export class DownloadManager {
|
||||
|
||||
try {
|
||||
// Fetch LoRA roots
|
||||
const rootsResponse = await fetch('/api/lora-roots');
|
||||
const rootsResponse = await fetch('/api/loras/roots');
|
||||
if (!rootsResponse.ok) {
|
||||
throw new Error('Failed to fetch LoRA roots');
|
||||
}
|
||||
@@ -272,7 +272,7 @@ export class DownloadManager {
|
||||
}
|
||||
|
||||
// Fetch folders dynamically
|
||||
const foldersResponse = await fetch('/api/folders');
|
||||
const foldersResponse = await fetch('/api/loras/folders');
|
||||
if (!foldersResponse.ok) {
|
||||
throw new Error('Failed to fetch folders');
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ class MoveManager {
|
||||
|
||||
try {
|
||||
// Fetch LoRA roots
|
||||
const rootsResponse = await fetch('/api/lora-roots');
|
||||
const rootsResponse = await fetch('/api/loras/roots');
|
||||
if (!rootsResponse.ok) {
|
||||
throw new Error('Failed to fetch LoRA roots');
|
||||
}
|
||||
@@ -96,7 +96,7 @@ class MoveManager {
|
||||
}
|
||||
|
||||
// Fetch folders dynamically
|
||||
const foldersResponse = await fetch('/api/folders');
|
||||
const foldersResponse = await fetch('/api/loras/folders');
|
||||
if (!foldersResponse.ok) {
|
||||
throw new Error('Failed to fetch folders');
|
||||
}
|
||||
@@ -190,7 +190,7 @@ class MoveManager {
|
||||
|
||||
// Refresh folder tags after successful move
|
||||
try {
|
||||
const foldersResponse = await fetch('/api/folders');
|
||||
const foldersResponse = await fetch('/api/loras/folders');
|
||||
if (foldersResponse.ok) {
|
||||
const foldersData = await foldersResponse.json();
|
||||
updateFolderTags(foldersData.folders);
|
||||
|
||||
@@ -161,7 +161,7 @@ export class SettingsManager {
|
||||
if (!defaultLoraRootSelect) return;
|
||||
|
||||
// Fetch lora roots
|
||||
const response = await fetch('/api/lora-roots');
|
||||
const response = await fetch('/api/loras/roots');
|
||||
if (!response.ok) {
|
||||
throw new Error('Failed to fetch LoRA roots');
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ export class FolderBrowser {
|
||||
}
|
||||
|
||||
// Fetch LoRA roots
|
||||
const rootsResponse = await fetch('/api/lora-roots');
|
||||
const rootsResponse = await fetch('/api/loras/roots');
|
||||
if (!rootsResponse.ok) {
|
||||
throw new Error(`Failed to fetch LoRA roots: ${rootsResponse.status}`);
|
||||
}
|
||||
@@ -119,7 +119,7 @@ export class FolderBrowser {
|
||||
}
|
||||
|
||||
// Fetch folders
|
||||
const foldersResponse = await fetch('/api/folders');
|
||||
const foldersResponse = await fetch('/api/loras/folders');
|
||||
if (!foldersResponse.ok) {
|
||||
throw new Error(`Failed to fetch folders: ${foldersResponse.status}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user