Skip to content

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

Give DBA and Owner a separate create database quickaction to directly go to the create new db page.

天舟82dae1bf8379
diff --git a/frontend/src/components/QuickActionPanel.vue b/frontend/src/components/QuickActionPanel.vue
index 9cff6130c2..7689590a01 100644
--- a/frontend/src/components/QuickActionPanel.vue
+++ b/frontend/src/components/QuickActionPanel.vue
@@ -107,6 +107,33 @@
</h3>
</div>
+ <div
+ v-if="quickAction == 'quickaction.bytebase.database.create'"
+ class="flex flex-col items-center w-28"
+ >
+ <router-link to="/db/new" class="btn-icon-primary p-3">
+ <svg
+ class="w-6 h-6"
+ fill="none"
+ stroke="currentColor"
+ viewBox="0 0 24 24"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ <path
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ stroke-width="2"
+ d="M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"
+ ></path>
+ </svg>
+ </router-link>
+ <h3
+ class="mt-1 text-base text-center font-normal text-main tracking-tight"
+ >
+ Create DB
+ </h3>
+ </div>
+
<div
v-if="quickAction == 'quickaction.bytebase.database.request'"
class="flex flex-col items-center w-28"
@@ -301,6 +328,12 @@ export default {
state.showModal = true;
};
+ const createDatabase = () => {
+ state.modalTitle = "Create database";
+ state.quickActionType = "quickaction.bytebase.database.request";
+ state.showModal = true;
+ };
+
const requestDatabase = () => {
state.modalTitle = "Request database";
state.quickActionType = "quickaction.bytebase.database.request";
@@ -318,6 +351,7 @@ export default {
return {
state,
createInstance,
+ createDatabase,
requestDatabase,
createEnvironment,
reorderEnvironment,
diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts
index d9dc55933d..e5c4db8633 100644
--- a/frontend/src/router/index.ts
+++ b/frontend/src/router/index.ts
@@ -83,7 +83,7 @@ const routes: Array<RouteRecordRaw> = [
"quickaction.bytebase.user.manage",
"quickaction.bytebase.instance.create",
"quickaction.bytebase.database.schema.update",
- "quickaction.bytebase.database.request",
+ "quickaction.bytebase.database.create",
"quickaction.bytebase.database.troubleshoot",
],
],
@@ -92,7 +92,7 @@ const routes: Array<RouteRecordRaw> = [
[
"quickaction.bytebase.instance.create",
"quickaction.bytebase.database.schema.update",
- "quickaction.bytebase.database.request",
+ "quickaction.bytebase.database.create",
"quickaction.bytebase.database.troubleshoot",
],
],
@@ -306,14 +306,14 @@ const routes: Array<RouteRecordRaw> = [
"OWNER",
[
"quickaction.bytebase.database.schema.update",
- "quickaction.bytebase.database.request",
+ "quickaction.bytebase.database.create",
],
],
[
"DBA",
[
"quickaction.bytebase.database.schema.update",
- "quickaction.bytebase.database.request",
+ "quickaction.bytebase.database.create",
],
],
[
diff --git a/frontend/src/types/bytebase.ts b/frontend/src/types/bytebase.ts
index e820725f24..fda012f967 100644
--- a/frontend/src/types/bytebase.ts
+++ b/frontend/src/types/bytebase.ts
@@ -630,7 +630,8 @@ export type EnvironmentQuickActionType =
export type InstanceQuickActionType = "quickaction.bytebase.instance.create";
export type UserQuickActionType = "quickaction.bytebase.user.manage";
export type DatabaseQuickActionType =
- | "quickaction.bytebase.database.request"
+ | "quickaction.bytebase.database.create" // Used by DBA and Owner
+ | "quickaction.bytebase.database.request" // Used by Developer
| "quickaction.bytebase.database.schema.update"
| "quickaction.bytebase.database.troubleshoot";