Don't use getEnv function anymore
ci/woodpecker/push/build Pipeline was successful
Details
ci/woodpecker/push/build Pipeline was successful
Details
This commit is contained in:
parent
e5cab64698
commit
4b9532ab23
11
index.html
11
index.html
|
@ -8,16 +8,5 @@
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
<script type="module" src="/src/main.ts"></script>
|
<script type="module" src="/src/main.ts"></script>
|
||||||
|
|
||||||
<script>
|
|
||||||
// overwrite these options
|
|
||||||
window.CONFIG = {
|
|
||||||
API_URL: undefined,
|
|
||||||
TITLE: undefined,
|
|
||||||
CSS_VAR: undefined,
|
|
||||||
LINK_TERMS: undefined,
|
|
||||||
LINK_PRIVACY: undefined,
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
import HeaderDropdown from "./lib/HeaderDropdown.svelte";
|
import HeaderDropdown from "./lib/HeaderDropdown.svelte";
|
||||||
import LazyComponent from "./lib/LazyComponent.svelte";
|
import LazyComponent from "./lib/LazyComponent.svelte";
|
||||||
import {loginStore, profileStore, type LoginStore, type ProfileData} from "./stores/login";
|
import {loginStore, profileStore, type LoginStore, type ProfileData} from "./stores/login";
|
||||||
import {getEnv} from "./utils/env";
|
|
||||||
|
|
||||||
loginStore.subscribe((value: LoginStore) => {
|
loginStore.subscribe((value: LoginStore) => {
|
||||||
getMe();
|
getMe();
|
||||||
|
@ -21,9 +20,9 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
<title>{getEnv("TITLE")}</title>
|
<title>{import.meta.env.VITE_TITLE}</title>
|
||||||
<link rel="stylesheet" href="{getEnv('CSS_VAR')}.light.css" media="screen" />
|
<link rel="stylesheet" href="{import.meta.env.VITE_CSS_VAR}.light.css" media="screen" />
|
||||||
<link rel="stylesheet" href="{getEnv('CSS_VAR')}.dark.css" media="screen and (prefers-color-scheme: dark)" />
|
<link rel="stylesheet" href="{import.meta.env.VITE_CSS_VAR}.dark.css" media="screen and (prefers-color-scheme: dark)" />
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
<div id="app-router">
|
<div id="app-router">
|
||||||
|
@ -31,7 +30,7 @@
|
||||||
<header>
|
<header>
|
||||||
<div class="central-header">
|
<div class="central-header">
|
||||||
<a href="/" use:link>
|
<a href="/" use:link>
|
||||||
<h1>{getEnv("TITLE")}</h1>
|
<h1>{import.meta.env.VITE_TITLE}</h1>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
import {getEnv} from "~/utils/env";
|
|
||||||
import {loginStore} from "~/stores/login";
|
import {loginStore} from "~/stores/login";
|
||||||
import {get} from "svelte/store";
|
import {get} from "svelte/store";
|
||||||
|
|
||||||
export function URL() {
|
export function URL() {
|
||||||
return getEnv("API_URL");
|
return import.meta.env.VITE_API_URL;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function sendApiRequest(path: string, opt: RequestInit) {
|
export async function sendApiRequest(path: string, opt: RequestInit) {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import {sendSessionRequest} from "./api";
|
import {sendSessionRequest} from "./api";
|
||||||
|
|
||||||
export async function postRegister(data: object, token?: string) {
|
export async function postRegister(data: object, token?: string) {
|
||||||
let headers = new Headers();
|
let headers = new Headers();
|
||||||
headers.set("Accept", "application/json");
|
headers.set("Accept", "application/json");
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
import {onMount} from "svelte";
|
import {onMount} from "svelte";
|
||||||
import {navigate, useLocation} from "svelte-navigator";
|
import {navigate, useLocation} from "svelte-navigator";
|
||||||
import {get} from "svelte/store";
|
import {get} from "svelte/store";
|
||||||
import {getUser} from "~/api/login";
|
|
||||||
import {getOAuthApp, getOAuthScopes, postAuthorize} from "~/api/oauth";
|
import {getOAuthApp, getOAuthScopes, postAuthorize} from "~/api/oauth";
|
||||||
import LazyDelay from "~/lib/LazyDelay.svelte";
|
import LazyDelay from "~/lib/LazyDelay.svelte";
|
||||||
import {profileStore} from "~/stores/login";
|
import {profileStore} from "~/stores/login";
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
import {ExternalLink} from "lucide-svelte";
|
import {ExternalLink} from "lucide-svelte";
|
||||||
import {createEventDispatcher} from "svelte";
|
import {createEventDispatcher} from "svelte";
|
||||||
import {navigate} from "svelte-navigator";
|
import {navigate} from "svelte-navigator";
|
||||||
import {getEnv} from "~/utils/env";
|
|
||||||
|
|
||||||
export let err: {message: string; log_id: string};
|
export let err: {message: string; log_id: string};
|
||||||
|
|
||||||
|
@ -112,9 +111,9 @@
|
||||||
<section>
|
<section>
|
||||||
<div>
|
<div>
|
||||||
You must agree to the
|
You must agree to the
|
||||||
<a href={getEnv("LINK_TERMS")} target="_blank">Terms <ExternalLink size={16} /></a>
|
<a href={import.meta.env.VITE_LINK_TERMS} rel="noreferrer" target="_blank">Terms <ExternalLink size={16} /></a>
|
||||||
and
|
and
|
||||||
<a href={getEnv("LINK_PRIVACY")} target="_blank">Privacy <ExternalLink size={16} /></a>
|
<a href={import.meta.env.VITE_LINK_PRIVACY} rel="noreferrer" target="_blank">Privacy <ExternalLink size={16} /></a>
|
||||||
documents.
|
documents.
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding: 12px 24px;
|
padding: 12px 24px;
|
||||||
|
|
||||||
> .icon {
|
/*> .icon {
|
||||||
margin: 0 auto 12px auto;
|
margin: 0 auto 12px auto;
|
||||||
width: 150px;
|
width: 150px;
|
||||||
height: 150px;
|
height: 150px;
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
|
|
||||||
> .email {
|
> .email {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
export function getEnv(key: string) {
|
|
||||||
key = key.toUpperCase();
|
|
||||||
return window.CONFIG[key] ?? import.meta.env["VITE_" + key];
|
|
||||||
}
|
|
Reference in New Issue