Skip to content

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

chore: move some settings to the dashboard (#11143)

ecmadaoc673c1c1902b
diff --git a/frontend/src/components/CommonSidebar.vue b/frontend/src/components/CommonSidebar.vue
index 9703455721..3bd5a8938f 100644
--- a/frontend/src/components/CommonSidebar.vue
+++ b/frontend/src/components/CommonSidebar.vue
@@ -86,6 +86,7 @@ export interface SidebarItem {
icon?: VNode;
hide?: boolean;
type: "route" | "div" | "divider" | "link";
+ expand?: boolean;
children?: SidebarItem[];
}
@@ -149,7 +150,10 @@ watch(
() => {
state.expandedSidebar.clear();
for (let i = 0; i < filteredSidebarList.value.length; i++) {
- if (filteredSidebarList.value[i].children.length > 0) {
+ if (
+ filteredSidebarList.value[i].children.length > 0 &&
+ filteredSidebarList.value[i].expand
+ ) {
state.expandedSidebar.add(`${i}`);
}
}
diff --git a/frontend/src/components/EnvironmentForm.vue b/frontend/src/components/EnvironmentForm.vue
index a2e2bd32d2..213cf73397 100644
--- a/frontend/src/components/EnvironmentForm.vue
+++ b/frontend/src/components/EnvironmentForm.vue
@@ -283,9 +283,9 @@ import { useRouter, onBeforeRouteLeave } from "vue-router";
import { DrawerContent, Switch } from "@/components/v2";
import ResourceIdField from "@/components/v2/Form/ResourceIdField.vue";
import {
- SETTING_ROUTE_WORKSPACE_SQL_REVIEW_DETAIL,
- SETTING_ROUTE_WORKSPACE_SQL_REVIEW_CREATE,
-} from "@/router/dashboard/workspaceSetting";
+ WORKSPACE_ROUTE_SQL_REVIEW_DETAIL,
+ WORKSPACE_ROUTE_SQL_REVIEW_CREATE,
+} from "@/router/dashboard/workspaceRoutes";
import {
hasFeature,
pushNotification,
@@ -409,14 +409,14 @@ const disableCopyDataPolicy = computed(() => {
const onSQLReviewPolicyClick = () => {
if (sqlReviewPolicy.value) {
router.push({
- name: SETTING_ROUTE_WORKSPACE_SQL_REVIEW_DETAIL,
+ name: WORKSPACE_ROUTE_SQL_REVIEW_DETAIL,
params: {
sqlReviewPolicySlug: sqlReviewPolicySlug(sqlReviewPolicy.value),
},
});
} else {
router.push({
- name: SETTING_ROUTE_WORKSPACE_SQL_REVIEW_CREATE,
+ name: WORKSPACE_ROUTE_SQL_REVIEW_CREATE,
query: {
environmentId: (props.environment as Environment).uid,
},
diff --git a/frontend/src/components/IdentityProviderCreateForm.vue b/frontend/src/components/IdentityProviderCreateForm.vue
index 118ff73256..22999a1d57 100644
--- a/frontend/src/components/IdentityProviderCreateForm.vue
+++ b/frontend/src/components/IdentityProviderCreateForm.vue
@@ -814,7 +814,7 @@ import { useI18n } from "vue-i18n";
import { useRouter } from "vue-router";
import ResourceIdField from "@/components/v2/Form/ResourceIdField.vue";
import { identityProviderClient } from "@/grpcweb";
-import { SETTING_ROUTE_WORKSPACE_SSO } from "@/router/dashboard/workspaceSetting";
+import { WORKSPACE_ROUTE_SSO } from "@/router/dashboard/workspaceRoutes";
import {
pushNotification,
useActuatorV1Store,
@@ -1238,7 +1238,7 @@ const handleDeleteButtonClick = async () => {
title: "Archive SSO succeed",
});
router.push({
- name: SETTING_ROUTE_WORKSPACE_SSO,
+ name: WORKSPACE_ROUTE_SSO,
});
};
@@ -1272,7 +1272,7 @@ const handleRestoreButtonClick = async () => {
const handleCancelButtonClick = () => {
router.push({
- name: SETTING_ROUTE_WORKSPACE_SSO,
+ name: WORKSPACE_ROUTE_SSO,
});
};
@@ -1333,7 +1333,7 @@ const handleCreateButtonClick = async () => {
title: "Create SSO succeed",
});
router.push({
- name: SETTING_ROUTE_WORKSPACE_SSO,
+ name: WORKSPACE_ROUTE_SSO,
});
};
diff --git a/frontend/src/components/IdentityProviderTable.vue b/frontend/src/components/IdentityProviderTable.vue
index adad685f27..538140aed5 100644
--- a/frontend/src/components/IdentityProviderTable.vue
+++ b/frontend/src/components/IdentityProviderTable.vue
@@ -28,7 +28,7 @@
import { computed } from "vue";
import { useI18n } from "vue-i18n";
import { useRouter } from "vue-router";
-import { SETTING_ROUTE_WORKSPACE_SSO_DETAIL } from "@/router/dashboard/workspaceSetting";
+import { WORKSPACE_ROUTE_SSO_DETAIL } from "@/router/dashboard/workspaceRoutes";
import { IdentityProvider } from "@/types/proto/v1/idp_service";
const props = defineProps<{
@@ -57,7 +57,7 @@ const columnList = computed(() => [
const clickIdentityProvider = function (section: number, row: number) {
const identityProvider = props.identityProviderList[row];
router.push({
- name: SETTING_ROUTE_WORKSPACE_SSO_DETAIL,
+ name: WORKSPACE_ROUTE_SSO_DETAIL,
params: {
ssoName: identityProvider.name,
},
diff --git a/frontend/src/components/IssueV1/components/IssueTableV1.vue b/frontend/src/components/IssueV1/components/IssueTableV1.vue
index defb34dc15..e0c9ee5237 100644
--- a/frontend/src/components/IssueV1/components/IssueTableV1.vue
+++ b/frontend/src/components/IssueV1/components/IssueTableV1.vue
@@ -88,20 +88,16 @@ const columnList = computed((): DataTableColumn<ComposedIssue>[] => {
innerHTML: highlight(issue.description),
}),
},
- {
- key: "status",
- className: "w-5 !p-0",
- render: (issue) => h(IssueStatusIconWithTaskSummary, { issue }),
- },
{
key: "title",
title: t("issue.table.name"),
resizable: true,
- render: (issue) => {
- return h("div", { class: "flex items-center overflow-hidden" }, [
+ render: (issue) =>
+ h("div", { class: "flex items-center overflow-hidden space-x-2" }, [
+ h(IssueStatusIconWithTaskSummary, { issue }),
h(
"div",
- { class: "whitespace-nowrap mr-2 text-control" },
+ { class: "whitespace-nowrap text-control" },
props.mode == "ALL"
? `${issue.projectEntity.key}-${issue.uid}`
: `#${issue.uid}`
@@ -123,8 +119,7 @@ const columnList = computed((): DataTableColumn<ComposedIssue>[] => {
),
}
),
- ]);
- },
+ ]),
},
{
key: "updateTime",
@@ -181,7 +176,7 @@ const columnList = computed((): DataTableColumn<ComposedIssue>[] => {
h(
"div",
{ class: "flex flex-row items-center overflow-hidden gap-x-2" },
- [
+ () => [
h(BBAvatar, { size: "SMALL", username: issue.creator }),
h("span", { class: "truncate" }, issue.creatorEntity.title),
]
diff --git a/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckBar/PlanCheckDetail.vue b/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckBar/PlanCheckDetail.vue
index 277ffc97b6..00d762c5ef 100644
--- a/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckBar/PlanCheckDetail.vue
+++ b/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckBar/PlanCheckDetail.vue
@@ -101,7 +101,7 @@ import { useI18n } from "vue-i18n";
import { useRouter } from "vue-router";
import { SQLRuleEditDialog } from "@/components/SQLReview/components";
import { PayloadValueType } from "@/components/SQLReview/components/RuleConfigComponents";
-import { SETTING_ROUTE_WORKSPACE_SQL_REVIEW } from "@/router/dashboard/workspaceSetting";
+import { WORKSPACE_ROUTE_SQL_REVIEW } from "@/router/dashboard/workspaceRoutes";
import { useReviewPolicyByEnvironmentName } from "@/store";
import {
GeneralErrorCode,
@@ -240,7 +240,7 @@ const errorCodeLink = (
title: t("sql-review.configure-policy"),
target: "__blank",
url: router.resolve({
- name: SETTING_ROUTE_WORKSPACE_SQL_REVIEW,
+ name: WORKSPACE_ROUTE_SQL_REVIEW,
}).fullPath,
};
default: {
diff --git a/frontend/src/components/Project/ProjectSidebarV1.vue b/frontend/src/components/Project/ProjectSidebarV1.vue
index 1f7a34b75a..61e0cb778b 100644
--- a/frontend/src/components/Project/ProjectSidebarV1.vue
+++ b/frontend/src/components/Project/ProjectSidebarV1.vue
@@ -140,7 +140,7 @@ const flattenProjectV1Routes = computed(() => {
return getFlattenProjectV1Routes(projectV1Routes);
});
-const filterprojectSidebarByPermissions = (
+const filterProjectSidebarByPermissions = (
sidebarList: ProjectSidebarItem[]
): ProjectSidebarItem[] => {
return sidebarList
@@ -154,7 +154,7 @@ const filterprojectSidebarByPermissions = (
})
.map((item) => ({
...item,
- children: filterprojectSidebarByPermissions(item.children ?? []),
+ children: filterProjectSidebarByPermissions(item.children ?? []),
}));
};
@@ -164,6 +164,7 @@ const projectSidebarItemList = computed((): ProjectSidebarItem[] => {
title: t("common.database"),
icon: h(Database),
type: "div",
+ expand: true,
children: [
{
title: t("common.databases"),
@@ -231,6 +232,7 @@ const projectSidebarItemList = computed((): ProjectSidebarItem[] => {
icon: h(Link),
type: "div",
hide: isDefaultProject.value,
+ expand: true,
children: [
{
title: t("common.gitops"),
@@ -249,6 +251,7 @@ const projectSidebarItemList = computed((): ProjectSidebarItem[] => {
icon: h(Users),
type: "div",
hide: isDefaultProject.value,
+ expand: true,
children: [
{
title: t("common.members"),
@@ -271,7 +274,7 @@ const projectSidebarItemList = computed((): ProjectSidebarItem[] => {
},
];
- return filterprojectSidebarByPermissions(sidebarList);
+ return filterProjectSidebarByPermissions(sidebarList);
});
const getItemClass = (item: SidebarItem) => {
diff --git a/frontend/src/components/ProjectMember/ProjectRoleTable/ProjectRoleTable.vue b/frontend/src/components/ProjectMember/ProjectRoleTable/ProjectRoleTable.vue
index 5182fcb289..e506aa9b69 100644
--- a/frontend/src/components/ProjectMember/ProjectRoleTable/ProjectRoleTable.vue
+++ b/frontend/src/components/ProjectMember/ProjectRoleTable/ProjectRoleTable.vue
@@ -1,6 +1,6 @@
<template>
<template v-for="[role, bindings] in roleGroup" :key="role">
- <p class="mb-2 text-base pl-2">{{ displayRoleTitle(role) }}</p>
+ <p class="mb-2 text-base">{{ displayRoleTitle(role) }}</p>
<BBGrid
:column-list="columnList"
:row-clickable="false"
diff --git a/frontend/src/components/SQLCheck/SQLCheckButton.vue b/frontend/src/components/SQLCheck/SQLCheckButton.vue
index 7ed43c8cdb..2f5f83d4e1 100644
--- a/frontend/src/components/SQLCheck/SQLCheckButton.vue
+++ b/frontend/src/components/SQLCheck/SQLCheckButton.vue
@@ -35,7 +35,7 @@
<template #link>
<router-link
v-if="hasManageSQLReviewPolicyPermission"
- :to="{ name: SETTING_ROUTE_WORKSPACE_SQL_REVIEW }"
+ :to="{ name: WORKSPACE_ROUTE_SQL_REVIEW }"
class="ml-1 normal-link underline"
>
{{ $t("common.go-to-configure") }}
@@ -69,7 +69,7 @@ import { computed, onUnmounted, ref } from "vue";
import { onMounted } from "vue";
import { useI18n } from "vue-i18n";
import { sqlServiceClient } from "@/grpcweb";
-import { SETTING_ROUTE_WORKSPACE_SQL_REVIEW } from "@/router/dashboard/workspaceSetting";
+import { WORKSPACE_ROUTE_SQL_REVIEW } from "@/router/dashboard/workspaceRoutes";
import { useCurrentUserV1, useSQLReviewStore } from "@/store";
import { ComposedDatabase } from "@/types";
import { DatabaseMetadata } from "@/types/proto/v1/database_service";
diff --git a/frontend/src/components/SQLReview/SQLReviewCreation.vue b/frontend/src/components/SQLReview/SQLReviewCreation.vue
index 817b37a7f5..489db7b486 100644
--- a/frontend/src/components/SQLReview/SQLReviewCreation.vue
+++ b/frontend/src/components/SQLReview/SQLReviewCreation.vue
@@ -41,7 +41,7 @@ import { reactive, computed, withDefaults } from "vue";
import { useI18n } from "vue-i18n";
import { useRouter } from "vue-router";
import { StepTab } from "@/components/v2";
-import { SETTING_ROUTE_WORKSPACE_SQL_REVIEW } from "@/router/dashboard/workspaceSetting";
+import { WORKSPACE_ROUTE_SQL_REVIEW } from "@/router/dashboard/workspaceRoutes";
import {
useCurrentUserV1,
pushNotification,
@@ -159,7 +159,7 @@ const onCancel = () => {
emit("cancel");
} else {
router.push({
- name: SETTING_ROUTE_WORKSPACE_SQL_REVIEW,
+ name: WORKSPACE_ROUTE_SQL_REVIEW,
});
}
};
diff --git a/frontend/src/components/SQLReview/SQLReviewPolicyTable.vue b/frontend/src/components/SQLReview/SQLReviewPolicyTable.vue
index e2a855babc..22c726e869 100644
--- a/frontend/src/components/SQLReview/SQLReviewPolicyTable.vue
+++ b/frontend/src/components/SQLReview/SQLReviewPolicyTable.vue
@@ -145,9 +145,9 @@ import { useRouter } from "vue-router";
import { BBButtonConfirm, BBGrid, BBGridColumn } from "@/bbkit";
import { EnvironmentV1Name } from "@/components/v2";
import {
- SETTING_ROUTE_WORKSPACE_SQL_REVIEW_CREATE,
- SETTING_ROUTE_WORKSPACE_SQL_REVIEW_DETAIL,
-} from "@/router/dashboard/workspaceSetting";
+ WORKSPACE_ROUTE_SQL_REVIEW_CREATE,
+ WORKSPACE_ROUTE_SQL_REVIEW_DETAIL,
+} from "@/router/dashboard/workspaceRoutes";
import {
pushNotification,
useCurrentUserV1,
@@ -234,7 +234,7 @@ const toggleReviewEnabled = async (review: SQLReviewPolicy, on: boolean) => {
const handleClickCreate = (environment: Environment) => {
if (hasUpdatePolicyPermission.value) {
router.push({
- name: SETTING_ROUTE_WORKSPACE_SQL_REVIEW_CREATE,
+ name: WORKSPACE_ROUTE_SQL_REVIEW_CREATE,
query: {
environmentId: extractEnvironmentResourceName(environment.name),
},
@@ -250,7 +250,7 @@ const handleClickCreate = (environment: Environment) => {
const handleClickEdit = (review: SQLReviewPolicy) => {
router.push({
- name: SETTING_ROUTE_WORKSPACE_SQL_REVIEW_DETAIL,
+ name: WORKSPACE_ROUTE_SQL_REVIEW_DETAIL,
params: {
sqlReviewPolicySlug: sqlReviewPolicySlug(review),
},
diff --git a/frontend/src/components/SlowQuery/Panel/SlowQueryPanel.vue b/frontend/src/components/SlowQuery/Panel/SlowQueryPanel.vue
index 6095639a6e..ed9fe2bbbc 100644
--- a/frontend/src/components/SlowQuery/Panel/SlowQueryPanel.vue
+++ b/frontend/src/components/SlowQuery/Panel/SlowQueryPanel.vue
@@ -9,7 +9,11 @@
@update:time="state.timeRange = $event"
>
<template #suffix>
- <NButton v-if="allowAdmin" type="default" @click="goConfig">
+ <NButton
+ v-if="allowAdmin"
+ type="default"
+ @click="state.showSetting = true"
+ >
{{ $t("common.configure") }}
</NButton>
<NButton
@@ -47,6 +51,15 @@
@close="selectedSlowQueryLog = undefined"
/>
</div>
+
+ <Drawer v-model:show="state.showSetting" width="auto">
+ <DrawerContent
+ :closable="true"
+ class="w-[calc(100vw-2rem)] lg:max-w-[64rem] xl:max-w-[72rem]"
+ >
+ <SlowQuerySettings />
+ </DrawerContent>
+ </Drawer>
</template>
<script lang="ts" setup>
@@ -54,8 +67,6 @@ import dayjs from "dayjs";
import { NButton } from "naive-ui";
import { computed, shallowRef, watch, reactive } from "vue";
import { useI18n } from "vue-i18n";
-import { useRouter } from "vue-router";
-import { SETTING_ROUTE_WORKSPACE_SLOW_QUERY } from "@/router/dashboard/workspaceSetting";
import {
pushNotification,
useCurrentUserV1,
@@ -72,6 +83,7 @@ import {
extractInstanceResourceName,
hasWorkspacePermissionV2,
} from "@/utils";
+import { SlowQuerySettings } from "../Settings";
import DetailPanel from "./DetailPanel.vue";
import LogFilter from "./LogFilter.vue";
import LogTable from "./LogTable.vue";
@@ -111,6 +123,7 @@ interface LocalState {
toTime: number | undefined;
};
params: SearchParams;
+ showSetting: boolean;
}
const defaultSlowQueryTimeRange = () => {
@@ -129,10 +142,10 @@ const state = reactive<LocalState>({
query: "",
scopes: [],
},
+ showSetting: false,
});
const { t } = useI18n();
-const router = useRouter();
const currentUser = useCurrentUserV1();
const slowQueryStore = useSlowQueryStore();
const loading = shallowRef(false);
@@ -233,12 +246,6 @@ const syncNow = async () => {
}
};
-const goConfig = () => {
- router.push({
- name: SETTING_ROUTE_WORKSPACE_SLOW_QUERY,
- });
-};
-
// Fetch the list while params changed.
watch(() => JSON.stringify(params.value), fetchSlowQueryLogList, {
immediate: true,
diff --git a/frontend/src/components/VCS/VCSCard.vue b/frontend/src/components/VCS/VCSCard.vue
index a3e8342636..5d5ee9a6b7 100644
--- a/frontend/src/components/VCS/VCSCard.vue
+++ b/frontend/src/components/VCS/VCSCard.vue
@@ -40,7 +40,7 @@
import { NButton } from "naive-ui";
import { PropType, computed } from "vue";
import { useRouter } from "vue-router";
-import { SETTING_ROUTE_WORKSPACE_GITOPS_DETAIL } from "@/router/dashboard/workspaceSetting";
+import { WORKSPACE_ROUTE_GITOPS_DETAIL } from "@/router/dashboard/workspaceRoutes";
import { useCurrentUserV1 } from "@/store";
import { ExternalVersionControl } from "@/types/proto/v1/externalvs_service";
import { hasWorkspacePermissionV2, vcsSlugV1 } from "@/utils";
@@ -64,7 +64,7 @@ const hasUpdateVCSPermission = computed(() => {
const editVCS = () => {
router.push({
- name: SETTING_ROUTE_WORKSPACE_GITOPS_DETAIL,
+ name: WORKSPACE_ROUTE_GITOPS_DETAIL,
params: {
vcsSlug: vcsSlugV1(props.vcs),
},
diff --git a/frontend/src/components/VCS/VCSSetupWizard.vue b/frontend/src/components/VCS/VCSSetupWizard.vue
index f2a3483e8d..ca873685ca 100644
--- a/frontend/src/components/VCS/VCSSetupWizard.vue
+++ b/frontend/src/components/VCS/VCSSetupWizard.vue
@@ -34,7 +34,7 @@ import { reactive, computed, onUnmounted, onMounted } from "vue";
import { useI18n } from "vue-i18n";
import { useRouter } from "vue-router";
import { StepTab } from "@/components/v2";
-import { SETTING_ROUTE_WORKSPACE_GITOPS } from "@/router/dashboard/workspaceSetting";
+import { WORKSPACE_ROUTE_GITOPS } from "@/router/dashboard/workspaceRoutes";
import { pushNotification, useVCSV1Store } from "@/store";
import {
isValidVCSApplicationIdOrSecret,
@@ -255,7 +255,7 @@ const tryFinishSetup = () => {
})
.then((vcs: ExternalVersionControl) => {
router.push({
- name: SETTING_ROUTE_WORKSPACE_GITOPS,
+ name: WORKSPACE_ROUTE_GITOPS,
});
pushNotification({
module: "bytebase",
@@ -269,7 +269,7 @@ const tryFinishSetup = () => {
const cancelSetup = () => {
router.push({
- name: SETTING_ROUTE_WORKSPACE_GITOPS,
+ name: WORKSPACE_ROUTE_GITOPS,
});
};
</script>
diff --git a/frontend/src/router/dashboard/environmentV1.ts b/frontend/src/router/dashboard/environmentV1.ts
index a11960a433..fba17c01a3 100644
--- a/frontend/src/router/dashboard/environmentV1.ts
+++ b/frontend/src/router/dashboard/environmentV1.ts
@@ -1,5 +1,4 @@
import { RouteLocationNormalized, RouteRecordRaw } from "vue-router";
-import { t } from "@/plugins/i18n";
import { useEnvironmentV1Store } from "@/store";
import { environmentNamePrefix } from "@/store/modules/v1/common";
import { unknownEnvironment } from "@/types";
@@ -9,24 +8,6 @@ import { ENVIRONMENT_V1_ROUTE_DASHBOARD } from "./workspaceRoutes";
export const ENVIRONMENT_V1_ROUTE_DETAIL = `${ENVIRONMENT_V1_ROUTE_DASHBOARD}.detail`;
const environmentV1Routes: RouteRecordRaw[] = [
- {
- path: "environments",
- name: ENVIRONMENT_V1_ROUTE_DASHBOARD,
- meta: {
- title: () => t("common.environments"),
- getQuickActionList: () => {
- return [
- "quickaction.bb.environment.create",
- "quickaction.bb.environment.reorder",
- ];
- },
- },
- components: {
- content: () => import("@/views/EnvironmentDashboard.vue"),
- leftSidebar: DashboardSidebar,
- },
- props: { content: true, leftSidebar: true },
- },
{
path: "environments/:environmentId",
name: ENVIRONMENT_V1_ROUTE_DETAIL,
diff --git a/frontend/src/router/dashboard/instance.ts b/frontend/src/router/dashboard/instance.ts
index 9a8b249b2e..6668d800dd 100644
--- a/frontend/src/router/dashboard/instance.ts
+++ b/frontend/src/router/dashboard/instance.ts
@@ -1,27 +1,11 @@
import { RouteRecordRaw } from "vue-router";
import InstanceLayout from "@/layouts/InstanceLayout.vue";
-import { t } from "@/plugins/i18n";
import DashboardSidebar from "@/views/DashboardSidebar.vue";
import { INSTANCE_ROUTE_DASHBOARD } from "./workspaceRoutes";
export const INSTANCE_ROUTE_DETAIL = `${INSTANCE_ROUTE_DASHBOARD}.detail`;
const instanceRoutes: RouteRecordRaw[] = [
- {
- path: "instances",
- name: INSTANCE_ROUTE_DASHBOARD,
- meta: {
- title: () => t("common.instances"),
- getQuickActionList: () => {
- return ["quickaction.bb.instance.create"];
- },
- },
- components: {
- content: () => import("@/views/InstanceDashboard.vue"),
- leftSidebar: DashboardSidebar,
- },
- props: { content: true, leftSidebar: true },
- },
{
path: "instances/:instanceId",
components: {
diff --git a/frontend/src/router/dashboard/projectV1.ts b/frontend/src/router/dashboard/projectV1.ts
index 0f480e9971..c2227e7243 100644
--- a/frontend/src/router/dashboard/projectV1.ts
+++ b/frontend/src/router/dashboard/projectV1.ts
@@ -1,7 +1,6 @@
import { RouteRecordRaw } from "vue-router";
import ProjectSidebarV1 from "@/components/Project/ProjectSidebarV1.vue";
import { t } from "@/plugins/i18n";
-import DashboardSidebar from "@/views/DashboardSidebar.vue";
import { PROJECT_V1_ROUTE_DASHBOARD } from "./workspaceRoutes";
export const PROJECT_V1_ROUTE_DETAIL = `${PROJECT_V1_ROUTE_DASHBOARD}.detail`;
@@ -34,21 +33,6 @@ export const PROJECT_V1_ROUTE_MEMBERS = `${PROJECT_V1_ROUTE_DASHBOARD}.members`;
export const PROJECT_V1_ROUTE_SETTINGS = `${PROJECT_V1_ROUTE_DASHBOARD}.settings`;
const projectV1Routes: RouteRecordRaw[] = [
- {
- path: "projects",
- name: PROJECT_V1_ROUTE_DASHBOARD,
- meta: {
- title: () => t("common.projects"),
- getQuickActionList: () => {
- return ["quickaction.bb.project.create"];
- },
- },
- components: {
- content: () => import("@/views/ProjectDashboard.vue"),
- leftSidebar: DashboardSidebar,
- },
- props: { content: true, leftSidebar: true },
- },
{
path: "projects/:projectId",
components: {
diff --git a/frontend/src/router/dashboard/workspace.ts b/frontend/src/router/dashboard/workspace.ts
index 8051bedb14..2e436a5f10 100644
--- a/frontend/src/router/dashboard/workspace.ts
+++ b/frontend/src/router/dashboard/workspace.ts
@@ -1,15 +1,32 @@
import { startCase } from "lodash-es";
import { RouteRecordRaw } from "vue-router";
import { t } from "@/plugins/i18n";
-import DashboardSidebar from "@/views/DashboardSidebar.vue";
import Home from "@/views/Home.vue";
import SettingSidebar from "@/views/SettingSidebar.vue";
import {
+ PROJECT_V1_ROUTE_DASHBOARD,
+ INSTANCE_ROUTE_DASHBOARD,
+ ENVIRONMENT_V1_ROUTE_DASHBOARD,
WORKSPACE_HOME_MODULE,
WORKSPACE_ROUTE_SLOW_QUERY,
WORKSPACE_ROUTE_EXPORT_CENTER,
WORKSPACE_ROUTE_ANOMALY_CENTER,
WORKSPACE_ROUTE_USER_PROFILE,
+ WORKSPACE_ROUTE_SQL_REVIEW,
+ WORKSPACE_ROUTE_SQL_REVIEW_CREATE,
+ WORKSPACE_ROUTE_SQL_REVIEW_DETAIL,
+ WORKSPACE_ROUTE_SCHEMA_TEMPLATE,
+ WORKSPACE_ROUTE_CUSTOM_APPROVAL,
+ WORKSPACE_ROUTE_RISK_CENTER,
+ WORKSPACE_ROUTE_SENSITIVE_DATA,
+ WORKSPACE_ROUTE_AUDIT_LOG,
+ WORKSPACE_ROUTE_GITOPS,
+ WORKSPACE_ROUTE_GITOPS_CREATE,
+ WORKSPACE_ROUTE_GITOPS_DETAIL,
+ WORKSPACE_ROUTE_SSO,
+ WORKSPACE_ROUTE_SSO_CREATE,
+ WORKSPACE_ROUTE_SSO_DETAIL,
+ WORKSPACE_ROUTE_MAIL_DELIVERY,
} from "./workspaceRoutes";
const workspaceRoutes: RouteRecordRaw[] = [
@@ -30,7 +47,7 @@ const workspaceRoutes: RouteRecordRaw[] = [
},
components: {
content: Home,
- leftSidebar: DashboardSidebar,
+ leftSidebar: () => import("@/views/DashboardSidebar.vue"),
},
props: {
content: true,
@@ -38,25 +55,66 @@ const workspaceRoutes: RouteRecordRaw[] = [
},
},
{
- path: "slow-query",
- name: WORKSPACE_ROUTE_SLOW_QUERY,
- meta: { title: () => startCase(t("slow-query.slow-queries")) },
+ path: "projects",
+ name: PROJECT_V1_ROUTE_DASHBOARD,
+ meta: {
+ title: () => t("common.projects"),
+ getQuickActionList: () => {
+ return ["quickaction.bb.project.create"];
+ },
+ requiredWorkspacePermissionList: () => ["bb.projects.list"],
+ },
components: {
- content: () => import("@/views/SlowQuery/SlowQueryDashboard.vue"),
- leftSidebar: DashboardSidebar,
+ content: () => import("@/views/ProjectDashboard.vue"),
+ leftSidebar: () => import("@/views/DashboardSidebar.vue"),
},
- props: {
- content: true,
- leftSidebar: true,
+ props: { content: true, leftSidebar: true },
+ },
+ {
+ path: "instances",
+ name: INSTANCE_ROUTE_DASHBOARD,
+ meta: {
+ title: () => t("common.instances"),
+ getQuickActionList: () => {
+ return ["quickaction.bb.instance.create"];
+ },
+ requiredWorkspacePermissionList: () => ["bb.instances.list"],
},
+ components: {
+ content: () => import("@/views/InstanceDashboard.vue"),
+ leftSidebar: () => import("@/views/DashboardSidebar.vue"),
+ },
+ props: { content: true, leftSidebar: true },
+ },
+ {
+ path: "environments",
+ name: ENVIRONMENT_V1_ROUTE_DASHBOARD,
+ meta: {
+ title: () => t("common.environments"),
+ getQuickActionList: () => {
+ return [
+ "quickaction.bb.environment.create",
+ "quickaction.bb.environment.reorder",
+ ];
+ },
+ requiredWorkspacePermissionList: () => ["bb.environments.list"],
+ },
+ components: {
+ content: () => import("@/views/EnvironmentDashboard.vue"),
+ leftSidebar: () => import("@/views/DashboardSidebar.vue"),
+ },
+ props: { content: true, leftSidebar: true },
},
{
path: "export-center",
name: WORKSPACE_ROUTE_EXPORT_CENTER,
- meta: { title: () => startCase(t("export-center.self")) },
+ meta: {
+ title: () => startCase(t("export-center.self")),
+ requiredWorkspacePermissionList: () => ["bb.projects.getIamPolicy"],
+ },
components: {
content: () => import("@/views/ExportCenter/index.vue"),
- leftSidebar: DashboardSidebar,
+ leftSidebar: () => import("@/views/DashboardSidebar.vue"),
},
props: {
content: true,
@@ -69,7 +127,7 @@ const workspaceRoutes: RouteRecordRaw[] = [
meta: { title: () => t("anomaly-center") },
components: {
content: () => import("@/views/AnomalyCenterDashboard.vue"),
- leftSidebar: DashboardSidebar,
+ leftSidebar: () => import("@/views/DashboardSidebar.vue"),
},
props: {
content: true,
@@ -96,7 +154,7 @@ const workspaceRoutes: RouteRecordRaw[] = [
name: "error.403",
components: {
content: () => import("@/views/Page403.vue"),
- leftSidebar: DashboardSidebar,
+ leftSidebar: () => import("@/views/DashboardSidebar.vue"),
},
props: {
content: true,
@@ -108,12 +166,234 @@ const workspaceRoutes: RouteRecordRaw[] = [
name: "error.404",
components: {
content: () => import("@/views/Page404.vue"),
- leftSidebar: DashboardSidebar,
+ leftSidebar: () => import("@/views/DashboardSidebar.vue"),
+ },
+ props: {
+ content: true,
+ leftSidebar: true,
+ },
+ },
+ {
+ path: "sql-review",
+ meta: {
+ title: () => t("sql-review.title"),
+ requiredWorkspacePermissionList: () => ["bb.policies.get"],
+ },
+ components: {
+ content: () => import("@/layouts/SettingLayout.vue"),
+ leftSidebar: () => import("@/views/DashboardSidebar.vue"),
+ },
+ props: {
+ content: true,
+ leftSidebar: true,
+ },
+ children: [
+ {
+ path: "",
+ name: WORKSPACE_ROUTE_SQL_REVIEW,
+ meta: {
+ title: () => t("sql-review.title"),
+ requiredWorkspacePermissionList: () => ["bb.policies.get"],
+ },
+ component: () => import("@/views/SettingWorkspaceSQLReview.vue"),
+ props: true,
+ },
+ {
+ path: "new",
+ name: WORKSPACE_ROUTE_SQL_REVIEW_CREATE,
+ meta: {
+ title: () => t("sql-review.create.breadcrumb"),
+ requiredWorkspacePermissionList: () => ["bb.policies.create"],
+ },
+ component: () => import("@/views/SettingWorkspaceSQLReviewCreate.vue"),
+ props: true,
+ },
+ {
+ path: ":sqlReviewPolicySlug",
+ name: WORKSPACE_ROUTE_SQL_REVIEW_DETAIL,
+ meta: {
+ title: () => t("sql-review.title"),
+ requiredWorkspacePermissionList: () => ["bb.policies.get"],
+ },
+ component: () => import("@/views/SettingWorkspaceSQLReviewDetail.vue"),
+ props: true,
+ },
+ ],
+ },
+ {
+ path: "gitops",
+ meta: {
+ title: () => t("settings.sidebar.gitops"),
+ },
+ components: {
+ content: () => import("@/layouts/SettingLayout.vue"),
+ leftSidebar: () => import("@/views/DashboardSidebar.vue"),
},
props: {
content: true,
leftSidebar: true,
},
+ children: [
+ {
+ path: "",
+ name: WORKSPACE_ROUTE_GITOPS,
+ meta: {
+ requiredWorkspacePermissionList: () => [
+ "bb.externalVersionControls.list",
+ ],
+ },
+ component: () => import("@/views/SettingWorkspaceVCS.vue"),
+ props: true,
+ },
+ {
+ path: "new",
+ name: WORKSPACE_ROUTE_GITOPS_CREATE,
+ meta: {
+ title: () => t("repository.add-git-provider"),
+ requiredWorkspacePermissionList: () => [
+ "bb.externalVersionControls.create",
+ ],
+ },
+ component: () => import("@/views/SettingWorkspaceVCSCreate.vue"),
+ props: true,
+ },
+ {
+ path: ":vcsSlug",
+ name: WORKSPACE_ROUTE_GITOPS_DETAIL,
+ meta: {
+ requiredWorkspacePermissionList: () => [
+ "bb.externalVersionControls.get",
+ ],
+ },
+ component: () => import("@/views/SettingWorkspaceVCSDetail.vue"),
+ props: true,
+ },
+ ],
+ },
+ {
+ path: "sso",
+ meta: {
+ title: () => t("settings.sidebar.sso"),
+ },
+ components: {
+ content: () => import("@/layouts/SettingLayout.vue"),
+ leftSidebar: () => import("@/views/DashboardSidebar.vue"),
+ },
+ props: {
+ content: true,
+ leftSidebar: true,
+ },
+ children: [
+ {
+ path: "",
+ name: WORKSPACE_ROUTE_SSO,
+ meta: {
+ requiredWorkspacePermissionList: () => ["bb.settings.get"],
+ },
+ component: () => import("@/views/SettingWorkspaceSSO.vue"),
+ },
+ {
+ path: "new",
+ name: WORKSPACE_ROUTE_SSO_CREATE,
+ meta: {
+ requiredWorkspacePermissionList: () => [
+ "bb.identityProviders.create",
+ ],
+ },
+ component: () => import("@/views/SettingWorkspaceSSODetail.vue"),
+ },
+ {
+ path: ":ssoName",
+ name: WORKSPACE_ROUTE_SSO_DETAIL,
+ meta: {
+ requiredWorkspacePermissionList: () => ["bb.identityProviders.get"],
+ },
+ component: () => import("@/views/SettingWorkspaceSSODetail.vue"),
+ props: true,
+ },
+ ],
+ },
+ {
+ path: "",
+ components: {
+ content: () => import("@/layouts/SettingLayout.vue"),
+ leftSidebar: () => import("@/views/DashboardSidebar.vue"),
+ },
+ props: true,
+ children: [
+ {
+ path: "custom-approval",
+ name: WORKSPACE_ROUTE_CUSTOM_APPROVAL,
+ meta: {
+ title: () => t("custom-approval.self"),
+ requiredWorkspacePermissionList: () => ["bb.settings.get"],
+ },
+ component: () => import("@/views/SettingWorkspaceCustomApproval.vue"),
+ props: true,
+ },
+ {
+ path: "schema-template",
+ name: WORKSPACE_ROUTE_SCHEMA_TEMPLATE,
+ meta: {
+ title: () => startCase(t("schema-template.self")),
+ requiredWorkspacePermissionList: () => ["bb.policies.get"],
+ },
+ component: () => import("@/views/SettingWorkspaceSchemaTemplate.vue"),
+ props: true,
+ },
+ {
+ path: "slow-query",
+ name: WORKSPACE_ROUTE_SLOW_QUERY,
+ meta: {
+ title: () => startCase(t("slow-query.self")),
+ requiredWorkspacePermissionList: () => ["bb.settings.get"],
+ },
+ component: () => import("@/views/SettingWorkspaceSlowQuery.vue"),
+ props: true,
+ },
+ {
+ path: "risk-center",
+ name: WORKSPACE_ROUTE_RISK_CENTER,
+ meta: {
+ title: () => t("custom-approval.risk.risk-center"),
+ requiredWorkspacePermissionList: () => [
+ "bb.settings.get",
+ "bb.risks.list",
+ ],
+ },
+ component: () => import("@/views/SettingWorkspaceRiskCenter.vue"),
+ props: true,
+ },
+ {
+ path: "sensitive-data",
+ name: WORKSPACE_ROUTE_SENSITIVE_DATA,
+ meta: {
+ title: () => t("settings.sidebar.sensitive-data"),
+ requiredWorkspacePermissionList: () => ["bb.policies.get"],
+ },
+ component: () => import("@/views/SettingWorkspaceSensitiveData.vue"),
+ props: true,
+ },
+ {
+ path: "audit-log",
+ name: WORKSPACE_ROUTE_AUDIT_LOG,
+ meta: {
+ title: () => t("settings.sidebar.audit-log"),
+ requiredWorkspacePermissionList: () => ["bb.settings.get"],
+ },
+ component: () => import("@/views/SettingWorkspaceAuditLog.vue"),
+ props: true,
+ },
+ {
+ path: "mail-delivery",
+ name: WORKSPACE_ROUTE_MAIL_DELIVERY,
+ meta: {
+ title: () => t("settings.sidebar.mail-delivery"),
+ requiredWorkspacePermissionList: () => ["bb.settings.get"],
+ },
+ component: () => import("@/views/SettingWorkspaceMailDelivery.vue"),
+ },
+ ],
},
];
diff --git a/frontend/src/router/dashboard/workspaceRoutes.ts b/frontend/src/router/dashboard/workspaceRoutes.ts
index d89a525a3c..13a09865e5 100644
--- a/frontend/src/router/dashboard/workspaceRoutes.ts
+++ b/frontend/src/router/dashboard/workspaceRoutes.ts
@@ -7,4 +7,23 @@ export const WORKSPACE_ROUTE_USER_PROFILE = "workspace.user-profile";
export const DATABASE_ROUTE_DASHBOARD = "workspace.database";
export const INSTANCE_ROUTE_DASHBOARD = "workspace.instance";
export const PROJECT_V1_ROUTE_DASHBOARD = "workspace.project";
-export const ENVIRONMENT_V1_ROUTE_DASHBOARD = `workspace.environment`;
+export const ENVIRONMENT_V1_ROUTE_DASHBOARD = "workspace.environment";
+
+export const WORKSPACE_ROUTE_SQL_REVIEW = "workspace.sql-review";
+export const WORKSPACE_ROUTE_SQL_REVIEW_CREATE = `${WORKSPACE_ROUTE_SQL_REVIEW}.create`;
+export const WORKSPACE_ROUTE_SQL_REVIEW_DETAIL = `${WORKSPACE_ROUTE_SQL_REVIEW}.detail`;
+
+export const WORKSPACE_ROUTE_SCHEMA_TEMPLATE = "workspace.schema-template";
+export const WORKSPACE_ROUTE_CUSTOM_APPROVAL = "workspace.custom-approval";
+export const WORKSPACE_ROUTE_RISK_CENTER = "workspace.risk-center";
+export const WORKSPACE_ROUTE_SENSITIVE_DATA = "workspace.sensitive-data";
+export const WORKSPACE_ROUTE_AUDIT_LOG = "workspace.audit-log";
+export const WORKSPACE_ROUTE_MAIL_DELIVERY = "workspace.mail-delivery";
+
+export const WORKSPACE_ROUTE_GITOPS = "workspace.gitops";
+export const WORKSPACE_ROUTE_GITOPS_CREATE = `${WORKSPACE_ROUTE_GITOPS}.create`;
+export const WORKSPACE_ROUTE_GITOPS_DETAIL = `${WORKSPACE_ROUTE_GITOPS}.detail`;
+
+export const WORKSPACE_ROUTE_SSO = "workspace.sso";
+export const WORKSPACE_ROUTE_SSO_CREATE = `${WORKSPACE_ROUTE_SSO}.create`;
+export const WORKSPACE_ROUTE_SSO_DETAIL = `${WORKSPACE_ROUTE_SSO}.detail`;
diff --git a/frontend/src/router/dashboard/workspaceSetting.ts b/frontend/src/router/dashboard/workspaceSetting.ts
index d1b605d3cf..e51df9c58b 100644
--- a/frontend/src/router/dashboard/workspaceSetting.ts
+++ b/frontend/src/router/dashboard/workspaceSetting.ts
@@ -1,12 +1,5 @@
-import { startCase } from "lodash-es";
-import { RouteLocationNormalized, RouteRecordRaw } from "vue-router";
+import { RouteRecordRaw } from "vue-router";
import { t } from "@/plugins/i18n";
-import {
- useIdentityProviderStore,
- useSQLReviewStore,
- useVCSV1Store,
-} from "@/store";
-import { uidFromSlug } from "@/utils";
import SettingSidebar from "@/views/SettingSidebar.vue";
export const SETTING_ROUTE = "setting";
@@ -16,23 +9,7 @@ export const SETTING_ROUTE_PROFILE_TWO_FACTOR = `${SETTING_ROUTE_PROFILE}.two-fa
export const SETTING_ROUTE_WORKSPACE_GENERAL = `${SETTING_ROUTE_WORKSPACE}.general`;
export const SETTING_ROUTE_WORKSPACE_MEMBER = `${SETTING_ROUTE_WORKSPACE}.member`;
export const SETTING_ROUTE_WORKSPACE_ROLE = `${SETTING_ROUTE_WORKSPACE}.role`;
-export const SETTING_ROUTE_WORKSPACE_SSO = `${SETTING_ROUTE_WORKSPACE}.sso`;
-export const SETTING_ROUTE_WORKSPACE_SSO_CREATE = `${SETTING_ROUTE_WORKSPACE_SSO}.create`;
-export const SETTING_ROUTE_WORKSPACE_SSO_DETAIL = `${SETTING_ROUTE_WORKSPACE_SSO}.detail`;
-export const SETTING_ROUTE_WORKSPACE_SENSITIVE_DATA = `${SETTING_ROUTE_WORKSPACE}.sensitive-data`;
-export const SETTING_ROUTE_WORKSPACE_RISK_CENTER = `${SETTING_ROUTE_WORKSPACE}.risk-center`;
-export const SETTING_ROUTE_WORKSPACE_CUSTOM_APPROVAL = `${SETTING_ROUTE_WORKSPACE}.custom-approval`;
-export const SETTING_ROUTE_WORKSPACE_SLOW_QUERY = `${SETTING_ROUTE_WORKSPACE}.slow-query`;
-export const SETTING_ROUTE_WORKSPACE_SCHEMA_TEMPLATE = `${SETTING_ROUTE_WORKSPACE}.schema-template`;
-export const SETTING_ROUTE_WORKSPACE_GITOPS = `${SETTING_ROUTE_WORKSPACE}.gitops`;
-export const SETTING_ROUTE_WORKSPACE_GITOPS_CREATE = `${SETTING_ROUTE_WORKSPACE_GITOPS}.create`;
-export const SETTING_ROUTE_WORKSPACE_GITOPS_DETAIL = `${SETTING_ROUTE_WORKSPACE_GITOPS}.detail`;
-export const SETTING_ROUTE_WORKSPACE_MAIL_DELIVERY = `${SETTING_ROUTE_WORKSPACE}.mail-delivery`;
export const SETTING_ROUTE_WORKSPACE_SUBSCRIPTION = `${SETTING_ROUTE_WORKSPACE}.subscription`;
-export const SETTING_ROUTE_WORKSPACE_SQL_REVIEW = `${SETTING_ROUTE_WORKSPACE}.sql-review`;
-export const SETTING_ROUTE_WORKSPACE_SQL_REVIEW_CREATE = `${SETTING_ROUTE_WORKSPACE_SQL_REVIEW}.create`;
-export const SETTING_ROUTE_WORKSPACE_SQL_REVIEW_DETAIL = `${SETTING_ROUTE_WORKSPACE_SQL_REVIEW}.detail`;
-export const SETTING_ROUTE_WORKSPACE_AUDIT_LOG = `${SETTING_ROUTE_WORKSPACE}.audit-log`;
export const SETTING_ROUTE_WORKSPACE_DEBUG_LOG = `${SETTING_ROUTE_WORKSPACE}.debug-log`;
export const SETTING_ROUTE_WORKSPACE_ARCHIVE = `${SETTING_ROUTE_WORKSPACE}.archive`;
@@ -94,146 +71,6 @@ const workspaceSettingRoutes: RouteRecordRaw[] = [
component: () => import("@/views/SettingWorkspaceRole.vue"),
props: true,
},
- {
- path: "sso",
- name: SETTING_ROUTE_WORKSPACE_SSO,
- meta: {
- title: () => t("settings.sidebar.sso"),
- requiredWorkspacePermissionList: () => ["bb.settings.get"],
- },
- component: () => import("@/views/SettingWorkspaceSSO.vue"),
- },
- {
- path: "sso/new",
- name: SETTING_ROUTE_WORKSPACE_SSO_CREATE,
- meta: {
- title: () => t("settings.sidebar.sso"),
- requiredWorkspacePermissionList: () => [
- "bb.identityProviders.create",
- ],
- },
- component: () => import("@/views/SettingWorkspaceSSODetail.vue"),
- },
- {
- path: "sso/:ssoName",
- name: SETTING_ROUTE_WORKSPACE_SSO_DETAIL,
- meta: {
- title: (route: RouteLocationNormalized) => {
- const name = route.params.ssoName as string;
- return (
- useIdentityProviderStore().getIdentityProviderByName(name)
- ?.title || t("settings.sidebar.sso")
- );
- },
- requiredWorkspacePermissionList: () => ["bb.identityProviders.get"],
- },
- component: () => import("@/views/SettingWorkspaceSSODetail.vue"),
- props: true,
- },
- {
- path: "sensitive-data",
- name: SETTING_ROUTE_WORKSPACE_SENSITIVE_DATA,
- meta: {
- title: () => t("settings.sidebar.sensitive-data"),
- requiredWorkspacePermissionList: () => ["bb.policies.get"],
- },
- component: () => import("@/views/SettingWorkspaceSensitiveData.vue"),
- props: true,
- },
- {
- path: "risk-center",
- name: SETTING_ROUTE_WORKSPACE_RISK_CENTER,
- meta: {
- title: () => t("custom-approval.risk.risk-center"),
- requiredWorkspacePermissionList: () => [
- "bb.settings.get",
- "bb.risks.list",
- ],
- },
- component: () => import("@/views/SettingWorkspaceRiskCenter.vue"),
- props: true,
- },
- {
- path: "custom-approval",
- name: SETTING_ROUTE_WORKSPACE_CUSTOM_APPROVAL,
- meta: {
- title: () => t("custom-approval.self"),
- requiredWorkspacePermissionList: () => ["bb.settings.get"],
- },
- component: () => import("@/views/SettingWorkspaceCustomApproval.vue"),
- props: true,
- },
- {
- path: "slow-query",
- name: SETTING_ROUTE_WORKSPACE_SLOW_QUERY,
- meta: {
- title: () => startCase(t("slow-query.self")),
- requiredWorkspacePermissionList: () => ["bb.settings.get"],
- },
- component: () => import("@/views/SettingWorkspaceSlowQuery.vue"),
- props: true,
- },
- {
- path: "schema-template",
- name: SETTING_ROUTE_WORKSPACE_SCHEMA_TEMPLATE,
- meta: {
- title: () => startCase(t("schema-template.self")),
- requiredWorkspacePermissionList: () => ["bb.policies.get"],
- },
- component: () => import("@/views/SettingWorkspaceSchemaTemplate.vue"),
- props: true,
- },
- {
- path: "gitops",
- name: SETTING_ROUTE_WORKSPACE_GITOPS,
- meta: {
- title: () => t("settings.sidebar.gitops"),
- requiredWorkspacePermissionList: () => [
- "bb.externalVersionControls.list",
- ],
- },
- component: () => import("@/views/SettingWorkspaceVCS.vue"),
- props: true,
- },
- {
- path: "gitops/new",
- name: SETTING_ROUTE_WORKSPACE_GITOPS_CREATE,
- meta: {
- title: () => t("repository.add-git-provider"),
- requiredWorkspacePermissionList: () => [
- "bb.externalVersionControls.create",
- ],
- },
- component: () => import("@/views/SettingWorkspaceVCSCreate.vue"),
- props: true,
- },
- {
- path: "gitops/:vcsSlug",
- name: SETTING_ROUTE_WORKSPACE_GITOPS_DETAIL,
- meta: {
- title: (route: RouteLocationNormalized) => {
- const slug = route.params.vcsSlug as string;
- return (
- useVCSV1Store().getVCSByUid(uidFromSlug(slug))?.title ??
- t("settings.sidebar.gitops")
- );
- },
- requiredWorkspacePermissionList: () => [
- "bb.externalVersionControls.get",
- ],
- },
- component: () => import("@/views/SettingWorkspaceVCSDetail.vue"),
- props: true,
- },
- {
- path: "mail-delivery",
- name: SETTING_ROUTE_WORKSPACE_MAIL_DELIVERY,
- meta: {
- title: () => t("settings.sidebar.mail-delivery"),
- requiredWorkspacePermissionList: () => ["bb.settings.get"],
- },
- component: () => import("@/views/SettingWorkspaceMailDelivery.vue"),
- },
{
path: "subscription",
name: SETTING_ROUTE_WORKSPACE_SUBSCRIPTION,
@@ -244,54 +81,6 @@ const workspaceSettingRoutes: RouteRecordRaw[] = [
component: () => import("@/views/SettingWorkspaceSubscription.vue"),
props: true,
},
- {
- path: "sql-review",
- name: SETTING_ROUTE_WORKSPACE_SQL_REVIEW,
- meta: {
- title: () => t("sql-review.title"),
- requiredWorkspacePermissionList: () => ["bb.policies.get"],
- },
- component: () => import("@/views/SettingWorkspaceSQLReview.vue"),
- props: true,
- },
- {
- path: "sql-review/new",
- name: SETTING_ROUTE_WORKSPACE_SQL_REVIEW_CREATE,
- meta: {
- title: () => t("sql-review.create.breadcrumb"),
- requiredWorkspacePermissionList: () => ["bb.policies.create"],
- },
- component: () => import("@/views/SettingWorkspaceSQLReviewCreate.vue"),
- props: true,
- },
- {
- path: "sql-review/:sqlReviewPolicySlug",
- name: SETTING_ROUTE_WORKSPACE_SQL_REVIEW_DETAIL,
- meta: {
- title: (route: RouteLocationNormalized) => {
- const slug = route.params.sqlReviewPolicySlug as string;
- const environmentUID = String(uidFromSlug(slug));
- const policy =
- useSQLReviewStore().getReviewPolicyByEnvironmentUID(
- environmentUID
- );
- return policy?.name ?? t("sql-review.title");
- },
- requiredWorkspacePermissionList: () => ["bb.policies.get"],
- },
- component: () => import("@/views/SettingWorkspaceSQLReviewDetail.vue"),
- props: true,
- },
- {
- path: "audit-log",
- name: SETTING_ROUTE_WORKSPACE_AUDIT_LOG,
- meta: {
- title: () => t("settings.sidebar.audit-log"),
- requiredWorkspacePermissionList: () => ["bb.settings.get"],
- },
- component: () => import("@/views/SettingWorkspaceAuditLog.vue"),
- props: true,
- },
{
path: "debug-log",
name: SETTING_ROUTE_WORKSPACE_DEBUG_LOG,
diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts
index d6af64dd19..b825cf5e19 100644
--- a/frontend/src/router/index.ts
+++ b/frontend/src/router/index.ts
@@ -31,10 +31,6 @@ import {
INSTANCE_ROUTE_DASHBOARD,
PROJECT_V1_ROUTE_DASHBOARD,
WORKSPACE_HOME_MODULE,
- WORKSPACE_ROUTE_SLOW_QUERY,
- WORKSPACE_ROUTE_EXPORT_CENTER,
- WORKSPACE_ROUTE_ANOMALY_CENTER,
- WORKSPACE_ROUTE_USER_PROFILE,
} from "./dashboard/workspaceRoutes";
import { SETTING_ROUTE } from "./dashboard/workspaceSetting";
import sqlEditorRoutes from "./sqlEditor";
@@ -176,11 +172,6 @@ router.beforeEach((to, from, next) => {
to.name === "error.403" ||
to.name === "error.404" ||
to.name === "error.500" ||
- to.name === WORKSPACE_HOME_MODULE ||
- to.name === WORKSPACE_ROUTE_SLOW_QUERY ||
- to.name === WORKSPACE_ROUTE_EXPORT_CENTER ||
- to.name === WORKSPACE_ROUTE_ANOMALY_CENTER ||
- to.name === WORKSPACE_ROUTE_USER_PROFILE ||
to.name?.toString().startsWith(ENVIRONMENT_V1_ROUTE_DASHBOARD) ||
to.name?.toString().startsWith(INSTANCE_ROUTE_DASHBOARD) ||
to.name?.toString().startsWith(PROJECT_V1_ROUTE_DASHBOARD) ||
@@ -188,7 +179,8 @@ router.beforeEach((to, from, next) => {
to.name?.toString().startsWith(ISSUE_ROUTE_DASHBOARD) ||
to.name === INSTANCE_ROUTE_DETAIL ||
to.name?.toString().startsWith("sql-editor") ||
- to.name?.toString().startsWith(SETTING_ROUTE)
+ to.name?.toString().startsWith(SETTING_ROUTE) ||
+ to.name?.toString().startsWith("workspace")
) {
next();
return;
diff --git a/frontend/src/views/DashboardSidebar.vue b/frontend/src/views/DashboardSidebar.vue
index 00fa398f46..e43d7f4197 100644
--- a/frontend/src/views/DashboardSidebar.vue
+++ b/frontend/src/views/DashboardSidebar.vue
@@ -10,21 +10,24 @@
<script lang="ts" setup>
import { Action, defineAction, useRegisterActions } from "@bytebase/vue-kbar";
import {
+ LinkIcon,
HomeIcon,
DatabaseIcon,
- TurtleIcon,
DownloadIcon,
ShieldAlertIcon,
GalleryHorizontalEndIcon,
LayersIcon,
SquareStackIcon,
+ ShieldCheck,
+ SettingsIcon,
} from "lucide-vue-next";
import { computed, h } from "vue";
import { useI18n } from "vue-i18n";
-import { useRoute, useRouter } from "vue-router";
+import { useRouter, useRoute, RouteRecordRaw } from "vue-router";
import { SidebarItem } from "@/components/CommonSidebar.vue";
import { useGlobalDatabaseActions } from "@/components/KBar/useDatabaseActions";
import { useProjectActions } from "@/components/KBar/useProjectActions";
+import workspaceRoutes from "@/router/dashboard/workspace";
import {
DATABASE_ROUTE_DASHBOARD,
ENVIRONMENT_V1_ROUTE_DASHBOARD,
@@ -34,15 +37,25 @@ import {
WORKSPACE_ROUTE_SLOW_QUERY,
WORKSPACE_ROUTE_EXPORT_CENTER,
WORKSPACE_ROUTE_ANOMALY_CENTER,
+ WORKSPACE_ROUTE_SQL_REVIEW,
+ WORKSPACE_ROUTE_SCHEMA_TEMPLATE,
+ WORKSPACE_ROUTE_CUSTOM_APPROVAL,
+ WORKSPACE_ROUTE_RISK_CENTER,
+ WORKSPACE_ROUTE_SENSITIVE_DATA,
+ WORKSPACE_ROUTE_AUDIT_LOG,
+ WORKSPACE_ROUTE_GITOPS,
+ WORKSPACE_ROUTE_SSO,
+ WORKSPACE_ROUTE_MAIL_DELIVERY,
} from "@/router/dashboard/workspaceRoutes";
+import { SETTING_ROUTE_WORKSPACE_GENERAL } from "@/router/dashboard/workspaceSetting";
import { useCurrentUserV1 } from "@/store";
-import { hasProjectPermissionV2, hasWorkspacePermissionV2 } from "../utils";
+import { WorkspacePermission } from "@/types";
+import { hasWorkspacePermissionV2, hasProjectPermissionV2 } from "@/utils";
interface DashboardSidebarItem extends SidebarItem {
- navigationId: string;
- shortcuts: string[];
- name: string;
- type: "route" | "divider";
+ navigationId?: string;
+ shortcuts?: string[];
+ children?: DashboardSidebarItem[];
}
const { t } = useI18n();
@@ -62,8 +75,62 @@ const getItemClass = (item: SidebarItem): string[] => {
return classes;
};
+const getFlattenRoutes = (
+ routes: RouteRecordRaw[],
+ permissions: WorkspacePermission[] = []
+): {
+ name: string;
+ permissions: WorkspacePermission[];
+}[] => {
+ return routes.reduce((list, workspaceRoute) => {
+ const requiredWorkspacePermissionListFunc =
+ workspaceRoute.meta?.requiredWorkspacePermissionList;
+ let requiredPermissionList = requiredWorkspacePermissionListFunc
+ ? requiredWorkspacePermissionListFunc()
+ : [];
+ if (requiredPermissionList.length === 0) {
+ requiredPermissionList = permissions;
+ }
+
+ if (workspaceRoute.name && workspaceRoute.name.toString() !== "") {
+ list.push({
+ name: workspaceRoute.name.toString(),
+ permissions: requiredPermissionList,
+ });
+ }
+ if (workspaceRoute.children) {
+ list.push(
+ ...getFlattenRoutes(workspaceRoute.children, requiredPermissionList)
+ );
+ }
+ return list;
+ }, [] as { name: string; permissions: WorkspacePermission[] }[]);
+};
+
+const flattenRoutes = computed(() => {
+ return getFlattenRoutes(workspaceRoutes);
+});
+
+const filterSidebarByPermissions = (
+ sidebarList: DashboardSidebarItem[]
+): DashboardSidebarItem[] => {
+ return sidebarList
+ .filter((item) => {
+ const routeConfig = flattenRoutes.value.find(
+ (workspaceRoute) => workspaceRoute.name === item.path
+ );
+ return (routeConfig?.permissions ?? []).every((permission) =>
+ hasWorkspacePermissionV2(currentUserV1.value, permission)
+ );
+ })
+ .map((item) => ({
+ ...item,
+ children: filterSidebarByPermissions(item.children ?? []),
+ }));
+};
+
const dashboardSidebarItemList = computed((): DashboardSidebarItem[] => {
- return [
+ const sidebarList: DashboardSidebarItem[] = [
{
navigationId: "bb.navigation.home",
title: t("issue.my-issues"),
@@ -79,7 +146,6 @@ const dashboardSidebarItemList = computed((): DashboardSidebarItem[] => {
name: PROJECT_V1_ROUTE_DASHBOARD,
type: "route",
shortcuts: ["g", "p"],
- hide: !hasWorkspacePermissionV2(currentUserV1.value, "bb.projects.list"),
},
{
navigationId: "bb.navigation.instances",
@@ -88,7 +154,6 @@ const dashboardSidebarItemList = computed((): DashboardSidebarItem[] => {
name: INSTANCE_ROUTE_DASHBOARD,
type: "route",
shortcuts: ["g", "i"],
- hide: !hasWorkspacePermissionV2(currentUserV1.value, "bb.instances.list"),
},
{
navigationId: "bb.navigation.databases",
@@ -105,24 +170,10 @@ const dashboardSidebarItemList = computed((): DashboardSidebarItem[] => {
name: ENVIRONMENT_V1_ROUTE_DASHBOARD,
type: "route",
shortcuts: ["g", "e"],
- hide: !hasWorkspacePermissionV2(
- currentUserV1.value,
- "bb.environments.list"
- ),
},
{
- navigationId: "",
type: "divider",
name: "",
- shortcuts: [],
- },
- {
- navigationId: "bb.navigation.slow-query",
- title: t("slow-query.slow-queries"),
- icon: h(TurtleIcon),
- name: WORKSPACE_ROUTE_SLOW_QUERY,
- type: "route",
- shortcuts: ["g", "s", "q"],
},
{
navigationId: "bb.navigation.export-center",
@@ -145,12 +196,101 @@ const dashboardSidebarItemList = computed((): DashboardSidebarItem[] => {
type: "route",
shortcuts: ["g", "a", "c"],
},
+ {
+ title: t("settings.sidebar.security-and-policy"),
+ icon: h(ShieldCheck),
+ type: "div",
+ expand: true,
+ children: [
+ {
+ title: t("sql-review.title"),
+ name: WORKSPACE_ROUTE_SQL_REVIEW,
+ type: "route",
+ },
+ {
+ title: t("slow-query.self"),
+ name: WORKSPACE_ROUTE_SLOW_QUERY,
+ type: "route",
+ navigationId: "bb.navigation.slow-query",
+ shortcuts: ["g", "s", "q"],
+ },
+ {
+ title: t("schema-template.self"),
+ name: WORKSPACE_ROUTE_SCHEMA_TEMPLATE,
+ type: "route",
+ },
+ {
+ title: t("custom-approval.risk.risk-center"),
+ name: WORKSPACE_ROUTE_RISK_CENTER,
+ type: "route",
+ },
+ {
+ title: t("custom-approval.self"),
+ name: WORKSPACE_ROUTE_CUSTOM_APPROVAL,
+ type: "route",
+ },
+ {
+ title: t("settings.sidebar.sensitive-data"),
+ name: WORKSPACE_ROUTE_SENSITIVE_DATA,
+ type: "route",
+ },
+ {
+ title: t("settings.sidebar.audit-log"),
+ name: WORKSPACE_ROUTE_AUDIT_LOG,
+ type: "route",
+ },
+ ],
+ },
+ {
+ title: t("settings.sidebar.integration"),
+ icon: h(LinkIcon),
+ type: "div",
+ expand: true,
+ children: [
+ {
+ title: t("settings.sidebar.gitops"),
+ name: WORKSPACE_ROUTE_GITOPS,
+ type: "route",
+ },
+ {
+ title: t("settings.sidebar.sso"),
+ name: WORKSPACE_ROUTE_SSO,
+ type: "route",
+ },
+ {
+ title: t("settings.sidebar.mail-delivery"),
+ name: WORKSPACE_ROUTE_MAIL_DELIVERY,
+ type: "route",
+ },
+ ],
+ },
+ {
+ title: t("common.setting"),
+ icon: h(SettingsIcon),
+ name: SETTING_ROUTE_WORKSPACE_GENERAL,
+ type: "route",
+ },
];
+
+ return filterSidebarByPermissions(sidebarList);
});
const navigationKbarActions = computed((): Action[] => {
return dashboardSidebarItemList.value
- .filter((item) => item.navigationId && item.name && !item.hide)
+ .reduce((list, item) => {
+ if (!item.children) {
+ if (item.navigationId && item.name && !item.hide) {
+ list.push(item);
+ }
+ } else {
+ for (const child of item.children) {
+ if (child.navigationId && child.name && !child.hide) {
+ list.push(child);
+ }
+ }
+ }
+ return list;
+ }, [] as DashboardSidebarItem[])
.map((item) => {
return defineAction({
id: item.navigationId,
diff --git a/frontend/src/views/SettingSidebar.vue b/frontend/src/views/SettingSidebar.vue
index e837d11049..f5a66dff0c 100644
--- a/frontend/src/views/SettingSidebar.vue
+++ b/frontend/src/views/SettingSidebar.vue
@@ -8,13 +8,7 @@
</template>
<script lang="ts" setup>
-import {
- UserCircle,
- Building,
- ShieldCheck,
- Link,
- Archive,
-} from "lucide-vue-next";
+import { UserCircle, Building, Archive } from "lucide-vue-next";
import { computed, h } from "vue";
import { useI18n } from "vue-i18n";
import { RouteRecordRaw, useRoute, useRouter } from "vue-router";
@@ -27,22 +21,6 @@ import workspaceSettingRoutes, {
SETTING_ROUTE_WORKSPACE_ROLE,
SETTING_ROUTE_WORKSPACE_SUBSCRIPTION,
SETTING_ROUTE_WORKSPACE_DEBUG_LOG,
- SETTING_ROUTE_WORKSPACE_SQL_REVIEW,
- SETTING_ROUTE_WORKSPACE_SQL_REVIEW_CREATE,
- SETTING_ROUTE_WORKSPACE_SQL_REVIEW_DETAIL,
- SETTING_ROUTE_WORKSPACE_SLOW_QUERY,
- SETTING_ROUTE_WORKSPACE_SCHEMA_TEMPLATE,
- SETTING_ROUTE_WORKSPACE_RISK_CENTER,
- SETTING_ROUTE_WORKSPACE_CUSTOM_APPROVAL,
- SETTING_ROUTE_WORKSPACE_SENSITIVE_DATA,
- SETTING_ROUTE_WORKSPACE_AUDIT_LOG,
- SETTING_ROUTE_WORKSPACE_GITOPS,
- SETTING_ROUTE_WORKSPACE_GITOPS_CREATE,
- SETTING_ROUTE_WORKSPACE_GITOPS_DETAIL,
- SETTING_ROUTE_WORKSPACE_SSO,
- SETTING_ROUTE_WORKSPACE_SSO_CREATE,
- SETTING_ROUTE_WORKSPACE_SSO_DETAIL,
- SETTING_ROUTE_WORKSPACE_MAIL_DELIVERY,
SETTING_ROUTE_WORKSPACE_ARCHIVE,
SETTING_ROUTE_WORKSPACE,
} from "@/router/dashboard/workspaceSetting";
@@ -65,24 +43,6 @@ const getItemClass = (item: SidebarItem) => {
}
switch (route.name) {
- case SETTING_ROUTE_WORKSPACE_SSO_CREATE:
- case SETTING_ROUTE_WORKSPACE_SSO_DETAIL:
- if (item.name === SETTING_ROUTE_WORKSPACE_SSO) {
- list.push("router-link-active", "bg-link-hover");
- }
- break;
- case SETTING_ROUTE_WORKSPACE_SQL_REVIEW_CREATE:
- case SETTING_ROUTE_WORKSPACE_SQL_REVIEW_DETAIL:
- if (item.name === SETTING_ROUTE_WORKSPACE_SQL_REVIEW) {
- list.push("router-link-active", "bg-link-hover");
- }
- break;
- case SETTING_ROUTE_WORKSPACE_GITOPS_CREATE:
- case SETTING_ROUTE_WORKSPACE_GITOPS_DETAIL:
- if (item.name === SETTING_ROUTE_WORKSPACE_GITOPS) {
- list.push("router-link-active", "bg-link-hover");
- }
- break;
case SETTING_ROUTE_PROFILE_TWO_FACTOR:
if (item.name === SETTING_ROUTE_PROFILE) {
list.push("router-link-active", "bg-link-hover");
@@ -113,6 +73,7 @@ const settingSidebarItemList = computed((): SidebarItem[] => {
title: t("settings.sidebar.account"),
icon: h(UserCircle),
type: "div",
+ expand: true,
children: [
{
title: t("settings.sidebar.profile"),
@@ -125,6 +86,7 @@ const settingSidebarItemList = computed((): SidebarItem[] => {
title: t("settings.sidebar.workspace"),
icon: h(Building),
type: "div",
+ expand: true,
children: [
{
title: t("settings.sidebar.general"),
@@ -153,70 +115,6 @@ const settingSidebarItemList = computed((): SidebarItem[] => {
},
],
},
- {
- title: t("settings.sidebar.security-and-policy"),
- icon: h(ShieldCheck),
- type: "div",
- children: [
- {
- title: t("sql-review.title"),
- name: SETTING_ROUTE_WORKSPACE_SQL_REVIEW,
- type: "route",
- },
- {
- title: t("slow-query.self"),
- name: SETTING_ROUTE_WORKSPACE_SLOW_QUERY,
- type: "route",
- },
- {
- title: t("schema-template.self"),
- name: SETTING_ROUTE_WORKSPACE_SCHEMA_TEMPLATE,
- type: "route",
- },
- {
- title: t("custom-approval.risk.risk-center"),
- name: SETTING_ROUTE_WORKSPACE_RISK_CENTER,
- type: "route",
- },
- {
- title: t("custom-approval.self"),
- name: SETTING_ROUTE_WORKSPACE_CUSTOM_APPROVAL,
- type: "route",
- },
- {
- title: t("settings.sidebar.sensitive-data"),
- name: SETTING_ROUTE_WORKSPACE_SENSITIVE_DATA,
- type: "route",
- },
- {
- title: t("settings.sidebar.audit-log"),
- name: SETTING_ROUTE_WORKSPACE_AUDIT_LOG,
- type: "route",
- },
- ],
- },
- {
- title: t("settings.sidebar.integration"),
- icon: h(Link),
- type: "div",
- children: [
- {
- title: t("settings.sidebar.gitops"),
- name: SETTING_ROUTE_WORKSPACE_GITOPS,
- type: "route",
- },
- {
- title: t("settings.sidebar.sso"),
- name: SETTING_ROUTE_WORKSPACE_SSO,
- type: "route",
- },
- {
- title: t("settings.sidebar.mail-delivery"),
- name: SETTING_ROUTE_WORKSPACE_MAIL_DELIVERY,
- type: "route",
- },
- ],
- },
{
title: t("common.archived"),
icon: h(Archive),
diff --git a/frontend/src/views/SettingWorkspaceAuditLog.vue b/frontend/src/views/SettingWorkspaceAuditLog.vue
index 2d68922d5f..ba13f9c0de 100644
--- a/frontend/src/views/SettingWorkspaceAuditLog.vue
+++ b/frontend/src/views/SettingWorkspaceAuditLog.vue
@@ -95,7 +95,7 @@ import { useI18n } from "vue-i18n";
import { useRoute, useRouter } from "vue-router";
import { BBDialog } from "@/bbkit";
import { ExportOption } from "@/components/DataExportButton.vue";
-import { SETTING_ROUTE_WORKSPACE_AUDIT_LOG } from "@/router/dashboard/workspaceSetting";
+import { WORKSPACE_ROUTE_AUDIT_LOG } from "@/router/dashboard/workspaceRoutes";
import { featureToRef, useUserStore, useActivityV1Store } from "@/store";
import {
AuditActivityTypeList,
@@ -138,7 +138,7 @@ watch(
() => state.userUid,
(uid) => {
router.replace({
- name: SETTING_ROUTE_WORKSPACE_AUDIT_LOG,
+ name: WORKSPACE_ROUTE_AUDIT_LOG,
query: {
...route.query,
user: parseInt(uid, 10) > 0 ? uid : undefined,
@@ -151,7 +151,7 @@ watch(
() => state.selectedAuditTypeList,
(list) => {
router.replace({
- name: SETTING_ROUTE_WORKSPACE_AUDIT_LOG,
+ name: WORKSPACE_ROUTE_AUDIT_LOG,
query: {
...route.query,
type: list.join(","),
@@ -213,7 +213,7 @@ const handleViewDetail = (log: LogEntity) => {
const confirmDatePicker = (value: [number, number]) => {
router.replace({
- name: SETTING_ROUTE_WORKSPACE_AUDIT_LOG,
+ name: WORKSPACE_ROUTE_AUDIT_LOG,
query: {
...route.query,
createdTsAfter: value[0],
@@ -224,7 +224,7 @@ const confirmDatePicker = (value: [number, number]) => {
const clearDatePicker = () => {
router.replace({
- name: SETTING_ROUTE_WORKSPACE_AUDIT_LOG,
+ name: WORKSPACE_ROUTE_AUDIT_LOG,
query: {
...route.query,
createdTsAfter: 0,
diff --git a/frontend/src/views/SettingWorkspaceSQLReviewDetail.vue b/frontend/src/views/SettingWorkspaceSQLReviewDetail.vue
index 797fee28ea..876cbf4116 100644
--- a/frontend/src/views/SettingWorkspaceSQLReviewDetail.vue
+++ b/frontend/src/views/SettingWorkspaceSQLReviewDetail.vue
@@ -147,7 +147,7 @@ import {
} from "@/components/SQLReview/components";
import { PayloadForEngine } from "@/components/SQLReview/components/RuleConfigComponents";
import { EnvironmentV1Name } from "@/components/v2";
-import { SETTING_ROUTE_WORKSPACE_SQL_REVIEW } from "@/router/dashboard/workspaceSetting";
+import { WORKSPACE_ROUTE_SQL_REVIEW } from "@/router/dashboard/workspaceRoutes";
import {
pushNotification,
useCurrentUserV1,
@@ -382,7 +382,7 @@ const onRemove = () => {
});
});
router.replace({
- name: SETTING_ROUTE_WORKSPACE_SQL_REVIEW,
+ name: WORKSPACE_ROUTE_SQL_REVIEW,
});
};
diff --git a/frontend/src/views/SettingWorkspaceSSO.vue b/frontend/src/views/SettingWorkspaceSSO.vue
index 0d4eae2c32..34a079e7c8 100644
--- a/frontend/src/views/SettingWorkspaceSSO.vue
+++ b/frontend/src/views/SettingWorkspaceSSO.vue
@@ -90,9 +90,9 @@ import { NButton } from "naive-ui";
import { computed, onMounted, reactive } from "vue";
import { useRouter } from "vue-router";
import {
- SETTING_ROUTE_WORKSPACE_SSO_CREATE,
- SETTING_ROUTE_WORKSPACE_SSO_DETAIL,
-} from "@/router/dashboard/workspaceSetting";
+ WORKSPACE_ROUTE_SSO_CREATE,
+ WORKSPACE_ROUTE_SSO_DETAIL,
+} from "@/router/dashboard/workspaceRoutes";
import { featureToRef, useCurrentUserV1 } from "@/store";
import { useIdentityProviderStore } from "@/store/modules/idp";
import { IdentityProvider } from "@/types/proto/v1/idp_service";
@@ -146,7 +146,7 @@ const handleCreateSSO = () => {
}
router.push({
- name: SETTING_ROUTE_WORKSPACE_SSO_CREATE,
+ name: WORKSPACE_ROUTE_SSO_CREATE,
});
};
@@ -157,7 +157,7 @@ const handleViewSSO = (identityProvider: IdentityProvider) => {
}
router.push({
- name: SETTING_ROUTE_WORKSPACE_SSO_DETAIL,
+ name: WORKSPACE_ROUTE_SSO_DETAIL,
params: {
ssoName: identityProvider.name,
},
diff --git a/frontend/src/views/SettingWorkspaceSlowQuery.vue b/frontend/src/views/SettingWorkspaceSlowQuery.vue
index 59b8fb0c91..e94d82b194 100644
--- a/frontend/src/views/SettingWorkspaceSlowQuery.vue
+++ b/frontend/src/views/SettingWorkspaceSlowQuery.vue
@@ -1,7 +1,7 @@
<template>
- <SlowQuerySettings />
+ <SlowQueryPanel />
</template>
<script lang="ts" setup>
-import { SlowQuerySettings } from "@/components/SlowQuery";
+import { SlowQueryPanel } from "@/components/SlowQuery";
</script>
diff --git a/frontend/src/views/SettingWorkspaceVCS.vue b/frontend/src/views/SettingWorkspaceVCS.vue
index 6ab88c381b..341184d3d0 100644
--- a/frontend/src/views/SettingWorkspaceVCS.vue
+++ b/frontend/src/views/SettingWorkspaceVCS.vue
@@ -36,7 +36,7 @@ import { computed, watchEffect } from "vue";
import { useRouter } from "vue-router";
import VCSCard from "@/components/VCS/VCSCard.vue";
import VCSSetupWizard from "@/components/VCS/VCSSetupWizard.vue";
-import { SETTING_ROUTE_WORKSPACE_GITOPS_CREATE } from "@/router/dashboard/workspaceSetting";
+import { WORKSPACE_ROUTE_GITOPS_CREATE } from "@/router/dashboard/workspaceRoutes";
import { useCurrentUserV1, useVCSV1Store } from "@/store";
import { hasWorkspacePermissionV2 } from "@/utils";
@@ -63,7 +63,7 @@ const vcsList = computed(() => {
const addVCSProvider = () => {
router.push({
- name: SETTING_ROUTE_WORKSPACE_GITOPS_CREATE,
+ name: WORKSPACE_ROUTE_GITOPS_CREATE,
});
};
</script>
diff --git a/frontend/src/views/SettingWorkspaceVCSDetail.vue b/frontend/src/views/SettingWorkspaceVCSDetail.vue
index e2144442df..74b175fbce 100644
--- a/frontend/src/views/SettingWorkspaceVCSDetail.vue
+++ b/frontend/src/views/SettingWorkspaceVCSDetail.vue
@@ -157,7 +157,7 @@ import { reactive, computed, watchEffect, onMounted, onUnmounted } from "vue";
import { useRouter } from "vue-router";
import RepositoryTable from "@/components/RepositoryTable.vue";
import { vcsListByUIType } from "@/components/VCS/utils";
-import { SETTING_ROUTE_WORKSPACE_GITOPS } from "@/router/dashboard/workspaceSetting";
+import { WORKSPACE_ROUTE_GITOPS } from "@/router/dashboard/workspaceRoutes";
import {
pushNotification,
useCurrentUserV1,
@@ -412,7 +412,7 @@ const doUpdate = () => {
const cancel = () => {
router.push({
- name: SETTING_ROUTE_WORKSPACE_GITOPS,
+ name: WORKSPACE_ROUTE_GITOPS,
});
};
@@ -428,7 +428,7 @@ const deleteVCS = () => {
title: `Successfully deleted '${title}'`,
});
router.push({
- name: SETTING_ROUTE_WORKSPACE_GITOPS,
+ name: WORKSPACE_ROUTE_GITOPS,
});
});
};
diff --git a/frontend/src/views/SlowQuery/SlowQueryDashboard.vue b/frontend/src/views/SlowQuery/SlowQueryDashboard.vue
deleted file mode 100644
index f3b391f041..0000000000
--- a/frontend/src/views/SlowQuery/SlowQueryDashboard.vue
+++ /dev/null
@@ -1,9 +0,0 @@
-<template>
- <div class="px-4">
- <SlowQueryPanel />
- </div>
-</template>
-
-<script lang="ts" setup>
-import { SlowQueryPanel } from "@/components/SlowQuery";
-</script>
diff --git a/frontend/src/views/sql-editor/EditorCommon/DataTable/SensitiveDataIcon.vue b/frontend/src/views/sql-editor/EditorCommon/DataTable/SensitiveDataIcon.vue
index b2e8e3e8f4..0af77e3e1f 100644
--- a/frontend/src/views/sql-editor/EditorCommon/DataTable/SensitiveDataIcon.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/DataTable/SensitiveDataIcon.vue
@@ -19,7 +19,7 @@
import { NTooltip } from "naive-ui";
import { computed } from "vue";
import { useRouter } from "vue-router";
-import { SETTING_ROUTE_WORKSPACE_SENSITIVE_DATA } from "@/router/dashboard/workspaceSetting";
+import { WORKSPACE_ROUTE_SENSITIVE_DATA } from "@/router/dashboard/workspaceRoutes";
import { useCurrentUserV1 } from "@/store";
import { hasWorkspacePermissionV2 } from "@/utils";
@@ -34,7 +34,7 @@ const handleClick = () => {
if (!clickable.value) {
return;
}
- const url = router.resolve({ name: SETTING_ROUTE_WORKSPACE_SENSITIVE_DATA });
+ const url = router.resolve({ name: WORKSPACE_ROUTE_SENSITIVE_DATA });
window.open(url.href, "_BLANK");
};
</script>
diff --git a/frontend/src/views/sql-editor/EditorCommon/ResultView/DataTable/SensitiveDataIcon.vue b/frontend/src/views/sql-editor/EditorCommon/ResultView/DataTable/SensitiveDataIcon.vue
index b2e8e3e8f4..0af77e3e1f 100644
--- a/frontend/src/views/sql-editor/EditorCommon/ResultView/DataTable/SensitiveDataIcon.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/ResultView/DataTable/SensitiveDataIcon.vue
@@ -19,7 +19,7 @@
import { NTooltip } from "naive-ui";
import { computed } from "vue";
import { useRouter } from "vue-router";
-import { SETTING_ROUTE_WORKSPACE_SENSITIVE_DATA } from "@/router/dashboard/workspaceSetting";
+import { WORKSPACE_ROUTE_SENSITIVE_DATA } from "@/router/dashboard/workspaceRoutes";
import { useCurrentUserV1 } from "@/store";
import { hasWorkspacePermissionV2 } from "@/utils";
@@ -34,7 +34,7 @@ const handleClick = () => {
if (!clickable.value) {
return;
}
- const url = router.resolve({ name: SETTING_ROUTE_WORKSPACE_SENSITIVE_DATA });
+ const url = router.resolve({ name: WORKSPACE_ROUTE_SENSITIVE_DATA });
window.open(url.href, "_BLANK");
};
</script>