11<script setup lang="ts">
22import axios from " axios" ;
33import { onMounted , ref } from " vue" ;
4+
45import { withPrefix } from " @/utils/redirect" ;
56
67import TabularChunkedView from " components/Visualizations/Tabular/TabularChunkedView.vue" ;
78
9+ const MAX_PEEK_SIZE_BINARY = 100000 ;
10+
811interface Props {
912 datasetId: string ;
1013 isPreview: boolean ;
@@ -14,7 +17,6 @@ const props = withDefaults(defineProps<Props>(), {});
1417
1518const content = ref ();
1619const datasetDetails = ref ();
17- const deleted = ref (true );
1820
1921onMounted (async () => {
2022 const detailsUrl = withPrefix (` /api/datasets/${props .datasetId } ` );
@@ -36,8 +38,8 @@ onMounted(async () => {
3638 </script >
3739
3840<template >
39- <div >
40- <div v-if =" deleted" class = " errormessagelarge " id =" deleted-data-message" >
41+ <div v-if = " datasetDetails " >
42+ <div v-if =" datasetDetails. deleted" id =" deleted-data-message" class = " errormessagelarge " >
4143 You are viewing a deleted dataset.
4244 </div >
4345 <div class =" warningmessagelarge" >
@@ -47,15 +49,15 @@ onMounted(async () => {
4749 </div >
4850 <div class =" warningmessagelarge" >
4951 This is a binary (or unknown to Galaxy) dataset of size ${ file_size }. Preview is not implemented for this filetype. Displaying
50- %if truncated:
51- first 100KB
52- %endif
53- as ASCII text<br />
52+ < span v-if = " datasetDetails.file_size > MAX_PEEK_SIZE_BINARY " >
53+ first 100KB
54+ </ span >
55+ as ASCII text<br />
5456 <a href =" ${h.url_for( controller='dataset', action='display', dataset_id=trans.security.encode_id( data.id ), to_ext=data.ext )}" >Download</a >
5557 </div >
56- <TabularChunkedView v-if =" content" :options =" { dataset_config: { ...datasetDetails, first_data_chunk: content } }" />
57- <pre >
58- {{ content }}
58+ <TabularChunkedView v-if =" content && content.ck_data " :options =" { dataset_config: { ...datasetDetails, first_data_chunk: content } }" />
59+ <pre v-else >
60+ {{ content }}
5961 </pre >
6062 </div >
6163</template >
0 commit comments