Skip to content

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

feat(frontend): open sql-editor in new tab (#2646)

Liu Ji14e46c480a21
diff --git a/frontend/src/components/DatabaseTable.vue b/frontend/src/components/DatabaseTable.vue
index 913c5685ef..f666e59955 100644
--- a/frontend/src/components/DatabaseTable.vue
+++ b/frontend/src/components/DatabaseTable.vue
@@ -467,12 +467,8 @@ const gotoSQLEditor = (database: Database) => {
state.warningDatabase = database;
state.showIncorrectProjectModal = true;
} else {
- router.push({
- name: "sql-editor.detail",
- params: {
- connectionSlug: connectionSlug(database),
- },
- });
+ const url = `/sql-editor/${connectionSlug(database)}`;
+ window.open(url);
}
};
diff --git a/frontend/src/views/DashboardSidebar.vue b/frontend/src/views/DashboardSidebar.vue
index 64c774e560..d95544089d 100644
--- a/frontend/src/views/DashboardSidebar.vue
+++ b/frontend/src/views/DashboardSidebar.vue
@@ -26,13 +26,14 @@
{{ $t("common.home") }}
</div>
</router-link>
- <router-link
- to="/sql-editor"
+ <a
+ href="/sql-editor"
+ target="__blank"
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>
+ </a>
<router-link
to="/anomaly-center"
class="outline-item group flex items-center px-2 py-2"
diff --git a/frontend/src/views/DatabaseDetail.vue b/frontend/src/views/DatabaseDetail.vue
index aaf0f04bbe..6f2bb775e6 100644
--- a/frontend/src/views/DatabaseDetail.vue
+++ b/frontend/src/views/DatabaseDetail.vue
@@ -617,12 +617,8 @@ const gotoSQLEditor = () => {
state.editingProjectId = database.value.project.id;
state.showIncorrectProjectModal = true;
} else {
- router.push({
- name: "sql-editor.detail",
- params: {
- connectionSlug: connectionSlug(database.value),
- },
- });
+ const url = `/sql-editor/${connectionSlug(database.value)}`;
+ window.open(url);
}
};
diff --git a/frontend/src/views/TableDetail.vue b/frontend/src/views/TableDetail.vue
index 58a12d6e4f..bf06979318 100644
--- a/frontend/src/views/TableDetail.vue
+++ b/frontend/src/views/TableDetail.vue
@@ -221,7 +221,6 @@ import {
idFromSlug,
isGhostTable,
} from "../utils";
-import { useRouter } from "vue-router";
import { useTableStore } from "@/store";
import { Table } from "@/types";
@@ -239,7 +238,6 @@ export default defineComponent({
},
},
setup(props) {
- const router = useRouter();
const tableStore = useTableStore();
const table = computed(() => {
@@ -254,12 +252,8 @@ export default defineComponent({
});
const gotoSQLEditor = () => {
- router.push({
- name: "sql-editor.detail",
- params: {
- connectionSlug: connectionSlug(database.value),
- },
- });
+ const url = `/sql-editor/${connectionSlug(database.value)}`;
+ window.open(url);
};
return {