mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-04-26 21:44:44 +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",
|
"repos": "Repos",
|
||||||
"repositories": "Repositories",
|
"repositories": "Repositories",
|
||||||
"docs": "Docs",
|
"docs": "Docs",
|
||||||
|
"api": "API",
|
||||||
"logout": "Logout",
|
"logout": "Logout",
|
||||||
"search": "Search…",
|
"search": "Search…",
|
||||||
"username": "Username",
|
"username": "Username",
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
</router-link>
|
</router-link>
|
||||||
<!-- Docs Link -->
|
<!-- Docs Link -->
|
||||||
<a :href="docsUrl" target="_blank" class="navbar-link navbar-clickable hidden md:flex">{{ $t('docs') }}</a>
|
<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>
|
</div>
|
||||||
<!-- Right Icons Box -->
|
<!-- Right Icons Box -->
|
||||||
<div class="flex ml-auto -m-1.5 items-center space-x-2 text-white dark:text-gray-400">
|
<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 authentication = useAuthentication();
|
||||||
const { darkMode } = useDarkMode();
|
const { darkMode } = useDarkMode();
|
||||||
const docsUrl = config.docs || undefined;
|
const docsUrl = config.docs || undefined;
|
||||||
|
const apiUrl = `${config.rootURL ?? ''}/swagger/index.html`;
|
||||||
|
|
||||||
function doLogin() {
|
function doLogin() {
|
||||||
authentication.authenticate(route.fullPath);
|
authentication.authenticate(route.fullPath);
|
||||||
|
@ -77,7 +80,7 @@ export default defineComponent({
|
||||||
|
|
||||||
const version = config.version?.startsWith('next') ? 'next' : config.version;
|
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>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue