Skip to content

Commit 0e49f66

Browse files
committed
Use preview url
1 parent d3b31b0 commit 0e49f66

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

client/src/components/Dataset/DatasetDisplay.vue

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const dataset = computed(() => getDataset(props.datasetId));
3737
const datasetUrl = computed(() => `/datasets/${props.datasetId}/display`);
3838
const downloadUrl = computed(() => withPrefix(`${datasetUrl.value}?to_ext=${dataset.value?.file_ext}`));
3939
const isLoading = computed(() => isLoadingDataset(props.datasetId));
40+
const previewUrl = computed(() => withPrefix(`${datasetUrl.value}?preview=True`));
4041
4142
const sanitizedMessage = computed(() => {
4243
const plainText = "Contents are shown as plain text.";
@@ -51,9 +52,8 @@ const sanitizedMessage = computed(() => {
5152
watch(
5253
() => props.datasetId,
5354
async () => {
54-
const url = withPrefix(`${datasetUrl.value}?preview=True`);
5555
try {
56-
const { data, headers } = await axios.get(url);
56+
const { data, headers } = await axios.get(previewUrl.value);
5757
content.value = data;
5858
contentTruncated.value = headers["x-content-truncated"];
5959
contentType.value = headers["content-type"];
@@ -98,8 +98,7 @@ watch(
9898
</div>
9999
<a :href="downloadUrl">Download</a>
100100
</div>
101-
<CenterFrame v-if="contentType === 'text/html'" :src="datasetUrl" />
102-
<pre v-else>{{ content }}</pre>
101+
<CenterFrame :src="previewUrl" />
103102
</div>
104103
</div>
105104
</template>

0 commit comments

Comments
 (0)