Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link swagger in navbar #1984

Merged
merged 16 commits into from
Jul 13, 2023
1 change: 1 addition & 0 deletions web/src/assets/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"repos": "Repos",
"repositories": "Repositories",
"docs": "Docs",
"api": "API",
"logout": "Logout",
"search": "Search…",
"username": "Username",
Expand Down
5 changes: 4 additions & 1 deletion web/src/components/layout/header/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down Expand Up @@ -70,14 +72,15 @@ export default defineComponent({
const authentication = useAuthentication();
const { darkMode } = useDarkMode();
const docsUrl = window.WOODPECKER_DOCS;
const apiUrl = `window.WOODPECKER_ROOT_URL/swagger/index.html`;
pat-s marked this conversation as resolved.
Show resolved Hide resolved

function doLogin() {
authentication.authenticate(route.fullPath);
}

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>
Expand Down