diff --git a/src/frontend/common-lib/docs.js b/src/frontend/common-lib/docs.js
index 623e72eb4e96..9c43022355f8 100644
--- a/src/frontend/common-lib/docs.js
+++ b/src/frontend/common-lib/docs.js
@@ -21,7 +21,8 @@ const createDocs = (lang, version) => {
TEMPLATE_GUIDE_DOC: `${commonPrefix}/Services/Store/ci-templates/start-new-template.md`, // 模板指引文档
TURBO_GUIDE_DOC: `${commonPrefix}/Services/Turbo/linux-tubo-speed/use_in_linux.md`, // turbo指引文档
BKAPP_NAV_OPEN_SOURCE_URL: 'https://github.com/TencentBlueKing/bk-ci', // 开源社区
- FEED_BACK_URL: `${DOCS_URL_PREFIX}/s-mart/community/question` // 问题反馈
+ FEED_BACK_URL: `${DOCS_URL_PREFIX}/s-mart/community/question`, // 问题反馈
+ PAC_GUIDE_DOC: `${commonPrefix}/Services/Pipeline-as-Code/01-quick-start/01-quict-start.md` // PAC快速上手文档
}
const pipelineDocs = {
ALIAS_BUILD_NO_DOC: `${commonPrefix}/Services/Pipeline/pipeline-edit-guide/alias-buildno.md`, // 构建号别名文档
diff --git a/src/frontend/devops-pipeline/src/components/ExportDialog.vue b/src/frontend/devops-pipeline/src/components/ExportDialog.vue
index 59926318c3ee..f4b22c68a852 100644
--- a/src/frontend/devops-pipeline/src/components/ExportDialog.vue
+++ b/src/frontend/devops-pipeline/src/components/ExportDialog.vue
@@ -27,7 +27,7 @@
{{ $t('newlist.exportPipelineJson') }}
@@ -41,6 +41,7 @@
import { PROCESS_API_URL_PREFIX } from '@/store/constants'
import Logo from '@/components/Logo'
import { mapActions, mapState } from 'vuex'
+ import { CODE_MODE, UI_MODE } from '@/utils/pipelineConst'
export default {
components: {
@@ -58,6 +59,8 @@
computed: {
...mapState('atom', [
+ 'pipeline',
+ 'pipelineSetting',
'pipelineInfo'
]),
@@ -76,11 +79,27 @@
exportList () {
return [
{
+ type: UI_MODE,
title: 'Pipeline Json',
icon: 'export-pipeline',
name: `${this.pipelineName}.json`,
tips: this.$t('newlist.exportJsonTip'),
exportUrl: `${API_URL_PREFIX}/${PROCESS_API_URL_PREFIX}/user/pipelines/${this.pipelineId}/projects/${this.projectId}/export`
+ },
+ {
+ type: CODE_MODE,
+ title: 'Pipeline YAML',
+ icon: 'export-pipeline',
+ name: `${this.pipelineName}.yml`,
+ tips: this.$t('newlist.exportPipelineYamlTip'),
+ exportUrl: `${API_URL_PREFIX}/${PROCESS_API_URL_PREFIX}/user/transfer/projects/${this.projectId}?pipelineId=${this.pipelineId}&actionType=FULL_MODEL2YAML`,
+ tipsLink: this.BKCI_DOCS?.PAC_GUIDE_DOC,
+ params: {
+ modelAndSetting: {
+ model: this.pipeline,
+ setting: this.pipelineSetting
+ }
+ }
}
]
}
@@ -93,9 +112,10 @@
this.$emit('update:isShow', false)
},
- downLoadFromApi (url, name) {
+ downLoadFromApi (exportItem) {
+ const { exportUrl: url, name, params, type } = exportItem
this.isDownLoading = true
- this.download({ url, name }).catch((e) => {
+ this.download({ url, name, params, type }).catch((e) => {
this.handleError(
e,
{
diff --git a/src/frontend/devops-pipeline/src/components/pipelineList/ImportPipelinePopup/index.vue b/src/frontend/devops-pipeline/src/components/pipelineList/ImportPipelinePopup/index.vue
index 183df0ae0346..c284d6703ba4 100644
--- a/src/frontend/devops-pipeline/src/components/pipelineList/ImportPipelinePopup/index.vue
+++ b/src/frontend/devops-pipeline/src/components/pipelineList/ImportPipelinePopup/index.vue
@@ -12,7 +12,7 @@
{{ $t('importPipelineLabel') }}
@@ -23,6 +23,8 @@