Skip to content

Commit 2fc9903

Browse files
authored
Merge pull request #21112 from martenson/prefix-dl
[25.0] Prefix download link
2 parents d33a151 + d0b9fa8 commit 2fc9903

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

client/src/components/Dataset/DatasetView.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { usePersistentToggle } from "@/composables/persistentToggle";
88
import { useDatasetStore } from "@/stores/datasetStore";
99
import { useDatatypesMapperStore } from "@/stores/datatypesMapperStore";
1010
import { useDatatypeStore } from "@/stores/datatypeStore";
11+
import { withPrefix } from "@/utils/redirect";
1112
import { bytesToString } from "@/utils/utils";
1213
1314
import DatasetError from "../DatasetInformation/DatasetError.vue";
@@ -56,6 +57,9 @@ const showError = computed(
5657
const isAutoDownloadType = computed(
5758
() => dataset.value && datatypeStore.isDatatypeAutoDownload(dataset.value.file_ext)
5859
);
60+
const downloadUrl = computed(
61+
() => withPrefix(`/datasets/${props.datasetId}/display`)
62+
);
5963
const preferredVisualization = computed(
6064
() => dataset.value && datatypeStore.getPreferredVisualization(dataset.value.file_ext)
6165
);
@@ -195,7 +199,7 @@ watch(
195199
<h4>Download Required</h4>
196200
<p>This file type ({{ dataset.file_ext }}) will download automatically when accessed directly.</p>
197201
<p>File size: <strong v-html="bytesToString(dataset.file_size || 0, false)" /></p>
198-
<a :href="`/datasets/${datasetId}/display`" class="btn btn-primary mt-2" download>
202+
<a :href="downloadUrl" class="btn btn-primary mt-2" download>
199203
<FontAwesomeIcon :icon="faFileAlt" class="mr-1" /> Download File
200204
</a>
201205
</div>
@@ -222,7 +226,7 @@ watch(
222226
<h4>Download Required</h4>
223227
<p>This file type ({{ dataset.file_ext }}) will download automatically when accessed directly.</p>
224228
<p>File size: <strong v-html="bytesToString(dataset.file_size || 0, false)" /></p>
225-
<a :href="`/datasets/${datasetId}/display`" class="btn btn-primary mt-2" download>
229+
<a :href="downloadUrl" class="btn btn-primary mt-2" download>
226230
<FontAwesomeIcon :icon="faFileAlt" class="mr-1" /> Download File
227231
</a>
228232
</div>

0 commit comments

Comments
 (0)