Skip to content

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

feat: add feature badge (#785)

ecmadaof502f63d830e
diff --git a/frontend/src/components/EnvironmentForm.vue b/frontend/src/components/EnvironmentForm.vue
index fc4fa0261d..190154a4e0 100644
--- a/frontend/src/components/EnvironmentForm.vue
+++ b/frontend/src/components/EnvironmentForm.vue
@@ -47,7 +47,10 @@
:disabled="!allowEdit"
/>
<div class="-mt-0.5">
- <div class="textlabel">{{ $t("policy.approval.auto") }}</div>
+ <div class="textlabel flex">
+ {{ $t("policy.approval.auto") }}
+ <FeatureBadge feature="bb.feature.approval-policy" />
+ </div>
<div class="mt-1 textinfolabel">
{{ $t("policy.approval.auto-info") }}
</div>
@@ -86,7 +89,10 @@
:disabled="!allowEdit"
/>
<div class="-mt-0.5">
- <div class="textlabel">{{ $t("policy.backup.daily") }}</div>
+ <div class="textlabel flex">
+ {{ $t("policy.backup.daily") }}
+ <FeatureBadge feature="bb.feature.backup-policy" />
+ </div>
<div class="mt-1 textinfolabel">
{{ $t("policy.backup.daily-info") }}
</div>
@@ -102,7 +108,10 @@
:disabled="!allowEdit"
/>
<div class="-mt-0.5">
- <div class="textlabel">{{ $t("policy.backup.weekly") }}</div>
+ <div class="textlabel flex">
+ {{ $t("policy.backup.weekly") }}
+ <FeatureBadge feature="bb.feature.backup-policy" />
+ </div>
<div class="mt-1 textinfolabel">
{{ $t("policy.backup.weekly-info") }}
</div>
diff --git a/frontend/src/components/FeatureBadge.vue b/frontend/src/components/FeatureBadge.vue
new file mode 100644
index 0000000000..247a0fd546
--- /dev/null
+++ b/frontend/src/components/FeatureBadge.vue
@@ -0,0 +1,31 @@
+<template>
+ <router-link v-if="!hasFeature" to="/setting/subscription" exact-active-class>
+ <heroicons-solid:sparkles class="w-5 h-5 text-accent" />
+ </router-link>
+</template>
+
+<script lang="ts">
+import { PropType, computed } from "vue";
+import { useStore } from "vuex";
+import { FeatureType } from "../types";
+
+export default {
+ props: {
+ feature: {
+ required: true,
+ type: String as PropType<FeatureType>,
+ },
+ },
+ setup(props) {
+ const store = useStore();
+
+ const hasFeature = computed(() =>
+ store.getters["subscription/feature"](props.feature)
+ );
+
+ return {
+ hasFeature,
+ };
+ },
+};
+</script>