File tree Expand file tree Collapse file tree 2 files changed +21
-6
lines changed
Expand file tree Collapse file tree 2 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,8 @@ import { bytesToString } from "@/utils/utils";
1212
1313import Alert from " @/components/Alert.vue" ;
1414import LoadingSpan from " @/components/LoadingSpan.vue" ;
15- import TabularChunkedView from " ./Tabular/TabularChunkedView.vue" ;
15+ import CenterFrame from " @/entry/analysis/modules/CenterFrame.vue" ;
16+ import TabularChunkedView from " components/Dataset/Tabular/TabularChunkedView.vue" ;
1617
1718interface Props {
1819 datasetId: string ;
7374 {{ errorMessage }}
7475 </BAlert >
7576 <LoadingSpan v-else-if =" isLoading || !dataset" message =" Loading dataset content" />
76- <div v-else >
77+ <div v-else class = " h-100 " >
7778 <Alert v-if =" sanitizedMessage" :dismissible =" true" variant =" warning" data-description =" sanitization warning" >
7879 {{ sanitizedMessage }}
7980 <span v-if =" isAdmin && sanitizedToolId" >
8687 You are viewing a deleted dataset.
8788 </div >
8889 <TabularChunkedView v-if =" content && content.ck_data" :options =" { ...dataset, first_data_chunk: content }" />
89- <div v-else-if =" content" >
90+ <div v-else-if =" content" class = " h-100 " >
9091 <div v-if =" isBinary" >
9192 This is a binary (or unknown to Galaxy) dataset of size {{ bytesToString(dataset.file_size) }}. Preview
9293 is not implemented for this filetype. Displaying as ASCII text.
9798 </div >
9899 <a :href =" downloadUrl" >Download</a >
99100 </div >
100- <pre v-if =" contentType === 'text/html'" v- html =" content" />
101+ <CenterFrame v-if =" contentType === 'text/html'" : html =" content" />
101102 <pre v-else >{{ content }}</pre >
102103 </div >
103104 </div >
Original file line number Diff line number Diff line change 11<script setup lang="ts">
2- import { computed , ref } from " vue" ;
2+ import { computed , onMounted , ref , watch } from " vue" ;
33
44import { withPrefix } from " @/utils/redirect" ;
55
@@ -10,16 +10,25 @@ const props = withDefaults(
1010 defineProps <{
1111 id? : string ;
1212 src? : string ;
13+ html? : string ;
1314 }>(),
1415 {
1516 id: " frame" ,
1617 src: " " ,
18+ html: " " ,
1719 },
1820);
1921
22+ const iframeRef = ref <HTMLIFrameElement >();
2023const srcWithRoot = computed (() => withPrefix (props .src ));
2124const isLoading = ref (true );
2225
26+ function injectHtml(val : string ) {
27+ if (iframeRef .value && val ) {
28+ iframeRef .value .srcdoc = val ;
29+ }
30+ }
31+
2332function onLoad(ev : Event ) {
2433 isLoading .value = false ;
2534 const iframe = ev .currentTarget as HTMLIFrameElement ;
@@ -32,14 +41,19 @@ function onLoad(ev: Event) {
3241 console .warn (" [CenterFrame] onLoad location access forbidden." , ev , location );
3342 }
3443}
44+
45+ watch (() => props .html , injectHtml );
46+ onMounted (() => injectHtml (props .html ));
3547 </script >
48+
3649<template >
3750 <div class =" h-100" >
3851 <LoadingSpan v-if =" isLoading" >Loading ...</LoadingSpan >
3952 <iframe
4053 :id =" id"
54+ ref =" iframeRef"
4155 :name =" id"
42- :src =" srcWithRoot"
56+ :src =" props.html ? undefined : srcWithRoot"
4357 class =" center-frame"
4458 frameborder =" 0"
4559 title =" galaxy frame"
You can’t perform that action at this time.
0 commit comments