Skip to content

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

Move VCSProviderXXXPanel to components

天舟40e5b5b62968
diff --git a/frontend/src/views/VCSProviderConfigPanel.vue b/frontend/src/components/VCSProviderConfigPanel.vue
similarity index 95%
rename from frontend/src/views/VCSProviderConfigPanel.vue
rename to frontend/src/components/VCSProviderConfigPanel.vue
index b50a4c9562..763f24cd7c 100644
--- a/frontend/src/views/VCSProviderConfigPanel.vue
+++ b/frontend/src/components/VCSProviderConfigPanel.vue
@@ -1,5 +1,5 @@
<template>
- <div class="text-lg leading-6 font-medium text-control">
+ <div class="textlabel">
Application ID <span class="text-red-600">*</span>
</div>
<BBTextField
@@ -11,9 +11,7 @@
<p v-if="state.showApplicationIdError" class="mt-2 text-sm text-error">
Application ID must be a 64-character alphanumeric string
</p>
- <div class="mt-4 text-lg leading-6 font-medium text-control">
- Secret <span class="text-red-600">*</span>
- </div>
+ <div class="mt-4 textlabel">Secret <span class="text-red-600">*</span></div>
<BBTextField
class="mt-2 w-full"
:placeholder="'ex. b9e0efc7a233403799b42620c60ff98c146895a27b6219912ad15f4e2251cc3a'"
diff --git a/frontend/src/views/VCSProviderInfoPanel.vue b/frontend/src/components/VCSProviderInfoPanel.vue
similarity index 68%
rename from frontend/src/views/VCSProviderInfoPanel.vue
rename to frontend/src/components/VCSProviderInfoPanel.vue
index d7438acfb7..e9f7b4a390 100644
--- a/frontend/src/views/VCSProviderInfoPanel.vue
+++ b/frontend/src/components/VCSProviderInfoPanel.vue
@@ -1,14 +1,11 @@
<template>
- <div class="text-lg leading-6 font-medium text-control">Name</div>
- <BBTextField
- class="mt-2 w-full"
- :placeholder="'GitLab self-host'"
- :value="config.name"
- @input="config.name = $event.target.value"
- />
- <div class="mt-4 text-lg leading-6 font-medium text-control">
- GitLab Instance URL <span class="text-red-600">*</span>
+ <div class="textlabel">
+ {{ instanceURLLabel }} <span class="text-red-600">*</span>
</div>
+ <p class="mt-1 textinfolabel">
+ The VCS instance URL. Make sure this instance and Bytebase are network
+ accessible from each other.
+ </p>
<BBTextField
class="mt-2 w-full"
:placeholder="'https://gitlab.example.com'"
@@ -18,10 +15,21 @@
<p v-if="state.showURLError" class="mt-2 text-sm text-error">
Instance URL must begin with https:// or http://
</p>
+ <div class="mt-4 textlabel">Display Name</div>
+ <p class="mt-1 textinfolabel">
+ An optional display name to help identifying among different configs using
+ the same Git provider.
+ </p>
+ <BBTextField
+ class="mt-2 w-full"
+ :placeholder="namePlaceholder"
+ :value="config.name"
+ @input="config.name = $event.target.value"
+ />
</template>
<script lang="ts">
-import { onUnmounted, PropType, reactive } from "@vue/runtime-core";
+import { computed, onUnmounted, PropType, reactive } from "@vue/runtime-core";
import isEmpty from "lodash-es/isEmpty";
import { TEXT_VALIDATION_DELAY, VCSConfig } from "../types";
import { isURL } from "../utils";
@@ -49,6 +57,20 @@ export default {
clearInterval(state.urlValidationTimer);
});
+ const namePlaceholder = computed((): string => {
+ if (props.config.type == "GITLAB_SELF_HOST") {
+ return "GitLab self-host";
+ }
+ return "";
+ });
+
+ const instanceURLLabel = computed((): string => {
+ if (props.config.type == "GITLAB_SELF_HOST") {
+ return "GitLab Instance URL";
+ }
+ return "";
+ });
+
const changeURL = (value: string) => {
props.config.instanceURL = value;
@@ -72,7 +94,7 @@ export default {
}
};
- return { state, changeURL };
+ return { state, namePlaceholder, instanceURLLabel, changeURL };
},
};
</script>
diff --git a/frontend/src/views/VCSProviderSelectionPanel.vue b/frontend/src/components/VCSProviderSelectionPanel.vue
similarity index 92%
rename from frontend/src/views/VCSProviderSelectionPanel.vue
rename to frontend/src/components/VCSProviderSelectionPanel.vue
index 4aa87c0f40..f926001fd3 100644
--- a/frontend/src/views/VCSProviderSelectionPanel.vue
+++ b/frontend/src/components/VCSProviderSelectionPanel.vue
@@ -15,7 +15,7 @@
</label>
</div>
</div>
- <div class="mt-2 relative">
+ <div class="mt-4 relative">
<div class="absolute inset-0 flex items-center" aria-hidden="true">
<div class="w-full border-t border-block-border"></div>
</div>
@@ -25,8 +25,8 @@
</span>
</div>
</div>
- <div class="space-y-2">
- <div class="mt-2 flex flex-row space-x-2 items-center text-control">
+ <div class="mt-2 flex flex-row itmes-center space-x-4">
+ <div class="flex flex-row space-x-2 items-center text-control">
<div class="h-5 w-5">
<img src="../assets/gitlab-logo.svg" />
</div>