Skip to content

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

chore: user count limit (#11782)

ecmadao644b942efb42
diff --git a/frontend/src/components/PricingTable/PricingTable.vue b/frontend/src/components/PricingTable/PricingTable.vue
index 1929de1940..be3490a113 100644
--- a/frontend/src/components/PricingTable/PricingTable.vue
+++ b/frontend/src/components/PricingTable/PricingTable.vue
@@ -47,7 +47,12 @@
</p>
<div class="mt-2 text-gray-600 h-12">
- {{ $t(`subscription.${plan.title}-price-intro`) }}
+ {{
+ $t(`subscription.${plan.title}-price-intro`, {
+ users: plan.maximumSeatCount,
+ instances: plan.maximumInstanceCount,
+ })
+ }}
</div>
<button
@@ -181,7 +186,12 @@
plan.type == PlanType.TEAM ? 'font-bold' : '',
]"
>
- {{ $t(`subscription.${plan.title}-price-intro`) }}
+ {{
+ $t(`subscription.${plan.title}-price-intro`, {
+ users: plan.maximumSeatCount,
+ instances: plan.maximumInstanceCount,
+ })
+ }}
</div>
<button
diff --git a/frontend/src/locales/subscription/en-US.json b/frontend/src/locales/subscription/en-US.json
index 7c2cc9028f..c2b835a1c0 100644
--- a/frontend/src/locales/subscription/en-US.json
+++ b/frontend/src/locales/subscription/en-US.json
@@ -16,8 +16,8 @@
"billed-annually": "Billed annually",
"billed-monthly": "Billed monthly",
"per-instance": "Per instance",
- "free-price-intro": "Up to 20 users and 10 instances",
- "team-price-intro": "Purchase up to 20 instances",
+ "free-price-intro": "Up to {users} users and {instances} instances",
+ "team-price-intro": "Purchase up to {instances} instances",
"enterprise-price-intro": "Customized, billed annually",
"deploy": "Deploy",
"contact-us": "Contact us",
diff --git a/frontend/src/locales/subscription/es-ES.json b/frontend/src/locales/subscription/es-ES.json
index 50c00b7b61..33fc318e66 100644
--- a/frontend/src/locales/subscription/es-ES.json
+++ b/frontend/src/locales/subscription/es-ES.json
@@ -16,8 +16,8 @@
"billed-annually": "Facturado anualmente",
"billed-monthly": "Facturado mensualmente",
"per-instance": "Por instancia",
- "free-price-intro": "Hasta 20 usuarios y 10 instancias",
- "team-price-intro": "Compra hasta 20 instancias",
+ "free-price-intro": "Hasta {users} usuarios y {instances} instancias",
+ "team-price-intro": "Compra hasta {instances} instancias",
"enterprise-price-intro": "Personalizado, facturado anualmente",
"deploy": "Desplegar",
"contact-us": "Contáctenos",
diff --git a/frontend/src/locales/subscription/ja-JP.json b/frontend/src/locales/subscription/ja-JP.json
index d1f76779b8..904fe5fcb5 100644
--- a/frontend/src/locales/subscription/ja-JP.json
+++ b/frontend/src/locales/subscription/ja-JP.json
@@ -16,8 +16,8 @@
"billed-annually": "年間請求",
"billed-monthly": "月額請求",
"per-instance": "インスタンスごと",
- "free-price-intro": "最大20ユーザーと10インスタンスまで",
- "team-price-intro": "最大20インスタンスまで購入できます",
+ "free-price-intro": "最大{users}ユーザーと{instances}インスタンスまで",
+ "team-price-intro": "最大{instances}インスタンスまで購入できます",
"enterprise-price-intro": "カスタマイズされ、年間請求",
"deploy": "デプロイ",
"contact-us": "お問い合わせ",
diff --git a/frontend/src/locales/subscription/vi-VN.json b/frontend/src/locales/subscription/vi-VN.json
index e6272fc0ed..38683335e7 100644
--- a/frontend/src/locales/subscription/vi-VN.json
+++ b/frontend/src/locales/subscription/vi-VN.json
@@ -16,8 +16,8 @@
"billed-annually": "Thanh toán hàng năm",
"billed-monthly": "Thanh toán hàng tháng",
"per-instance": "Mỗi trường hợp",
- "free-price-intro": "Tối đa 20 người dùng và 10 phiên bản",
- "team-price-intro": "Mua tối đa 20 phiên bản",
+ "free-price-intro": "Tối đa {users} người dùng và {instances} phiên bản",
+ "team-price-intro": "Mua tối đa {instances} phiên bản",
"enterprise-price-intro": "Tùy chỉnh, thanh toán hàng năm",
"deploy": "Triển khai",
"contact-us": "Liên hệ chúng tôi",
diff --git a/frontend/src/locales/subscription/zh-CN.json b/frontend/src/locales/subscription/zh-CN.json
index 1b08f0394d..5f872a6e05 100644
--- a/frontend/src/locales/subscription/zh-CN.json
+++ b/frontend/src/locales/subscription/zh-CN.json
@@ -16,8 +16,8 @@
"billed-annually": "按年付费",
"billed-monthly": "按月付费",
"per-instance": "每个实例",
- "free-price-intro": "最多 20 个用户,10 个实例",
- "team-price-intro": "最多购买 20 个实例",
+ "free-price-intro": "最多 {users} 个用户,{instances} 个实例",
+ "team-price-intro": "最多购买 {instances} 个实例",
"enterprise-price-intro": "自定义,按年付费",
"deploy": "部署",
"contact-us": "联系我们",
diff --git a/frontend/src/store/modules/user.ts b/frontend/src/store/modules/user.ts
index e31b8f3569..2f9cfad880 100644
--- a/frontend/src/store/modules/user.ts
+++ b/frontend/src/store/modules/user.ts
@@ -1,12 +1,12 @@
-import { isEqual, isUndefined } from "lodash-es";
+import { isEqual, isUndefined, orderBy } from "lodash-es";
import { defineStore } from "pinia";
import { authServiceClient } from "@/grpcweb";
import type { PrincipalType } from "@/types";
+import { PresetRoleType } from "@/types";
import { ALL_USERS_USER_ID, ALL_USERS_USER_EMAIL, allUsersUser } from "@/types";
import type { UpdateUserRequest, User } from "@/types/proto/v1/auth_service";
import { UserType } from "@/types/proto/v1/auth_service";
import { State } from "@/types/proto/v1/common";
-import { extractUserUID } from "@/utils";
import { userNamePrefix, getUserEmailFromIdentifier } from "./v1/common";
interface UserState {
@@ -25,13 +25,20 @@ export const useUserStore = defineStore("user", {
const list = Array.from(state.userMapByName.values()).filter(
(user) => user.state === State.ACTIVE
);
- list.sort((a, b) => {
- return (
- parseInt(extractUserUID(a.name), 10) -
- parseInt(extractUserUID(b.name), 10)
- );
- });
- return list;
+ return orderBy(
+ list,
+ [
+ (user) =>
+ user.userType === UserType.SYSTEM_BOT
+ ? 0
+ : user.userType === UserType.SERVICE_ACCOUNT
+ ? 1
+ : 2,
+ (user) => user.roles.includes(PresetRoleType.WORKSPACE_ADMIN),
+ (user) => user.roles.includes(PresetRoleType.WORKSPACE_DBA),
+ ],
+ ["asc", "desc", "desc"]
+ );
},
},
actions: {
diff --git a/frontend/src/views/SettingWorkspaceMember.vue b/frontend/src/views/SettingWorkspaceMember.vue
index 758af16d9c..c17932d8aa 100644
--- a/frontend/src/views/SettingWorkspaceMember.vue
+++ b/frontend/src/views/SettingWorkspaceMember.vue
@@ -168,20 +168,9 @@ const userList = computed(() => {
});
const activeUserList = computed(() => {
- const list = userList.value.filter((user) => user.state === State.ACTIVE);
- return orderBy(
- filterUserListByKeyword(list, state.activeUserFilterText),
- [
- (user) =>
- user.userType === UserType.SYSTEM_BOT
- ? 0
- : user.userType === UserType.SERVICE_ACCOUNT
- ? 1
- : 2,
- (user) => user.roles.includes(PresetRoleType.WORKSPACE_ADMIN),
- (user) => user.roles.includes(PresetRoleType.WORKSPACE_DBA),
- ],
- ["asc", "desc", "desc"]
+ return filterUserListByKeyword(
+ userStore.activeUserList,
+ state.activeUserFilterText
);
});
@@ -209,7 +198,9 @@ const showUpgradeInfo = computed(() => {
const endUserList = computed(() => {
return userStore.activeUserList.filter(
- (user) => user.userType === UserType.USER
+ (user) =>
+ user.userType === UserType.USER ||
+ user.userType === UserType.SERVICE_ACCOUNT
);
});