-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feedback improvements: API throttling issues, support deleting multip…
…le images, and more (#47) * refactor: checkForWaitingJobs improvements * refactor: pending jobs controller * refactor: cleanup pending image store * refactor: update and fix rendering issue with image thumbnail * fix: handle issue with hitting API limit * chore: add test for ImageParams class * fix: broken build * feat: ability to export and import loras * chore: update manifest and add additional icon sizes * feat: add pagination to lora favorites page * chore: handle undefined values in lora search * chore: filter favorites and recents * fix: stretched out image issue on lora page * chore: cleanup civitai hook * chore: fix issue with image thumbnail * fix: add use client to linker * feat: add changelog page with pagination * chore: update changelog * fix: skip importing lora if already exists in db * fix: issue where input validation warning didn't return specific errors * fix: issue with showing incorrect lora * fix: broken build * chore: allow opening lora panel if max lora count reached * chore: update gitignore * fix: pending image completed count funkyness * fix: issue with throttle function and generate image endpoint * chore: update changelog * feat: implement task queue for managing multiple API calls * feat: offload check logic to webworker * chore: update deps * feat: initial work on multi-image selection * feat: add support for custom notes fields and support for auto-downgrade * chore: select all images toggle * feat: multiple image downloads * fix: issue with duplicate images on gallery page * chore: cleanup console logs * feat: download multiple images method * feat: add ability to delete image batch from popup modal * fix: build issues * feat: create local html image viewer for downloaded files * chore: update changelog * feat: add accordion option to section component * chore: add accordions to embeddings components * fix: handle error with missing values * chore: add bundle analyzer package * fix: correctly cast number types * chore: update changelog * feat: allow canceling of partial job without losing results * fix: issue with not possible job being stuck and add feedback * fix: handle 404 errors from expired jobs * chore: update changelog * chore: update npm script
- Loading branch information
1 parent
e5f7bb8
commit 70f07b7
Showing
92 changed files
with
4,402 additions
and
1,155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
|
||
# production | ||
/build | ||
buildId.json | ||
build.sh | ||
*.tar.gz | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
|
||
/** | ||
* Saves API response data for debugging purposes on a local machine. | ||
* | ||
* This function sends a POST request to a local debug endpoint ('/api/debug/save-response') | ||
* with the provided API response data. It's designed to be attached to API requests | ||
* to log data for debugging and troubleshooting. | ||
* | ||
* @param id - A unique identifier for the API response | ||
* @param data - The API response data to be saved (can be of any type) | ||
* @param route - The API route that was called | ||
* | ||
* @example | ||
* // Usage in an API call: | ||
* const apiData = await fetchSomeApiData(); | ||
* await debugSaveApiResponse('uniqueId123', apiData, '/api/some-endpoint'); | ||
*/ | ||
export const debugSaveApiResponse = async ( | ||
id: string, | ||
data: any, | ||
route: string | ||
) => { | ||
if (process.env.NEXT_PUBLIC_SAVE_DEBUG_LOGS !== 'true') return | ||
|
||
try { | ||
const response = await fetch('/api/debug/save-response', { | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/json' | ||
}, | ||
body: JSON.stringify({ id, data, route }) | ||
}) | ||
|
||
if (!response.ok) { | ||
throw new Error('Failed to save API response') | ||
} | ||
|
||
console.log('API response saved successfully') | ||
} catch (error) { | ||
console.error('Error saving API response:', error) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
self.onmessage = async (event) => { | ||
const { jobId, url, headers } = event.data | ||
|
||
try { | ||
const res = await fetch(url, { headers, cache: 'no-store' }) | ||
const statusCode = res.status | ||
const data = await res.json() | ||
|
||
if ('done' in data && 'is_possible' in data) { | ||
self.postMessage({ | ||
jobId, | ||
result: { | ||
success: true, | ||
...data | ||
} | ||
}) | ||
} else { | ||
self.postMessage({ | ||
jobId, | ||
result: { | ||
success: false, | ||
message: data.message, | ||
statusCode | ||
} | ||
}) | ||
} | ||
} catch (error) { | ||
self.postMessage({ | ||
jobId, | ||
result: { | ||
success: false, | ||
statusCode: 0, | ||
message: 'unknown error' | ||
} | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.