mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-22 18:01:02 +00:00
Link swagger in navbar (#1984)
fix point 1 from #1944 Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
This commit is contained in:
parent
a778b5fb90
commit
004d72a853
2 changed files with 5 additions and 1 deletions
|
@ -5,6 +5,7 @@
|
|||
"repos": "Repos",
|
||||
"repositories": "Repositories",
|
||||
"docs": "Docs",
|
||||
"api": "API",
|
||||
"logout": "Logout",
|
||||
"search": "Search…",
|
||||
"username": "Username",
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
</router-link>
|
||||
<!-- Docs Link -->
|
||||
<a :href="docsUrl" target="_blank" class="navbar-link navbar-clickable hidden md:flex">{{ $t('docs') }}</a>
|
||||
<!-- API Link -->
|
||||
<a :href="apiUrl" target="_blank" class="navbar-link navbar-clickable hidden md:flex">{{ $t('api') }}</a>
|
||||
</div>
|
||||
<!-- Right Icons Box -->
|
||||
<div class="flex ml-auto -m-1.5 items-center space-x-2 text-white dark:text-gray-400">
|
||||
|
@ -70,6 +72,7 @@ export default defineComponent({
|
|||
const authentication = useAuthentication();
|
||||
const { darkMode } = useDarkMode();
|
||||
const docsUrl = config.docs || undefined;
|
||||
const apiUrl = `${config.rootURL ?? ''}/swagger/index.html`;
|
||||
|
||||
function doLogin() {
|
||||
authentication.authenticate(route.fullPath);
|
||||
|
@ -77,7 +80,7 @@ export default defineComponent({
|
|||
|
||||
const version = config.version?.startsWith('next') ? 'next' : config.version;
|
||||
|
||||
return { darkMode, user: authentication.user, doLogin, docsUrl, version };
|
||||
return { darkMode, user: authentication.user, doLogin, docsUrl, version, apiUrl };
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Reference in a new issue