Skip to content

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

Add initial repo setup UI

天舟fc758a94456c
diff --git a/frontend/src/components/RepositorySetupPanel.vue b/frontend/src/components/RepositorySetupPanel.vue
new file mode 100644
index 0000000000..8fb1d88ab0
--- /dev/null
+++ b/frontend/src/components/RepositorySetupPanel.vue
@@ -0,0 +1,134 @@
+<template>
+ <nav aria-label="Repository setup">
+ <ol class="flex space-y-0 space-x-8">
+ <li v-for="(step, index) in stepList" :key="index" class="flex-1">
+ <!-- Completed Step -->
+ <div
+ class="group flex flex-col pt-4 border-t-4"
+ :class="
+ state.currentStep >= index
+ ? 'border-accent hover:border-accent-hover cursor-pointer'
+ : 'border-control-border'
+ "
+ @click.prevent="
+ () => {
+ if (state.currentStep >= index) {
+ switchStep(index);
+ }
+ }
+ "
+ >
+ <span
+ class="text-xs font-semibold tracking-wide uppercase"
+ :class="
+ state.currentStep >= index
+ ? 'text-accent group-hover:text-accent-hover'
+ : 'text-control-light'
+ "
+ >Step {{ index + 1 }}</span
+ >
+ <span class="text-sm font-medium">{{ step }}</span>
+ </div>
+ </li>
+ </ol>
+ </nav>
+ <template v-if="state.currentStep == SetupStep.CHOOSE_PROVIDER">
+ choose provider
+ </template>
+ <template v-else-if="state.currentStep == SetupStep.SELECT_REPO">
+ select repo
+ </template>
+ <template v-else-if="state.currentStep == SetupStep.CONFIGURE_DEPLOY">
+ configure deploy
+ </template>
+ <div class="pt-4 flex justify-between">
+ <button type="button" class="btn-normal" @click.prevent="cancel">
+ Cancel
+ </button>
+ <div class="flex flex-row space-x-2">
+ <button
+ v-if="state.currentStep != 0"
+ type="button"
+ class="btn-normal"
+ @click.prevent="switchStep(state.currentStep - 1)"
+ >
+ <svg
+ class="-ml-1 mr-1 h-5 w-5 text-control-light"
+ fill="none"
+ stroke="currentColor"
+ viewBox="0 0 24 24"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ <path
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ stroke-width="2"
+ d="M15 19l-7-7 7-7"
+ ></path>
+ </svg>
+ <span>Back</span>
+ </button>
+ <button
+ v-if="state.currentStep == stepList.length - 1"
+ type="button"
+ class="btn-primary"
+ @click.prevent="finishSetup"
+ >
+ Finish
+ </button>
+ <button
+ v-else
+ type="button"
+ class="btn-primary"
+ @click.prevent="switchStep(state.currentStep + 1)"
+ >
+ Next
+ </button>
+ </div>
+ </div>
+</template>
+
+<script lang="ts">
+import { reactive } from "@vue/reactivity";
+enum SetupStep {
+ CHOOSE_PROVIDER = 0,
+ SELECT_REPO = 1,
+ CONFIGURE_DEPLOY = 2,
+}
+
+interface LocalState {
+ currentStep: SetupStep;
+}
+
+const stepList = [
+ "Choose Git provider",
+ "Select repository",
+ "Configure deploy",
+];
+
+export default {
+ name: "RepositorySetupPanel",
+ components: {},
+ setup(props, ctx) {
+ const state = reactive<LocalState>({
+ currentStep: SetupStep.CHOOSE_PROVIDER,
+ });
+
+ const switchStep = (step: SetupStep) => {
+ state.currentStep = step;
+ };
+
+ const finishSetup = () => {
+ console.log("finish");
+ };
+
+ return {
+ SetupStep,
+ state,
+ stepList,
+ switchStep,
+ finishSetup,
+ };
+ },
+};
+</script>
diff --git a/frontend/src/views/ProjectDetail.vue b/frontend/src/views/ProjectDetail.vue
index 659a3bb109..be0bd67981 100644
--- a/frontend/src/views/ProjectDetail.vue
+++ b/frontend/src/views/ProjectDetail.vue
@@ -8,7 +8,7 @@
<BBTableTabFilter
class="px-1 pb-2 border-b border-block-border"
:responsive="false"
- :tabList="['Overview', 'Repository', 'Settings']"
+ :tabList="['Overview', 'Git repository', 'Settings']"
:selectedIndex="state.selectedIndex"
@select-index="
(index) => {
@@ -39,7 +39,9 @@
/>
</div>
</div>
- <template v-else-if="state.selectedIndex == REPO_TAB"> </template>
+ <template v-else-if="state.selectedIndex == REPO_TAB">
+ <RepositorySetupPanel />
+ </template>
<template v-else-if="state.selectedIndex == SETTING_TAB">
<div class="max-w-3xl mx-auto space-y-4">
<div class="divide-y divide-block-border space-y-6">
@@ -83,6 +85,7 @@ import ArchiveBanner from "../components/ArchiveBanner.vue";
import DatabaseTable from "../components/DatabaseTable.vue";
import ProjectGeneralSettingPanel from "../components/ProjectGeneralSettingPanel.vue";
import ProjectMemberPanel from "../components/ProjectMemberPanel.vue";
+import RepositorySetupPanel from "../components/RepositorySetupPanel.vue";
import IssueTable from "../components/IssueTable.vue";
import { ProjectPatch, Issue } from "../types";
@@ -103,6 +106,7 @@ export default {
DatabaseTable,
ProjectGeneralSettingPanel,
ProjectMemberPanel,
+ RepositorySetupPanel,
IssueTable,
},
props: {