-
Notifications
You must be signed in to change notification settings - Fork 144
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
36 changed files
with
2,982 additions
and
3,032 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,14 @@ | ||
<script lang="ts"> | ||
export let size: number; | ||
export let src: string; | ||
export let name: string; | ||
</script> | ||
|
||
<img | ||
width={size} | ||
height={size} | ||
class="avatar" | ||
style="--size: {size}px" | ||
{src} | ||
title={name} | ||
alt={name} /> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<div> | ||
<i class="icon-info-circled" /> | ||
<slot /> | ||
</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,48 @@ | ||
<script lang="ts"> | ||
import { createEventDispatcher } from 'svelte'; | ||
type SwitchBox = { | ||
label: string; | ||
id: string; | ||
src: string; | ||
alt: string; | ||
href: string; | ||
linkText: string; | ||
value: boolean; | ||
required: boolean; | ||
disabled: boolean; | ||
wip: boolean; | ||
}; | ||
export let box: SwitchBox; | ||
let { label, id, src, alt, href, linkText, disabled, required, value, wip } = box; | ||
const dispatch = createEventDispatcher(); | ||
//TODO: move SwitchBox type outside component | ||
</script> | ||
|
||
<li class="card"> | ||
<label class="switch-box" for={id}> | ||
<div class="switch-box-image"> | ||
<img height="50" width="50" src={src || 'https://via.placeholder.com/50'} {alt} /> | ||
</div> | ||
<span class="switch-box-title">{label}</span> | ||
{#if !wip} | ||
<a {href} class="link" target="_blank"> | ||
<span class="text">{linkText || 'Docs'} </span> | ||
<span class="icon-link-ext" aria-hidden="true" /> | ||
</a> | ||
<input | ||
{id} | ||
{disabled} | ||
{required} | ||
type="checkbox" | ||
class="switch" | ||
role="switch" | ||
bind:checked={value} | ||
on:change={() => dispatch('updated', { value, id })} /> | ||
{/if} | ||
</label> | ||
</li> |
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,13 @@ | ||
<script> | ||
import SwitchBox from './switchBox.svelte'; | ||
import { createEventDispatcher } from 'svelte'; | ||
const dispatch = createEventDispatcher(); | ||
export let boxes; | ||
</script> | ||
|
||
<ul class="grid-box"> | ||
{#each boxes as box} | ||
<SwitchBox {box} on:updated={(e) => dispatch('updated', e.detail)} /> | ||
{/each} | ||
</ul> |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<script lang="ts"> | ||
import { Modal, InfoSection } from '$lib/components'; | ||
import { Button, InputNumber, Form } from '$lib/elements/forms'; | ||
import { addNotification } from '$lib/stores/notifications'; | ||
import { sdkForConsole } from '$lib/stores/sdk'; | ||
import { project } from '../store'; | ||
export let showUserLimitModal = false; | ||
export let authLimit: number; | ||
const projectId = $project.$id; | ||
let userLimit: number = $project.authLimit; | ||
const update = async () => { | ||
try { | ||
const oauth = await sdkForConsole.projects.updateAuthLimit(projectId, userLimit); | ||
console.log(oauth); | ||
authLimit = userLimit; | ||
showUserLimitModal = false; | ||
addNotification({ | ||
type: 'success', | ||
message: 'Updated project users limit successfully' | ||
}); | ||
} catch (error) { | ||
addNotification({ | ||
type: 'error', | ||
message: error.message | ||
}); | ||
} | ||
}; | ||
</script> | ||
|
||
<Form on:submit={update}> | ||
<Modal bind:show={showUserLimitModal}> | ||
<svelte:fragment slot="header">Max Allowed Users</svelte:fragment> | ||
<InputNumber id="userLimit" label="User Limit" autofocus={true} bind:value={userLimit} /> | ||
<InfoSection> | ||
<p> | ||
This limit will prevent new users from signing up for your project, no matter what | ||
auth method has been used. You will still be able to create users and team | ||
memberships from your Appwrite console. For an unlimited amount of users, set the | ||
limit to 0. Max limit is 10,000. | ||
</p> | ||
</InfoSection> | ||
<svelte:fragment slot="footer"> | ||
<Button submit>Update</Button> | ||
<Button secondary on:click={() => (showUserLimitModal = false)}>Cancel</Button> | ||
</svelte:fragment> | ||
</Modal> | ||
</Form> |
Oops, something went wrong.