Draft of zip downloader

This commit is contained in:
Joel Collins 2019-11-28 17:15:29 +00:00
parent 481fbe9bf4
commit 2baba05e09
2 changed files with 171 additions and 1 deletions

View file

@ -52,6 +52,10 @@
</li>
</ul>
</div>
<div class="uk-navbar-right">
<ZipDownloader :capture-ids="Object.keys(filteredCaptures)" />
</div>
</nav>
<div
@ -92,13 +96,16 @@ import axios from "axios";
import captureCard from "./galleryComponents/captureCard.vue";
import scanCard from "./galleryComponents/scanCard.vue";
import ZipDownloader from "./galleryComponents/zipDownloader";
// Export main app
export default {
name: "GalleryDisplay",
components: {
captureCard,
scanCard
scanCard,
ZipDownloader
},
data: function() {
@ -225,6 +232,22 @@ export default {
return this.filterCaptureList(this.itemList, this.checkedTags);
},
filteredCaptures: function() {
var captures = {};
for (var item of this.filteredItems) {
if ("captureList" in item) {
for (var capture of item.captureList) {
captures[capture.metadata.id] = capture;
}
} else {
captures[item.metadata.id] = item;
}
}
return captures;
},
sortedItems: function() {
// Sort filteredItems using sortCaptureList function
return this.sortCaptureList(this.filteredItems);