Skip to content

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

feat(sql-editor): add SQL editor menu in dashboard (#445)

Yunwei Xiao68af0b32c189
diff --git a/frontend/src/views/DashboardHeader.vue b/frontend/src/views/DashboardHeader.vue
index 6bc77540bb..2ec6ab973b 100644
--- a/frontend/src/views/DashboardHeader.vue
+++ b/frontend/src/views/DashboardHeader.vue
@@ -41,12 +41,6 @@
class="bar-link px-2 py-2 rounded-md"
>{{ $t("common.settings") }}</router-link
>
- <router-link
- v-if="isDevFeatures"
- to="/sql-editor"
- class="bar-link px-2 py-2 rounded-md"
- >{{ $t("sql-editor.self") }}</router-link
- >
</div>
</div>
</div>
@@ -117,6 +111,14 @@
></span>
<heroicons-outline:bell class="w-6 h-6" />
</router-link>
+ <router-link to="/sql-editor" class="bar-link px-2 py-2 rounded-md">
+ <NTooltip>
+ <template #trigger>
+ <heroicons-outline:terminal class="w-6 h-6" />
+ </template>
+ {{ $t("sql-editor.self") }}
+ </NTooltip>
+ </router-link>
<div v-if="isDevFeatures" class="cursor-pointer" @click="toggleLocales">
<heroicons-outline:translate class="w-6 h-6" />
</div>
@@ -184,7 +186,7 @@
<script lang="ts">
import { defineAction, useRegisterActions } from "@bytebase/vue-kbar";
-import { computed, reactive, watchEffect } from "vue";
+import { computed, reactive, watchEffect, defineComponent } from "vue";
import { useRouter } from "vue-router";
import { useStore } from "vuex";
import { useI18n } from "vue-i18n";
@@ -198,7 +200,7 @@ interface LocalState {
showMobileMenu: boolean;
}
-export default {
+export default defineComponent({
name: "DashboardHeader",
components: { ProfileDropdown },
setup() {
@@ -371,5 +373,5 @@ export default {
toggleLocales,
};
},
-};
+});
</script>
diff --git a/frontend/src/views/DashboardSidebar.vue b/frontend/src/views/DashboardSidebar.vue
index 533e1d4da0..e3cb3665e8 100644
--- a/frontend/src/views/DashboardSidebar.vue
+++ b/frontend/src/views/DashboardSidebar.vue
@@ -12,6 +12,13 @@
<heroicons-outline:shield-exclamation class="w-5 h-5 mr-2" />
{{ $t("anomaly-center") }}
</router-link>
+ <router-link
+ to="/sql-editor"
+ class="outline-item group flex items-center px-2 py-2"
+ >
+ <heroicons-outline:terminal class="w-5 h-5 mr-2" />
+ {{ $t("sql-editor.self") }}
+ </router-link>
<div>
<BookmarkListSidePanel />
</div>
@@ -24,17 +31,8 @@
</nav>
</template>
-<script lang="ts">
+<script lang="ts" setup>
import BookmarkListSidePanel from "../components/BookmarkListSidePanel.vue";
import ProjectListSidePanel from "../components/ProjectListSidePanel.vue";
import DatabaseListSidePanel from "../components/DatabaseListSidePanel.vue";
-
-export default {
- name: "DashboardSidebar",
- components: {
- BookmarkListSidePanel,
- ProjectListSidePanel,
- DatabaseListSidePanel,
- },
-};
</script>