Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
feat: vcs config for GitLab.com (#4883)
Tianzhou (天舟)1a0ee7be08aa
diff --git a/frontend/src/components/VCSProviderBasicInfoPanel.vue b/frontend/src/components/VCSProviderBasicInfoPanel.vueindex 0e888c863c..c39e654a64 100644--- a/frontend/src/components/VCSProviderBasicInfoPanel.vue+++ b/frontend/src/components/VCSProviderBasicInfoPanel.vue@@ -7,13 +7,13 @@<div class="pt-4 radio-set-row"><div class="radio space-x-2"><input- v-model="config.type"+ v-model="config.uiType"name="Self-host GitLab"tabindex="-1"type="radio"class="btn"- value="GITLAB"- @change="changeType()"+ value="GITLAB_SELF_HOST"+ @change="changeUIType()"/><img class="h-6 w-auto" src="../assets/gitlab-logo.svg" /><label class="whitespace-nowrap"@@ -22,13 +22,26 @@</div><div class="radio space-x-2"><input- v-model="config.type"+ v-model="config.uiType"+ name="GitLab.com"+ tabindex="-1"+ type="radio"+ class="btn"+ value="GITLAB_COM"+ @change="changeUIType()"+ />+ <img class="h-6 w-auto" src="../assets/gitlab-logo.svg" />+ <label class="whitespace-nowrap">GitLab.com </label>+ </div>+ <div class="radio space-x-2">+ <input+ v-model="config.uiType"name="GitHub.com"tabindex="-1"type="radio"class="btn"- value="GITHUB"- @change="changeType()"+ value="GITHUB_COM"+ @change="changeUIType()"/><img class="h-6 w-auto" src="../assets/github-logo.svg" /><label class="whitespace-nowrap">GitHub.com</label>@@ -42,12 +55,6 @@</div></div><div class="mt-2 flex flex-row itmes-center space-x-4 text-xs">- <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>- <label class="whitespace-nowrap">GitLab.com </label>- </div><div class="flex flex-row space-x-2 items-center text-control"><div class="h-5 w-5"><img src="../assets/github-logo.svg" />@@ -128,7 +135,11 @@ export default defineComponent({const namePlaceholder = computed((): string => {if (props.config.type == "GITLAB") {- return t("gitops.setting.add-git-provider.gitlab-self-host");+ if (props.config.uiType == "GITLAB_SELF_HOST") {+ return t("gitops.setting.add-git-provider.gitlab-self-host");+ } else if (props.config.uiType == "GITLAB_COM") {+ return "GitLab.com";+ }} else if (props.config.type == "GITHUB") {return "GitHub.com";}@@ -150,7 +161,11 @@ export default defineComponent({const instanceUrlPlaceholder = computed((): string => {if (props.config.type == "GITLAB") {- return "https://gitlab.example.com";+ if (props.config.uiType == "GITLAB_SELF_HOST") {+ return "https://gitlab.example.com";+ } else if (props.config.uiType == "GITLAB_COM") {+ return "https://gitlab.com";+ }} else if (props.config.type == "GITHUB") {return "https://github.com";}@@ -159,7 +174,10 @@ export default defineComponent({// github.com instance url is always https://github.comconst instanceUrlDisabled = computed((): boolean => {- return props.config.type == "GITHUB";+ return (+ props.config.type == "GITHUB" ||+ (props.config.type == "GITLAB" && props.config.uiType == "GITLAB_COM")+ );});const changeUrl = (value: string) => {@@ -189,15 +207,26 @@ export default defineComponent({};// FIXME: Unexpected mutation of "config" prop. Do we care?- const changeType = () => {- if (props.config.type == "GITLAB") {+ const changeUIType = () => {+ if (props.config.uiType == "GITLAB_SELF_HOST") {+ // eslint-disable-next-line vue/no-mutating-props+ props.config.type = "GITLAB";// eslint-disable-next-line vue/no-mutating-propsprops.config.instanceUrl = "";// eslint-disable-next-line vue/no-mutating-propsprops.config.name = t("gitops.setting.add-git-provider.gitlab-self-host");- } else if (props.config.type == "GITHUB") {+ } else if (props.config.uiType == "GITLAB_COM") {+ // eslint-disable-next-line vue/no-mutating-props+ props.config.type = "GITLAB";+ // eslint-disable-next-line vue/no-mutating-props+ props.config.instanceUrl = "https://gitlab.com";+ // eslint-disable-next-line vue/no-mutating-props+ props.config.name = "GitLab.com";+ } else if (props.config.uiType == "GITHUB_COM") {+ // eslint-disable-next-line vue/no-mutating-props+ props.config.type = "GITHUB";// eslint-disable-next-line vue/no-mutating-propsprops.config.instanceUrl = "https://github.com";// eslint-disable-next-line vue/no-mutating-props@@ -212,7 +241,7 @@ export default defineComponent({instanceUrlPlaceholder,instanceUrlDisabled,changeUrl,- changeType,+ changeUIType,};},});diff --git a/frontend/src/components/VCSProviderConfirmPanel.vue b/frontend/src/components/VCSProviderConfirmPanel.vueindex 0a14cf8c9d..7d6aed48ee 100644--- a/frontend/src/components/VCSProviderConfirmPanel.vue+++ b/frontend/src/components/VCSProviderConfirmPanel.vue@@ -19,7 +19,7 @@</dt><dd class="col-start-2 col-span-3 text-sm text-main"><div- v-if="config.type == 'GITLAB'"+ v-if="config.uiType == 'GITLAB_SELF_HOST'"class="flex flex-row items-center space-x-2"><img class="h-6 w-auto" src="../assets/gitlab-logo.svg" />@@ -28,7 +28,14 @@</div></div><div- v-if="config.type == 'GITHUB'"+ v-else-if="config.uiType == 'GITLAB_COM'"+ class="flex flex-row items-center space-x-2"+ >+ <img class="h-6 w-auto" src="../assets/gitlab-logo.svg" />+ <div class="whitespace-nowrap">GitLab.com</div>+ </div>+ <div+ v-else-if="config.uiType == 'GITHUB_COM'"class="flex flex-row items-center space-x-2"><img class="h-6 w-auto" src="../assets/github-logo.svg" />diff --git a/frontend/src/components/VCSProviderOAuthPanel.vue b/frontend/src/components/VCSProviderOAuthPanel.vueindex 55fa1d97af..6235732a07 100644--- a/frontend/src/components/VCSProviderOAuthPanel.vue+++ b/frontend/src/components/VCSProviderOAuthPanel.vue@@ -1,14 +1,21 @@<template><div class="space-y-4"><div class="textlabel">- <template v-if="config.type == 'GITLAB'">+ <template v-if="config.uiType == 'GITLAB_SELF_HOST'">{{$t(- "gitops.setting.add-git-provider.oauth-info.gitlab-register-oauth-application"+ "gitops.setting.add-git-provider.oauth-info.gitlab-self-host-register-oauth-application")}}</template>- <template v-if="config.type == 'GITHUB'">+ <template v-else-if="config.uiType == 'GITLAB_COM'">+ {{+ $t(+ "gitops.setting.add-git-provider.oauth-info.gitlab-com-register-oauth-application"+ )+ }}+ </template>+ <template v-else-if="config.uiType == 'GITHUB_COM'">{{$t("gitops.setting.add-git-provider.oauth-info.github-register-oauth-application"@@ -17,12 +24,12 @@</template></div><ol class="textinfolabel space-y-2">- <template v-if="config.type == 'GITLAB'">+ <template v-if="config.uiType == 'GITLAB_SELF_HOST'"><li>1.{{$t(- "gitops.setting.add-git-provider.oauth-info.gitlab-login-as-admin"+ "gitops.setting.add-git-provider.oauth-info.gitlab-self-host-login-as-admin")}}<img class="w-auto" src="../assets/gitlab_admin_area.png" />@@ -31,11 +38,11 @@2.{{$t(- "gitops.setting.add-git-provider.oauth-info.gitlab-visit-admin-page"+ "gitops.setting.add-git-provider.oauth-info.gitlab-self-host-visit-admin-page")}}<a- :href="createAdminApplicationUrl"+ :href="createOAuthApplicationUrl"target="_blank"class="normal-link">{{@@ -103,7 +110,84 @@}}</li></template>- <template v-if="config.type == 'GITHUB'">+ <template v-else-if="config.uiType == 'GITLAB_COM'">+ <li>+ 1.+ {{+ $t("gitops.setting.add-git-provider.oauth-info.gitlab-com-login")+ }}+ </li>+ <li>+ 2.+ {{+ $t(+ "gitops.setting.add-git-provider.oauth-info.gitlab-com-visit-application-page"+ )+ }}+ <a+ :href="createOAuthApplicationUrl"+ target="_blank"+ class="normal-link"+ >{{+ $t("gitops.setting.add-git-provider.oauth-info.direct-link")+ }}</a+ >+ </li>+ <li>+ 3.+ {{+ $t("gitops.setting.add-git-provider.oauth-info.create-oauth-app")+ }}+ <div class="m-4 flex justify-center">+ <dl+ class="divide-y divide-block-border border border-block-border shadow rounded-lg"+ >+ <div class="grid grid-cols-2 gap-4 px-4 py-2">+ <dt class="text-sm font-medium text-control-light text-right">+ Name+ </dt>+ <dd class="text-sm text-main">Bytebase</dd>+ </div>+ <div class="grid grid-cols-2 gap-4 px-4 py-2 items-center">+ <dt class="text-sm font-medium text-control-light text-right">+ Redirect URI+ </dt>+ <dd class="text-sm text-main items-center flex">+ {{ redirectUrl() }}+ <button+ tabindex="-1"+ class="ml-1 text-sm font-medium text-control-light hover:bg-gray-100"+ @click.prevent="copyRedirectURI"+ >+ <heroicons-outline:clipboard class="w-6 h-6" />+ </button>+ </dd>+ </div>+ <div class="grid grid-cols-2 gap-4 px-4 py-2">+ <dt class="text-sm font-medium text-control-light text-right">+ Confidential+ </dt>+ <dd class="text-sm text-main">Yes</dd>+ </div>+ <div class="grid grid-cols-2 gap-4 px-4 py-2">+ <dt class="text-sm font-medium text-control-light text-right">+ Scopes+ </dt>+ <dd class="text-sm text-main">api</dd>+ </div>+ </dl>+ </div>+ </li>+ <li>+ 4.+ {{+ $t(+ "gitops.setting.add-git-provider.oauth-info.gitlab-paste-oauth-info"+ )+ }}+ </li>+ </template>+ <template v-else-if="config.uiType == 'GITHUB_COM'"><li>1.{{@@ -268,10 +352,12 @@ export default defineComponent({}});- const createAdminApplicationUrl = computed((): string => {- if (props.config.type == "GITLAB") {+ const createOAuthApplicationUrl = computed((): string => {+ if (props.config.uiType == "GITLAB_SELF_HOST") {return `${props.config.instanceUrl}/admin/applications/new`;- } else if (props.config.type == "GITHUB") {+ } else if (props.config.uiType == "GITLAB_COM") {+ return `https://gitlab.com/-/profile/applications`;+ } else if (props.config.uiType == "GITHUB_COM") {return `https://github.com/settings/applications/new`;}return "";@@ -404,7 +490,7 @@ export default defineComponent({return {redirectUrl,state,- createAdminApplicationUrl,+ createOAuthApplicationUrl,copyHomepageURL,copyRedirectURI,changeApplicationId,diff --git a/frontend/src/components/VCSSetupWizard.vue b/frontend/src/components/VCSSetupWizard.vueindex 2d6135d691..c796bf267f 100644--- a/frontend/src/components/VCSSetupWizard.vue+++ b/frontend/src/components/VCSSetupWizard.vue@@ -83,6 +83,7 @@ export default defineComponent({const state = reactive<LocalState>({config: {type: "GITLAB",+ uiType: "GITLAB_SELF_HOST",name: t("gitops.setting.add-git-provider.gitlab-self-host"),instanceUrl: "",applicationId: "",@@ -143,8 +144,13 @@ export default defineComponent({const attentionText = computed((): string => {if (state.config.type == "GITLAB") {+ if (state.config.uiType == "GITLAB_SELF_HOST") {+ return t(+ "gitops.setting.add-git-provider.gitlab-self-host-admin-requirement"+ );+ }return t(- "gitops.setting.add-git-provider.gitlab-self-host-admin-requirement"+ "gitops.setting.add-git-provider.gitlab-com-admin-requirement");} else if (state.config.type == "GITHUB") {return t(diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.jsonindex 38c4479a30..306630f104 100644--- a/frontend/src/locales/en-US.json+++ b/frontend/src/locales/en-US.json@@ -1288,6 +1288,7 @@"description": "Before any project can enable GitOps workflow, Bytebase first needs to integrate with the corresponding version control system (VCS) by registering as an OAuth application in that VCS. Below are the steps to configure this, you can also follow our {guide}.","gitlab-self-host": "GitLab self-host","gitlab-self-host-admin-requirement": "You need to be an Admin of your chosen GitLab instance to configure this. Otherwise, you need to ask your GitLab instance Admin to register Bytebase as a GitLab instance-wide OAuth application, then provide you that Application ID and Secret to fill at the 'OAuth application info' step.",+ "gitlab-com-admin-requirement": "Your account needs to have Admin access to any of the repositories to be linked. Usually this account corresponds to a dedicated service user instead of a human user.","github-com-admin-requirement": "You need to be an admin of your chosen GitHub organization to configure this. Otherwise, you need to ask your GitHub organization admin to register Bytebase as a GitHub organization-wide OAuth application, then provide you that Application ID and Secret to fill at the 'OAuth application info' step.","oauth-info-correct": "Verified OAuth info is correct","check-oauth-info-match": "Please make sure Secret matches the one from your GitLab instance Application.",@@ -1305,12 +1306,15 @@},"oauth-info": {"self": "OAuth application info",- "gitlab-register-oauth-application": "Register Bytebase as a GitLab instance-wide OAuth application.",- "gitlab-login-as-admin": "Login as an Admin user to the GitLab instance. The account must be an Admin of the entire GitLab instance (it has a wrench icon on the top bar).",- "gitlab-visit-admin-page": "Go to the Admin page by clicking the wrench icon, then navigate to \"Applications\" section and click \"New application\" button.",+ "gitlab-self-host-register-oauth-application": "Register Bytebase as a GitLab instance-wide OAuth application.",+ "gitlab-self-host-login-as-admin": "Log in as an Admin user to the GitLab instance. The account must be an Admin of the entire GitLab instance (it has a wrench icon on the top bar).",+ "gitlab-self-host-visit-admin-page": "Go to the Admin page by clicking the wrench icon, then navigate to \"Applications\" section and click \"New application\" button.",+ "gitlab-com-register-oauth-application": "Register Bytebase as a GitLab user OAuth application.",+ "gitlab-com-login": "Log in as whichever account you want Bytebase to act as. Usually this account corresponds to a dedicated service user instead of a human user.",+ "gitlab-com-visit-application-page": "Go to Preferences -> Applications page. You can reach it through your profile picture on the top right corner.","gitlab-paste-oauth-info": "Paste the Application ID and Secret from that just created application into fields below.","github-register-oauth-application": "Register Bytebase as a GitHub organization-wide OAuth application.",- "github-login-as-admin": "Login as an organization admin user to the GitHub.com. The account must be an organization admin of the GitHub organization (able to access the organization Settings page).",+ "github-login-as-admin": "Log in as an organization admin user to the GitHub.com. The account must be an organization admin of the GitHub organization (able to access the organization Settings page).","github-visit-admin-page": "Go to the Settings page, then navigate to \"Developer settings > OAuth Apps\" section and click \"Register an application\" button.","github-paste-oauth-info": "Paste the Client ID and Client secret from that just created application into fields below.","copy-homepage-url": "Homepage URL copied to clipboard. Paste to the corresponding field on the OAuth application form.",@@ -1328,9 +1332,11 @@}},"git-provider": {- "gitlab-application-id-label": "Application ID for the registered GitLab instance-wide OAuth application.",+ "gitlab-self-host-application-id-label": "Application ID for the registered GitLab instance-wide OAuth application.",+ "gitlab-com-application-id-label": "Application ID for the registered GitLab OAuth application.","view-in-gitlab": "View in GitLab",- "secret-label-gitlab": "Secret for the registered GitLab instance-wide OAuth application.",+ "gitlab-self-host-secret-label": "Secret for the registered GitLab instance-wide OAuth application.",+ "gitlab-com-secret-label": "Secret for the registered GitLab OAuth application.","github-application-id-label": "Client ID for the registered GitHub organization-wide OAuth application.","secret-label-github": "Client secret for the registered GitHub organization-wide OAuth application.","delete-forbidden": "To delete this provider, unlink all repositories first.",diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.jsonindex 97e66cc8da..4d178f9124 100644--- a/frontend/src/locales/zh-CN.json+++ b/frontend/src/locales/zh-CN.json@@ -1286,6 +1286,7 @@"description": "在项目可以启用 GitOps 工作流前,Bytebase 首先需要以在 VCS 中注册为 OAuth 应用的方式和 VCS 进行集成。以下是配置该集成的步骤,您也可以按照我们的{guide}。","gitlab-self-host": "自托管 GitLab","gitlab-self-host-admin-requirement": "您必须是 GitLab 实例的管理员才能进行该配置。否则您需要让您的 GitLab 实例管理员把 Bytebase 先注册为 GitLab 整个实例级别的 OAuth 应用,之后再让对方提供给您注册完成后的应用 ID 以及 Secret,以让您在「OAuth 应用信息」步骤进行填写。",+ "gitlab-com-admin-requirement": "您的账号必须对您打算关联的代码仓库拥有管理员权限。通常这个账号对应的是一个专门的服务账号而非个人账号。","github-com-admin-requirement": "您必须是 GitHub 组织的管理员才能进行该配置。否则您需要让您的 GitHub 组织管理员把 Bytebase 先注册为组织级别的 OAuth 应用,之后再让对方提供给您注册完成后的应用 ID 以及 Secret,以让您在「OAuth 应用信息」步骤进行填写。","oauth-info-correct": "OAuth 信息验证成功","check-oauth-info-match": "请确认 Secret 和注册在 GitLab 实例上的应用信息匹配。",@@ -1303,9 +1304,12 @@},"oauth-info": {"self": "OAuth 应用信息",- "gitlab-register-oauth-application": "注册 Bytebase 为一个 GitLab 实例级别 (instance-wide) 的 OAuth 应用。",- "gitlab-login-as-admin": "以管理员身份登录 GitLab 实例。这个账号必须是整个 GitLab 实例的管理员 (会看到小扳手在顶栏)。",- "gitlab-visit-admin-page": "通过点击小扳手访问管理员界面,然后导航到「应用」分区,再点击「创建应用」。",+ "gitlab-self-host-register-oauth-application": "注册 Bytebase 为一个 GitLab 实例级别 (instance-wide) 的 OAuth 应用。",+ "gitlab-self-host-login-as-admin": "以管理员身份登录 GitLab 实例。这个账号必须是整个 GitLab 实例的管理员 (会看到小扳手在顶栏)。",+ "gitlab-self-host-visit-admin-page": "通过点击小扳手访问管理员界面,然后导航到「应用」分区,再点击「创建应用」。",+ "gitlab-com-register-oauth-application": "注册 Bytebase 为一个 GitLab 用户的 OAuth 应用。",+ "gitlab-com-login": "通过账号登陆 GitLab.com。通常这个账号对应的是一个专门的服务账号而非个人账号。",+ "gitlab-com-visit-application-page": "访问 Preferences -> Applications 页面。您可以通过右上角的头像下拉菜单访问到该页面。","gitlab-paste-oauth-info": "从刚创建好的应用上粘贴它的应用 ID 和 Secret 到下面的字段。","github-register-oauth-application": "注册 Bytebase 为一个 GitHub 组织级别 (organization-wide) 的 OAuth 应用。","github-login-as-admin": "以组织管理员身份登录 GitHub.com。这个账号必须是 GitHub 组织的管理员 (能够进入组织 Settings 页面)。",@@ -1326,9 +1330,11 @@}},"git-provider": {- "gitlab-application-id-label": "注册为 GitLab 实例级 OAuth 应用的应用 ID。",+ "gitlab-self-host-application-id-label": "注册为 GitLab 实例级 OAuth 应用的应用 ID。",+ "gitlab-com-application-id-label": "注册为 GitLab OAuth 应用的应用 ID。","view-in-gitlab": "查看 GitLab",- "secret-label-gitlab": "注册为 GitLab 实例级 OAuth 应用的 Secret。",+ "gitlab-self-host-secret-label": "注册为 GitLab 实例级 OAuth 应用的 Secret。",+ "gitlab-com-secret-label": "注册为 GitLab OAuth 应用的 Secret。","github-application-id-label": "注册为 GitHub 组织级别 OAuth 应用的 Client ID。","secret-label-github": "注册为 GitHub 组织级别 OAuth 应用的 Client secret。","delete-forbidden": "删除这个提供方前,需要先解除所有仓库的关联。",diff --git a/frontend/src/store/modules/vcs.ts b/frontend/src/store/modules/vcs.tsindex c3ac3aa9ee..5c7b8dee5c 100644--- a/frontend/src/store/modules/vcs.ts+++ b/frontend/src/store/modules/vcs.ts@@ -10,12 +10,22 @@ import {VCSPatch,empty,EMPTY_ID,+ VCSUIType,} from "@/types";function convert(vcs: ResourceObject, includedList: ResourceObject[]): VCS {+ let uiType: VCSUIType = "GITLAB_SELF_HOST";+ if (vcs.attributes.type == "GITLAB") {+ if (vcs.attributes.instanceUrl == "https://gitlab.com") {+ uiType = "GITLAB_COM";+ }+ } else if (vcs.attributes.type == "GITHUB") {+ uiType = "GITHUB_COM";+ }return {...(vcs.attributes as Omit<VCS, "id">),id: parseInt(vcs.id),+ uiType,};}diff --git a/frontend/src/types/vcs.ts b/frontend/src/types/vcs.tsindex 1c26f6ad23..67252a16d8 100644--- a/frontend/src/types/vcs.ts+++ b/frontend/src/types/vcs.ts@@ -1,9 +1,15 @@import { VCSId } from "./id";+// Backend uses the same ENUM for GitLab/GitHub SaaS and self-hosted. Because they are based on the+// same codebase.export type VCSType = "GITLAB" | "GITHUB";+// When configuring the VCS, we split the SaaS and self-hosted into two types to present optimal UX.+export type VCSUIType = "GITLAB_SELF_HOST" | "GITLAB_COM" | "GITHUB_COM";+export interface VCSConfig {type: VCSType;+ uiType: VCSUIType;name: string;instanceUrl: string;applicationId: string;@@ -16,6 +22,7 @@ export type VCS = {// Domain specific fieldsname: string;type: VCSType;+ uiType: VCSUIType;instanceUrl: string;apiUrl: string;applicationId: string;diff --git a/frontend/src/views/SettingWorkspaceVCSDetail.vue b/frontend/src/views/SettingWorkspaceVCSDetail.vueindex 377f0763ba..2379fcdf9d 100644--- a/frontend/src/views/SettingWorkspaceVCSDetail.vue+++ b/frontend/src/views/SettingWorkspaceVCSDetail.vue@@ -2,7 +2,7 @@<div class="mt-4 space-y-4"><div class="flex justify-end"><div- v-if="vcs.type == 'GITLAB'"+ v-if="vcs.uiType == 'GITLAB_SELF_HOST'"class="flex flex-row items-center space-x-2"><div class="textlabel whitespace-nowrap">@@ -11,7 +11,14 @@<img class="h-6 w-auto" src="../assets/gitlab-logo.svg" /></div><div- v-if="vcs.type == 'GITHUB'"+ v-else-if="vcs.uiType == 'GITLAB_COM'"+ class="flex flex-row items-center space-x-2"+ >+ <div class="textlabel whitespace-nowrap">GitLab.com</div>+ <img class="h-6 w-auto" src="../assets/gitlab-logo.svg" />+ </div>+ <div+ v-else-if="vcs.uiType == 'GITHUB_COM'"class="flex flex-row items-center space-x-2"><div class="textlabel whitespace-nowrap">GitHub.com</div>@@ -56,13 +63,25 @@{{ $t("common.application") }} ID</label><p class="mt-1 textinfolabel">- <template v-if="vcs.type == 'GITLAB'">- {{ $t("gitops.setting.git-provider.gitlab-application-id-label") }}+ <template v-if="vcs.uiType == 'GITLAB_SELF_HOST'">+ {{+ $t(+ "gitops.setting.git-provider.gitlab-self-host-application-id-label"+ )+ }}<a :href="adminApplicationUrl" target="_blank" class="normal-link">{{$t("gitops.setting.git-provider.view-in-gitlab")}}</a></template>- <template v-if="vcs.type == 'GITHUB'">+ <template v-else-if="vcs.uiType == 'GITLAB_COM'">+ {{+ $t("gitops.setting.git-provider.gitlab-com-application-id-label")+ }}+ <a :href="adminApplicationUrl" target="_blank" class="normal-link">{{+ $t("gitops.setting.git-provider.view-in-gitlab")+ }}</a>+ </template>+ <template v-else-if="vcs.uiType == 'GITHUB_COM'">{{ $t("gitops.setting.git-provider.github-application-id-label") }}</template></p>@@ -78,10 +97,13 @@<div><label for="secret" class="textlabel"> Secret </label><p class="mt-1 textinfolabel">- <template v-if="vcs.type == 'GITLAB'">- {{ $t("gitops.setting.git-provider.secret-label-gitlab") }}+ <template v-if="vcs.uiType == 'GITLAB_SELF_HOST'">+ {{ $t("gitops.setting.git-provider.gitlab-self-host-secret-label") }}+ </template>+ <template v-else-if="vcs.uiType == 'GITLAB_COM'">+ {{ $t("gitops.setting.git-provider.gitlab-com-secret-label") }}</template>- <template v-if="vcs.type == 'GITHUB'">+ <template v-else-if="vcs.uiType == 'GITHUB_COM'">{{ $t("gitops.setting.git-provider.secret-label-github") }}</template></p>@@ -241,8 +263,10 @@ export default defineComponent({watchEffect(prepareRepositoryList);const adminApplicationUrl = computed(() => {- if (vcs.value.type == "GITLAB") {+ if (vcs.value.uiType == "GITLAB_SELF_HOST") {return `${vcs.value.instanceUrl}/admin/applications`;+ } else if (vcs.value.uiType == "GITLAB_COM") {+ return "https://gitlab.com/-/profile/applications";}return "";});