Compare commits
No commits in common. "815e07c13262607f2f0e701423b8b85d7996cf9c" and "35d379d84303cfb119c8df97d8ad0222e9749826" have entirely different histories.
815e07c132
...
35d379d843
@ -1,6 +0,0 @@
|
|||||||
FROM fholzer/nginx-brotli:v1.19.1
|
|
||||||
ENV APP_CONF="config={}"
|
|
||||||
# TODO: buildstep
|
|
||||||
COPY ./dist /usr/share/nginx/html
|
|
||||||
COPY nginx.conf /etc/nginx/conf.d/default.conf.template
|
|
||||||
# COPY ./nginx.conf /etc/nginx/nginx.conf
|
|
@ -1,9 +0,0 @@
|
|||||||
version: '3'
|
|
||||||
services:
|
|
||||||
httpd:
|
|
||||||
build: .
|
|
||||||
environment:
|
|
||||||
- APP_CONF=config={"baseUrl":"http://localhost:8081"}
|
|
||||||
command: ["sh", "-c", "envsubst < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"]
|
|
||||||
ports:
|
|
||||||
- 4050:80
|
|
30
nginx.conf
30
nginx.conf
@ -1,30 +0,0 @@
|
|||||||
# http {
|
|
||||||
include mime.types;
|
|
||||||
# sendfile on;
|
|
||||||
server {
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
location / {
|
|
||||||
add_header "Set-Cookie" '${APP_CONF}';
|
|
||||||
}
|
|
||||||
|
|
||||||
location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
|
|
||||||
expires 1y;
|
|
||||||
add_header Pragma public;
|
|
||||||
add_header Cache-Control "public";
|
|
||||||
}
|
|
||||||
# --- Brotli
|
|
||||||
# brotli on;
|
|
||||||
# brotli_comp_level 6;
|
|
||||||
# brotli_static on;
|
|
||||||
# brotli_types application/atom+xml application/javascript application/json application/rss+xml application/vnd.ms-fontobject application/x-font-opentype application/x-font-truetype application/x-font-ttf application/x-javascript application/xhtml+xml application/xml font/eot font/opentype font/otf font/truetype image/svg+xml image/vnd.microsoft.icon image/x-icon image/x-win-bitmap text/css text/javascript text/plain text/xml;
|
|
||||||
# --- GZIP
|
|
||||||
gzip on;
|
|
||||||
gzip_disable "msie6";
|
|
||||||
gzip_vary on;
|
|
||||||
gzip_proxied any;
|
|
||||||
gzip_comp_level 6;
|
|
||||||
gzip_buffers 16 8k;
|
|
||||||
gzip_http_version 1.1;
|
|
||||||
gzip_types application/javascript application/rss+xml application/vnd.ms-fontobject application/x-font application/x-font-opentype application/x-font-otf application/x-font-truetype application/x-font-ttf application/x-javascript application/xhtml+xml application/xml font/opentype font/otf font/ttf image/svg+xml image/x-icon text/css text/javascript text/plain text/xml;
|
|
||||||
}
|
|
||||||
# }
|
|
8180
package-lock.json
generated
8180
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -3,11 +3,10 @@
|
|||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "svite",
|
"dev": "svite",
|
||||||
"build": "svite build",
|
"build": "svite build"
|
||||||
"start": "svite serve"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@odit/lfk-client-js": "^0.0.4",
|
"@odit/lfk-client-js": "^0.0.3",
|
||||||
"svelte-i18n": "^3.3.0",
|
"svelte-i18n": "^3.3.0",
|
||||||
"toastify-js": "^1.9.3"
|
"toastify-js": "^1.9.3"
|
||||||
},
|
},
|
||||||
|
@ -1,62 +0,0 @@
|
|||||||
<div class="flex flex-row mb-4">
|
|
||||||
<div class="w-full">
|
|
||||||
<nav class="w-full flex">
|
|
||||||
<ol class="list-none flex flex-row items-center justify-start">
|
|
||||||
<li class="mr-2 flex items-center">
|
|
||||||
<svg
|
|
||||||
stroke="currentColor"
|
|
||||||
fill="none"
|
|
||||||
stroke-width="2"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round"
|
|
||||||
class="h-3 w-3 stroke-current"
|
|
||||||
height="1em"
|
|
||||||
width="1em"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"><path
|
|
||||||
d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
|
|
||||||
<polyline points="9 22 9 12 15 12 15 22" /></svg>
|
|
||||||
</li>
|
|
||||||
<li class="flex items-center">
|
|
||||||
<a class="mr-2" href="/">Home</a><svg
|
|
||||||
stroke="currentColor"
|
|
||||||
fill="none"
|
|
||||||
stroke-width="2"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round"
|
|
||||||
class="h-3 w-3 mr-2 stroke-current"
|
|
||||||
height="1em"
|
|
||||||
width="1em"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"><line
|
|
||||||
x1="5"
|
|
||||||
y1="12"
|
|
||||||
x2="19"
|
|
||||||
y2="12" />
|
|
||||||
<polyline points="12 5 19 12 12 19" /></svg>
|
|
||||||
</li>
|
|
||||||
<li class="flex items-center">
|
|
||||||
<a class="mr-2" href="/">Second level</a><svg
|
|
||||||
stroke="currentColor"
|
|
||||||
fill="none"
|
|
||||||
stroke-width="2"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round"
|
|
||||||
class="h-3 w-3 mr-2 stroke-current"
|
|
||||||
height="1em"
|
|
||||||
width="1em"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"><line
|
|
||||||
x1="5"
|
|
||||||
y1="12"
|
|
||||||
x2="19"
|
|
||||||
y2="12" />
|
|
||||||
<polyline points="12 5 19 12 12 19" /></svg>
|
|
||||||
</li>
|
|
||||||
<li class="flex items-center">
|
|
||||||
<a class="mr-2" href="/">Third level</a>
|
|
||||||
</li>
|
|
||||||
</ol>
|
|
||||||
</nav>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
@ -4,7 +4,6 @@
|
|||||||
import Pagination from "./Pagination.svelte";
|
import Pagination from "./Pagination.svelte";
|
||||||
import FormLayout from "./FormLayout.svelte";
|
import FormLayout from "./FormLayout.svelte";
|
||||||
import Tracks from "./Tracks.svelte";
|
import Tracks from "./Tracks.svelte";
|
||||||
import BreadcrumbNav from "./BreadcrumbNav.svelte";
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
@ -276,7 +275,6 @@
|
|||||||
</header>
|
</header>
|
||||||
<main>
|
<main>
|
||||||
<div class="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8">
|
<div class="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8">
|
||||||
<BreadcrumbNav/>
|
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<StatCards />
|
<StatCards />
|
||||||
<!-- -->
|
<!-- -->
|
||||||
|
@ -1,61 +1,9 @@
|
|||||||
<script>
|
<script>
|
||||||
import { _ } from "svelte-i18n";
|
import { _ } from "svelte-i18n";
|
||||||
import store from "../store.js";
|
import store from "../store.js";
|
||||||
//
|
|
||||||
import { OpenAPI, AuthService, TrackService } from "@odit/lfk-client-js";
|
|
||||||
OpenAPI.BASE = "http://localhost:4010";
|
|
||||||
//
|
|
||||||
store.init();
|
store.init();
|
||||||
//
|
const login = () => {
|
||||||
import Toastify from "toastify-js";
|
store.login();
|
||||||
import "toastify-js/src/toastify.css";
|
|
||||||
let usersUsername = "";
|
|
||||||
let usersPassword = "";
|
|
||||||
let last_loginclick_processed = true;
|
|
||||||
|
|
||||||
const login = async () => {
|
|
||||||
// prevent login button spamming
|
|
||||||
if (last_loginclick_processed) {
|
|
||||||
last_loginclick_processed = false;
|
|
||||||
Toastify({
|
|
||||||
text: $_("login_is_checked"),
|
|
||||||
duration: 1500,
|
|
||||||
}).showToast();
|
|
||||||
console.log(usersUsername);
|
|
||||||
console.log(usersPassword);
|
|
||||||
AuthService.authControllerLogin({
|
|
||||||
username: usersUsername,
|
|
||||||
password: usersPassword,
|
|
||||||
})
|
|
||||||
.then((result) => {
|
|
||||||
OpenAPI.TOKEN = result.access_token;
|
|
||||||
store.login(result.access_token);
|
|
||||||
Toastify({
|
|
||||||
text: $_("welcome_wavinghand"),
|
|
||||||
duration: 1500,
|
|
||||||
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
|
||||||
}).showToast();
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
Toastify({
|
|
||||||
text: $_("error_on_login"),
|
|
||||||
duration: 1500,
|
|
||||||
backgroundColor:
|
|
||||||
"linear-gradient(90deg, hsla(281, 37%, 45%, 1) 0%, hsla(1, 62%, 48%, 1) 100%)",
|
|
||||||
}).showToast();
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
last_loginclick_processed = true;
|
|
||||||
});
|
|
||||||
// last login was not processed yet
|
|
||||||
} else {
|
|
||||||
Toastify({
|
|
||||||
text: "chill...",
|
|
||||||
duration: 1500,
|
|
||||||
backgroundColor:
|
|
||||||
"linear-gradient(90deg, hsla(281, 37%, 45%, 1) 0%, hsla(1, 62%, 48%, 1) 100%)",
|
|
||||||
}).showToast();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -65,9 +13,6 @@
|
|||||||
class="mx-auto h-20 w-auto"
|
class="mx-auto h-20 w-auto"
|
||||||
src="https://lauf-fuer-kaya.de/Bilder/kaya-logo-quadrat.png"
|
src="https://lauf-fuer-kaya.de/Bilder/kaya-logo-quadrat.png"
|
||||||
alt="" />
|
alt="" />
|
||||||
<p class="mt-6 text-lg text-center font-bold text-gray-900">
|
|
||||||
{$_('log_in_to_your_account')}
|
|
||||||
</p>
|
|
||||||
<p class="mt-6 text-sm text-center text-gray-900">
|
<p class="mt-6 text-sm text-center text-gray-900">
|
||||||
{$_('log_in_to_your_account')}
|
{$_('log_in_to_your_account')}
|
||||||
</p>
|
</p>
|
||||||
@ -81,17 +26,22 @@
|
|||||||
required=""
|
required=""
|
||||||
class="border-gray-300 placeholder-gray-500 appearance-none rounded-none relative block w-full px-3 py-2 border text-gray-900 rounded-t-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-sm"
|
class="border-gray-300 placeholder-gray-500 appearance-none rounded-none relative block w-full px-3 py-2 border text-gray-900 rounded-t-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-sm"
|
||||||
placeholder={$_('email_address')}
|
placeholder={$_('email_address')}
|
||||||
bind:value={usersUsername} />
|
value="" />
|
||||||
</div>
|
</div>
|
||||||
<div class="-mt-px relative">
|
<div class="-mt-px relative">
|
||||||
<input
|
<input
|
||||||
aria-label={$_('password')}
|
aria-label="Password"
|
||||||
name="password"
|
name="password"
|
||||||
type="password"
|
type="password"
|
||||||
required=""
|
required=""
|
||||||
bind:value={usersPassword}
|
|
||||||
class="border-gray-300 placeholder-gray-500 appearance-none rounded-none relative block w-full px-3 py-2 border text-gray-900 rounded-b-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-sm"
|
class="border-gray-300 placeholder-gray-500 appearance-none rounded-none relative block w-full px-3 py-2 border text-gray-900 rounded-b-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-sm"
|
||||||
placeholder={$_('password')} />
|
placeholder="Password" />
|
||||||
|
<div
|
||||||
|
class="absolute inset-y-0 right-0 pr-3 flex items-center text-sm">
|
||||||
|
<a
|
||||||
|
href="https://tailwindui.com/password/reset"
|
||||||
|
class="text-gray-900 underline">{$_('forgot_password?')}</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -115,12 +65,23 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-2">
|
<div class="mt-6">
|
||||||
|
<div class="relative">
|
||||||
|
<div class="absolute inset-0 flex items-center">
|
||||||
|
<div class="w-full border-t border-gray-300" />
|
||||||
|
</div>
|
||||||
|
<div class="relative flex justify-center text-sm">
|
||||||
|
<span class="px-2 bg-gray-100 text-gray-500">Don't have an account?</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mt-6">
|
||||||
<a
|
<a
|
||||||
href="/forgot_password"
|
href="/pricing"
|
||||||
class="block w-full text-center py-2 px-3 border border-gray-300 rounded-md text-gray-900 font-medium hover:border-gray-400 focus:outline-none focus:border-gray-400 sm:text-sm">
|
class="block w-full text-center py-2 px-3 border border-gray-300 rounded-md text-gray-900 font-medium hover:border-gray-400 focus:outline-none focus:border-gray-400 sm:text-sm">
|
||||||
{$_('forgot_password?')}
|
Register
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
@ -15,11 +15,15 @@
|
|||||||
{:then tracks}
|
{:then tracks}
|
||||||
<h4>{tracks.length}</h4>
|
<h4>{tracks.length}</h4>
|
||||||
<hr />
|
<hr />
|
||||||
|
{#if tracks.length % 2 == 0}
|
||||||
<ul>
|
<ul>
|
||||||
{#each tracks as item}
|
{#each tracks as item}
|
||||||
<li>{item.distance}</li>
|
<li>{item.distance}</li>
|
||||||
{/each}
|
{/each}
|
||||||
</ul>
|
</ul>
|
||||||
|
{:else}
|
||||||
|
{#each tracks as item}<span>{item.distance}</span><br />{/each}
|
||||||
|
{/if}
|
||||||
{:catch error}
|
{:catch error}
|
||||||
<div class="text-white px-6 py-4 border-0 rounded relative mb-4 bg-red-500">
|
<div class="text-white px-6 py-4 border-0 rounded relative mb-4 bg-red-500">
|
||||||
<span class="inline-block align-middle mr-8">
|
<span class="inline-block align-middle mr-8">
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
{
|
{
|
||||||
"forgot_password?": "Passwort vergessen?",
|
"forgot_password?": "Passwort vergessen?",
|
||||||
"log_in": "Anmelden",
|
"log_in": "Anmelden",
|
||||||
"log_in_to_your_account": "Bitte melde dich an",
|
"log_in_to_your_account": "Bitte melde dich an"
|
||||||
"login_is_checked": "Login wird überprüft",
|
|
||||||
"welcome_wavinghand": "Willkommen 👋",
|
|
||||||
"error_on_login": "😢Fehler beim Login"
|
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,6 @@
|
|||||||
{
|
{
|
||||||
"forgot_password?": "Forgot your password?",
|
"forgot_password?": "Forgot your password?",
|
||||||
"register": "Register",
|
|
||||||
"log_in": "Log in",
|
"log_in": "Log in",
|
||||||
"password": "Password",
|
|
||||||
"email_address": "Email address",
|
"email_address": "Email address",
|
||||||
"log_in_to_your_account": "Log in to your account",
|
"log_in_to_your_account": "Log in to your account"
|
||||||
"welcome_wavinghand": "Welcome 👋",
|
|
||||||
"login_is_checked": "Login is being checked...",
|
|
||||||
"error_on_login": "Error on login"
|
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@ import { writable } from 'svelte/store';
|
|||||||
|
|
||||||
const store = () => {
|
const store = () => {
|
||||||
const state = {
|
const state = {
|
||||||
access_token: undefined,
|
|
||||||
isLoggedIn: false
|
isLoggedIn: false
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -17,9 +16,8 @@ const store = () => {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
login(access_token) {
|
login() {
|
||||||
update((state) => {
|
update((state) => {
|
||||||
state.access_token = access_token;
|
|
||||||
state.isLoggedIn = true;
|
state.isLoggedIn = true;
|
||||||
console.log('login performed');
|
console.log('login performed');
|
||||||
return state;
|
return state;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user