@@ -5,8 +5,8 @@ import { useConfigurationStore } from '@/stores/configuration'
5
5
import ImageViewer from ' ./ImageViewer.vue'
6
6
import LinePlot from ' ./LinePlot.vue'
7
7
import FilterBadge from ' @/components/Global/FilterBadge.vue'
8
+ import ImageDownloadMenu from ' @/components/Project/ImageAnalysis/ImageDownloadMenu.vue'
8
9
9
- // eslint-disable-next-line no-unused-vars
10
10
const props = defineProps ([' modelValue' , ' image' ])
11
11
const emit = defineEmits ([' update:modelValue' ])
12
12
const configStore = useConfigurationStore ()
@@ -26,17 +26,17 @@ function closeDialog() {
26
26
}
27
27
28
28
// This function runs when imageViewer emits an analysis-action event and should be extended to handle other analysis types
29
- function requestAnalysis (action , input ){
29
+ function requestAnalysis (action , input , action_callback = null ){
30
30
const url = configStore .datalabApiBaseUrl + ' analysis/' + action + ' /'
31
31
const body = {
32
32
' basename' : props .image .basename ,
33
33
... input
34
34
}
35
- fetchApiCall ({url: url, method: ' POST' , body: body, successCallback : (response ) => {handleAnalysisOutput (response, action)}})
35
+ fetchApiCall ({url: url, method: ' POST' , body: body, successCallback : (response ) => {handleAnalysisOutput (response, action, action_callback )}})
36
36
}
37
37
38
38
// The successCallback function for the fetchApiCall in requestAnalysis new operations can be added here as an additional case
39
- function handleAnalysisOutput (response , action ){
39
+ function handleAnalysisOutput (response , action , action_callback ){
40
40
switch (action) {
41
41
case ' line-profile' :
42
42
lineProfile .value = response .line_profile
@@ -47,6 +47,9 @@ function handleAnalysisOutput(response, action){
47
47
case ' source-catalog' :
48
48
catalog .value = response
49
49
break
50
+ case ' get-tif' :
51
+ action_callback (response .tif_url , props .image .basename , ' TIF' )
52
+ break
50
53
default :
51
54
console .error (' Invalid action:' , action)
52
55
break
@@ -65,13 +68,10 @@ function handleAnalysisOutput(response, action){
65
68
density =" comfortable"
66
69
:title =" image.target_name"
67
70
>
68
- <a
69
- :href =" image.url"
70
- :download =" image.basename"
71
- target =" _blank"
72
- >
73
- <v-icon icon =" mdi-download" />
74
- </a >
71
+ <image-download-menu
72
+ :image =" image"
73
+ @analysis-action =" requestAnalysis"
74
+ />
75
75
<v-btn
76
76
icon =" mdi-close"
77
77
@click =" closeDialog()"
0 commit comments