fix: availability of env variables
This commit is contained in:
parent
fa45559127
commit
f74c10d4aa
10 changed files with 78 additions and 10 deletions
|
@ -1,9 +1,14 @@
|
|||
<template>
|
||||
<div class="flex flex-col text-gray-400 text-sm mt-4 items-center">
|
||||
<div class="flex flex-row gap-2 justify-center">
|
||||
<a href="https://jk-effects.com/privacy" target="_blank">Datenschutz</a>
|
||||
<a href="https://jk-effects.com/imprint" target="_blank">Impressum</a>
|
||||
<a v-if="config.imprint_link" :href="config.imprint_link" target="_blank">Datenschutz</a>
|
||||
<a v-if="config.privacy_link" :href="config.privacy_link" target="_blank">Impressum</a>
|
||||
</div>
|
||||
<p v-if="config.custom_login_message">{{ config.custom_login_message }}</p>
|
||||
<a href="https://jk-effects.com" target="_blank"> © Admin-Portal by JK Effects </a>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { config } from '../config'
|
||||
</script>
|
|
@ -26,7 +26,7 @@
|
|||
</RouterLink>
|
||||
</MenuItem>
|
||||
<MenuItem v-slot="{ close }">
|
||||
<RouterLink to="/docs">
|
||||
<RouterLink to="/docs" target="_blank">
|
||||
<button button primary @click="close">Dokumentation</button>
|
||||
</RouterLink>
|
||||
</MenuItem>
|
||||
|
|
13
src/config.ts
Normal file
13
src/config.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
export interface Config {
|
||||
server_address: string;
|
||||
imprint_link: string;
|
||||
privacy_link: string;
|
||||
custom_login_message: string;
|
||||
}
|
||||
|
||||
export const config: Config = {
|
||||
server_address: import.meta.env.VITE_SERVER_ADDRESS,
|
||||
imprint_link: import.meta.env.VITE_IMPRINT_LINK,
|
||||
privacy_link: import.meta.env.VITE_PRIVACY_LINK,
|
||||
custom_login_message: import.meta.env.VITE_CUSTOM_LOGIN_MESSAGE,
|
||||
};
|
|
@ -3,10 +3,11 @@ import { isAuthenticatedPromise, type Payload } from "./router/authGuard";
|
|||
import router from "./router";
|
||||
import { useNotificationStore } from "./stores/notification";
|
||||
import { EventSourcePolyfill } from "event-source-polyfill";
|
||||
import { config } from "./config";
|
||||
|
||||
let devMode = process.env.NODE_ENV === "development";
|
||||
|
||||
let host = devMode ? "localhost:5000" : process.env.SERVER_ADDRESS || "";
|
||||
let host = devMode ? "localhost:5000" : (config.server_address ?? "");
|
||||
let url = devMode ? "http://" + host : (host ? "https://" : "") + host;
|
||||
|
||||
const http = axios.create({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue