@@ -49,6 +49,11 @@
|
||||
on:click={async () => {
|
||||
const locale = getLocaleFromNavigator();
|
||||
const orgs = current_organizations.filter((r) => r.is_selected === true);
|
||||
const toast = Toastify({
|
||||
text: $_('generating-pdfs'),
|
||||
duration: -1,
|
||||
}).showToast();
|
||||
let count = 0;
|
||||
for await (const o of orgs) {
|
||||
const runners = await RunnerOrganizationService.runnerOrganizationControllerGetRunners(o.id);
|
||||
fetch(
|
||||
@@ -63,6 +68,7 @@
|
||||
)
|
||||
.then((response) => response.blob())
|
||||
.then((blob) => {
|
||||
count++;
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
let a = document.createElement('a');
|
||||
a.href = url;
|
||||
@@ -70,6 +76,15 @@
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
a.remove();
|
||||
if (count === orgs.length) {
|
||||
toast.hideToast();
|
||||
Toastify({
|
||||
text: $_('pdfs-successfully-generated'),
|
||||
duration: 3500,
|
||||
backgroundColor:
|
||||
'linear-gradient(to right, #00b09b, #96c93d)',
|
||||
}).showToast();
|
||||
}
|
||||
})
|
||||
.catch((err) => {});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user