-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Chris White <[email protected]>
- Loading branch information
Showing
8 changed files
with
138 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
<template> | ||
<div class="app" data-teleport-target="app"> | ||
<suspense> | ||
<AppRouterView /> | ||
<router-view /> | ||
</suspense> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { useColorTheme } from '@prefecthq/prefect-design' | ||
import AppRouterView from '@/pages/AppRouterView.vue' | ||
useColorTheme() | ||
</script> |
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,62 @@ | ||
<template> | ||
<div class="flex items-center justify-center min-h-screen"> | ||
<div class="w-full max-w-[400px] p-8 m-4 bg-surface-raised rounded-lg shadow-lg"> | ||
<p-heading tag="h1" size="lg" class="mb-6 text-center text-default"> | ||
Login | ||
</p-heading> | ||
<form @submit.prevent="handleSubmit" class="flex flex-col gap-4"> | ||
<p-text-input | ||
v-model="password" | ||
type="password" | ||
placeholder="Enter password" | ||
:error="error" | ||
autofocus | ||
class="w-full" | ||
/> | ||
<p-button | ||
type="submit" | ||
:loading="loading" | ||
class="w-full" | ||
> | ||
Login | ||
</p-button> | ||
</form> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { ref } from 'vue' | ||
import { useRouter } from 'vue-router' | ||
import { usePrefectApi } from '@/compositions/usePrefectApi' | ||
const props = defineProps<{ | ||
redirect?: string | ||
}>() | ||
const password = ref('') | ||
const loading = ref(false) | ||
const error = ref('') | ||
const router = useRouter() | ||
const api = usePrefectApi() | ||
const handleSubmit = async (): Promise<void> => { | ||
if (loading.value) return | ||
loading.value = true | ||
error.value = '' | ||
try { | ||
localStorage.setItem('prefect-password', btoa(password.value)) | ||
router.push(props.redirect || '/') | ||
} catch (e) { | ||
localStorage.removeItem('prefect-password') | ||
error.value = 'Invalid password' | ||
} finally { | ||
loading.value = false | ||
} | ||
} | ||
</script> | ||
|
||
<style> | ||
</style> |
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