Skip to content
Snippets Groups Projects
Commit 81115b97 authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

Quick fix to make wiki works. Api molstar-pdbe-plugin changed

parent a37bab97
No related branches found
No related tags found
1 merge request!14Add all pdbs
Pipeline #112942 failed
...@@ -3,19 +3,35 @@ import { withTrailingSlash, withLeadingSlash, joinURL } from 'ufo' ...@@ -3,19 +3,35 @@ import { withTrailingSlash, withLeadingSlash, joinURL } from 'ufo'
import { useRuntimeConfig, computed } from '#imports' import { useRuntimeConfig, computed } from '#imports'
export interface Props { export interface Props {
height?: number height?: number
dataUrls: string[] dataUrls?: string[]
dataUrl?: string
} }
// const selectedPdb = ref('') // const selectedPdb = ref('')
const refinedDataUrls = computed(() => { const refinedDataUrls = computed(() => {
return props.dataUrls.map((dataUrl) => {
if (dataUrl?.startsWith('/') && !dataUrl.startsWith('//')) { function refinedUrl(url: string) {
if (url?.startsWith('/') && !url.startsWith('//')) {
const _base = withLeadingSlash(withTrailingSlash(useRuntimeConfig().app.baseURL)) const _base = withLeadingSlash(withTrailingSlash(useRuntimeConfig().app.baseURL))
if (_base !== '/' && !dataUrl.startsWith(_base)) { if (_base !== '/' && !url.startsWith(_base)) {
return joinURL(_base, dataUrl) return joinURL(_base, url)
} }
} }
return dataUrl return url
}) }
let urls: string[] = []
if (props?.dataUrls && props?.dataUrls?.length > 0) {
urls = [...props.dataUrls.map((dataUrl) => {
return refinedUrl(dataUrl)
})]
}
if (props?.dataUrl) {
urls = [...urls, refinedUrl(props.dataUrl)]
}
return urls
}) })
// const selectedPdb = ref(refinedDataUrls.value?.length > 0 ? refinedDataUrls.value[0] : null) // const selectedPdb = ref(refinedDataUrls.value?.length > 0 ? refinedDataUrls.value[0] : null)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment