Remove WOODPECKER_DOCS config (#2647)

This commit is contained in:
qwerty287
2023-10-25 15:05:19 +02:00
committed by GitHub
parent 70531821bf
commit aeb7bcb26a
9 changed files with 5 additions and 23 deletions

View File

@@ -12,15 +12,13 @@
import { computed, toRef } from 'vue';
import Icon from '~/components/atomic/Icon.vue';
import useConfig from '~/compositions/useConfig';
const props = defineProps<{
url: string;
topic: string;
}>();
const docsBaseUrl = useConfig().docs;
const url = toRef(props, 'url');
const topic = toRef(props, 'topic');
const docsUrl = computed(() => (url.value.startsWith('http') ? url.value : `${docsBaseUrl}${url.value}`));
const docsUrl = computed(() => (url.value.startsWith('http') ? url.value : `https://woodpecker-ci.org/${url.value}`));
</script>

View File

@@ -16,7 +16,9 @@
<span class="hidden md:flex">{{ $t('repositories') }}</span>
</router-link>
<!-- Docs Link -->
<a :href="docsUrl" target="_blank" class="navbar-link navbar-clickable hidden md:flex">{{ $t('docs') }}</a>
<a href="https://woodpecker-ci.org/" target="_blank" class="navbar-link navbar-clickable hidden md:flex">{{
$t('docs')
}}</a>
<!-- API Link -->
<a v-if="enableSwagger" :href="apiUrl" target="_blank" class="navbar-link navbar-clickable hidden md:flex">{{
$t('api')
@@ -69,7 +71,6 @@ const route = useRoute();
const authentication = useAuthentication();
const { user } = authentication;
const { darkMode } = useDarkMode();
const docsUrl = config.docs || undefined;
const apiUrl = `${config.rootPath ?? ''}/swagger/index.html`;
function doLogin() {

View File

@@ -3,7 +3,6 @@ import { User } from '~/lib/api/types';
declare global {
interface Window {
WOODPECKER_USER: User | undefined;
WOODPECKER_DOCS: string | undefined;
WOODPECKER_VERSION: string | undefined;
WOODPECKER_CSRF: string | undefined;
WOODPECKER_FORGE: 'github' | 'gitlab' | 'gitea' | 'bitbucket' | undefined;
@@ -14,7 +13,6 @@ declare global {
export default () => ({
user: window.WOODPECKER_USER || null,
docs: window.WOODPECKER_DOCS || null,
version: window.WOODPECKER_VERSION,
csrf: window.WOODPECKER_CSRF || null,
forge: window.WOODPECKER_FORGE || null,