mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
Correcting some bugs in statistics.
This commit is contained in:
@@ -86,7 +86,7 @@ export default async function RoutePage(props: PageParams<{ agentId: string }>)
|
||||
</Card>
|
||||
|
||||
</div>
|
||||
<Card className="w-full sm:w-auto flex-1">
|
||||
<Card className="w-full sm:w-auto flex-1 mb-4">
|
||||
<CardHeader className="font-bold text-xl">
|
||||
Edge Key
|
||||
</CardHeader>
|
||||
|
||||
@@ -4,13 +4,15 @@ import {prisma} from "@/prisma";
|
||||
import {Card, CardContent, CardHeader, CardTitle} from "@/components/ui/card";
|
||||
import {EvolutionLineChart} from "@/components/wrappers/dashboard/statistics/charts/evolution-line-chart";
|
||||
import {PercentageLineChart} from "@/components/wrappers/dashboard/statistics/charts/percentage-line-chart";
|
||||
import {getCurrentOrganizationSlug} from "@/features/dashboard/organization-cookie";
|
||||
|
||||
export default async function RoutePage(props: PageParams<{}>) {
|
||||
const currentOrganizationSlug = await getCurrentOrganizationSlug()
|
||||
|
||||
const projectsCount = await prisma.project.count({
|
||||
where: {
|
||||
organization: {
|
||||
slug: "default"
|
||||
slug: currentOrganizationSlug
|
||||
}
|
||||
},
|
||||
});
|
||||
@@ -22,6 +24,15 @@ export default async function RoutePage(props: PageParams<{}>) {
|
||||
orderBy: {
|
||||
createdAt: "asc",
|
||||
},
|
||||
where: {
|
||||
database: {
|
||||
project: {
|
||||
organization: {
|
||||
slug: currentOrganizationSlug
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const backupsRate = await prisma.backup.groupBy({
|
||||
@@ -30,12 +41,22 @@ export default async function RoutePage(props: PageParams<{}>) {
|
||||
status: {
|
||||
in: ['success', 'failed'],
|
||||
},
|
||||
database: {
|
||||
project: {
|
||||
organization: {
|
||||
slug: currentOrganizationSlug
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
_count: {
|
||||
id: true,
|
||||
},
|
||||
});
|
||||
|
||||
console.log("data",backupsEvolution)
|
||||
console.log("data",backupsRate)
|
||||
|
||||
|
||||
return (
|
||||
<Page>
|
||||
|
||||
Reference in New Issue
Block a user