Skip to content

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

chore: UI optimize (#9600)

ecmadaoc27c6eea7df9
diff --git a/frontend/src/components/CommonSidebar.vue b/frontend/src/components/CommonSidebar.vue
index ce317db1f6..760f113bee 100644
--- a/frontend/src/components/CommonSidebar.vue
+++ b/frontend/src/components/CommonSidebar.vue
@@ -1,20 +1,20 @@
<template>
<nav class="flex-1 flex flex-col overflow-y-hidden">
- <BytebaseLogo class="w-full px-4 shrink-0" />
- <div class="flex-1 overflow-y-auto px-2 pb-4">
+ <BytebaseLogo v-if="showLogo" class="w-full px-4 shrink-0" />
+ <div class="flex-1 overflow-y-auto px-2">
<div v-for="(item, i) in filteredSidebarList" :key="i">
<router-link
- v-if="type === 'route' && item.path"
+ v-if="item.type === 'route' && item.path"
:to="item.path"
- class="outline-item group w-full flex items-center px-2 py-1.5"
+ class="outline-item group w-full flex items-center px-2 py-1.5 !text-base"
:class="getItemClass(item.path)"
>
<component :is="item.icon" class="mr-2 w-5 h-5 text-gray-500" />
{{ item.title }}
</router-link>
<div
- v-else
- class="group flex items-center px-2 py-1.5 text-sm leading-5 font-medium rounded-md text-gray-700 outline-item"
+ v-else-if="item.type === 'div'"
+ class="group flex items-center px-2 py-1.5 leading-5 font-medium rounded-md text-gray-700 outline-item !text-base"
:class="getItemClass(item.path)"
@click="onClick(i)"
>
@@ -28,13 +28,17 @@
<ChevronDown v-else class="w-4 h-4" />
</div>
</div>
+ <div
+ v-else-if="item.type === 'divider'"
+ class="border-t border-gray-300 my-2"
+ />
<div
v-if="item.children.length > 0 && state.expandedSidebar.has(i)"
class=""
>
<template v-for="(child, j) in item.children" :key="`${i}-${j}`">
<div
- v-if="type === 'div'"
+ v-if="child.type === 'div'"
class="group w-full flex items-center pl-11 pr-2 py-1.5 rounded-md outline-item"
:class="getItemClass(child.path)"
@click="$emit('select', child.path)"
@@ -42,7 +46,7 @@
{{ child.title }}
</div>
<router-link
- v-else
+ v-else-if="child.type === 'route'"
:to="child.path"
class="outline-item group w-full flex items-center pl-11 pr-2 py-1.5"
:class="getItemClass(child.path)"
@@ -61,14 +65,16 @@ import { ChevronDown, ChevronRight } from "lucide-vue-next";
import { computed, VNode, reactive, onMounted } from "vue";
export interface SidebarItem {
- title: string;
+ title?: string;
path?: string;
- icon: VNode;
+ icon?: VNode;
hide?: boolean;
+ type: "route" | "div" | "divider";
children?: {
title: string;
path: string;
hide?: boolean;
+ type: "route" | "div" | "divider";
}[];
}
@@ -79,10 +85,11 @@ interface LocalState {
const props = withDefaults(
defineProps<{
itemList: SidebarItem[];
- type: "route" | "div";
+ showLogo?: boolean;
getItemClass: (path: string | undefined) => string[];
}>(),
{
+ showLogo: true,
getItemClass: (_: string | undefined) => [],
}
);
@@ -101,7 +108,12 @@ const filteredSidebarList = computed(() => {
...item,
children: (item.children ?? []).filter((child) => !child.hide),
}))
- .filter((item) => !item.hide && (!!item.path || item.children.length > 0));
+ .filter((item) => {
+ if (item.type === "divider") {
+ return true;
+ }
+ return !item.hide && (!!item.path || item.children.length > 0);
+ });
});
onMounted(() => {
diff --git a/frontend/src/components/CustomApproval/Settings/components/common/RiskFilter/RiskFilter.vue b/frontend/src/components/CustomApproval/Settings/components/common/RiskFilter/RiskFilter.vue
index 293e5a186f..ad782a7695 100644
--- a/frontend/src/components/CustomApproval/Settings/components/common/RiskFilter/RiskFilter.vue
+++ b/frontend/src/components/CustomApproval/Settings/components/common/RiskFilter/RiskFilter.vue
@@ -1,6 +1,8 @@
<template>
<div class="space-y-4">
- <div class="flex items-center justify-between">
+ <div
+ class="flex flex-col md:flex-row md:items-center justify-between gap-y-2"
+ >
<div>
<LevelFilter v-if="!hideLevelFilter" />
</div>
diff --git a/frontend/src/components/PricingTable/PricingTable.vue b/frontend/src/components/PricingTable/PricingTable.vue
index 946987cc22..cdf408585f 100644
--- a/frontend/src/components/PricingTable/PricingTable.vue
+++ b/frontend/src/components/PricingTable/PricingTable.vue
@@ -159,7 +159,7 @@
</span>
</div>
- <p class="text-gray-500">
+ <p class="text-gray-500 text-center">
{{ $t(`subscription.plan.${plan.title}.desc`) }}
</p>
diff --git a/frontend/src/components/Project/ProjectSidebar.vue b/frontend/src/components/Project/ProjectSidebar.vue
index 989283e042..be0d6b3701 100644
--- a/frontend/src/components/Project/ProjectSidebar.vue
+++ b/frontend/src/components/Project/ProjectSidebar.vue
@@ -1,6 +1,5 @@
<template>
<CommonSidebar
- type="div"
:item-list="projectSidebarItemList"
:get-item-class="getItemClass"
@select="(val: string | undefined) => onSelect(val as ProjectHash)"
@@ -21,7 +20,7 @@ import {
RefreshCcw,
PencilRuler,
} from "lucide-vue-next";
-import { computed, VNode, h, reactive, watch, nextTick } from "vue";
+import { computed, h, reactive, watch, nextTick } from "vue";
import { useI18n } from "vue-i18n";
import { useRouter, useRoute } from "vue-router";
import { SidebarItem } from "@/components/CommonSidebar.vue";
@@ -51,15 +50,15 @@ const projectHashList = [
export type ProjectHash = typeof projectHashList[number];
const isProjectHash = (x: any): x is ProjectHash => projectHashList.includes(x);
-interface ProjectSidebarItem {
+interface ProjectSidebarItem extends SidebarItem {
title: string;
path?: ProjectHash;
- icon: VNode;
- hide?: boolean;
+ type: "div";
children?: {
title: string;
path: ProjectHash;
hide?: boolean;
+ type: "div";
}[];
}
@@ -126,19 +125,22 @@ const isTenantProject = computed((): boolean => {
return project.value.tenantMode === TenantMode.TENANT_MODE_ENABLED;
});
-const projectSidebarItemList = computed((): SidebarItem[] => {
- const fullList: ProjectSidebarItem[] = [
+const projectSidebarItemList = computed((): ProjectSidebarItem[] => {
+ return [
{
title: t("common.database"),
icon: h(Database),
+ type: "div",
children: [
{
title: t("common.databases"),
path: "databases",
+ type: "div",
},
{
title: t("common.groups"),
path: "database-groups",
+ type: "div",
hide:
!isTenantProject.value ||
!currentUserIamPolicy.isMemberOfProject(project.value.name),
@@ -146,6 +148,7 @@ const projectSidebarItemList = computed((): SidebarItem[] => {
{
title: t("common.change-history"),
path: "change-history",
+ type: "div",
hide:
isTenantProject.value ||
!currentUserIamPolicy.isMemberOfProject(project.value.name),
@@ -153,11 +156,13 @@ const projectSidebarItemList = computed((): SidebarItem[] => {
{
title: startCase(t("slow-query.slow-queries")),
path: "slow-query",
+ type: "div",
hide: !currentUserIamPolicy.isMemberOfProject(project.value.name),
},
{
title: t("common.anomalies"),
path: "anomalies",
+ type: "div",
hide: !currentUserIamPolicy.isMemberOfProject(project.value.name),
},
],
@@ -166,6 +171,7 @@ const projectSidebarItemList = computed((): SidebarItem[] => {
title: t("common.issues"),
path: "issues",
icon: h(CircleDot),
+ type: "div",
hide:
isDefaultProject.value ||
!currentUserIamPolicy.allowToChangeDatabaseOfProject(
@@ -176,6 +182,7 @@ const projectSidebarItemList = computed((): SidebarItem[] => {
title: t("common.branches"),
path: "branches",
icon: h(GitBranch),
+ type: "div",
hide:
isDefaultProject.value ||
!currentUserIamPolicy.allowToChangeDatabaseOfProject(
@@ -186,6 +193,7 @@ const projectSidebarItemList = computed((): SidebarItem[] => {
title: t("changelist.changelists"),
path: "changelists",
icon: h(PencilRuler),
+ type: "div",
hide:
isDefaultProject.value ||
!currentUserIamPolicy.allowToChangeDatabaseOfProject(
@@ -196,6 +204,7 @@ const projectSidebarItemList = computed((): SidebarItem[] => {
title: t("database.sync-schema.title"),
path: "sync-schema",
icon: h(RefreshCcw),
+ type: "div",
hide:
isDefaultProject.value ||
!currentUserIamPolicy.allowToChangeDatabaseOfProject(
@@ -205,6 +214,7 @@ const projectSidebarItemList = computed((): SidebarItem[] => {
{
title: t("settings.sidebar.integration"),
icon: h(Link),
+ type: "div",
hide:
isDefaultProject.value ||
!currentUserIamPolicy.allowToChangeDatabaseOfProject(
@@ -214,16 +224,19 @@ const projectSidebarItemList = computed((): SidebarItem[] => {
{
title: t("common.gitops"),
path: "gitops",
+ type: "div",
},
{
title: t("common.webhooks"),
path: "webhook",
+ type: "div",
},
],
},
{
title: t("common.manage"),
icon: h(Users),
+ type: "div",
hide:
isDefaultProject.value ||
!currentUserIamPolicy.isMemberOfProject(project.value.name),
@@ -231,10 +244,12 @@ const projectSidebarItemList = computed((): SidebarItem[] => {
{
title: t("common.members"),
path: "members",
+ type: "div",
},
{
title: t("common.activities"),
path: "activities",
+ type: "div",
},
],
},
@@ -242,13 +257,12 @@ const projectSidebarItemList = computed((): SidebarItem[] => {
title: t("common.setting"),
icon: h(Settings),
path: "setting",
+ type: "div",
hide:
isDefaultProject.value ||
!currentUserIamPolicy.isMemberOfProject(project.value.name),
},
];
-
- return fullList as SidebarItem[];
});
const getItemClass = (hash: string | undefined) => {
diff --git a/frontend/src/components/ProjectMember/ProjectMemberPanel.vue b/frontend/src/components/ProjectMember/ProjectMemberPanel.vue
index 16fd42cfc6..080eb031ea 100644
--- a/frontend/src/components/ProjectMember/ProjectMemberPanel.vue
+++ b/frontend/src/components/ProjectMember/ProjectMemberPanel.vue
@@ -2,29 +2,20 @@
<div class="w-full mx-auto space-y-4">
<FeatureAttention feature="bb.feature.rbac" />
- <div class="w-full flex flex-row justify-between items-center">
- <div>
- <SearchBox
- v-model:value="state.searchText"
- style="width: 12rem"
- :placeholder="$t('project.members.search-member')"
- />
- </div>
- <div v-if="allowAdmin" class="flex gap-x-2">
- <NButton
- v-if="state.selectedTab === 'users'"
- :disabled="state.selectedMemberNameList.size === 0"
- @click="handleRevokeSelectedMembers"
- >
- {{ $t("project.members.revoke-access") }}
- </NButton>
- <NButton type="primary" @click="state.showAddMemberPanel = true">
- <template #icon>
- <heroicons-outline:user-add class="w-4 h-4" />
- </template>
- {{ $t("project.members.grant-access") }}
- </NButton>
- </div>
+ <div v-if="allowAdmin" class="flex justify-end gap-x-2">
+ <NButton
+ v-if="state.selectedTab === 'users'"
+ :disabled="state.selectedMemberNameList.size === 0"
+ @click="handleRevokeSelectedMembers"
+ >
+ {{ $t("project.members.revoke-access") }}
+ </NButton>
+ <NButton type="primary" @click="state.showAddMemberPanel = true">
+ <template #icon>
+ <heroicons-outline:user-add class="w-4 h-4" />
+ </template>
+ {{ $t("project.members.grant-access") }}
+ </NButton>
</div>
<div class="textinfolabel">
@@ -40,6 +31,13 @@
</div>
<NTabs v-model:value="state.selectedTab" type="bar">
+ <template #suffix>
+ <SearchBox
+ v-model:value="state.searchText"
+ style="width: 12rem"
+ :placeholder="$t('project.members.search-member')"
+ />
+ </template>
<NTabPane name="users" :tab="$t('project.members.users')">
<ProjectMemberTable
:project="project"
diff --git a/frontend/src/components/ProjectMember/ProjectMemberTable/ProjectMemberRolePanel.vue b/frontend/src/components/ProjectMember/ProjectMemberTable/ProjectMemberRolePanel.vue
index bc9ba16fbb..3e85f8df38 100644
--- a/frontend/src/components/ProjectMember/ProjectMemberTable/ProjectMemberRolePanel.vue
+++ b/frontend/src/components/ProjectMember/ProjectMemberTable/ProjectMemberRolePanel.vue
@@ -247,29 +247,29 @@ const getGridColumns = (role: string) => {
};
const conditionName = {
title: t("project.members.condition-name"),
- width: "1fr",
+ width: "minmax(min-content, auto)",
};
const databaseRelatedColumns = [
{
title: t("common.database"),
- width: "12rem",
+ width: "minmax(min-content, auto)",
},
{
title: t("common.schema"),
- width: "8rem",
+ width: "minmax(min-content, auto)",
},
{
title: t("common.table"),
- width: "8rem",
+ width: "minmax(min-content, auto)",
},
];
const expiration = {
title: t("common.expiration"),
- width: "12rem",
+ width: "minmax(min-content, auto)",
};
const description = {
title: t("common.description"),
- width: "8rem",
+ width: "minmax(min-content, auto)",
};
if (isRoleShouldShowDatabaseRelatedColumns(role)) {
return [
diff --git a/frontend/src/components/ProjectMember/ProjectMemberTable/ProjectMemberTable.vue b/frontend/src/components/ProjectMember/ProjectMemberTable/ProjectMemberTable.vue
index ed222b8613..7238388896 100644
--- a/frontend/src/components/ProjectMember/ProjectMemberTable/ProjectMemberTable.vue
+++ b/frontend/src/components/ProjectMember/ProjectMemberTable/ProjectMemberTable.vue
@@ -188,19 +188,19 @@ const { policy: iamPolicy } = useProjectIamPolicy(projectResourceName);
const columnList = computed(() => {
const ACCOUNT: BBGridColumn = {
title: t("common.user"),
- width: hasRBACFeature.value ? "minmax(auto, 18rem)" : "1fr",
+ width: hasRBACFeature.value ? "minmax(min-content, auto)" : "1fr",
};
const ROLE: BBGridColumn = {
title: t("common.role.self"),
- width: "1fr",
+ width: "minmax(min-content, auto)",
};
const EXPIRATION: BBGridColumn = {
title: t("common.expiration"),
- width: "16rem",
+ width: "minmax(min-content, auto)",
};
const OPERATIONS: BBGridColumn = {
title: "",
- width: "4rem",
+ width: "minmax(min-content, auto)",
};
const list = hasRBACFeature.value
? [ACCOUNT, ROLE, EXPIRATION, OPERATIONS]
diff --git a/frontend/src/components/ProjectWebhookForm.vue b/frontend/src/components/ProjectWebhookForm.vue
index 1cf8ee7d76..1fca41ea55 100644
--- a/frontend/src/components/ProjectWebhookForm.vue
+++ b/frontend/src/components/ProjectWebhookForm.vue
@@ -56,12 +56,11 @@
<label for="name" class="textlabel">
{{ $t("common.name") }} <span class="text-red-600">*</span>
</label>
- <input
+ <NInput
id="name"
- v-model="state.webhook.title"
+ v-model:value="state.webhook.title"
name="name"
- type="text"
- class="textfield mt-1 w-full"
+ class="mt-1 w-full"
:placeholder="namePlaceholder"
:disabled="!allowEdit"
/>
@@ -198,12 +197,11 @@
>.
</template>
</div>
- <input
+ <NInput
id="url"
- v-model="state.webhook.url"
+ v-model:value="state.webhook.url"
name="url"
- type="text"
- class="textfield mt-1 w-full"
+ class="mt-1 w-full"
:placeholder="urlPlaceholder"
:disabled="!allowEdit"
/>
@@ -229,13 +227,9 @@
/>
</div>
</div>
- <button
- type="button"
- class="btn-normal whitespace-nowrap items-center"
- @click.prevent="testWebhook"
- >
+ <NButton @click.prevent="testWebhook">
{{ $t("project.webhook.test-webhook") }}
- </button>
+ </NButton>
<div
class="flex pt-5"
:class="!create && allowEdit ? 'justify-between' : 'justify-end'"
diff --git a/frontend/src/components/SQLReview/SQLReviewCreation.vue b/frontend/src/components/SQLReview/SQLReviewCreation.vue
index a52f23d73d..2b7ac5277b 100644
--- a/frontend/src/components/SQLReview/SQLReviewCreation.vue
+++ b/frontend/src/components/SQLReview/SQLReviewCreation.vue
@@ -1,7 +1,6 @@
<template>
<div>
<BBStepTab
- class="mt-4 mb-8"
:sticky="true"
:step-item-list="STEP_LIST"
:allow-next="allowNext"
diff --git a/frontend/src/components/SensitiveData/GlobalMaskingRulesView.vue b/frontend/src/components/SensitiveData/GlobalMaskingRulesView.vue
index 01862e0b70..9709f62eff 100644
--- a/frontend/src/components/SensitiveData/GlobalMaskingRulesView.vue
+++ b/frontend/src/components/SensitiveData/GlobalMaskingRulesView.vue
@@ -77,7 +77,14 @@
</MiniActionButton>
</div>
</div>
- <div :class="['w-full', item.mode === 'NORMAL' ? '' : 'ml-[42px]']">
+ <div
+ class="pb-5"
+ :class="[
+ 'w-full',
+ item.mode === 'NORMAL' ? '' : 'ml-[42px]',
+ index === state.maskingRuleItemList.length - 1 ? '' : 'border-b',
+ ]"
+ >
<MaskingRuleConfig
:key="`expr-${item.rule.id}`"
:index="index + 1"
diff --git a/frontend/src/components/SensitiveData/GrantAccessDrawer.vue b/frontend/src/components/SensitiveData/GrantAccessDrawer.vue
index 6fb67e72df..7d0b683f89 100644
--- a/frontend/src/components/SensitiveData/GrantAccessDrawer.vue
+++ b/frontend/src/components/SensitiveData/GrantAccessDrawer.vue
@@ -1,7 +1,7 @@
<template>
<Drawer :show="true" @close="onDismiss">
<DrawerContent :title="$t('settings.sensitive-data.grant-access')">
- <div class="divide-block-border space-y-8 w-[60rem] h-full">
+ <div class="divide-block-border space-y-8 h-full">
<SensitiveColumnTable
:row-clickable="false"
:show-operation="false"
diff --git a/frontend/src/components/SensitiveData/SensitiveColumnView.vue b/frontend/src/components/SensitiveData/SensitiveColumnView.vue
index 7ad9ad783e..3669fd930d 100644
--- a/frontend/src/components/SensitiveData/SensitiveColumnView.vue
+++ b/frontend/src/components/SensitiveData/SensitiveColumnView.vue
@@ -7,14 +7,14 @@
"
feature="bb.feature.sensitive-data"
/>
- <div>
- <EnvironmentTabFilter
- :environment="state.selectedEnvironmentName"
- :include-all="true"
- @update:environment="state.selectedEnvironmentName = $event"
- />
- </div>
- <div class="flex justify-between items-center">
+ <EnvironmentTabFilter
+ :environment="state.selectedEnvironmentName"
+ :include-all="true"
+ @update:environment="state.selectedEnvironmentName = $event"
+ />
+ <div
+ class="flex flex-col sm:flex-row gap-y-4 justify-between items-end sm:items-center"
+ >
<NInputGroup>
<ProjectSelect
:project="state.selectedProjectUid"
diff --git a/frontend/src/components/SensitiveData/components/MaskingRuleConfig.vue b/frontend/src/components/SensitiveData/components/MaskingRuleConfig.vue
index 383dfc7d97..84ab0097c9 100644
--- a/frontend/src/components/SensitiveData/components/MaskingRuleConfig.vue
+++ b/frontend/src/components/SensitiveData/components/MaskingRuleConfig.vue
@@ -1,6 +1,8 @@
<template>
- <div class="gap-y-4 w-full">
- <div class="flex items-stretch gap-x-4 overflow-hidden">
+ <div class="space-y-4 w-full">
+ <div
+ class="flex flex-col md:flex-row items-start md:items-stretch gap-x-4 gap-y-4 overflow-hidden"
+ >
<div class="flex-1 space-y-2 overflow-x-hidden overflow-y-auto">
<div class="flex items-center h-[36px]">
<NInput
@@ -47,7 +49,6 @@
<template #trigger>
<NButton
tag="div"
- size="small"
style="--n-padding: 0 6px; --n-icon-margin: 4px"
:disabled="disabled"
@click.stop=""
diff --git a/frontend/src/components/User/Settings/UserTable.vue b/frontend/src/components/User/Settings/UserTable.vue
index 60d4fc3db6..3632783cd1 100644
--- a/frontend/src/components/User/Settings/UserTable.vue
+++ b/frontend/src/components/User/Settings/UserTable.vue
@@ -115,15 +115,17 @@
{{ $t("two-factor.enabled") }}
</span>
</BBTableCell>
- <BBTableCell class="whitespace-nowrap tooltip-wrapper w-36">
- <span v-if="changeRoleTooltip(user)" class="tooltip">{{
- changeRoleTooltip(user)
- }}</span>
- <WorkspaceRoleSelect
- :role="user.userRole"
- :disabled="!allowChangeRole(user)"
- @update:role="changeRole(user, $event)"
- />
+ <BBTableCell class="whitespace-nowrap w-36">
+ <NTooltip :disabled="!changeRoleTooltip(user)">
+ <template #trigger>
+ <WorkspaceRoleSelect
+ :role="user.userRole"
+ :disabled="!allowChangeRole(user)"
+ @update:role="changeRole(user, $event)"
+ />
+ </template>
+ {{ changeRoleTooltip(user) }}
+ </NTooltip>
</BBTableCell>
<BBTableCell>
<BBButtonConfirm
diff --git a/frontend/src/views/DashboardHeader.vue b/frontend/src/views/DashboardHeader.vue
index 90710d68da..b0bcffe6ca 100644
--- a/frontend/src/views/DashboardHeader.vue
+++ b/frontend/src/views/DashboardHeader.vue
@@ -1,5 +1,5 @@
<template>
- <div class="flex items-center justify-between h-10 pl-2 pr-4 space-x-3">
+ <div class="flex items-center justify-between h-10 pl-2 pr-4 my-1 space-x-3">
<div class="flex items-center">
<BytebaseLogo class="block md:hidden" />
@@ -21,7 +21,7 @@
</div>
<div class="flex-1 flex justify-end items-center space-x-3">
<button
- class="hidden w-full max-w-xs md:flex items-center justify-between rounded-sm border border-control-border bg-white hover:bg-control-bg-hover pl-2 pr-1 py-0.5 outline-none"
+ class="hidden w-full max-w-xs md:flex items-center justify-between rounded-sm border border-control-border bg-gray-100 hover:bg-control-bg-hover pl-2 pr-1 py-0.5 outline-none"
@click="onClickSearchButton"
>
<span class="text-control-placeholder text-sm">
diff --git a/frontend/src/views/DashboardSidebar.vue b/frontend/src/views/DashboardSidebar.vue
index 565697ce4f..4c8a5e4870 100644
--- a/frontend/src/views/DashboardSidebar.vue
+++ b/frontend/src/views/DashboardSidebar.vue
@@ -1,91 +1,10 @@
<template>
<!-- Navigation -->
<nav class="overflow-y-hidden flex flex-col">
- <BytebaseLogo class="w-full px-4 shrink-0" />
-
- <div class="flex-1 overflow-y-auto px-2">
- <router-link to="/" class="outline-item group flex items-center">
- <div
- class="outline-item group flex items-center px-2 py-1.5 capitalize"
- data-label="bb-dashboard-sidebar-home-button"
- >
- <HomeIcon class="w-5 h-5 mr-2" />
- {{ $t("issue.my-issues") }}
- </div>
- </router-link>
-
- <router-link to="/project" class="outline-item group flex items-center">
- <div
- class="outline-item group flex items-center px-2 py-1.5 capitalize"
- data-label="bb-dashboard-sidebar-home-button"
- >
- <GalleryHorizontalEndIcon class="w-5 h-5 mr-2" />
- {{ $t("common.projects") }}
- </div>
- </router-link>
-
- <router-link
- v-if="shouldShowInstanceEntry"
- to="/instance"
- class="outline-item group flex items-center"
- :class="getRouteLinkClass('/instance')"
- >
- <div
- class="outline-item group flex items-center px-2 py-1.5 capitalize"
- data-label="bb-dashboard-sidebar-home-button"
- >
- <LayersIcon class="w-5 h-5 mr-2" />
- {{ $t("common.instances") }}
- </div>
- </router-link>
-
- <router-link to="/db" class="outline-item group flex items-center">
- <div
- class="outline-item group flex items-center px-2 py-1.5 capitalize"
- data-label="bb-dashboard-sidebar-home-button"
- >
- <DatabaseIcon class="w-5 h-5 mr-2" />
- {{ $t("common.databases") }}
- </div>
- </router-link>
-
- <router-link
- to="/environment"
- class="outline-item group flex items-center"
- >
- <div
- class="outline-item group flex items-center px-2 py-1.5 capitalize"
- data-label="bb-dashboard-sidebar-home-button"
- >
- <SquareStackIcon class="w-5 h-5 mr-2" />
- {{ $t("common.environments") }}
- </div>
- </router-link>
-
- <div class="border-t border-gray-300 my-2" />
-
- <router-link
- to="/slow-query"
- class="outline-item group flex items-center px-2 py-1.5 capitalize"
- >
- <TurtleIcon class="w-5 h-auto mr-2" />
- {{ $t("slow-query.slow-queries") }}
- </router-link>
- <router-link
- to="/export-center"
- class="outline-item group flex items-center px-2 py-1.5 capitalize"
- >
- <DownloadIcon class="w-5 h-5 mr-2" />
- {{ $t("export-center.self") }}
- </router-link>
- <router-link
- to="/anomaly-center"
- class="outline-item group flex items-center px-2 py-1.5 capitalize"
- >
- <ShieldAlertIcon class="w-5 h-5 mr-2" />
- {{ $t("anomaly-center") }}
- </router-link>
- </div>
+ <CommonSidebar
+ :item-list="dashboardSidebarItemList"
+ :get-item-class="getItemClass"
+ />
</nav>
</template>
@@ -101,10 +20,10 @@ import {
LayersIcon,
SquareStackIcon,
} from "lucide-vue-next";
-import { computed } from "vue";
+import { computed, h } from "vue";
import { useI18n } from "vue-i18n";
-import { RouterLink, useRoute, useRouter } from "vue-router";
-import BytebaseLogo from "@/components/BytebaseLogo.vue";
+import { useRoute, useRouter } from "vue-router";
+import { SidebarItem } from "@/components/CommonSidebar.vue";
import { useGlobalDatabaseActions } from "@/components/KBar/useDatabaseActions";
import { useProjectActions } from "@/components/KBar/useProjectActions";
import {
@@ -137,9 +56,9 @@ const shouldShowInstanceEntry = computed(() => {
);
});
-const getRouteLinkClass = (prefix: string): string[] => {
- const { path } = route;
- const isActiveRoute = path === prefix || path.startsWith(`${prefix}/`);
+const getItemClass = (path: string | undefined): string[] => {
+ const { path: current } = route;
+ const isActiveRoute = path === current || current.startsWith(`${path}/`);
const classes: string[] = [];
if (isActiveRoute) {
classes.push("router-link-active", "bg-link-hover");
@@ -147,6 +66,63 @@ const getRouteLinkClass = (prefix: string): string[] => {
return classes;
};
+const dashboardSidebarItemList = computed((): SidebarItem[] => {
+ return [
+ {
+ title: t("issue.my-issues"),
+ icon: h(HomeIcon),
+ path: "/",
+ type: "route",
+ },
+ {
+ title: t("common.projects"),
+ icon: h(GalleryHorizontalEndIcon),
+ path: "/project",
+ type: "route",
+ },
+ {
+ title: t("common.instances"),
+ icon: h(LayersIcon),
+ path: "/instance",
+ type: "route",
+ hide: !shouldShowInstanceEntry.value,
+ },
+ {
+ title: t("common.databases"),
+ icon: h(DatabaseIcon),
+ path: "/db",
+ type: "route",
+ },
+ {
+ title: t("common.environments"),
+ icon: h(SquareStackIcon),
+ path: "/environment",
+ type: "route",
+ },
+ {
+ type: "divider",
+ },
+ {
+ title: t("slow-query.slow-queries"),
+ icon: h(TurtleIcon),
+ path: "/slow-query",
+ type: "route",
+ },
+ {
+ title: t("export-center.self"),
+ icon: h(DownloadIcon),
+ path: "/export-center",
+ type: "route",
+ },
+ {
+ title: t("anomaly-center"),
+ icon: h(ShieldAlertIcon),
+ path: "/anomaly-center",
+ type: "route",
+ },
+ ];
+});
+
const navigationKbarActions = computed(() => {
const actions: Action[] = [];
actions.push(
diff --git a/frontend/src/views/ExportCenter/index.vue b/frontend/src/views/ExportCenter/index.vue
index a4c49d9600..d4d7539571 100644
--- a/frontend/src/views/ExportCenter/index.vue
+++ b/frontend/src/views/ExportCenter/index.vue
@@ -3,7 +3,7 @@
<div
class="w-full flex flex-col lg:flex-row items-start lg:items-center justify-between gap-y-2"
>
- <div class="flex items-center gap-x-4">
+ <div class="flex max-w-full items-center gap-x-4">
<NInputGroup>
<ProjectSelect
:project="state.filterParams.project?.uid ?? String(UNKNOWN_ID)"
@@ -32,15 +32,13 @@
<heroicons:x-mark class="w-4 h-4 ml-1 -mr-1.5" />
</NButton>
</div>
- <div>
- <NButton type="primary" @click="handleRequestExportClick">
- <FeatureBadge
- feature="bb.feature.access-control"
- custom-class="text-white pointer-events-none mr-2"
- />
- {{ $t("quick-action.request-export-data") }}
- </NButton>
- </div>
+ <NButton type="primary" @click="handleRequestExportClick">
+ <FeatureBadge
+ feature="bb.feature.access-control"
+ custom-class="text-white pointer-events-none mr-2"
+ />
+ {{ $t("quick-action.request-export-data") }}
+ </NButton>
</div>
<div class="w-full mt-4">
<ExportRecordTable :export-records="filterExportRecords" />
diff --git a/frontend/src/views/SettingSidebar.vue b/frontend/src/views/SettingSidebar.vue
index 8cd3bed312..bd572d54f0 100644
--- a/frontend/src/views/SettingSidebar.vue
+++ b/frontend/src/views/SettingSidebar.vue
@@ -1,7 +1,5 @@
<template>
<CommonSidebar
- type="route"
- :show-go-back="true"
:item-list="(settingSidebarItemList as SidebarItem[])"
:get-item-class="getItemClass"
/>
@@ -55,20 +53,24 @@ const settingSidebarItemList = computed((): SidebarItem[] => {
{
title: t("settings.sidebar.account"),
icon: h(UserCircle),
+ type: "div",
children: [
{
title: t("settings.sidebar.profile"),
path: "/setting/profile",
+ type: "route",
},
],
},
{
title: t("settings.sidebar.workspace"),
icon: h(Building),
+ type: "div",
children: [
{
title: t("settings.sidebar.general"),
path: "/setting/general",
+ type: "route",
},
{
title: t("settings.sidebar.members"),
@@ -77,10 +79,12 @@ const settingSidebarItemList = computed((): SidebarItem[] => {
"setting.workspace.member",
currentUserV1.value.userRole
),
+ type: "route",
},
{
title: t("settings.sidebar.custom-roles"),
path: "/setting/role",
+ type: "route",
},
{
title: t("common.projects"),
@@ -89,10 +93,12 @@ const settingSidebarItemList = computed((): SidebarItem[] => {
"setting.workspace.project",
currentUserV1.value.userRole
),
+ type: "route",
},
{
title: t("settings.sidebar.subscription"),
path: "/setting/subscription",
+ type: "route",
},
{
title: t("settings.sidebar.debug-log"),
@@ -101,32 +107,39 @@ const settingSidebarItemList = computed((): SidebarItem[] => {
"setting.workspace.debug-log",
currentUserV1.value.userRole
),
+ type: "route",
},
],
},
{
title: t("settings.sidebar.security-and-policy"),
icon: h(ShieldCheck),
+ type: "div",
children: [
{
title: t("sql-review.title"),
path: "/setting/sql-review",
+ type: "route",
},
{
title: t("slow-query.self"),
path: "/setting/slow-query",
+ type: "route",
},
{
title: t("schema-template.self"),
path: "/setting/schema-template",
+ type: "route",
},
{
title: t("custom-approval.risk.risk-center"),
path: "/setting/risk-center",
+ type: "route",
},
{
title: t("custom-approval.self"),
path: "/setting/custom-approval",
+ type: "route",
},
{
title: t("settings.sidebar.sensitive-data"),
@@ -135,6 +148,7 @@ const settingSidebarItemList = computed((): SidebarItem[] => {
"setting.workspace.sensitive-data",
currentUserV1.value.userRole
),
+ type: "route",
},
{
title: t("settings.sidebar.access-control"),
@@ -143,6 +157,7 @@ const settingSidebarItemList = computed((): SidebarItem[] => {
"setting.workspace.access-control",
currentUserV1.value.userRole
),
+ type: "route",
},
{
title: t("settings.sidebar.audit-log"),
@@ -151,12 +166,14 @@ const settingSidebarItemList = computed((): SidebarItem[] => {
"setting.workspace.audit-log",
currentUserV1.value.userRole
),
+ type: "route",
},
],
},
{
title: t("settings.sidebar.integration"),
icon: h(Link),
+ type: "div",
children: [
{
title: t("settings.sidebar.gitops"),
@@ -165,6 +182,7 @@ const settingSidebarItemList = computed((): SidebarItem[] => {
"setting.workspace.gitops",
currentUserV1.value.userRole
),
+ type: "route",
},
{
title: t("settings.sidebar.sso"),
@@ -173,6 +191,7 @@ const settingSidebarItemList = computed((): SidebarItem[] => {
"setting.workspace.sso",
currentUserV1.value.userRole
),
+ type: "route",
},
{
title: t("settings.sidebar.mail-delivery"),
@@ -181,6 +200,7 @@ const settingSidebarItemList = computed((): SidebarItem[] => {
"setting.workspace.mail-delivery",
currentUserV1.value.userRole
),
+ type: "route",
},
],
},
@@ -188,6 +208,7 @@ const settingSidebarItemList = computed((): SidebarItem[] => {
title: t("common.archived"),
icon: h(Archive),
path: "/setting/archive",
+ type: "route",
},
];
});
diff --git a/frontend/src/views/SettingWorkspaceAuditLog.vue b/frontend/src/views/SettingWorkspaceAuditLog.vue
index d06e4e6273..25d7d6ec3d 100644
--- a/frontend/src/views/SettingWorkspaceAuditLog.vue
+++ b/frontend/src/views/SettingWorkspaceAuditLog.vue
@@ -18,7 +18,7 @@
@update-selected-type-list="selectAuditType"
/>
</div>
- <div class="w-112">
+ <div class="hidden sm:block w-112">
<NDatePicker
v-model:value="selectedTimeRange"
type="datetimerange"