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(i18n): repository module (#172)
tianzhou745cf2b18db2
diff --git a/frontend/src/bbkit/BBAlert.vue b/frontend/src/bbkit/BBAlert.vueindex 8c01bd10c8..f11c5c4c55 100644--- a/frontend/src/bbkit/BBAlert.vue+++ b/frontend/src/bbkit/BBAlert.vue@@ -1,17 +1,7 @@<template><div class="fixed z-10 inset-0 overflow-y-auto"><div- class="- flex- items-end- justify-center- min-h-screen- pt-4- px-4- pb-20- text-center- sm:block sm:p-0- "+ class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0"><!--Background overlay, show/hide based on modal state.@@ -44,21 +34,7 @@To: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"--><div- class="- inline-block- align-bottom- bg-white- rounded-lg- px-4- pt-5- pb-4- text-left- overflow-hidden- shadow-xl- transform- transition-all- sm:my-8 sm:align-middle sm:max-w-lg sm:w-full sm:p-6- "+ class="inline-block align-bottom bg-white rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full sm:p-6"role="dialog"aria-modal="true"aria-labelledby="modal-headline"@@ -67,83 +43,35 @@<div class="flex items-start"><divv-if="style == 'SUCCESS'"- class="- mx-auto- flex-shrink-0 flex- items-center- justify-center- h-12- w-12- rounded-full- bg-green-100- sm:mx-0 sm:h-10 sm:w-10- "+ class="mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-green-100 sm:mx-0 sm:h-10 sm:w-10"><!-- Heroicons name: outline/exclamation --><heroicons-outline:exclamation class="h-6 w-6 text-success" /></div><divv-else-if="style == 'WARN'"- class="- mx-auto- flex-shrink-0 flex- items-center- justify-center- h-12- w-12- rounded-full- bg-yellow-100- sm:mx-0 sm:h-10 sm:w-10- "+ class="mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-yellow-100 sm:mx-0 sm:h-10 sm:w-10"><!-- Heroicons name: outline/exclamation --><heroicons-outline:exclamation class="h-6 w-6 text-yellow-600" /></div><divv-else-if="style == 'CRITICAL'"- class="- mx-auto- flex-shrink-0 flex- items-center- justify-center- h-12- w-12- rounded-full- bg-red-100- sm:mx-0 sm:h-10 sm:w-10- "+ class="mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10"><!-- Heroicons name: outline/exclamation --><heroicons-outline:exclamation class="h-6 w-6 text-red-600" /></div><divv-else- class="- mx-auto- flex-shrink-0 flex- items-center- justify-center- h-12- w-12- rounded-full- bg-blue-100- sm:mx-0 sm:h-10 sm:w-10- "+ class="mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-100 sm:mx-0 sm:h-10 sm:w-10"><!-- Heroicons name: outline/exclamation --><heroicons-outline:exclamation class="h-6 w-6 text-blue-600" /></div><h3id="modal-headline"- class="- ml-4- flex- self-center- text-lg- leading-6- font-medium- text-gray-900- "+ class="ml-4 flex self-center text-lg leading-6 font-medium text-gray-900">{{ $t(title) }}</h3>@@ -175,26 +103,7 @@</button><buttontype="button"- class="- sm:ml-3- inline-flex- justify-center- w-full- rounded-md- border border-transparent- shadow-sm- px-4- py-2- bg-error- text-base- font-medium- text-white- hover:bg-error-hover- focus:outline-none- focus-visible:ring-2- focus:ring-offset-2 focus:ring-red-500- sm:w-auto sm:text-sm- "+ class="sm:ml-3 inline-flex justify-center w-full rounded-md border border-transparent shadow-sm px-4 py-2 bg-error text-base font-medium text-white hover:bg-error-hover focus:outline-none focus-visible:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:w-auto sm:text-sm":class="okButtonStyle":disabled="inProgress"@click.prevent="$emit('ok', payload)"@@ -229,11 +138,11 @@ export default {},okText: {type: String,- default: "bbkit.alert.ok",+ default: "bbkit.common.ok",},cancelText: {type: String,- default: "bbkit.alert.cancel",+ default: "bbkit.common.cancel",},inProgress: {type: Boolean,diff --git a/frontend/src/bbkit/BBAttention.vue b/frontend/src/bbkit/BBAttention.vueindex a18c313232..9bd8a32276 100644--- a/frontend/src/bbkit/BBAttention.vue+++ b/frontend/src/bbkit/BBAttention.vue@@ -21,7 +21,7 @@</div><div class="ml-3"><h3 class="text-sm font-medium" :class="`text-${color}-800`">- {{ title }}+ {{ $t(title) }}</h3><divv-if="description"@@ -29,7 +29,7 @@:class="`text-${color}-700`"><p>- {{ description }}+ {{ $t(description) }}</p></div></div>@@ -40,7 +40,7 @@class="btn-primary"@click.prevent="$emit('click-action')">- {{ actionText }}+ {{ $t(actionText) }}</button></div></div>@@ -49,6 +49,7 @@<script lang="ts">import { computed, PropType } from "vue";import { BBAttentionStyle } from "./types";+export default {name: "BBAttention",props: {@@ -57,7 +58,7 @@ export default {default: "INFO",},title: {- default: "Attention needed",+ default: "bbkit.attention.default",type: String,},description: {diff --git a/frontend/src/bbkit/BBStepTab.vue b/frontend/src/bbkit/BBStepTab.vueindex 265fdfd7bb..cc78a63ea3 100644--- a/frontend/src/bbkit/BBStepTab.vue+++ b/frontend/src/bbkit/BBStepTab.vue@@ -26,23 +26,13 @@? 'text-accent group-hover:text-accent-hover': 'text-control-light'"- >Step {{ index + 1 }}</span+ >{{ $t("bbkit.common.step") }} {{ index + 1 }}</span><span class="text-sm font-medium">{{ step.title }}</span></div><divv-if="state.currentStep > index || state.done"- class="- flex- items-center- justify-center- w-6- h-6- bg-accent- text-white- rounded-full- select-none- "+ class="flex items-center justify-center w-6 h-6 bg-accent text-white rounded-full select-none"><heroicons-solid:check class="w-4 h-4" /></div>@@ -65,7 +55,7 @@</div><div class="pt-4 border-t border-block-border flex justify-between"><button type="button" class="btn-normal" @click.prevent="cancel">- Cancel+ {{ $t("bbkit.common.cancel") }}</button><div class="flex flex-row space-x-2"><button@@ -77,7 +67,7 @@<heroicons-outline:chevron-leftclass="-ml-1 mr-1 h-5 w-5 text-control-light"/>- <span>Back</span>+ <span> {{ $t("bbkit.common.back") }}</span></button><buttonv-if="state.currentStep == stepItemList.length - 1"@@ -86,7 +76,7 @@class="btn-primary"@click.prevent="finish">- {{ finishTitle }}+ {{ $t(finishTitle) }}</button><buttonv-else-if="!stepItemList[state.currentStep].hideNext"@@ -95,7 +85,7 @@class="btn-primary"@click.prevent="changeStep(state.currentStep + 1)">- Next+ {{ $t("bbkit.common.next") }}</button></div></div>@@ -123,7 +113,7 @@ export default {type: Boolean,},finishTitle: {- default: "Finish",+ default: "bbkit.common.finish",type: String,},},diff --git a/frontend/src/components/ProjectVersionControlPanel.vue b/frontend/src/components/ProjectVersionControlPanel.vueindex b98b828874..62dda234c3 100644--- a/frontend/src/components/ProjectVersionControlPanel.vue+++ b/frontend/src/components/ProjectVersionControlPanel.vue@@ -16,58 +16,46 @@<!-- Use the persistent workflowType here --><template v-if="project.workflowType == 'UI'"><div class="text-lg leading-6 font-medium text-main">- Current workflow+ {{ $t("workflow.current-workflow") }}</div><div class="mt-6 flex flex-col space-y-4"><div class="flex space-x-4"><input+ id="workflow-ui"v-model="state.workflowType"name="UI workflow"- id="workflow-ui"tabindex="-1"type="radio"- class="- text-accent- disabled:text-accent-disabled- focus:ring-accent- "+ class="text-accent disabled:text-accent-disabled focus:ring-accent"value="UI":disabled="!allowEdit"/><div class="-mt-1">- <label for="workflow-ui" class="textlabel">UI workflow (no version control)</label>+ <label for="workflow-ui" class="textlabel">{{+ $t("workflow.ui-workflow")+ }}</label><div class="mt-1 textinfolabel">- Classic SQL Review workflow where the developer submits a SQL- review ticket directly from Bytebase and waits for the assigned- DBA or peer developer to review. Bytebase applies the SQL change- after review approved.+ {{ $t("workflow.ui-workflow-description") }}</div></div></div><div class="flex space-x-4"><input+ id="workflow-version-control"v-model="state.workflowType"name="Version control workflow"- id="workflow-version-control"tabindex="-1"type="radio"- class="- text-accent- disabled:text-accent-disabled- focus:ring-accent- "+ class="text-accent disabled:text-accent-disabled focus:ring-accent"value="VCS":disabled="!allowEdit"/><div class="-mt-1">- <label for="workflow-version-control" class="textlabel">Version control workflow</label>+ <label for="workflow-version-control" class="textlabel">{{+ $t("workflow.gitops-workflow")+ }}</label><div class="mt-1 textinfolabel">- Database migration scripts are stored in a git repository. To- make schema changes, a developer would create a migration script- and submit for review in the corresponding VCS such as GitLab.- After the script is approved and merged into the configured- branch, Bytebase will automatically kicks off the task to apply- the new schema change.+ {{ $t("workflow.gitops-workflow-description") }}</div></div></div>@@ -79,7 +67,7 @@class="btn-primary inline-flex justify-center py-2 px-2"@click.prevent="enterWizard(true)">- Configure version control+ {{ $t("workflow.configure-gitops") }}<heroicons-outline:chevron-right class="ml-1 w-5 h-5" /></button></div>@@ -104,6 +92,7 @@ import RepositorySetupWizard from "./RepositorySetupWizard.vue";import RepositoryPanel from "./RepositoryPanel.vue";import { Project, ProjectWorkflowType, Repository, UNKNOWN_ID } from "../types";import { useStore } from "vuex";+import { useI18n } from "vue-i18n";interface LocalState {workflowType: ProjectWorkflowType;@@ -128,6 +117,8 @@ export default {},},async setup(props) {+ const { t } = useI18n();+const store = useStore();const state = reactive<LocalState>({@@ -174,8 +165,12 @@ export default {module: "bytebase",style: "SUCCESS",title: state.showWizardForCreate- ? `Successfully enabled version control workflow for '${props.project.name}'`- : `Successfully changed repository for '${props.project.name}'`,+ ? t("workflow.configure-gitops-success", {+ project: props.project.name,+ })+ : t("workflow.change-gitops-success", {+ project: props.project.name,+ }),});state.showWizardForCreate = false;state.showWizardForChange = false;diff --git a/frontend/src/components/RepositoryForm.vue b/frontend/src/components/RepositoryForm.vueindex 92f7ba3c89..3b854f7e1b 100644--- a/frontend/src/components/RepositoryForm.vue+++ b/frontend/src/components/RepositoryForm.vue@@ -2,7 +2,7 @@<div class="space-y-4"><div><div class="flex flex-row space-x-2 items-center">- <label for="gitprovider" class="textlabel"> Git provider </label>+ <label for="gitprovider" class="textlabel"> {{ $t('repository.git-provider') }} </label><template v-if="vcsType.startsWith('GITLAB')"><img class="h-4 w-auto" src="../assets/gitlab-logo.svg" /></template>@@ -18,13 +18,13 @@</div><div><div class="flex flex-row space-x-2 items-center">- <label for="repository" class="textlabel"> Repository </label>+ <label for="repository" class="textlabel"> {{ $t('common.repository') }} </label><divv-if="!create && allowEdit"class="ml-1 normal-link text-sm"@click.prevent="$emit('change-repository')">- Change+ {{ $t('common.change') }}</div></div><input@@ -37,9 +37,9 @@/></div><div>- <div class="textlabel">Branch <span class="text-red-600">*</span></div>+ <div class="textlabel">{{ $t('common.branch') }} <span class="text-red-600">*</span></div><div class="mt-1 textinfolabel">- The branch where Bytebase observes the file change.+ {{ $t('repository.branch-observe-file-change') }}</div><inputid="branch"@@ -51,14 +51,13 @@:disabled="!allowEdit"/><div v-if="vcsType == 'GITLAB_SELF_HOST'" class="mt-2 textinfolabel">- Tip: You can also use wildcard like 'feature/*'+ {{ $t('repository.branch-specify-tip') }}</div></div><div>- <div class="textlabel">Base directory</div>+ <div class="textlabel">{{ $t('repository.base-directory') }}</div><div class="mt-1 textinfolabel">- The root directory where Bytebase observes the file change. If empty,- then it observes the entire repository.+ {{ $t('repository.base-directory-description') }}</div><inputid="basedirectory"@@ -71,18 +70,17 @@</div><div><div class="textlabel">- File path template <span class="text-red-600">*</span>+ {{ $t('repository.file-path-template') }} <span class="text-red-600">*</span><ahref="https://docs.bytebase.com/use-bytebase/vcs-integration/organize-repository-files#file-path-template"target="__blank"class="font-normal normal-link">- config guide</a+ {{ $t('common.config-guide') }}</a></div><div class="mt-1 textinfolabel">- Bytebase only observes the file path name matching the template pattern- relative to the base directory.+ {{ $t('repository.file-path-template-description') }}</div><inputid="filepathtemplate"@@ -92,13 +90,13 @@class="textfield mt-2 w-full":disabled="!allowEdit"/>- <div class="mt-2 textinfolabel">- <span class="text-red-600">*</span> Required placeholders:- {{ FILE_REQUIRED_PLACEHOLDER }}; optional placeholders:+ <div class="mt-2 textinfolabel capitalize">+ <span class="text-red-600">*</span> {{ $t('common.required-placeholder') }}:+ {{ FILE_REQUIRED_PLACEHOLDER }}; {{ $t('common.optional-placeholder') }}:{{ FILE_OPTIONAL_PLACEHOLDER }}</div><div class="mt-2 textinfolabel">- • File path example for normal migration type:+ • {{ $t('repository.file-path-example-normal-migration') }}:{{sampleFilePath(repositoryConfig.baseDirectory,@@ -108,7 +106,7 @@}}</div><div class="mt-2 textinfolabel">- • File path example for baseline migration type:+ • {{ $t('repository.file-path-example-baseline-migration') }}:{{sampleFilePath(repositoryConfig.baseDirectory,@@ -120,24 +118,20 @@</div><div><div class="textlabel">- Schema path template+ {{ $t('repository.schema-path-template') }}<ahref="https://docs.bytebase.com/use-bytebase/vcs-integration/organize-repository-files#schema-path-template"target="__blank"class="font-normal normal-link">- config guide</a+ {{ $t('common.config-guide') }}</a></div><div class="mt-1 textinfolabel">- When specified, after each migration, Bytebase will write the latest- schema to the schema path relative to the base directory in the same- branch as the original commit triggering the migration. Leave empty if- you don't want Bytebase to do this.+ {{ $t('repository.schema-writeback-description') }}<span class="font-medium text-main"- >Make sure the changed branch is not protected or allow repository- maintainer to push to that protected branch</span- >.+ >{{ $t('repository.schema-writeback-protected-branch') }}</span+ ></div><inputid="schemapathtemplate"@@ -148,15 +142,15 @@:disabled="!allowEdit"/><div class="mt-2 textinfolabel">- <span class="text-red-600">*</span> If specified, required placeholder:- {{ SCHEMA_REQUIRED_PLACEHOLDER }}; optional placeholder:+ <span class="text-red-600">*</span> {{ $t('repository.if-specified') }}, {{ $t('common.required-placeholder') }}:+ {{ SCHEMA_REQUIRED_PLACEHOLDER }}; {{ $t('common.optional-placeholder') }}:{{ SCHEMA_OPTIONAL_PLACEHOLDER }}</div><divv-if="repositoryConfig.schemaPathTemplate"class="mt-2 textinfolabel">- • Schema path example:+ • {{ $t('repository.schema-path-example') }}:{{sampleSchemaPath(repositoryConfig.baseDirectory,diff --git a/frontend/src/components/RepositoryPanel.vue b/frontend/src/components/RepositoryPanel.vueindex 15d4d0073b..3ede7a9035 100644--- a/frontend/src/components/RepositoryPanel.vue+++ b/frontend/src/components/RepositoryPanel.vue@@ -1,37 +1,51 @@<template><div class="text-lg leading-6 font-medium text-main">- Version control is <span class="text-success">enabled</span>+ <i18n-t keypath="repository.version-control-status">+ <template #status>+ <span class="text-success"> {{ $t("common.enabled") }} </span>+ </template>+ </i18n-t></div><div class="mt-2 textinfolabel">- Database migration scripts are stored in- <a class="normal-link" :href="repository.webUrl" target="_blank">{{- repository.fullPath- }}</a- >. To make schema changes, a developer would create a migration script- matching file path pattern- <span class="font-medium text-main">{{- state.repositoryConfig.baseDirectory- }}</span>- <span class="font-medium text-main"- >/{{ state.repositoryConfig.filePathTemplate }}</span- >. After the script is review approved and merged into the- <template v-if="state.repositoryConfig.branchFilter"- >branch matching pattern- <span class="font-medium text-main">{{- state.repositoryConfig.branchFilter- }}</span></template- >- <span v-else class="font-medium text-main">default branch</span>, Bytebase- will automatically kicks off the task to apply the new schema change.- <template v-if="state.repositoryConfig.schemaPathTemplate"- >After applying the schema change, if schema path template is specified,- Bytebase will also write the latest schema to the specified schema path- location- <span class="font-medium text-main">{{- state.repositoryConfig.schemaPathTemplate- }}</span- >.</template- >+ <i18n-t keypath="repository.version-control-description-file-path">+ <template #fullPath>+ <a class="normal-link" :href="repository.webUrl" target="_blank">{{+ repository.fullPath+ }}</a>+ </template>+ <template #fullPathTemplate>+ <span class="font-medium text-main"+ >{{ state.repositoryConfig.baseDirectory }}/{{+ state.repositoryConfig.filePathTemplate+ }}</span+ >+ </template>+ </i18n-t>+ <span> </span>+ <i18n-t keypath="repository.version-control-description-branch">+ <template #branch>+ <span class="font-medium text-main">+ <template v-if="state.repositoryConfig.branchFilter">+ {{ state.repositoryConfig.branchFilter }}+ </template>+ <template v-else>+ {{ $t("common.default") }}+ </template>+ </span>+ </template>+ </i18n-t>+ <template v-if="state.repositoryConfig.schemaPathTemplate">+ <span> </span>+ <i18n-t+ keypath="repository.version-control-description-description-schema-path"+ >+ <template #schemaPathTemplate>+ <span class="font-medium text-main">{{+ state.repositoryConfig.schemaPathTemplate+ }}</span>+ </template>+ </i18n-t>+ </template></div><RepositoryFormclass="mt-4"@@ -45,11 +59,11 @@<div v-if="allowEdit" class="mt-4 pt-4 flex border-t justify-between"><BBButtonConfirm:style="'RESTORE'"- :button-text="'Restore to UI workflow'"+ :button-text="$t('repository.restore-to-ui-workflow')":require-confirm="true"- :ok-text="'Restore'"- :confirm-title="'Restore to UI workflow?'"- :confirm-description="'When using the UI workflow, the developer submits a SQL review ticket directly from Bytebase and waits for the assigned DBA or peer developer to review. Bytebase applies the SQL change after review approved.'"+ :ok-text="$t('common.restore')"+ :confirm-title="$t('repository.restore-to-ui-workflow') + '?'"+ :confirm-description="$t('repository.restore-ui-workflow-description')"@confirm="restoreToUIWorkflowType"/><div>@@ -59,7 +73,7 @@:disabled="!allowUpdate"@click.prevent="doUpdate">- Update+ {{ $t("common.update") }}</button></div></div>@@ -77,6 +91,7 @@ import {Project,} from "../types";import { useStore } from "vuex";+import { useI18n } from "vue-i18n";interface LocalState {repositoryConfig: RepositoryConfig;@@ -101,6 +116,7 @@ export default {},emits: ["change-repository"],setup(props) {+ const { t } = useI18n();const store = useStore();const state = reactive<LocalState>({repositoryConfig: {@@ -153,7 +169,7 @@ export default {store.dispatch("notification/pushNotification", {module: "bytebase",style: "SUCCESS",- title: `Successfully restored to UI workflow`,+ title: t("repository.restore-ui-workflow-success"),});});};@@ -193,7 +209,7 @@ export default {store.dispatch("notification/pushNotification", {module: "bytebase",style: "SUCCESS",- title: `Successfully updated version control config`,+ title: t("repository.update-version-control-config-success"),});});};diff --git a/frontend/src/components/RepositorySelectionPanel.vue b/frontend/src/components/RepositorySelectionPanel.vueindex bf03744373..959a72838e 100644--- a/frontend/src/components/RepositorySelectionPanel.vue+++ b/frontend/src/components/RepositorySelectionPanel.vue@@ -6,7 +6,7 @@<heroicons-outline:refresh class="w-6 h-6" /></button><BBTableSearch- :placeholder="'Search repository'"+ :placeholder="$t('repository.select-repository-search')"@change-text="(text) => changeSearchText(text)"/></div>@@ -89,7 +89,7 @@ export default {const attentionText = computed((): string => {if (props.config.vcs.type == "GITLAB_SELF_HOST") {- return "Bytebase only lists GitLab projects granting you at least the 'Maintainer' role, which allows to configure the project webhook to observe the code push event.";+ return "repository.select-repository-attention-gitlab";}return "";});diff --git a/frontend/src/components/RepositorySetupWizard.vue b/frontend/src/components/RepositorySetupWizard.vueindex a93b3592ff..551f262243 100644--- a/frontend/src/components/RepositorySetupWizard.vue+++ b/frontend/src/components/RepositorySetupWizard.vue@@ -1,13 +1,17 @@<template><div><div class="textinfolabel">- If you encounter errors during the process, please refer to our<a- href="https://docs.bytebase.com/use-bytebase/vcs-integration/link-repository?ref=console"- target="_blank"- class="normal-link"- >- detailed guide</a- >.+ <i18n-t keypath="repository.setup-wizard-guide">+ <template #guide>+ <a+ href="https://docs.bytebase.com/use-bytebase/vcs-integration/link-repository?ref=console"+ target="_blank"+ class="normal-link"+ >+ {{ $t("common.detailed-guide") }}</a+ >+ </template>+ </i18n-t></div><BBStepTabclass="pt-4"@@ -47,6 +51,7 @@ import {VCS,} from "../types";import { projectSlug } from "../utils";+import { useI18n } from "vue-i18n";// Default file path template is to organize migration files from different environments under separate directories.const DEFAULT_FILE_PATH_TEMPLATE =@@ -63,12 +68,6 @@ interface LocalState {currentStep: number;}-const stepList: BBStepTabItem[] = [- { title: "Choose Git provider", hideNext: true },- { title: "Select repository", hideNext: true },- { title: "Configure deploy" },-];-export default {name: "RepositorySetupWizard",components: {@@ -89,8 +88,17 @@ export default {},emits: ["cancel", "finish"],setup(props, { emit }) {+ const { t } = useI18n();+const router = useRouter();const store = useStore();++ const stepList: BBStepTabItem[] = [+ { title: t("repository.choose-git-provider"), hideNext: true },+ { title: t("repository.select-repository"), hideNext: true },+ { title: t("repository.configure-deploy") },+ ];+const state = reactive<LocalState>({config: {vcs: unknown("VCS") as VCS,diff --git a/frontend/src/components/RepositoryTable.vue b/frontend/src/components/RepositoryTable.vueindex d328a9389d..aec6aaeda3 100644--- a/frontend/src/components/RepositoryTable.vue+++ b/frontend/src/components/RepositoryTable.vue@@ -34,21 +34,7 @@ import PrincipalAvatar from "./PrincipalAvatar.vue";import { BBTableColumn } from "../bbkit/types";import { projectSlug } from "../utils";import { Repository } from "../types";--const columnList: BBTableColumn[] = [- {- title: "Project",- },- {- title: "Repository",- },- {- title: "Creator",- },- {- title: "Created",- },-];+import { useI18n } from "vue-i18n";export default {name: "RepositoryTable",@@ -60,8 +46,25 @@ export default {},},setup(props) {+ const { t } = useI18n();+const router = useRouter();+ const columnList: BBTableColumn[] = [+ {+ title: t("common.project"),+ },+ {+ title: t("common.repository"),+ },+ {+ title: t("common.creator"),+ },+ {+ title: t("common.created-at"),+ },+ ];+const clickRepository = function (section: number, row: number) {const repository = props.repositoryList[row];router.push(diff --git a/frontend/src/components/RepositoryVCSProviderPanel.vue b/frontend/src/components/RepositoryVCSProviderPanel.vueindex 74dfd5d4e1..9b32294594 100644--- a/frontend/src/components/RepositoryVCSProviderPanel.vue+++ b/frontend/src/components/RepositoryVCSProviderPanel.vue@@ -1,8 +1,6 @@<template><div class="textlabel">- Choose the Git provider where your database schema scripts (.sql) are- hosted. When you push the changed script to the Git repository, Bytebase- will automatically applies the script change to the database.+ {{ $t("repository.choose-git-provider-description") }}</div><div class="mt-4 flex flex-wrap"><template v-for="(vcs, index) in vcsList" :key="index">@@ -20,16 +18,17 @@</div><div class="mt-2 textinfolabel"><template v-if="isCurrentUserOwner">- Visit- <router-link class="normal-link" to="/setting/version-control"- >Workspace Version Control</router-link- >- setting to add more Git providers.+ <i18n-t keypath="repository.choose-git-provider-visit-workspace">+ <template #workspace>+ <router-link class="normal-link" to="/setting/version-control"+ >{{ $t("common.workspace") }} -+ {{ $t("common.version-control") }}</router-link+ >+ </template>+ </i18n-t></template><template v-else>- Contact your Bytebase owner if you want other Git providers to appear- here. Bytebase currently supports self-host GitLab EE/CE, and plan to add- GitLab.com, GitHub Enterprise and GitHub.com later.+ {{ $t("repository.choose-git-provider-contact-workspace-owner") }}</template></div></template>diff --git a/frontend/src/locales/en.yml b/frontend/src/locales/en.ymlindex 28a70aa47f..268e3571df 100644--- a/frontend/src/locales/en.yml+++ b/frontend/src/locales/en.yml@@ -79,6 +79,18 @@ common:query: Querytransfer: Transferlanguage: Language+ repository: Repository+ change: Change+ branch: Branch+ config-guide: config guide+ required-placeholder: required placeholder+ optional-placeholder: optional placeholder+ enabled: enabled+ default: default+ version-control: version control+ restore: Restore+ detailed-guide: detailed guide+ workspace: workspaceerror-page:go-back-home: Go back homeanomaly-center: Anomaly Center@@ -128,9 +140,15 @@ intro:doc: docissue: issuebbkit:- alert:+ common:ok: OKcancel: Cancel+ back: Back+ next: Next+ finish: Finish+ step: Step+ attention:+ default: Attention neededsettings:sidebar:account: Account@@ -401,3 +419,83 @@ migration-history:instance-missing-migration-schema: Missing migration history schema on instance "{name}".instance-bad-connection: Unable to connect instance "{name}" to retrieve migration history.contact-dba: Please contact your DBA to config it+repository:+ branch-observe-file-change: The branch where Bytebase observes the file change.+ branch-specify-tip: 'Tip: You can also use wildcard like ''feature/*'+ base-directory: Base directory+ base-directory-description: >-+ The root directory where Bytebase observes the file change. If empty, then+ it observes the entire repository.+ file-path-template: File path template+ file-path-template-description: >-+ Bytebase only observes the file path name matching the template pattern+ relative to the base directory.+ file-path-example-normal-migration: File path example for normal migration type+ file-path-example-baseline-migration: File path example for baseline migration type+ schema-path-template: Schema path template+ schema-writeback-description: >-+ When specified, after each migration, Bytebase will write the latest schema+ to the schema path relative to the base directory in the same branch as the+ original commit triggering the migration. Leave empty if you don't want+ Bytebase to do this+ schema-writeback-protected-branch: >-+ Make sure the changed branch is not protected or allow repository maintainer+ to push to that protected branch.+ if-specified: If specified+ schema-path-example: Schema path example+ git-provider: Git provider+ version-control-status: '@.capitalize:common.version-control is {status}'+ version-control-description-file-path: >-+ Database migration scripts are stored in {fullPath}. To make schema changes,+ a developer would create a migration script matching file path pattern+ {fullPathTemplate}.+ version-control-description-branch: >-+ After the script is review approved and merged into the {branch} branch,+ Bytebase will automatically kicks off the pipeline to apply the new schema+ change.+ version-control-description-description-schema-path: >-+ After applying the schema change, Bytebase will also write the latest schema+ to the specified schema path location {schemaPathTemplate}.+ restore-to-ui-workflow: Restore to UI workflow+ restore-ui-workflow-description: >-+ When using the UI workflow, the developer submits a SQL review ticket+ directly from Bytebase console and waits for the assigned DBA or peer+ developer to review. Bytebase applies the SQL change after review approved.+ restore-ui-workflow-success: Successfully restored to UI workflow+ update-version-control-config-success: Successfully updated @:common.version-control config+ setup-wizard-guide: If you encounter errors during the process, please refer to our {guide}+ choose-git-provider: Choose Git provider+ select-repository: Select repository+ configure-deploy: Configure deploy+ choose-git-provider-description: >-+ Choose the Git provider where your database schema scripts (.sql) are+ hosted. When you push the changed script to the Git repository, Bytebase+ will automatically create a pipeline to apply the schema change to the+ database.+ choose-git-provider-visit-workspace: Visit {workspace} setting to add more Git providers.+ choose-git-provider-contact-workspace-owner: >-+ Contact your Bytebase owner if you want other Git providers to appear here.+ Bytebase currently supports self-host GitLab EE/CE, and plan to add+ GitLab.com, GitHub Enterprise and GitHub.com later.+ select-repository-attention-gitlab: >-+ Bytebase only lists GitLab projects granting you at least the 'Maintainer'+ role, which allows to configure the project webhook to observe the code push+ event.+ select-repository-search: Search repository+workflow:+ current-workflow: Current workflow+ ui-workflow: UI workflow+ ui-workflow-description: >-+ Classic SQL Review workflow where the developer submits a SQL review ticket+ directly from Bytebase and waits for the assigned DBA or peer developer to+ review. Bytebase applies the SQL schema change after review approved.+ gitops-workflow: GitOps workflow+ gitops-workflow-description: >-+ Database migration scripts are stored in a git repository. To make schema+ changes, a developer would create a migration script and submit for review+ in the corresponding VCS such as GitLab. After the script is approved and+ merged into the configured branch, Bytebase will automatically kicks off the+ task to apply the new schema change.+ configure-gitops: Configure version control+ configure-gitops-success: Successfully enabled GitOps workflow for {project}+ change-gitops-success: Successfully changed repository for {project}diff --git a/frontend/src/locales/zh-CN.yml b/frontend/src/locales/zh-CN.ymlindex cbbad7c18d..087ed48389 100644--- a/frontend/src/locales/zh-CN.yml+++ b/frontend/src/locales/zh-CN.yml@@ -79,6 +79,18 @@ common:query: 查询transfer: 转移language: 语言+ repository: 仓库+ change: 变更+ branch: 分支+ config-guide: 配置指南+ required-placeholder: 必需的占位符+ optional-placeholder: 可选的占位符+ enabled: 开启+ default: 默认+ version-control: 版本控制+ restore: 重置+ detailed-guide: 详细指南+ workspace: 工作空间error-page:go-back-home: 回到主页anomaly-center: 异常中心@@ -125,9 +137,15 @@ intro:issue: 工单quickstart: 快速入门bbkit:- alert:+ common:ok: 确认cancel: 取消+ back: 退回+ next: 下一步+ finish: 完成+ step: 步骤+ attention:+ default: 特别注意settings:sidebar:account: 账户@@ -372,4 +390,57 @@ migration-history:establish-database-baseline: 建立「{name}」基线instance-missing-migration-schema: 实例「{name}」缺失用于记录迁移历史的 schema。instance-bad-connection: 无法连接实例「{name}」以获取迁移历史。- contact-dba: 请联系您的 DBA 进行配置。+ contact-dba: 请联系你的 DBA 进行配置。+repository:+ branch-observe-file-change: Bytebase 跟踪文件变更的分支。+ branch-specify-tip: '诀窍: 可以使用诸如 "feature/*" 这样的通配符'+ base-directory: 根目录+ base-directory-description: Bytebase 跟踪文件变更的根目录。如果为空,则他会跟踪整个仓库。+ file-path-template: 文件路径模版+ file-path-template-description: Bytebase 仅会跟踪那些文件路径匹配模版 (相对于指定根目录)的文件。+ file-path-example-normal-migration: 针对普通迁移类型的文件路径样例+ file-path-example-baseline-migration: 针对基线迁移类型的文件路径样例+ schema-path-template: Schema 路径模版+ schema-writeback-description: >-+ 如果指定,在每一次迁移之后,Bytebase 将把最新的 Schema+ 回写到本来触发迁移的提交分支,回写的具体路径则是相对于前面指定的根目录。如果您不希望 Bytebase 这样做,则置为空。+ schema-writeback-protected-branch: 请保证被变更的分支不是处于保护 (protected) 状态,或者仓库允许他的 maintainer 可以推送变更到保护分支。+ if-specified: 如果指定+ schema-path-example: Schema 路径样例+ git-provider: Git 实例+ version-control-status: '@.capitalize:common.version-control 已{status}'+ version-control-description-file-path: 数据库迁移脚本存放在 {fullPath}。为了进行一次变更,开发者需要创建一个匹配 {fullPathTemplate} 文件路径格式的迁移脚本。+ version-control-description-branch: 当脚本审核通过并且合并到 {branch} 分支后,Bytebase 将自动发起一条流水线来执行新的 schema 变更。+ version-control-description-description-schema-path: 当 schema 变更完成后, Bytebase 会把变更后的最新 schema 回写到指定的 {schemaPathTemplate}。+ restore-to-ui-workflow: 重置到 UI 工作流+ restore-ui-workflow-description: "当使用 UI 工作流时,开发者会通过 Bytebase \b控制台直接提交一个 SQL 审核工单,让指定的 DBA 或者开发同事审核。当审核通过后,Bytebase 再执行相应的 SQL 变更。"+ restore-ui-workflow-success: 成功重置到 UI 工作流+ update-version-control-config-success: 成功更新@:common.version-control配置+ setup-wizard-guide: 如果您在过程中遇到问题, 请参考{guide}+ choose-git-provider: 选择 Git 提供方+ select-repository: 选择仓库+ configure-deploy: 配置部署+ choose-git-provider-description: >-+ 选择存放着您数据库 schema 脚本的 Git 提供方。当您把变更脚本推送到 Git 仓库后,Bytebase 会自动创建一条流水线把 schema+ 变更应用到数据库上。+ choose-git-provider-visit-workspace: 访问 {workspace} 设置以添加更多 Git 提供方.+ choose-git-provider-contact-workspace-owner: >-+ 如果您希望其他 Git 提供方出现在列表中,请联系 Bytebase 实例的所有者。当前 Bytebase 支持自己托管的 GitLab+ EE/CE,我们之后也会支持 GitLab.com, GitHub Enterprise 以及 GitHub.com。+ select-repository-attention-gitlab: >-+ Bytebase 仅列出您至少拥有 ’Maintainer' 权限的 GitLab 项目。因为只有至少拥有该权限,才能够配置项目的 webhook+ 用来监听代码推送事件。+ select-repository-search: 搜索仓库+workflow:+ current-workflow: 当前工作流+ ui-workflow: UI 工作流+ ui-workflow-description: >-+ 经典的 SQL 审核工作流。开发者直接在 Bytebase 上提交一个 SQL 审核工单,然后等待被指派的 DBA+ 或者开发同事审核。在审核通过后,Bytebase 会进行相应的 SQL schema 变更。+ gitops-workflow: GitOps 工作流+ gitops-workflow-description: >-+ 数据库迁移脚本保存在 Git 仓库中。为了进行一次 schema 变更,开发者会创建一个迁移脚本并且提交至诸如 GitLab 这样的 VCS 进行审核。+ 当审核通过并且合并到配置的分支后,Bytebase 会自动开启流水线来进行新的 schema 变更。+ configure-gitops: 配置 Git+ configure-gitops-success: 开启「{project}」GitOps 工作流成功+ change-gitops-success: 变更「{project}」仓库成功