From 0be62d773d52353a1c1790d03c4724b0c83eec2d Mon Sep 17 00:00:00 2001 From: jaknapper Date: Fri, 17 Oct 2025 18:39:29 +0100 Subject: [PATCH] Scan viewer component --- .../scanListComponents/scanViewer.vue | 171 ++++++++++++++++++ .../tabContentComponents/scanListContent.vue | 131 ++------------ 2 files changed, 184 insertions(+), 118 deletions(-) create mode 100644 webapp/src/components/tabContentComponents/scanListComponents/scanViewer.vue diff --git a/webapp/src/components/tabContentComponents/scanListComponents/scanViewer.vue b/webapp/src/components/tabContentComponents/scanListComponents/scanViewer.vue new file mode 100644 index 00000000..96f2203d --- /dev/null +++ b/webapp/src/components/tabContentComponents/scanListComponents/scanViewer.vue @@ -0,0 +1,171 @@ + + + + + diff --git a/webapp/src/components/tabContentComponents/scanListContent.vue b/webapp/src/components/tabContentComponents/scanListContent.vue index 2e83e624..400ca229 100644 --- a/webapp/src/components/tabContentComponents/scanListContent.vue +++ b/webapp/src/components/tabContentComponents/scanListContent.vue @@ -50,97 +50,12 @@ - -
-
-

- {{ selectedScan.name }} - - -

+ - -
- -
- - -
- -
- - - -
- - - -
-
-
import axios from "axios"; -import UIkit from "uikit"; import actionButton from "../labThingsComponents/actionButton.vue"; import scanCard from "./scanListComponents/scanCard.vue"; -import OpenSeadragonViewer from "./scanListComponents/openSeadragonViewer.vue"; +import ScanViewerModal from "./scanListComponents/scanViewer.vue"; // Export main app export default { name: "ScanListContent", - components: { actionButton, OpenSeadragonViewer, scanCard }, + components: { actionButton, scanCard, ScanViewerModal }, data: function() { return { @@ -263,24 +177,6 @@ export default { this.updateScans(); } }, - updateViewerFilter() { - const viewer = this.$refs.openseadragon; - if (viewer) { - viewer.brightness = this.brightness; - viewer.contrast = this.contrast; - viewer.saturation = this.saturation; - viewer.updateFilter(); - } - }, - resetFilters() { - this.brightness = 1; - this.contrast = 1; - this.saturation = 1; - this.updateViewerFilter(); - }, - goFullscreen() { - this.$refs.openseadragon.openFullscreen(); - }, async updateScans() { try { let scans_information = await this.readThingProperty("smart_scan", "scans"); @@ -320,16 +216,15 @@ export default { } }, showScan(scan) { - if (scan.dzi){ + if (scan.dzi) { this.selectedScan = scan; - UIkit.modal(this.$refs.scanModal).show(); + this.$refs.scanViewer.show(); + } else { + this.modalError("Scan not stitched for viewing in webapp, please download or stitch"); } - else { - this.modalError(`Scan not stitched for viewing in webapp, please download or stitch`) - } - } + }, } -}; +}