From 163d4a96b931fea3cf9e9550a619ec559edca686 Mon Sep 17 00:00:00 2001 From: Eric Gauzens Date: Wed, 21 Feb 2024 10:15:26 -0500 Subject: [PATCH] Added action icons for viewers --- components/FilesTable/FilesTable.vue | 143 +++++++++++++++++++++++---- 1 file changed, 124 insertions(+), 19 deletions(-) diff --git a/components/FilesTable/FilesTable.vue b/components/FilesTable/FilesTable.vue index ea3a41c0..ac586cf1 100644 --- a/components/FilesTable/FilesTable.vue +++ b/components/FilesTable/FilesTable.vue @@ -191,6 +191,54 @@ +
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
item !== undefined) + let shortened = scope.row.path + shortened = shortened.replace('files/', '') + for (let i = 0; i < biolucidaObjects.length; i++) { + if (biolucidaObjects[i].dataset.path === shortened) + return true + } + } + return false + }, + isPlotViewFile: function (scope) { + if ( + this.datasetScicrunch && + this.datasetScicrunch['abi-plot'] + ) { + let plotObjects = this.datasetScicrunch['abi-plot'] + let shortened = scope.row.path + shortened = shortened.replace('files/', '') + for (let i = 0; i < plotObjects.length; i++) { + if (plotObjects[i].dataset.path === shortened) + return true + } + } + return false + }, + isVideoViewFile: function (scope) { + if ( + this.datasetScicrunch && + this.datasetScicrunch['video'] + ) { + let videoObjects = this.datasetScicrunch['video'] + let shortened = scope.row.path + shortened = shortened.replace('files/', '') + for (let i = 0; i < videoObjects.length; i++) { + if (videoObjects[i].dataset.path === shortened) + return true + } + } + return false + }, + isSegmentationViewFile: function (scope) { + if ( + this.datasetScicrunch && + this.datasetScicrunch['mbf-segmentation'] + ) { + let segmentationObjects = this.datasetScicrunch['mbf-segmentation'] + let shortened = scope.row.path + shortened = shortened.replace('files/', '') + for (let i = 0; i < segmentationObjects.length; i++) { + if (segmentationObjects[i].dataset.path === shortened) + return true + } + } + return false + }, + openViewerFile(scope) { + const route = { + name: 'file-datasetId-datasetVersion', + params: { + datasetId: this.datasetInfo.id, + datasetVersion: this.datasetInfo.version + }, + query: { + path: this.s3Path(scope.row) + } + } + this.$router.push(route) + }, /** * Compute if the file is an image * @returns {Boolean}