forked from TencentBlueKing/bk-ci
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: pipeline as code issue TencentBlueKing#8125
- Loading branch information
1 parent
2c37c7a
commit 5d6dc67
Showing
85 changed files
with
6,190 additions
and
3,133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
Oops, something went wrong.