Skip to content

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

Add guide alert to Environment and instance

天舟d6ec41687882
diff --git a/frontend/src/components/ProfileDropdown.vue b/frontend/src/components/ProfileDropdown.vue
index c50cca7728..a8b98e9e37 100644
--- a/frontend/src/components/ProfileDropdown.vue
+++ b/frontend/src/components/ProfileDropdown.vue
@@ -132,6 +132,15 @@ export default {
key: "hidden",
newState: false,
});
+
+ store.dispatch("uistate/saveIntroStateByKey", {
+ key: "guide.environment",
+ newState: false,
+ });
+ store.dispatch("uistate/saveIntroStateByKey", {
+ key: "guide.instance",
+ newState: false,
+ });
};
const isOwner = computed(() => {
diff --git a/frontend/src/views/EnvironmentDashboard.vue b/frontend/src/views/EnvironmentDashboard.vue
index 98167a608b..6031803f50 100644
--- a/frontend/src/views/EnvironmentDashboard.vue
+++ b/frontend/src/views/EnvironmentDashboard.vue
@@ -50,6 +50,22 @@
@cancel="state.showCreateModal = false"
/>
</BBModal>
+
+ <BBAlert
+ v-if="state.showGuide"
+ :style="'INFO'"
+ :okText="'Do not show again'"
+ :cancelText="'Dismiss'"
+ :title="'How to setup \'Environment\' ?'"
+ :description="'Each environment in Bytebase maps to one of your testing, staging, prod environment respectively.\n\nEnvironment is a global setting, one Bytebase deployment only contains a single set of environments.\n\nDatabase instances are created under a particular environment and most tasks also require specifying an environment first.'"
+ @ok="
+ () => {
+ doDismissGuide();
+ }
+ "
+ @cancel="state.showGuide = false"
+ >
+ </BBAlert>
</template>
<script lang="ts">
@@ -64,6 +80,7 @@ interface LocalState {
reorderedEnvironmentList: Environment[];
selectedIndex: number;
showCreateModal: boolean;
+ showGuide: boolean;
reorder: boolean;
}
@@ -81,6 +98,7 @@ export default {
reorderedEnvironmentList: [],
selectedIndex: -1,
showCreateModal: false,
+ showGuide: false,
reorder: false,
});
@@ -103,6 +121,12 @@ export default {
if (environmentList.value.length > 0) {
selectEnvironment(0);
}
+
+ if (!store.getters["uistate/introStateByKey"]("guide.environment")) {
+ setTimeout(() => {
+ state.showGuide = true;
+ }, 1000);
+ }
});
onUnmounted(() => {
@@ -158,6 +182,14 @@ export default {
});
};
+ const doDismissGuide = () => {
+ store.dispatch("uistate/saveIntroStateByKey", {
+ key: "guide.environment",
+ newState: true,
+ });
+ state.showGuide = false;
+ };
+
const startReorder = () => {
state.reorderedEnvironmentList = [...environmentList.value];
state.reorder = true;
@@ -227,6 +259,7 @@ export default {
tabTitleList,
createEnvironment,
doCreate,
+ doDismissGuide,
reorderEnvironment,
orderChanged,
discardReorder,
diff --git a/frontend/src/views/InstanceDashboard.vue b/frontend/src/views/InstanceDashboard.vue
index caeca1a2c5..877a9d5f83 100644
--- a/frontend/src/views/InstanceDashboard.vue
+++ b/frontend/src/views/InstanceDashboard.vue
@@ -13,6 +13,22 @@
</div>
<InstanceTable :instanceList="filteredList(instanceList)" />
</div>
+
+ <BBAlert
+ v-if="state.showGuide"
+ :style="'INFO'"
+ :okText="'Do not show again'"
+ :cancelText="'Dismiss'"
+ :title="'How to setup \'Instance\' ?'"
+ :description="'Each instance in Bytebase usually maps to one of your database instance represented by an host:port address. This could be your on-premise MySQL instance, a RDS instance.\n\nBytebase requires read/write (NOT the super privilege) access to the instance in order to perform database operations on behalf of the user.\n\nInstance is only exposed to Owners and DBAs. For the developers, they are interacting directly with the database inside the instance.'"
+ @ok="
+ () => {
+ doDismissGuide();
+ }
+ "
+ @cancel="state.showGuide = false"
+ >
+ </BBAlert>
</template>
<script lang="ts">
@@ -26,6 +42,7 @@ import { Environment, Instance } from "../types";
interface LocalState {
searchText: string;
selectedEnvironment?: Environment;
+ showGuide: boolean;
}
export default {
@@ -47,11 +64,18 @@ export default {
router.currentRoute.value.query.environment
)
: undefined,
+ showGuide: false,
});
onMounted(() => {
// Focus on the internal search field when mounted
searchField.value.$el.querySelector("#search").focus();
+
+ if (!store.getters["uistate/introStateByKey"]("guide.instance")) {
+ setTimeout(() => {
+ state.showGuide = true;
+ }, 1000);
+ }
});
const prepareInstanceList = () => {
@@ -78,6 +102,14 @@ export default {
state.searchText = searchText;
};
+ const doDismissGuide = () => {
+ store.dispatch("uistate/saveIntroStateByKey", {
+ key: "guide.instance",
+ newState: true,
+ });
+ state.showGuide = false;
+ };
+
const instanceList = computed(() => {
return store.getters["instance/instanceList"]();
});
@@ -106,6 +138,7 @@ export default {
filteredList,
selectEnvironment,
changeSearchText,
+ doDismissGuide,
};
},
};