-
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.
- Loading branch information
Showing
27 changed files
with
240 additions
and
60 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
10 changes: 10 additions & 0 deletions
10
holo-key-manager-extension/src/lib/components/GoBack.svelte
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,10 @@ | ||
<script lang="ts"> | ||
const goBack = () => window?.history.back(); | ||
export let extraClass = 'ml-6'; | ||
</script> | ||
|
||
<button class={`${extraClass} mb-4 flex items-center self-start`} on:click={goBack}> | ||
<img src="/img/arrow-left.svg" alt="Arrow" /> | ||
<span class="ml-2 text-base">Back</span></button | ||
> |
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 |
---|---|---|
@@ -1,3 +1,9 @@ | ||
<h1 class="mb-2 text-center text-3xl font-bold"> | ||
<script lang="ts"> | ||
import clsx from 'clsx'; | ||
export let small = false; | ||
</script> | ||
|
||
<h1 class={clsx('text-center font-bold', small ? 'text-2xl' : 'mb-2 text-3xl')}> | ||
<slot /> | ||
</h1> |
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
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
12 changes: 12 additions & 0 deletions
12
holo-key-manager-extension/src/routes/list-of/+layout.svelte
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,12 @@ | ||
<script> | ||
import { Title } from '$components'; | ||
</script> | ||
|
||
<div class="mx-8 my-4"> | ||
<div class="flex"> | ||
<img src={'/img/holo_logo.svg'} alt={'Holo Logo'} class="mr-2 max-w-[48px]" /> | ||
<Title small>Holo Key Manager</Title> | ||
</div> | ||
|
||
<slot /> | ||
</div> |
58 changes: 58 additions & 0 deletions
58
holo-key-manager-extension/src/routes/list-of/happs/+page.svelte
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,58 @@ | ||
<script lang="ts"> | ||
import { goto } from '$app/navigation'; | ||
import { appQueries } from '$queries'; | ||
const { allApplicationsQuery } = appQueries(); | ||
let searchInput = ''; | ||
$: filteredApplications = $allApplicationsQuery.data?.filter( | ||
(applicationKey) => | ||
applicationKey.happId.toLowerCase().includes(searchInput.toLowerCase()) || | ||
applicationKey.happName.toLowerCase().includes(searchInput.toLowerCase()) | ||
); | ||
</script> | ||
|
||
<div class="mt-4 flex justify-between"> | ||
<h2 class="text-xl font-semibold">Managed hApps</h2> | ||
<div class="relative"> | ||
<img | ||
src={'/img/magnifying-glass.svg'} | ||
alt={'Search'} | ||
class="absolute left-3 top-1/2 -translate-y-1/2" | ||
/> | ||
<input | ||
placeholder="Search hApp" | ||
bind:value={searchInput} | ||
class="rounded-md border border-grey py-1.5 pl-9 outline-none focus:outline-none" | ||
/> | ||
</div> | ||
</div> | ||
{#each filteredApplications || [] as applicationKey} | ||
<div class="flex items-center justify-between border-b border-grey py-2 last:border-b-0"> | ||
<div class="flex items-center"> | ||
{#if !!applicationKey.happLogo} | ||
<img src={applicationKey.happLogo} alt="hApp Logo" class="mr-2 h-10 w-10" /> | ||
{/if} | ||
<span>{applicationKey.happName}</span> | ||
</div> | ||
<div class="flex"> | ||
{#if !!applicationKey.happUiUrl} | ||
<a | ||
href={applicationKey.happUiUrl} | ||
class="mr-2 flex items-center justify-center text-sm text-secondary" | ||
target="_blank" | ||
> | ||
Visit | ||
<img src="/img/arrow-outward.svg" alt="Visit page" class="ml-2" /> | ||
</a> | ||
{/if} | ||
<button | ||
class="rounded-md px-4 py-2 text-sm text-primary" | ||
on:click={() => goto(`keys?happId=${applicationKey.happId}`)} | ||
> | ||
View Keys | ||
</button> | ||
</div> | ||
</div> | ||
{/each} |
46 changes: 46 additions & 0 deletions
46
holo-key-manager-extension/src/routes/list-of/keys/+page.svelte
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,46 @@ | ||
<script lang="ts"> | ||
import { GoBack } from '$components'; | ||
import { extractDetailsFromUrl } from '$helpers'; | ||
import { appQueries } from '$queries'; | ||
const { applicationKeysQueryFunction } = appQueries(); | ||
const applicationKeysQuery = applicationKeysQueryFunction($extractDetailsFromUrl.happId); | ||
</script> | ||
|
||
<GoBack extraClass="mt-8" /> | ||
{#if $applicationKeysQuery.data && $applicationKeysQuery.data.length > 0} | ||
{@const applicationKeyFirst = $applicationKeysQuery.data[0]} | ||
<div class="mt-4 flex items-center justify-between"> | ||
<div class="flex items-center"> | ||
{#if !!applicationKeyFirst.happLogo} | ||
<img src={applicationKeyFirst.happLogo} alt="hApp Logo" class="mr-2 h-10 w-10" /> | ||
{/if} | ||
<h2 class="text-center text-xl font-semibold">{applicationKeyFirst.happName}</h2> | ||
</div> | ||
<div class="flex"> | ||
{#if !!applicationKeyFirst.happUiUrl} | ||
<a | ||
href={applicationKeyFirst.happUiUrl} | ||
class="mr-2 flex items-center justify-center text-sm text-primary" | ||
target="_blank" | ||
> | ||
Visit | ||
<img src="/img/arrow-outward-primary.svg" alt="Visit page" class="ml-2" /> | ||
</a> | ||
{/if} | ||
</div> | ||
</div> | ||
<h2 class="border-b border-grey py-4 text-xl font-semibold">Keys</h2> | ||
<table class="mt-4 w-full rounded-lg border"> | ||
{#each $applicationKeysQuery.data as applicationKey, index} | ||
<tr class="w-full" class:bg-gray-100={index % 2 === 0}> | ||
<td class="border-b px-4 py-2 last:border-b-0">{applicationKey.keyName}</td> | ||
<td class="flex justify-end border-b px-4 py-2 last:border-b-0"> | ||
<button class="mr-2 rounded-md px-4 py-2 text-sm text-grey" disabled> Delete Key </button> | ||
<button class="rounded-md px-4 py-2 text-sm text-grey" disabled> Change Key </button> | ||
</td> | ||
</tr> | ||
{/each} | ||
</table> | ||
{/if} |
Oops, something went wrong.