-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
close #176 close #117 close #173 close #180 --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
- Loading branch information
1 parent
0edaa60
commit 0a8f5bd
Showing
54 changed files
with
696 additions
and
273 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
shamefully-hoist=true | ||
strict-peer-dependencies=false |
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,54 @@ | ||
<script setup lang="ts"> | ||
import type { Token } from '@shelve/types' | ||
const tokenName = ref('') | ||
const loading = ref(false) | ||
const emits = defineEmits(['create']) | ||
async function createToken() { | ||
loading.value = true | ||
try { | ||
await $fetch<Token>('/api/tokens', { | ||
method: 'POST', | ||
body: { | ||
name: tokenName.value, | ||
}, | ||
}) | ||
emits('create') | ||
tokenName.value = '' | ||
toast.success('Token created') | ||
} catch (error) { | ||
toast.error('Failed to create token') | ||
} | ||
loading.value = false | ||
} | ||
</script> | ||
|
||
<template> | ||
<div class="hidden items-center justify-end gap-2 sm:flex"> | ||
<UPopover :popper="{ arrow: true }"> | ||
<UButton variant="solid" color="primary"> | ||
Create a token | ||
</UButton> | ||
<template #panel> | ||
<form @submit.prevent="createToken(tokenName)"> | ||
<UCard> | ||
<div class="flex flex-col gap-2"> | ||
<p class="flex gap-2 text-sm font-semibold leading-6"> | ||
Create a token | ||
</p> | ||
<div class="flex gap-2"> | ||
<UInput v-model="tokenName" label="Token name" placeholder="Token name" /> | ||
<UButton :loading label="Create" type="submit" /> | ||
</div> | ||
</div> | ||
</UCard> | ||
</form> | ||
</template> | ||
</UPopover> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<script setup lang="ts"> | ||
const { token } = defineProps<{ | ||
token: string | ||
}>() | ||
const visible = ref(false) | ||
const copy = () => { | ||
navigator.clipboard.writeText(token) | ||
toast.success('Token copied to clipboard') | ||
} | ||
</script> | ||
|
||
<template> | ||
<div class="flex select-none items-center gap-2"> | ||
<UTooltip text="Copy token" class="cursor-pointer text-sm font-semibold leading-6 text-gray-500 dark:text-gray-400"> | ||
<span v-if="visible" @click="copy"> | ||
{{ token.slice(0, 4) }}...{{ token.slice(-4) }} | ||
</span> | ||
<div v-else @click="copy"> | ||
********** | ||
</div> | ||
</UTooltip> | ||
<UIcon | ||
:name="visible ? 'lucide:eye-off' : 'lucide:eye'" | ||
class="cursor-pointer text-gray-500 dark:text-gray-400" | ||
@click="visible = !visible" | ||
/> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
</style> |
This file was deleted.
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 |
---|---|---|
@@ -1,4 +1,7 @@ | ||
export default defineNuxtRouteMiddleware(async () => { | ||
const user = await useSession().refresh() | ||
if (user) return '/app/projects' | ||
export default defineNuxtRouteMiddleware(() => { | ||
const { loggedIn } = useUserSession() | ||
|
||
if (loggedIn.value) { | ||
return navigateTo('/app/projects') | ||
} | ||
}) |
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,7 +1,8 @@ | ||
export default defineNuxtRouteMiddleware(async () => { | ||
const user = await useSession().refresh() | ||
if (!user) { | ||
export default defineNuxtRouteMiddleware(() => { | ||
const { loggedIn } = useUserSession() | ||
|
||
if (!loggedIn.value) { | ||
toast.error('You need to be logged in to access this page.') | ||
return '/login' | ||
return navigateTo('/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
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.