Skip to content

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

feat: add plan info in sidebar (#742)

ecmadao400a171ca1e5
diff --git a/frontend/src/components/ProfileDropdown.vue b/frontend/src/components/ProfileDropdown.vue
index 63ac12a6a1..f10bde8616 100644
--- a/frontend/src/components/ProfileDropdown.vue
+++ b/frontend/src/components/ProfileDropdown.vue
@@ -99,6 +99,9 @@
@click.prevent="resetQuickstart"
>{{ $t("common.quickstart") }}</a
>
+ <a href="https://docs.bytebase.com" target="_blank" class="menu-item">
+ {{ $t("common.help") }}
+ </a>
</div>
<div class="border-t border-gray-100"></div>
<div v-if="!isRelease" class="py-1 menu-item">
diff --git a/frontend/src/layouts/BodyLayout.vue b/frontend/src/layouts/BodyLayout.vue
index 776bdc1669..bdf7432fbd 100644
--- a/frontend/src/layouts/BodyLayout.vue
+++ b/frontend/src/layouts/BodyLayout.vue
@@ -35,17 +35,16 @@
<div
class="flex-shrink-0 flex border-t border-block-border px-4 py-2"
>
- <a
- href="https://docs.bytebase.com"
- target="_blank"
- class="flex justify-between items-center w-full flex-shrink-0 text-main group"
+ <router-link
+ to="/setting/subscription"
+ exact-active-class
+ class="text-sm text-accent flex"
+ :class="isFreePlan ? 'text-accent' : ''"
>
- <div class="flex items-center">
- <heroicons-outline:question-mark-circle class="w-5 h-5 mr-2" />
- <span class="text-sm">{{ $t("common.help") }}</span>
- </div>
- <div class="text-sm">{{ version }}</div>
- </a>
+ <heroicons-solid:sparkles class="w-5 h-5" />
+ {{ $t(currentPlan) }}
+ </router-link>
+ <div class="text-sm ml-auto">{{ version }}</div>
</div>
</div>
<div class="flex-shrink-0 w-14" aria-hidden="true">
@@ -75,17 +74,16 @@
<Quickstart />
</div>
<div class="flex-shrink-0 flex border-t border-block-border px-4 py-2">
- <a
- href="https://docs.bytebase.com"
- target="_blank"
- class="flex justify-between items-center flex-shrink-0 w-full text-main group"
+ <router-link
+ to="/setting/subscription"
+ exact-active-class
+ class="text-sm flex"
+ :class="isFreePlan ? 'text-accent' : ''"
>
- <div class="flex items-center py-1">
- <heroicons-outline:question-mark-circle class="w-5 h-5 mr-2" />
- <span class="text-sm">{{ $t("common.help") }}</span>
- </div>
- <div class="text-sm">{{ version }}</div>
- </a>
+ <heroicons-outline:sparkles class="w-5 h-5" />
+ {{ $t(currentPlan) }}
+ </router-link>
+ <div class="text-sm ml-auto">{{ version }}</div>
</div>
</div>
</aside>
@@ -147,6 +145,7 @@ import Quickstart from "../components/Quickstart.vue";
import QuickActionPanel from "../components/QuickActionPanel.vue";
import { QuickActionType } from "../types";
import { isDBA, isDeveloper, isOwner } from "../utils";
+import { PlanType } from "../types";
interface LocalState {
showMobileOverlay: boolean;
@@ -238,6 +237,23 @@ export default {
return v;
});
+ const currentPlan = computed((): string => {
+ const plan = store.getters["subscription/currentPlan"]();
+ switch (plan) {
+ case PlanType.TEAM:
+ return "subscription.plan.team.title";
+ case PlanType.ENTERPRISE:
+ return "subscription.plan.enterprise.title";
+ default:
+ return "subscription.plan.try";
+ }
+ });
+
+ const isFreePlan = computed((): boolean => {
+ const plan = store.getters["subscription/currentPlan"]();
+ return plan === PlanType.FREE;
+ });
+
return {
state,
quickActionList,
@@ -245,6 +261,8 @@ export default {
showIntro,
showQuickstart,
version,
+ currentPlan,
+ isFreePlan,
};
},
};
diff --git a/frontend/src/locales/en.yml b/frontend/src/locales/en.yml
index 8f78765894..d96bf8d061 100644
--- a/frontend/src/locales/en.yml
+++ b/frontend/src/locales/en.yml
@@ -1305,15 +1305,16 @@ subscription:
gitlab-login: Login with GitLab account
plan:
title: Plan
+ try: Try Team
free:
- title: Free
+ title: Free Plan
label: ''
desc: Personal project or small team, no DBA
team:
- title: Team
+ title: Team Plan
label: Beta
desc: Medium size team, has dedicated DBA or TL for engineering velocity
enterprise:
- title: Enterprise
+ title: Enterprise Plan
label: Early access
desc: Large organization, has dedicated DBA group to manage database fleet
diff --git a/frontend/src/locales/zh-CN.yml b/frontend/src/locales/zh-CN.yml
index ae401805db..8225b50704 100644
--- a/frontend/src/locales/zh-CN.yml
+++ b/frontend/src/locales/zh-CN.yml
@@ -1146,6 +1146,7 @@ subscription:
gitlab-login: 通过 GitLab 账户登录
plan:
title: 版本
+ try: 试用团队版
free:
title: 免费版
label: ''