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

Make refseq path handle baseUrl

parent ffa4f812
No related branches found
No related tags found
No related merge requests found
Pipeline #112512 passed with stages
in 6 minutes and 3 seconds
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
<script setup lang="ts"> <script setup lang="ts">
// import { useCustomTheme } from '~/composables/useCustomTheme' // import { useCustomTheme } from '~/composables/useCustomTheme'
import { useDisplay, useTheme } from "vuetify"; import { useDisplay, useTheme } from "vuetify";
import { withTrailingSlash, withLeadingSlash, joinURL } from "ufo";
const runtimeConfig = useRuntimeConfig(); const runtimeConfig = useRuntimeConfig();
const { navigation } = useContent(); const { navigation } = useContent();
...@@ -47,13 +48,28 @@ const theme = useTheme(); ...@@ -47,13 +48,28 @@ const theme = useTheme();
function toggleTheme() { function toggleTheme() {
theme.global.name.value = theme.global.current.value.dark ? "light" : "dark"; theme.global.name.value = theme.global.current.value.dark ? "light" : "dark";
} }
const refSeqPath = ref("/refseq");
const refinedRefSeqPath = computed(() => {
if (refSeqPath.value?.startsWith("/") && !refSeqPath.value.startsWith("//")) {
const _base = withLeadingSlash(
withTrailingSlash(useRuntimeConfig().app.baseURL)
);
if (_base !== "/" && !refSeqPath.value.startsWith(_base)) {
return joinURL(_base, refSeqPath.value);
}
}
return refSeqPath;
});
const sections = ref([ const sections = ref([
{ {
id: "webservice", id: "webservice",
label: "webservice", label: "webservice",
href: runtimeConfig.public.defenseFinderWebservice, href: runtimeConfig.public.defenseFinderWebservice,
}, },
{ id: "refseq", label: "REFSEQ", href: "/refseq" }, { id: "refseq", label: "REFSEQ", href: refinedRefSeqPath },
]); ]);
const drawer = ref(true); const drawer = ref(true);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment