mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-26 20:01:02 +00:00
Add repo-link to badge markdown in UI (#753)
Co-authored-by: Anbraten <anton@ju60.de>
This commit is contained in:
parent
5f79739bc0
commit
8ce41788e8
1 changed files with 9 additions and 2 deletions
|
@ -20,7 +20,7 @@
|
|||
|
||||
<div>
|
||||
<h2 class="text-lg text-gray-500 ml-2">Markdown</h2>
|
||||
<pre class="box">![status-badge]({{ baseUrl }}{{ badgeUrl }})</pre>
|
||||
<pre class="box">[![status-badge]({{ baseUrl }}{{ badgeUrl }})]({{ baseUrl }}{{ repoUrl }})</pre>
|
||||
</div>
|
||||
</div>
|
||||
</Panel>
|
||||
|
@ -47,8 +47,15 @@ export default defineComponent({
|
|||
|
||||
return `/api/badges/${repo.value.owner}/${repo.value.name}/status.svg`;
|
||||
});
|
||||
const repoUrl = computed(() => {
|
||||
if (!repo) {
|
||||
throw new Error('Unexpected: "repo" should be provided at this place');
|
||||
}
|
||||
|
||||
return { baseUrl, badgeUrl };
|
||||
return `/${repo.value.owner}/${repo.value.name}`;
|
||||
});
|
||||
|
||||
return { baseUrl, badgeUrl, repoUrl };
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Reference in a new issue