This commit is contained in:
@@ -55,6 +55,7 @@ const inventory = ref([]);
|
||||
const selectedInventoryIds = ref([]);
|
||||
const inventoryTags = ref("");
|
||||
const exportStatus = ref("");
|
||||
const exportJobId = ref("");
|
||||
const listings = ref([]);
|
||||
const sales = ref([]);
|
||||
const acquisitions = ref([]);
|
||||
@@ -262,6 +263,7 @@ async function enqueueInventoryExport() {
|
||||
exportStatus.value = "Starting export...";
|
||||
try {
|
||||
const job = await enqueueAdminInventoryExport(csrfToken());
|
||||
exportJobId.value = job.id;
|
||||
const completed = await getAdminInventoryExportJob(job.id);
|
||||
exportStatus.value = `Export ${completed.status.toLowerCase()}.`;
|
||||
} catch (requestError) {
|
||||
@@ -542,6 +544,14 @@ onMounted(load);
|
||||
Queue JSON export
|
||||
</button>
|
||||
<span v-if="exportStatus" role="status">{{ exportStatus }}</span>
|
||||
<a
|
||||
v-if="exportJobId && exportStatus === 'Export completed.'"
|
||||
class="button button--secondary"
|
||||
:href="`/api/v1/admin/exports/jobs/${exportJobId}/download`"
|
||||
download="inventory.json"
|
||||
>
|
||||
Download queued export
|
||||
</a>
|
||||
</p>
|
||||
<p v-if="isLoading" class="state state--loading" role="status">
|
||||
Loading inventory...
|
||||
|
||||
Reference in New Issue
Block a user