Skip to content

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

feat(frontend): Highlight SQL Editor Entry Button and remove "New Project", "Manage User" in home view (#4454)

Liu Jib0d9760f7da7
diff --git a/frontend/src/layouts/BodyLayout.vue b/frontend/src/layouts/BodyLayout.vue
index 3ebb071042..3cbcd9d5a5 100644
--- a/frontend/src/layouts/BodyLayout.vue
+++ b/frontend/src/layouts/BodyLayout.vue
@@ -165,8 +165,25 @@
<div v-if="showBreadcrumb" class="hidden md:block px-4 pt-4">
<Breadcrumb />
</div>
- <div v-if="quickActionList.length > 0" class="mx-4 mt-4">
- <QuickActionPanel :quick-action-list="quickActionList" />
+ <div class="flex items-center flex-wrap px-4 gap-x-4">
+ <div v-if="quickActionList.length > 0" class="flex-1 mt-4">
+ <QuickActionPanel :quick-action-list="quickActionList" />
+ </div>
+ <div
+ v-if="route.name === 'workspace.home'"
+ class="mt-4 hidden md:flex"
+ >
+ <a
+ href="/sql-editor"
+ target="_blank"
+ class="btn-primary items-center !px-6 !py-3 !text-xl"
+ >
+ <heroicons-solid:terminal class="w-6 h-6 mr-2" />
+ <span class="whitespace-nowrap">{{
+ $t("sql-editor.self")
+ }}</span>
+ </a>
+ </div>
</div>
</div>
</div>
@@ -193,7 +210,7 @@
<script lang="ts">
import { computed, defineComponent, reactive } from "vue";
-import { useRouter } from "vue-router";
+import { useRoute, useRouter } from "vue-router";
import Breadcrumb from "../components/Breadcrumb.vue";
import Quickstart from "../components/Quickstart.vue";
import QuickActionPanel from "../components/QuickActionPanel.vue";
@@ -224,6 +241,7 @@ export default defineComponent({
const actuatorStore = useActuatorStore();
const subscriptionStore = useSubscriptionStore();
const uiStateStore = useUIStateStore();
+ const route = useRoute();
const router = useRouter();
const state = reactive<LocalState>({
@@ -328,6 +346,7 @@ export default defineComponent({
return {
state,
+ route,
quickActionList,
showBreadcrumb,
showQuickstart,
diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts
index 0f06342016..0a0bfcfd24 100644
--- a/frontend/src/router/index.ts
+++ b/frontend/src/router/index.ts
@@ -129,10 +129,7 @@ const routes: Array<RouteRecordRaw> = [
"quickaction.bb.database.data.update",
"quickaction.bb.database.schema.sync",
"quickaction.bb.database.create",
- // "quickaction.bb.database.troubleshoot",
"quickaction.bb.instance.create",
- "quickaction.bb.project.create",
- "quickaction.bb.user.manage",
]
: [
"quickaction.bb.database.schema.update",
@@ -140,8 +137,6 @@ const routes: Array<RouteRecordRaw> = [
"quickaction.bb.database.schema.sync",
"quickaction.bb.database.create",
"quickaction.bb.instance.create",
- "quickaction.bb.project.create",
- "quickaction.bb.user.manage",
];
const dbaList: QuickActionType[] = hasDBAWorkflowFeature
? [
@@ -149,9 +144,7 @@ const routes: Array<RouteRecordRaw> = [
"quickaction.bb.database.data.update",
"quickaction.bb.database.schema.sync",
"quickaction.bb.database.create",
- // "quickaction.bb.database.troubleshoot",
"quickaction.bb.instance.create",
- "quickaction.bb.project.create",
]
: [
"quickaction.bb.database.schema.update",
@@ -159,21 +152,18 @@ const routes: Array<RouteRecordRaw> = [
"quickaction.bb.database.schema.sync",
"quickaction.bb.database.create",
"quickaction.bb.instance.create",
- "quickaction.bb.project.create",
];
const developerList: QuickActionType[] = hasDBAWorkflowFeature
? [
"quickaction.bb.database.schema.update",
"quickaction.bb.database.data.update",
"quickaction.bb.database.schema.sync",
- "quickaction.bb.project.create",
]
: [
"quickaction.bb.database.schema.update",
"quickaction.bb.database.data.update",
"quickaction.bb.database.schema.sync",
"quickaction.bb.database.create",
- "quickaction.bb.project.create",
];
return new Map([
["OWNER", ownerList],
diff --git a/frontend/src/views/sql-editor/TerminalPanel/TerminalPanel.vue b/frontend/src/views/sql-editor/TerminalPanel/TerminalPanel.vue
index 3d004c7fe9..acd5da221a 100644
--- a/frontend/src/views/sql-editor/TerminalPanel/TerminalPanel.vue
+++ b/frontend/src/views/sql-editor/TerminalPanel/TerminalPanel.vue
@@ -73,7 +73,7 @@ import {
} from "../EditorCommon";
import { useExecuteSQL } from "@/composables/useExecuteSQL";
import { useCancelableTimeout } from "@/composables/useCancelableTimeout";
-import { minmax } from "@/components/SchemaDiagram/common";
+import { minmax } from "@/utils";
type LocalState = {
historyIndex: number;