Skip to content

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

feat(frontend): tenant badge in project table (#1769)

Liu Ji213a6ecf005a
diff --git a/frontend/src/bbkit/BBBadge.vue b/frontend/src/bbkit/BBBadge.vue
index e062b85a6d..c47092dba8 100644
--- a/frontend/src/bbkit/BBBadge.vue
+++ b/frontend/src/bbkit/BBBadge.vue
@@ -1,9 +1,11 @@
<template>
<span
:class="[
- 'inline-flex rounded-full items-center py-0.5 px-2.5 text-sm font-medium',
+ 'inline-flex rounded-full items-center',
`bg-${color}-100 text-${color}-800`,
canRemove ? 'pr-1' : '',
+ size === 'normal' && 'py-0.5 px-2.5 text-sm font-medium',
+ size === 'small' && 'px-[6px] py-[2px] text-xs font-normal',
]"
>
{{ text }}
@@ -26,17 +28,20 @@ import { computed, withDefaults } from "vue";
import { BBAttentionStyle } from "./types";
export type BBBadgeStyle = BBAttentionStyle | "DISABLED";
+export type BBBadgeSize = "normal" | "small";
const props = withDefaults(
defineProps<{
text: string;
canRemove?: boolean;
style?: BBBadgeStyle;
+ size?: BBBadgeSize;
}>(),
{
style: "INFO",
text: "",
canRemove: true,
+ size: "normal",
}
);
@@ -51,6 +56,8 @@ const color = computed(() => {
case "DISABLED":
return "gray";
}
+ throw new Error("should never reach this line");
});
-const emit = defineEmits(["remove"]);
+
+defineEmits(["remove"]);
</script>
diff --git a/frontend/src/components/ProjectTable.vue b/frontend/src/components/ProjectTable.vue
index 527c4f1586..8e6dc4e993 100644
--- a/frontend/src/components/ProjectTable.vue
+++ b/frontend/src/components/ProjectTable.vue
@@ -8,17 +8,20 @@
@click-row="clickProject"
>
<template #header>
- <BBTableHeaderCell class="w-4 table-cell" :title="COLUMN_LIST[0].title" />
- <BBTableHeaderCell
- class="w-24 table-cell"
- :title="COLUMN_LIST[1].title"
- />
- <BBTableHeaderCell class="w-8 table-cell" :title="COLUMN_LIST[2].title" />
+ <BBTableHeaderCell class="table-cell" :title="COLUMN_LIST[0].title" />
+ <BBTableHeaderCell class="table-cell" :title="COLUMN_LIST[1].title" />
+ <BBTableHeaderCell class="table-cell" :title="COLUMN_LIST[2].title" />
</template>
<template #body="{ rowData: project }">
- <BBTableCell :left-padding="4" class="table-cell text-gray-500">
+ <BBTableCell :left-padding="4" class="table-cell text-gray-500 w-[30%]">
<span class="flex flex-row items-center space-x-1">
<span>{{ project.key }}</span>
+ <BBBadge
+ v-if="project.tenantMode === 'TENANT'"
+ :text="$t('project.mode.tenant')"
+ :can-remove="false"
+ size="small"
+ />
<div v-if="project.rowStatus === 'ARCHIVED'" class="tooltip-wrapper">
<heroicons-outline:archive class="ml-1 w-4 h-4 text-control" />
<span class="tooltip whitespace-nowrap">
@@ -36,7 +39,7 @@
<BBTableCell class="truncate">
{{ projectName(project) }}
</BBTableCell>
- <BBTableCell class="hidden md:table-cell">
+ <BBTableCell class="hidden md:table-cell md:w-[15%]">
{{ humanizeTs(project.createdTs) }}
</BBTableCell>
</template>