-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from kamyabnazari/kn-enhancing-dashboard
Kn enhancing dashboard
- Loading branch information
Showing
26 changed files
with
663 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<script lang="ts"> | ||
import IconFile from '~icons/solar/file-text-outline'; | ||
import IconCreate from '~icons/solar/clipboard-add-outline'; | ||
</script> | ||
|
||
<div class="card bg-base-100 w-96 flex-1 shadow-md"> | ||
<div class="card-body"> | ||
<h2 class="card-title">Read a new file</h2> | ||
<p>Upload a new file and ask it your questions!</p> | ||
<div class="card-actions justify-end py-4"> | ||
<a href="/dashboard/file-read"> | ||
<button class="btn btn-primary gap-4"> | ||
<IconFile style="font-size: x-large" /> | ||
Read | ||
</button></a | ||
> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="card bg-base-100 w-96 flex-1 shadow-md"> | ||
<div class="card-body"> | ||
<h2 class="card-title">Create a new file</h2> | ||
<p>Tell us what you want and create your file!</p> | ||
<div class="card-actions justify-end py-4"> | ||
<a href="/dashboard/file-create"> | ||
<button class="btn btn-primary gap-4"> | ||
<IconCreate style="font-size: x-large" /> | ||
Create | ||
</button> | ||
</a> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<script lang="ts"> | ||
import IconPDF from '~icons/bxs/file-pdf'; | ||
</script> | ||
|
||
<div class="w-full overflow-x-auto"> | ||
<table class="table w-full"> | ||
<!-- head --> | ||
<thead> | ||
<tr> | ||
<th> | ||
<label> | ||
<input type="checkbox" class="checkbox" /> | ||
</label> | ||
</th> | ||
<th>Name</th> | ||
<th>Type</th> | ||
<th>Create Date</th> | ||
<th /> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<th> | ||
<label> | ||
<input type="checkbox" class="checkbox" /> | ||
</label> | ||
</th> | ||
<td> | ||
<div class="flex items-center space-x-3"> | ||
<div class="mask mask-square flex h-10 w-10 items-center justify-center"> | ||
<IconPDF style="font-size: x-large" /> | ||
</div> | ||
<div> | ||
<div class="font-bold">file-23.pdf</div> | ||
</div> | ||
</div> | ||
</td> | ||
<td> | ||
<span class="text-sm">Uploaded</span><br /> | ||
<span class="badge badge-ghost badge-sm">PDF</span> | ||
</td> | ||
<td>13.05.2023</td> | ||
<th> | ||
<button class="btn btn-sm btn-ghost">Actions</button> | ||
</th> | ||
</tr> | ||
</tbody> | ||
<!-- foot --> | ||
<tfoot> | ||
<tr> | ||
<th /> | ||
<th>Name</th> | ||
<th>Type</th> | ||
<th>Create Date</th> | ||
<th /> | ||
</tr> | ||
</tfoot> | ||
</table> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<script lang="ts"> | ||
import IconFile from '~icons/solar/file-text-outline'; | ||
import IconNewFile from '~icons/solar/pen-new-square-outline'; | ||
import IconArrowUp from '~icons/solar/arrow-right-up-outline'; | ||
import IconArrowDown from '~icons/solar/arrow-left-down-outline'; | ||
import IconWord from '~icons/solar/chat-square-outline'; | ||
import IconPage from '~icons/solar/documents-outline'; | ||
</script> | ||
|
||
<div class="stats flex-auto flex-nowrap shadow-md"> | ||
<div class="stat"> | ||
<div class="stat-figure text-secondary"><IconFile style="font-size: x-large;" /></div> | ||
<div class="stat-title">Uploaded files</div> | ||
<div class="stat-value">118</div> | ||
<div class="stat-desc">Jan 1st - Dec 1st</div> | ||
</div> | ||
<div class="stat"> | ||
<div class="stat-figure text-secondary"><IconNewFile style="font-size: x-large;" /></div> | ||
<div class="stat-title">Created files</div> | ||
<div class="stat-value">24</div> | ||
<div class="stat-desc flex flex-row gap-2"> | ||
<IconArrowUp style="font-size: small;" /> | ||
<span>12 (22%)</span> | ||
</div> | ||
</div> | ||
<div class="stat"> | ||
<div class="stat-figure text-secondary"><IconPage style="font-size: x-large;" /></div> | ||
<div class="stat-title">Total pages</div> | ||
<div class="stat-value">459</div> | ||
<div class="stat-desc flex flex-row gap-2"> | ||
<IconArrowDown style="font-size: small;" /> | ||
<span>52 (5%)</span> | ||
</div> | ||
</div> | ||
<div class="stat"> | ||
<div class="stat-figure text-secondary"><IconWord style="font-size: x-large;" /></div> | ||
<div class="stat-title">Total words</div> | ||
<div class="stat-value">24K</div> | ||
<div class="stat-desc flex flex-row gap-2"> | ||
<IconArrowUp style="font-size: small;" /> | ||
<span>2K (10%)</span> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { redirect } from '@sveltejs/kit'; | ||
import type { Actions } from './$types'; | ||
|
||
export const actions: Actions = { | ||
default: async ({ locals, request }) => { | ||
const data = Object.fromEntries(await request.formData()) as { | ||
email: string; | ||
newEmail: string; | ||
password: string; | ||
}; | ||
|
||
try { | ||
await locals.pb.collection('users').authWithPassword(data.email, data.password); | ||
await locals.pb.collection('users').requestEmailChange(data.email); | ||
} catch (e) { | ||
console.error(e); | ||
throw e; | ||
} | ||
|
||
throw redirect(303, '/login'); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<script lang="ts"> | ||
import { applyAction, enhance } from '$app/forms'; | ||
import { pb } from '$lib/pocketbase'; | ||
</script> | ||
|
||
<div class="hero bg-base-100 min-h-full"> | ||
<div class="hero-content flex-col lg:flex-row-reverse"> | ||
<div class="text-center lg:text-left"> | ||
<h1 class="text-5xl font-bold">Email Change</h1> | ||
<p class="py-6"> | ||
Enter your new email below. <br /> | ||
We'll send a confirmation to verify it's correct and accessible. Follow the instructions in the | ||
confirmation to complete the change. | ||
</p> | ||
</div> | ||
<div class="card bg-base-100 w-full max-w-sm flex-shrink-0 shadow-2xl"> | ||
<div class="card-body"> | ||
<form | ||
method="POST" | ||
use:enhance={() => { | ||
return async ({ result }) => { | ||
pb.authStore.loadFromCookie(document.cookie); | ||
await applyAction(result); | ||
}; | ||
}} | ||
> | ||
<div class="form-control gap-2"> | ||
<label for="email" class="label"> | ||
<span class="label-text">Email</span> | ||
</label> | ||
<input | ||
type="email" | ||
name="email" | ||
placeholder="your@email.com" | ||
class="input input-bordered" | ||
/> | ||
<label for="newEmail" class="label"> | ||
<span class="label-text">New Email</span> | ||
</label> | ||
<input | ||
type="newEmail" | ||
name="newEmail" | ||
placeholder="yournew@email.com" | ||
class="input input-bordered" | ||
/> | ||
<label for="password" class="label"> | ||
<span class="label-text">Password</span> | ||
</label> | ||
<input | ||
type="password" | ||
name="password" | ||
placeholder="password" | ||
class="input input-bordered" | ||
/> | ||
<div class="form-control mt-6"> | ||
<button class="btn btn-primary">Send email</button> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.