Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4814ef4c22 | |||
|
b0d866873b
|
|||
|
06364a06bf
|
|||
| 795b166d7f | |||
|
adb4bb7f75
|
|||
| 958902631f | |||
|
b0347a9d06
|
|||
| 384354fbac | |||
|
ed2e8ef446
|
|||
| fa16814f91 | |||
|
735279bc47
|
|||
| 204bf5b01d | |||
|
cb0e86a66a
|
|||
|
5b375f888e
|
|||
|
7365749113
|
|||
|
2cf66ab6cb
|
|||
|
4377fc56c8
|
|||
|
6584b3c7c7
|
|||
|
a3c379a813
|
49
CHANGELOG.md
49
CHANGELOG.md
@@ -2,14 +2,63 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
|
||||
|
||||
#### [0.4.5](https://git.odit.services/kauft.es/linkylinky-dashboard/compare/0.4.4...0.4.5)
|
||||
|
||||
- Added missing text styling to button [`b0d8668`](https://git.odit.services/kauft.es/linkylinky-dashboard/commit/b0d866873b7871118f664d5955212913aabbb414)
|
||||
- Fixed image src for deployment [`06364a0`](https://git.odit.services/kauft.es/linkylinky-dashboard/commit/06364a06bfd625e8f255569404892104a3192014)
|
||||
|
||||
#### [0.4.4](https://git.odit.services/kauft.es/linkylinky-dashboard/compare/0.4.3...0.4.4)
|
||||
|
||||
> 21 August 2021
|
||||
|
||||
- 🚀RELEASE 0.4.4 [`795b166`](https://git.odit.services/kauft.es/linkylinky-dashboard/commit/795b166d7f733907662047f1f6eb01bf5ce2eab4)
|
||||
- Added logo to sidebar [`adb4bb7`](https://git.odit.services/kauft.es/linkylinky-dashboard/commit/adb4bb7f7523e7fd739e93a74837c32eb9b266fa)
|
||||
|
||||
#### [0.4.3](https://git.odit.services/kauft.es/linkylinky-dashboard/compare/0.4.2...0.4.3)
|
||||
|
||||
> 21 August 2021
|
||||
|
||||
- 🚀RELEASE 0.4.3 [`9589026`](https://git.odit.services/kauft.es/linkylinky-dashboard/commit/958902631fe282b378048be8728cb9ec10c97cc4)
|
||||
- Added provider to detail vist table [`b0347a9`](https://git.odit.services/kauft.es/linkylinky-dashboard/commit/b0347a9d06a21578b4e5263daabf11e5de45ef5c)
|
||||
|
||||
#### [0.4.2](https://git.odit.services/kauft.es/linkylinky-dashboard/compare/0.4.1...0.4.2)
|
||||
|
||||
> 21 August 2021
|
||||
|
||||
- 🚀RELEASE 0.4.2 [`384354f`](https://git.odit.services/kauft.es/linkylinky-dashboard/commit/384354fbac3b58a7e4480a0788d9b079827938b7)
|
||||
- Commented search away from sidebar [`ed2e8ef`](https://git.odit.services/kauft.es/linkylinky-dashboard/commit/ed2e8ef44650f1c63d38258d7bef84c9e9222364)
|
||||
|
||||
#### [0.4.1](https://git.odit.services/kauft.es/linkylinky-dashboard/compare/0.4.0...0.4.1)
|
||||
|
||||
> 21 August 2021
|
||||
|
||||
- 🚀RELEASE 0.4.1 [`fa16814`](https://git.odit.services/kauft.es/linkylinky-dashboard/commit/fa16814f9165c89caaacfa9d6e042aa9aa77aebb)
|
||||
- Applied new sidebar styles to logout button [`735279b`](https://git.odit.services/kauft.es/linkylinky-dashboard/commit/735279bc47ef547549e57f6d137c95541e8bdd16)
|
||||
|
||||
#### [0.4.0](https://git.odit.services/kauft.es/linkylinky-dashboard/compare/0.3.2...0.4.0)
|
||||
|
||||
> 21 August 2021
|
||||
|
||||
- Migrated all sidebar items to the new component [`7365749`](https://git.odit.services/kauft.es/linkylinky-dashboard/commit/7365749113afc8f51e6b4aff78babcf361992f0a)
|
||||
- Removed unused commented template stuff [`5b375f8`](https://git.odit.services/kauft.es/linkylinky-dashboard/commit/5b375f888e729bea0a82938d9af7bc016c6bd74e)
|
||||
- Extracted a bunch of duplicate stylechecks into own component [`4377fc5`](https://git.odit.services/kauft.es/linkylinky-dashboard/commit/4377fc56c8f8d0f63a7579d21bcef95c0db45be8)
|
||||
- Refactoring: Rename [`cb0e86a`](https://git.odit.services/kauft.es/linkylinky-dashboard/commit/cb0e86a66af04c6f88b989ee8e1490aad689d1db)
|
||||
- Sidebar activestates [`a3c379a`](https://git.odit.services/kauft.es/linkylinky-dashboard/commit/a3c379a813be4349879e90ad07d9977a4e334e0d)
|
||||
- 🚀RELEASE 0.4.0 [`204bf5b`](https://git.odit.services/kauft.es/linkylinky-dashboard/commit/204bf5b01d61f4ab96aaa891225377fe5f7792cf)
|
||||
- Added hoverstates [`2cf66ab`](https://git.odit.services/kauft.es/linkylinky-dashboard/commit/2cf66ab6cbf661330a7767896157c62d958a651e)
|
||||
- Removed console log [`6584b3c`](https://git.odit.services/kauft.es/linkylinky-dashboard/commit/6584b3c7c7c0d5496d52522e8130f615145d1b03)
|
||||
|
||||
#### [0.3.2](https://git.odit.services/kauft.es/linkylinky-dashboard/compare/0.3.1...0.3.2)
|
||||
|
||||
> 21 August 2021
|
||||
|
||||
- Added code to createurl component [`59a411b`](https://git.odit.services/kauft.es/linkylinky-dashboard/commit/59a411bab5462710109767dfccb90a0f0459b2dd)
|
||||
- More basics for the shorturl creation module [`515370e`](https://git.odit.services/kauft.es/linkylinky-dashboard/commit/515370eac7ff5f018cae5ec790ccc8e90c025718)
|
||||
- added display logic for the basic elements [`cc5cb27`](https://git.odit.services/kauft.es/linkylinky-dashboard/commit/cc5cb2782f20c4a7ab480132217463a0f4a9a956)
|
||||
- Added basics for error handling on url creation [`c5c8514`](https://git.odit.services/kauft.es/linkylinky-dashboard/commit/c5c8514bab9615c90de8b5fb1f9a5925f752b28b)
|
||||
- Basics for the new url creation component [`5329c4e`](https://git.odit.services/kauft.es/linkylinky-dashboard/commit/5329c4e1219a1cd3c8f1b5c0bdf02cb22330fd72)
|
||||
- Added adding url functionality to apiclient [`0c629e2`](https://git.odit.services/kauft.es/linkylinky-dashboard/commit/0c629e241668e1809d9616e9f7cb6ba804ad4c53)
|
||||
- 🚀RELEASE 0.3.2 [`0927620`](https://git.odit.services/kauft.es/linkylinky-dashboard/commit/092762011dbaf5270b482e838cf29059af9d24eb)
|
||||
- Tmp removed the createurl component from index until it works [`ea6bd07`](https://git.odit.services/kauft.es/linkylinky-dashboard/commit/ea6bd074a12ed4a43d30b1e9bacbe12bc6f97356)
|
||||
- Now only using odit registry hosted images to speed up the build [`3a82caa`](https://git.odit.services/kauft.es/linkylinky-dashboard/commit/3a82caad95eb99dac71e01dc02e3fdafe17ef6da)
|
||||
- Switched to our own brotli nginx build [`19e08bc`](https://git.odit.services/kauft.es/linkylinky-dashboard/commit/19e08bc52cc6a9c73e4b2d42d612d3ea7401f108)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@odit/linkylinky-dashboard",
|
||||
"version": "0.3.2",
|
||||
"version": "0.4.5",
|
||||
"scripts": {
|
||||
"dev": "svelte-kit dev",
|
||||
"build": "svelte-kit build",
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
import UserStore from '$lib/UserStore';
|
||||
import { onDestroy } from 'svelte';
|
||||
import Apiclient from './Apiclient';
|
||||
import { page } from '$app/stores';
|
||||
import SidebarEntry from './SidebarEntry.svelte';
|
||||
|
||||
$: logged_in = false;
|
||||
$: currentPage = $page.path;
|
||||
|
||||
const unsubscribe = UserStore.subscribe((value) => {
|
||||
logged_in = value.isLoggedIn;
|
||||
@@ -20,9 +23,9 @@
|
||||
<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"
|
||||
>
|
||||
<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>
|
||||
|
||||
<div class="relative mt-6">
|
||||
<!-- <div class="relative mt-6">
|
||||
<span class="absolute inset-y-0 left-0 flex items-center pl-3">
|
||||
<svg class="w-5 h-5 text-gray-400" viewBox="0 0 24 24" fill="none">
|
||||
<path
|
||||
@@ -40,14 +43,11 @@
|
||||
class="w-full py-3 pl-10 pr-4 text-gray-700 bg-white border border-gray-300 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 focus:border-blue-500 dark:focus:border-blue-500 focus:outline-none focus:ring"
|
||||
placeholder="Search"
|
||||
/>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="flex flex-col justify-between flex-1 mt-6">
|
||||
<nav>
|
||||
<a
|
||||
class="flex items-center px-4 py-2 text-gray-700 bg-gray-200 rounded-md dark:bg-gray-700 dark:text-gray-200"
|
||||
href="./"
|
||||
>
|
||||
<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">
|
||||
<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"
|
||||
@@ -57,17 +57,12 @@
|
||||
stroke-linejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
|
||||
<span class="mx-4 font-medium">Dashboard</span>
|
||||
</a>
|
||||
</SidebarEntry>
|
||||
|
||||
<hr class="my-6 dark:border-gray-600" />
|
||||
|
||||
{#if logged_in}
|
||||
<a
|
||||
class="flex items-center px-4 py-2 mt-5 text-gray-600 transition-colors duration-200 transform rounded-md dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700 dark:hover:text-gray-200 hover:text-gray-700"
|
||||
href="./links"
|
||||
>
|
||||
<SidebarEntry title="Manage Links" href="./links" pageUrl="/links" bind:currentPage>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
class="h-5 w-5"
|
||||
@@ -82,13 +77,8 @@
|
||||
d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"
|
||||
/>
|
||||
</svg>
|
||||
|
||||
<span class="mx-4 font-medium">Manage Links</span>
|
||||
</a>
|
||||
<a
|
||||
class="flex items-center px-4 py-2 mt-5 text-gray-600 transition-colors duration-200 transform rounded-md dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700 dark:hover:text-gray-200 hover:text-gray-700"
|
||||
href="./visits"
|
||||
>
|
||||
</SidebarEntry>
|
||||
<SidebarEntry title="All visits" href="./visits" pageUrl="/visits" bind:currentPage>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
class="h-5 w-5"
|
||||
@@ -109,35 +99,9 @@
|
||||
d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"
|
||||
/>
|
||||
</svg>
|
||||
|
||||
<span class="mx-4 font-medium">All Visits</span>
|
||||
</a>
|
||||
|
||||
<!-- <a
|
||||
class="flex items-center px-4 py-2 mt-5 text-gray-600 transition-colors duration-200 transform rounded-md dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700 dark:hover:text-gray-200 hover:text-gray-700"
|
||||
href="#"
|
||||
>
|
||||
<svg class="w-5 h-5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M10.3246 4.31731C10.751 2.5609 13.249 2.5609 13.6754 4.31731C13.9508 5.45193 15.2507 5.99038 16.2478 5.38285C17.7913 4.44239 19.5576 6.2087 18.6172 7.75218C18.0096 8.74925 18.5481 10.0492 19.6827 10.3246C21.4391 10.751 21.4391 13.249 19.6827 13.6754C18.5481 13.9508 18.0096 15.2507 18.6172 16.2478C19.5576 17.7913 17.7913 19.5576 16.2478 18.6172C15.2507 18.0096 13.9508 18.5481 13.6754 19.6827C13.249 21.4391 10.751 21.4391 10.3246 19.6827C10.0492 18.5481 8.74926 18.0096 7.75219 18.6172C6.2087 19.5576 4.44239 17.7913 5.38285 16.2478C5.99038 15.2507 5.45193 13.9508 4.31731 13.6754C2.5609 13.249 2.5609 10.751 4.31731 10.3246C5.45193 10.0492 5.99037 8.74926 5.38285 7.75218C4.44239 6.2087 6.2087 4.44239 7.75219 5.38285C8.74926 5.99037 10.0492 5.45193 10.3246 4.31731Z"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
/>
|
||||
<path
|
||||
d="M15 12C15 13.6569 13.6569 15 12 15C10.3431 15 9 13.6569 9 12C9 10.3431 10.3431 9 12 9C13.6569 9 15 10.3431 15 12Z"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
|
||||
<span class="mx-4 font-medium">Settings</span>
|
||||
</a> -->
|
||||
</SidebarEntry>
|
||||
<button
|
||||
class="flex items-center px-4 py-2 mt-5 text-gray-600 transition-colors duration-200 transform rounded-md dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700 dark:hover:text-gray-200 hover:text-gray-700"
|
||||
class="flex items-center px-4 py-2 mt-5 transition-colors duration-200 transform rounded-md hover:bg-gray-200 dark:hover:bg-gray-700 dark:hover:text-gray-200 hover:text-gray-700 text-gray-600 dark:text-gray-400"
|
||||
on:click={logout}
|
||||
>
|
||||
<svg
|
||||
@@ -158,10 +122,7 @@
|
||||
<span class="mx-4 font-medium">Logout</span>
|
||||
</button>
|
||||
{:else}
|
||||
<a
|
||||
class="flex items-center px-4 py-2 mt-5 text-gray-600 transition-colors duration-200 transform rounded-md dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700 dark:hover:text-gray-200 hover:text-gray-700"
|
||||
href="./login"
|
||||
>
|
||||
<SidebarEntry title="Login" href="./login" pageUrl="/login" bind:currentPage>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
class="h-5 w-5"
|
||||
@@ -176,9 +137,7 @@
|
||||
d="M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1"
|
||||
/>
|
||||
</svg>
|
||||
|
||||
<span class="mx-4 font-medium">Login</span>
|
||||
</a>
|
||||
</SidebarEntry>
|
||||
{/if}
|
||||
</nav>
|
||||
|
||||
|
||||
21
src/lib/SidebarEntry.svelte
Normal file
21
src/lib/SidebarEntry.svelte
Normal file
@@ -0,0 +1,21 @@
|
||||
<script>
|
||||
export let currentPage;
|
||||
export let title = 'null';
|
||||
export let href = './null';
|
||||
export let pageUrl = '/null';
|
||||
</script>
|
||||
|
||||
<a
|
||||
class="flex items-center px-4 py-2 mt-5 transition-colors duration-200 transform rounded-md hover:bg-gray-200 dark:hover:bg-gray-700 dark:hover:text-gray-200 hover:text-gray-700"
|
||||
class:dark:bg-gray-700={currentPage == pageUrl}
|
||||
class:bg-gray-200={currentPage == pageUrl}
|
||||
class:dark:text-gray-200={currentPage == pageUrl}
|
||||
class:text-gray-700={currentPage == pageUrl}
|
||||
class:dark:text-gray-400={!(currentPage == pageUrl)}
|
||||
class:text-gray-600={!(currentPage == pageUrl)}
|
||||
{href}
|
||||
>
|
||||
<slot />
|
||||
|
||||
<span class="mx-4 font-medium">{title}</span>
|
||||
</a>
|
||||
@@ -50,6 +50,9 @@
|
||||
<th scope="col" class="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider">
|
||||
Timestamp
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider">
|
||||
Provider
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="bg-white dark:bg-gray-700 divide-y divide-gray-200 dark:text-gray-100" x-max="1">
|
||||
@@ -60,6 +63,7 @@
|
||||
>
|
||||
Loading data...
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm"> Loading data... </td>
|
||||
</tr>
|
||||
{:then}
|
||||
{#each urlVisists as visit}
|
||||
@@ -69,6 +73,7 @@
|
||||
>
|
||||
{visit.timestamp}
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm"> {visit.provider} </td>
|
||||
</tr>
|
||||
{/each}
|
||||
{/await}
|
||||
|
||||
@@ -16,6 +16,12 @@ import Apiclient from '$lib/Apiclient';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function handleKeydown(e) {
|
||||
if (e.keyCode === 13) {
|
||||
login();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="w-full max-w-sm mx-auto overflow-hidden bg-white rounded-lg shadow-md dark:bg-gray-800">
|
||||
@@ -30,21 +36,23 @@ import Apiclient from '$lib/Apiclient';
|
||||
|
||||
<div class="w-full mt-4">
|
||||
<input
|
||||
class="block w-full px-4 py-2 mt-2 text-gray-700 dark:text-gray-400 placeholder-gray-500 bg-white border border-gray-300 rounded-md dark:bg-gray-800 dark:border-gray-600 dark:placeholder-gray-400 focus:border-blue-500 dark:focus:border-blue-500 focus:outline-none focus:ring"
|
||||
class="block w-full px-4 py-2 mt-2 text-gray-700 dark:text-gray-200 placeholder-gray-500 bg-white border border-gray-300 rounded-md dark:bg-gray-800 dark:border-gray-600 dark:placeholder-gray-400 focus:border-blue-500 dark:focus:border-blue-500 focus:outline-none focus:ring"
|
||||
type="text"
|
||||
placeholder="Username"
|
||||
aria-label="Username"
|
||||
bind:value={username}
|
||||
on:keydown={handleKeydown}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="w-full mt-4">
|
||||
<input
|
||||
class="block w-full px-4 py-2 mt-2 text-gray-700 dark:text-gray-400 placeholder-gray-500 bg-white border border-gray-300 rounded-md dark:bg-gray-800 dark:border-gray-600 dark:placeholder-gray-400 focus:border-blue-500 dark:focus:border-blue-500 focus:outline-none focus:ring"
|
||||
class="block w-full px-4 py-2 mt-2 text-gray-700 dark:text-gray-200 placeholder-gray-500 bg-white border border-gray-300 rounded-md dark:bg-gray-800 dark:border-gray-600 dark:placeholder-gray-400 focus:border-blue-500 dark:focus:border-blue-500 focus:outline-none focus:ring"
|
||||
type="password"
|
||||
placeholder="Password"
|
||||
aria-label="Password"
|
||||
bind:value={password}
|
||||
on:keydown={handleKeydown}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user