Compare commits

...

6 Commits

Author SHA1 Message Date
e04314217b
Removed dashboard preroute
All checks were successful
continuous-integration/drone/push Build is passing
2022-04-30 17:25:11 +02:00
17060fb068
Tailwind fix 2022-04-30 17:24:58 +02:00
a818b7f203
fixed dynamic links 2022-04-30 17:12:51 +02:00
d4c69f2723
Svelte confiug update 2022-04-30 16:59:00 +02:00
f92162bca9
Updated svelte config 2022-04-30 16:54:08 +02:00
3bc11ce05f
Acessibilydy 2022-04-30 16:53:56 +02:00
7 changed files with 4350 additions and 41 deletions

View File

@ -1,4 +1,5 @@
{ {
"extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": { "compilerOptions": {
"baseUrl": ".", "baseUrl": ".",
"paths": { "paths": {

4299
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@
import SidebarEntry from './SidebarEntry.svelte'; import SidebarEntry from './SidebarEntry.svelte';
$: logged_in = false; $: logged_in = false;
$: currentPage = $page.path; $: currentPage = $page.url.pathname;
const unsubscribe = UserStore.subscribe((value) => { const unsubscribe = UserStore.subscribe((value) => {
logged_in = value.isLoggedIn; logged_in = value.isLoggedIn;
@ -23,7 +23,7 @@
<div <div
class="flex flex-col w-64 h-screen px-4 py-8 bg-white border-r dark:bg-gray-800 dark:border-gray-600" class="flex flex-col w-64 h-screen px-4 py-8 bg-white border-r dark:bg-gray-800 dark:border-gray-600"
> >
<img class="h-36 w-36" src="./icon_128.png" alt="LinkyLinky Logo (White kauft.es K on red background)"> <img class="h-36 w-36" src="/icon_128.png" alt="LinkyLinky Logo (White kauft.es K on red background)">
<h2 class="text-3xl font-semibold text-gray-800 dark:text-white">LinkyLinky</h2> <h2 class="text-3xl font-semibold text-gray-800 dark:text-white">LinkyLinky</h2>
<!-- <div class="relative mt-6"> <!-- <div class="relative mt-6">
<span class="absolute inset-y-0 left-0 flex items-center pl-3"> <span class="absolute inset-y-0 left-0 flex items-center pl-3">
@ -47,7 +47,7 @@
<div class="flex flex-col justify-between flex-1 mt-6"> <div class="flex flex-col justify-between flex-1 mt-6">
<nav> <nav>
<SidebarEntry title="Dashboard" href="./" pageUrl="/" bind:currentPage> <SidebarEntry title="Dashboard" href="" pageUrl="/" bind:currentPage>
<svg class="w-5 h-5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg class="w-5 h-5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path <path
d="M19 11H5M19 11C20.1046 11 21 11.8954 21 13V19C21 20.1046 20.1046 21 19 21H5C3.89543 21 3 20.1046 3 19V13C3 11.8954 3.89543 11 5 11M19 11V9C19 7.89543 18.1046 7 17 7M5 11V9C5 7.89543 5.89543 7 7 7M7 7V5C7 3.89543 7.89543 3 9 3H15C16.1046 3 17 3.89543 17 5V7M7 7H17" d="M19 11H5M19 11C20.1046 11 21 11.8954 21 13V19C21 20.1046 20.1046 21 19 21H5C3.89543 21 3 20.1046 3 19V13C3 11.8954 3.89543 11 5 11M19 11V9C19 7.89543 18.1046 7 17 7M5 11V9C5 7.89543 5.89543 7 7 7M7 7V5C7 3.89543 7.89543 3 9 3H15C16.1046 3 17 3.89543 17 5V7M7 7H17"
@ -62,7 +62,7 @@
<hr class="my-6 dark:border-gray-600" /> <hr class="my-6 dark:border-gray-600" />
{#if logged_in} {#if logged_in}
<SidebarEntry title="Manage Links" href="./links" pageUrl="/links" bind:currentPage> <SidebarEntry title="Manage Links" href="/links" pageUrl="/links" bind:currentPage>
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
class="h-5 w-5" class="h-5 w-5"
@ -78,7 +78,7 @@
/> />
</svg> </svg>
</SidebarEntry> </SidebarEntry>
<SidebarEntry title="All visits" href="./visits" pageUrl="/visits" bind:currentPage> <SidebarEntry title="All visits" href="/visits" pageUrl="/visits" bind:currentPage>
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
class="h-5 w-5" class="h-5 w-5"
@ -122,7 +122,7 @@
<span class="mx-4 font-medium">Logout</span> <span class="mx-4 font-medium">Logout</span>
</button> </button>
{:else} {:else}
<SidebarEntry title="Login" href="./login" pageUrl="/login" bind:currentPage> <SidebarEntry title="Login" href="/login" pageUrl="/login" bind:currentPage>
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
class="h-5 w-5" class="h-5 w-5"

View File

@ -1,10 +1,7 @@
<script> <script>
import { page } from '$app/stores';
import Apiclient from '$lib/Apiclient'; import Apiclient from '$lib/Apiclient';
import UserStore from '$lib/UserStore'; import UserStore from '$lib/UserStore';
import { onDestroy } from 'svelte'; import { onDestroy, onMount } from 'svelte';
let shortcode = $page.query.get('shortcode');
$: urlDetails = { $: urlDetails = {
shortcode: 'Loading...', shortcode: 'Loading...',
@ -14,6 +11,11 @@
}; };
$: urlVisists = []; $: urlVisists = [];
let visitQuery; let visitQuery;
let shortcode;
onMount(async () => {
const params = new URLSearchParams(window.location.search);
let shortcode = params.get('shortcode');
// Yes i know this isn't the best way to implement this, but linkylinky dashboard is just a oneshot sideproject r/n. // Yes i know this isn't the best way to implement this, but linkylinky dashboard is just a oneshot sideproject r/n.
const unsubscribe = UserStore.subscribe((value) => { const unsubscribe = UserStore.subscribe((value) => {
@ -29,6 +31,7 @@
}); });
onDestroy(unsubscribe); onDestroy(unsubscribe);
});
</script> </script>
<h2 class="text-3xl font-bold text-gray-800 dark:text-gray-100 pb-6">Details: {shortcode}</h2> <h2 class="text-3xl font-bold text-gray-800 dark:text-gray-100 pb-6">Details: {shortcode}</h2>

View File

@ -52,7 +52,7 @@
Loading data... Loading data...
</td> </td>
<td class="px-6 py-4 whitespace-nowrap text-sm"> <td class="px-6 py-4 whitespace-nowrap text-sm">
<a href="#">Loading data...</a> <p href="#">Loading data...</p>
</td> </td>
<td class="px-6 py-4 whitespace-nowrap text-sm"> Loading data... </td> <td class="px-6 py-4 whitespace-nowrap text-sm"> Loading data... </td>
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium"> <td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">

View File

@ -1,25 +1,30 @@
import preprocess from 'svelte-preprocess';
import staticAdapter from '@sveltejs/adapter-static';
/** @type {import('@sveltejs/kit').Config} */ /** @type {import('@sveltejs/kit').Config} */
import preprocess from "svelte-preprocess";
import adapterStatic from '@sveltejs/adapter-static';
const config = { const config = {
kit: { kit: {
// hydrate the <div id="svelte"> element in src/app.html adapter: adapterStatic({
target: '#svelte', // default options are shown
adapter: staticAdapter(), pages: 'build',
assets: 'build',
fallback: null,
precompress: false
}),
trailingSlash: 'always',
prerender: {
// This can be false if you're using a fallback (i.e. SPA mode)
default: true
},
files: { files: {
assets: 'static' assets: 'static'
}
}, },
paths: {
base: '/dashboard',
},
},
preprocess: [ preprocess: [
preprocess({ preprocess({
postcss: true postcss: true
}) })
] ],
}; };
export default config; export default config;

View File

@ -1,11 +1,12 @@
const config = { const config = {
mode: 'jit', mode: "jit",
darkMode: 'media', content: [
purge: ['./src/**/*.{html,js,svelte,ts}'], "./src/**/*.{html,js,svelte,ts}",
],
theme: { theme: {
extend: {} extend: {},
}, },
plugins: [] plugins: [],
}; };
module.exports = config; module.exports = config;