Skip to content

Commit

Permalink
Add configuration conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed May 21, 2024
1 parent 25c0f04 commit 88a981b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 deletions.
31 changes: 21 additions & 10 deletions client/src/components/Masthead/Masthead.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ const route = useRoute();
const router = useRouter();
const { config, isConfigLoaded } = useConfig();
const emit = defineEmits(["open-url"]);
const props = defineProps({
brand: {
type: String,
Expand Down Expand Up @@ -86,7 +84,13 @@ onMounted(() => {
</script>

<template>
<BNavbar id="masthead" type="dark" role="navigation" aria-label="Main" class="justify-content-between">
<BNavbar
v-if="isConfigLoaded"
id="masthead"
type="dark"
role="navigation"
aria-label="Main"
class="justify-content-between">
<BNavbarNav>
<BNavbarBrand
v-b-tooltip.hover
Expand All @@ -102,12 +106,14 @@ onMounted(() => {
</span>
</BNavbarNav>
<BNavbarNav>
<MastheadItem id="analysis" title="Tools and Current History" icon="fa-home" @click="openUrl('/')" />
<MastheadItem
id="analysis"
title="Tools and Current History"
icon="fa-home"
@click="openUrl('/')" />
<MastheadItem v-if="windowTab" :id="windowTab.id" :title="windowTab.title" :icon="windowTab.icon" :toggle="windowToggle" @click="onWindowToggle" />
v-if="windowTab"
:id="windowTab.id"
:title="windowTab.title"
:icon="windowTab.icon"
:toggle="windowToggle"
@click="onWindowToggle" />
<MastheadItem
v-for="(tab, idx) in extensionTabs"
v-show="tab.hidden !== true"
Expand All @@ -126,12 +132,17 @@ onMounted(() => {
@click="openUrl('/about')" />
<QuotaMeter />
<MastheadItem
v-if="isAnonymous"
v-if="isAnonymous && config.allow_user_creation"
id="user"
title="Log in or Register"
@click="openUrl('/login/start')" />
<MastheadItem
v-else
v-if="isAnonymous && !config.allow_user_creation"
id="user"
title="Login"
@click="openUrl('/login/start')" />
<MastheadItem
v-if="!isAnonymous && !config.single_user"
id="user"
title="Logout"
icon="fa-sign-out-alt"
Expand Down
8 changes: 3 additions & 5 deletions client/src/components/Masthead/MastheadItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@ import Vue from "vue";
Vue.use(VBPopoverPlugin);
Vue.use(VBTooltipPlugin);
const emit = defineEmits(["click", "open-url"]);
/* props */
const props = defineProps({
defineProps({
disabled: {
type: Boolean,
},
id: {
type: String,
},
icon: {
icon: {
type: String,
},
target: {
Expand Down Expand Up @@ -44,7 +42,7 @@ const props = defineProps({
v-b-tooltip.hover.bottom
:href="withPrefix(url)"
:target="target || '_parent'"
:link-classes="{ 'nav-icon': !!icon, 'toggle': toggle }"
:link-classes="{ 'nav-icon': !!icon, toggle: toggle }"
:title="tooltip"
@click="$emit('click')">
<template v-if="icon">
Expand Down
1 change: 0 additions & 1 deletion client/src/entry/analysis/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ import { WindowManager } from "layout/window-manager";
import Modal from "mvc/ui/ui-modal";
import { getAppRoot } from "onload";
import { storeToRefs } from "pinia";
import { withPrefix } from "utils/redirect";
import { ref, watch } from "vue";
import short from "@/components/plugins/short";
Expand Down

0 comments on commit 88a981b

Please sign in to comment.