Files
speckle-connectors-dui/components/header/NavBar.vue
T
Oğuzhan Koral 3b4aa93858 Feat: mocked bindings and logging to seq (#39)
* mocked bindings and logging to seq

* test deploy

* test deploy

* test deploy

* connectorless state

* remove logs

* remove more logs

* add flags to globalThus

* log with /api/events/raw

* log error link on prod over local account

* handle test query to distinguish self hosters

* throw again

* log again...

* sa and ra

* error policy non none

* attach server url to logs

* Add host app version

* rename name to slug

* remove useless re throw

* fix confusion on versions
2025-07-23 15:51:09 +01:00

118 lines
3.8 KiB
Vue

<template>
<nav
v-if="!hasNoModelCards"
class="fixed top-0 h-9 flex items-center bg-foundation border-b border-outline-2 w-full transition z-20"
>
<div class="flex items-center transition-all justify-between w-full">
<div class="flex items-center space-x-2">
<div class="max-[200px]:hidden block ml-2">
<img
class="block h-6 w-6"
src="~~/assets/images/speckle_logo_big.png"
alt="Speckle"
/>
</div>
<div class="relative group flex items-center">
<FormButton
v-tippy="'Publish objects from this file to a new Speckle model'"
color="outline"
size="sm"
class="relative group px-0"
:icon-left="ArrowUpTrayIcon"
hide-text
@click="showSendDialog = true"
></FormButton>
</div>
<div class="relative group flex items-center">
<FormButton
v-if="app.$receiveBinding"
v-tippy="'Load a model from Speckle into this file'"
color="outline"
size="sm"
class="relative group px-0"
:icon-left="ArrowDownTrayIcon"
hide-text
@click="showReceiveDialog = true"
></FormButton>
</div>
</div>
<div class="flex justify-between items-center pr-1">
<!-- <FormButton
v-if="!hostAppStore.isConnectorUpToDate"
v-tippy="hostAppStore.latestAvailableVersion?.Number.replace('+0', '')"
:icon-right="ArrowUpCircleIcon"
size="sm"
color="subtle"
class="flex min-w-0 transition text-primary py-1 mr-1"
@click.stop="hostAppStore.downloadLatestVersion()"
>
<span class="">Update</span>
</FormButton> -->
<div class="text-[8px] text-foreground-disabled max-[150px]:hidden">
{{ hostAppStore.connectorVersion }}
</div>
<HeaderButton
v-if="hostAppStore.isDistributedBySpeckle"
v-tippy="'Documentation and help'"
@click="
app.$openUrl(
`https://docs.speckle.systems/connectors/${hostAppStore.hostAppName}?utm=dui`
)
"
>
<QuestionMarkCircleIcon
class="w-4 text-foreground-disabled group-hover:text-foreground-2"
/>
</HeaderButton>
<HeaderButton v-tippy="'Send us feedback'" @click="openFeedbackDialog()">
<ChatBubbleLeftIcon
class="w-4 text-foreground-disabled group-hover:text-foreground-2"
/>
</HeaderButton>
<HeaderUserMenu />
</div>
</div>
<FeedbackDialog v-model:open="showFeedbackDialog" />
<SendWizard v-model:open="showSendDialog" @close="showSendDialog = false" />
<ReceiveWizard
v-model:open="showReceiveDialog"
@close="showReceiveDialog = false"
/>
</nav>
</template>
<script setup lang="ts">
import {
ArrowUpTrayIcon,
ArrowDownTrayIcon,
QuestionMarkCircleIcon,
ChatBubbleLeftIcon
} from '@heroicons/vue/24/solid'
import { useHostAppStore } from '~/store/hostApp'
const app = useNuxtApp()
const hostAppStore = useHostAppStore()
const hasNoModelCards = computed(() => hostAppStore.projectModelGroups.length === 0)
const showFeedbackDialog = ref<boolean>(false)
const showSendDialog = ref<boolean>(false)
const showReceiveDialog = ref<boolean>(false)
app.$baseBinding?.on('documentChanged', () => {
showSendDialog.value = false
showReceiveDialog.value = false
})
const { $intercom } = useNuxtApp()
const openFeedbackDialog = () => {
if (
hostAppStore.hostAppName?.toLowerCase() === 'revit' &&
hostAppStore.hostAppVersion?.includes('2022')
) {
showFeedbackDialog.value = true
} else {
$intercom.show()
}
}
</script>