Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"singleQuote": true,
"semi": false,
"trailingComma": "none"
"trailingComma": "none",
"singleAttributePerLine": true
}
80 changes: 0 additions & 80 deletions app/components/TeamsMenu.vue

This file was deleted.

28 changes: 22 additions & 6 deletions app/components/home/HomeChart.client.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,28 @@ const template = (d: DataRecord) =>
class="h-96"
:width="width"
>
<VisLine :x="x" :y="y" color="var(--ui-primary)" />
<VisArea :x="x" :y="y" color="var(--ui-primary)" :opacity="0.1" />

<VisAxis type="x" :x="x" :tick-format="xTicks" />

<VisCrosshair color="var(--ui-primary)" :template="template" />
<VisLine
:x="x"
:y="y"
color="var(--ui-primary)"
/>
<VisArea
:x="x"
:y="y"
color="var(--ui-primary)"
:opacity="0.1"
/>

<VisAxis
type="x"
:x="x"
:tick-format="xTicks"
/>

<VisCrosshair
color="var(--ui-primary)"
:template="template"
/>

<VisTooltip />
</VisXYContainer>
Expand Down
1 change: 0 additions & 1 deletion app/composables/useAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export const useAuth = () => {
const loadAuthUser = async () => {
const { data } = await supabase.auth.getUser()
user.value = data.user
console.log('Auth user loaded:', user.value)
}

const login = async (email: string, password: string) => {
Expand Down
2 changes: 1 addition & 1 deletion app/composables/useDashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const _useDashboard = () => {
defineShortcuts({
'g-h': () => router.push('/'),
'g-a': () => router.push('/anuncios'),
'g-s': () => router.push('/settings'),
'g-s': () => router.push('/settings')
})
}

Expand Down
21 changes: 9 additions & 12 deletions app/layouts/default.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<script setup lang="ts">
import type { NavigationMenuItem } from '@nuxt/ui'

const route = useRoute()

const open = ref(false)

const links = [
[
{
label: 'Home',
label: 'Dashboard',
icon: 'i-lucide-house',
to: '/',
onSelect: () => {
Expand Down Expand Up @@ -78,20 +76,18 @@ const links = [
const groups = computed(() => [
{
id: 'links',
label: 'Go to',
label: 'Ir para',
items: links.flat()
},
{
id: 'code',
label: 'Code',
label: 'Código fonte',
items: [
{
id: 'source',
label: 'View page source',
label: 'Ver página no GitHub',
icon: 'i-simple-icons-github',
to: `https://github.com/nuxt-ui-templates/dashboard/blob/main/app/pages${
route.path === '/' ? '/index' : route.path
}.vue`,
to: 'https://github.com/matusilva/vinouber',
target: '_blank'
}
]
Expand All @@ -109,13 +105,14 @@ const groups = computed(() => [
class="bg-elevated/25"
:ui="{ footer: 'lg:border-t lg:border-default' }"
>
<template #header="{ collapsed }">
<!-- <template #header="{ collapsed }">
<TeamsMenu :collapsed="collapsed" />
</template>
</template> -->

<template #default="{ collapsed }">
<UDashboardSearchButton
:collapsed="collapsed"
label="Pesquisar..."
class="bg-transparent ring-default"
/>

Expand All @@ -141,7 +138,7 @@ const groups = computed(() => [
</template>
</UDashboardSidebar>

<UDashboardSearch :groups="groups" />
<UDashboardSearch :groups="groups" placeholder="Clique para pesquisar ou digite..." />

<slot />
</UDashboardGroup>
Expand Down
3 changes: 2 additions & 1 deletion app/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const period = ref<Period>('daily')
<template>
<UDashboardPanel id="home">
<template #header>
<UDashboardNavbar title="Home" :ui="{ right: 'gap-3' }">
<UDashboardNavbar title="Dashboard" :ui="{ right: 'gap-3' }">
<template #leading>
<UDashboardSidebarCollapse />
</template>
Expand All @@ -42,6 +42,7 @@ const period = ref<Period>('daily')
</template>

<template #body>
Dashboard Em construção...
<HomeStats :period="period" :range="range" />
<HomeChart :period="period" :range="range" />
<HomeSales :period="period" :range="range" />
Expand Down
9 changes: 6 additions & 3 deletions app/pages/login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,13 @@ async function onSubmit(payload: FormSubmitEvent<Schema>) {
try {
await login(email, password)
await navigateTo('/')
} catch (err: any) {
} catch (err: unknown) {
const message =
err instanceof Error ? err.message : 'Credenciais inválidas.'

toast.add({
title: 'Falha no login',
description: err?.message || 'Credenciais inválidas.',
description: message,
color: 'error',
icon: 'i-lucide-x'
})
Expand All @@ -80,8 +83,8 @@ async function onSubmit(payload: FormSubmitEvent<Schema>) {
description="Insira suas credenciais para acessar sua conta."
icon="i-lucide-user"
:fields="fields"
:loading-auto="true"
@submit="onSubmit"
:loadingAuto="true"
/>
</UPageCard>
</div>
Expand Down
14 changes: 11 additions & 3 deletions app/pages/settings/anuncios.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,25 @@ onMounted(loadVideos)
/>
</UFormField>

<UButton type="submit" label="Enviar" loading-auto class="cursor-pointer" />
<UButton
type="submit"
label="Enviar"
loading-auto
class="cursor-pointer"
/>
</UForm>

<hr class="my-8" />
<hr class="my-8">

<UCard>
<template #header>
<span class="font-semibold">Vídeos no Storage</span>
</template>

<div v-if="videos.length === 0" class="text-sm text-gray-500">
<div
v-if="videos.length === 0"
class="text-sm text-gray-500"
>
Nenhum vídeo encontrado.
</div>

Expand Down
5 changes: 4 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ export default withNuxt({
rules: {
'vue/no-multiple-template-root': 'off',
'vue/max-attributes-per-line': ['error', { singleline: 3 }],
'@stylistic/arrow-parens': ['error', 'always']
'vue/singleline-html-element-content-newline': 'off',
'@stylistic/arrow-parens': ['error', 'always'],
'@stylistic/operator-linebreak': 'off',
'@typescript-eslint/no-explicit-any': 'off'
}
})