Skip to content

Commit

Permalink
feat: pipeline as code issue TencentBlueKing#8125
Browse files Browse the repository at this point in the history
  • Loading branch information
lockiechen committed Jul 31, 2023
1 parent 2c37c7a commit 5d6dc67
Show file tree
Hide file tree
Showing 85 changed files with 6,190 additions and 3,133 deletions.
2 changes: 1 addition & 1 deletion src/frontend/devops-nav/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"@icon-cool/bk-icon-devops": "^0.1.13",
"@types/webpack-env": "^1.15.2",
"axios": "^0.27.2",
"bk-magic-vue": "2.4.15-beta.7",
"bk-magic-vue": "2.4.15-beta.22",
"bluebird": "^3.5.1",
"js-cookie": "^3.0.1",
"vue": "2.6.12",
Expand Down
3 changes: 2 additions & 1 deletion src/frontend/devops-nav/src/views/IFrame.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
/>
<div
v-bkloading="{ isLoading }"
:style="{ height: &quot;100%&quot; }"
:style="{ height: '100%' }"
>
<iframe
v-if="src"
id="iframe-box"
ref="iframeEle"
allowfullscreen
allow="clipboard-read; clipboard-write"
:src="src"
@load="onLoad"
/>
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/devops-pipeline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@blueking/log": "2.0.14",
"@icon-cool/bk-icon-devops": "^0.2.1",
"axios": "^0.27.2",
"bk-magic-vue": "2.4.15-beta.7",
"bk-magic-vue": "2.4.15-beta.22",
"bkui-pipeline": "0.1.34",
"clipboard": "^1.7.1",
"moment": "^2.29.2",
Expand Down Expand Up @@ -85,4 +85,4 @@
"vue-template-compiler": "2.6.12",
"webpack": "^5.58.1"
}
}
}
5 changes: 0 additions & 5 deletions src/frontend/devops-pipeline/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,6 @@
flex: 1;
background: #fafbfd;
}
.text-link {
font-size: 14px;
cursor: pointer;
color: $primaryColor;
}
.bkdevops-radio {
> input[type=radio] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,6 @@
'requestGlobalEnvs',
'updateAtom',
'updateAtomType',
'fetchAtoms',
'fetchAtomModal',
'fetchAtomVersionList',
'togglePropertyPanel',
Expand Down
71 changes: 71 additions & 0 deletions src/frontend/devops-pipeline/src/components/Badge.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<template>
<bk-popover style="font-size: 0;" theme="light" trigger="click">
<img class="pipeline-exec-badge" :src="badgeImageUrl" />
<section class="badge-link-content" slot="content">
<span @click="copy('markdownLink')" class="pointer">
{{ $t('copyBadgeMarkdownLink') }}
<i class="bk-icon icon-info-circle" />
</span>
<span @click="copy('picLink')" class="pointer">
{{ $t('copyBadgePicLink') }}
</span>
</section>
</bk-popover>
</template>

<script>
export default {
props: {
projectId: {
type: String,
required: true
},
pipelineId: {
type: String,
required: true
}
},
computed: {
badgeImageUrl () {
const { projectId, pipelineId } = this
if (!projectId || !pipelineId) {
return ''
}
return `${BADGE_URL_PREFIX}/process/api/external/pipelines/projects/${projectId}/${pipelineId}/badge?X-DEVOPS-PROJECT-ID=${projectId}`
}
},
methods: {
copy (ref) {
try {
window.navigator.clipboard.writeText(this.badgeImageUrl)
this.$bkMessage({
theme: 'success',
message: this.$t('copySuc')
})
} catch (error) {
console.log(error)
}
}
}
}
</script>

<style lang="scss">
.pipeline-exec-badge {
cursor: pointer;
}
.badge-link-content {
display: grid;
grid-gap: 6px;
grid-auto-rows: 32px;
width: 168px;
align-items: stretch;
> span {
line-height: 32px;
color: #63656E;
&:hover {
background: #F5F7FA;
}
}
}
</style>
Loading

0 comments on commit 5d6dc67

Please sign in to comment.