mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-29 21:31:02 +00:00
Do not use window.WOODPECKER_*
variables directly (#1992)
use the config helper instead
This commit is contained in:
parent
570f5044e8
commit
a778b5fb90
2 changed files with 3 additions and 2 deletions
|
@ -12,13 +12,14 @@
|
|||
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 = window.WOODPECKER_DOCS;
|
||||
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}`));
|
||||
|
|
|
@ -69,7 +69,7 @@ export default defineComponent({
|
|||
const route = useRoute();
|
||||
const authentication = useAuthentication();
|
||||
const { darkMode } = useDarkMode();
|
||||
const docsUrl = window.WOODPECKER_DOCS;
|
||||
const docsUrl = config.docs || undefined;
|
||||
|
||||
function doLogin() {
|
||||
authentication.authenticate(route.fullPath);
|
||||
|
|
Loading…
Reference in a new issue