-
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
1 parent
4e7a2b8
commit 7d34156
Showing
5 changed files
with
40 additions
and
7 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
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 |
---|---|---|
@@ -1,11 +1,41 @@ | ||
<template> | ||
<div> | ||
teste | ||
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4"> | ||
<Card title="Empresas cadastradas" type="primary" :text="data?.companies || 0" /> | ||
<Card title="Usuários cadastrados" type="info" :text="data?.users || 0" /> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import CompanyService from "~/services/api/admin/CompanyService"; | ||
import UserService from "~/services/api/admin/UserService"; | ||
import Card from "~/components/shared/Card.vue"; | ||
useHead({ | ||
title: 'Dashboard', | ||
}) | ||
definePageMeta({ | ||
layout: 'default', | ||
}) | ||
const companyService = new CompanyService() | ||
const userService = new UserService() | ||
async function fetchData() { | ||
const companies = await companyService.index() | ||
.then((res) => res.meta?.total) | ||
.catch(() => { | ||
useNotify('error', 'Ops! Ocorreu algum erro, tente novamente mais tarde.') | ||
}) | ||
const users = await userService.index() | ||
.then((res) => res.meta?.total) | ||
.catch(() => { | ||
useNotify('error', 'Ops! Ocorreu algum erro, tente novamente mais tarde.') | ||
}) | ||
return {companies, users} | ||
} | ||
const {pending, data, refresh} = useLazyAsyncData('dashData', await fetchData) | ||
Check warning on line 40 in pages/admin/home.vue GitHub Actions / check-eslint (20.x)
Check warning on line 40 in pages/admin/home.vue GitHub Actions / check-eslint (20.x)
Check warning on line 40 in pages/admin/home.vue GitHub Actions / check-eslint (20.x)
|
||
</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