Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: record path when click the logo (#14535)

ecmadao561724fdb60d
diff --git a/frontend/src/DummyRootView.ts b/frontend/src/DummyRootView.ts
index 8dcc687023..2014d66895 100644
--- a/frontend/src/DummyRootView.ts
+++ b/frontend/src/DummyRootView.ts
@@ -56,7 +56,7 @@ export default defineComponent({
// Redirect to
// - /sql-editor if defaultWorkspaceView == 'EDITOR'
// - lastVisit.path if not empty
- // - /issues as fallback
+ // - /landing as fallback
if (!lastVisit.value) {
return fallback();
}
diff --git a/frontend/src/components/BytebaseLogo.vue b/frontend/src/components/BytebaseLogo.vue
index 8575f8c7cb..0238134e96 100644
--- a/frontend/src/components/BytebaseLogo.vue
+++ b/frontend/src/components/BytebaseLogo.vue
@@ -1,6 +1,7 @@
<template>
<div
class="flex-shrink-0 w-44 min-h-[4rem] flex items-center overflow-y-hidden"
+ @click="recordRedirect"
>
<component
:is="component"
@@ -29,6 +30,8 @@
<script lang="ts" setup>
import { computed } from "vue";
+import { useRouter } from "vue-router";
+import { useRecentVisit } from "@/router/useRecentVisit";
import { useActuatorV1Store } from "@/store/modules/v1/actuator";
const props = withDefaults(
@@ -41,8 +44,20 @@ const props = withDefaults(
);
const component = computed(() => (props.redirect ? "router-link" : "span"));
+const { record } = useRecentVisit();
+const router = useRouter();
const customBrandingLogo = computed((): string => {
return useActuatorV1Store().brandingLogo;
});
+
+const recordRedirect = () => {
+ if (!props.redirect) {
+ return;
+ }
+ const route = router.resolve({
+ name: props.redirect,
+ });
+ record(route.fullPath);
+};
</script>