mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-30 11:56:18 -05:00
Creating Generate Screenshot button for Archives which are missing a screenshot.
This commit is contained in:
parent
41e1ed6be6
commit
1ed0d63bac
11 changed files with 508 additions and 4 deletions
|
|
@ -750,6 +750,28 @@ export async function getArchive(archiveId) {
|
|||
}
|
||||
}
|
||||
|
||||
export async function generateArchiveScreenshot(archiveId) {
|
||||
const response = await apiPost(`${ARCHIVES_API}/${archiveId}/generate_screenshot`);
|
||||
if (response.ok) {
|
||||
toast({
|
||||
type: 'success',
|
||||
title: 'Screenshot Generation Queued',
|
||||
description: 'Screenshot generation has been queued. This may take a moment.',
|
||||
time: 3000,
|
||||
});
|
||||
return true;
|
||||
} else {
|
||||
const message = await getErrorMessage(response, 'Failed to queue screenshot generation.');
|
||||
toast({
|
||||
type: 'error',
|
||||
title: 'Screenshot Generation Error',
|
||||
description: message,
|
||||
time: 5000,
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
export async function postDownload(downloadData) {
|
||||
if (!downloadData.downloader) {
|
||||
toast({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue