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>
|
</Card>
|
||||||
|
|
||||||
</div>
|
</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">
|
<CardHeader className="font-bold text-xl">
|
||||||
Edge Key
|
Edge Key
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
|
|||||||
@@ -4,13 +4,15 @@ import {prisma} from "@/prisma";
|
|||||||
import {Card, CardContent, CardHeader, CardTitle} from "@/components/ui/card";
|
import {Card, CardContent, CardHeader, CardTitle} from "@/components/ui/card";
|
||||||
import {EvolutionLineChart} from "@/components/wrappers/dashboard/statistics/charts/evolution-line-chart";
|
import {EvolutionLineChart} from "@/components/wrappers/dashboard/statistics/charts/evolution-line-chart";
|
||||||
import {PercentageLineChart} from "@/components/wrappers/dashboard/statistics/charts/percentage-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<{}>) {
|
export default async function RoutePage(props: PageParams<{}>) {
|
||||||
|
const currentOrganizationSlug = await getCurrentOrganizationSlug()
|
||||||
|
|
||||||
const projectsCount = await prisma.project.count({
|
const projectsCount = await prisma.project.count({
|
||||||
where: {
|
where: {
|
||||||
organization: {
|
organization: {
|
||||||
slug: "default"
|
slug: currentOrganizationSlug
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -22,6 +24,15 @@ export default async function RoutePage(props: PageParams<{}>) {
|
|||||||
orderBy: {
|
orderBy: {
|
||||||
createdAt: "asc",
|
createdAt: "asc",
|
||||||
},
|
},
|
||||||
|
where: {
|
||||||
|
database: {
|
||||||
|
project: {
|
||||||
|
organization: {
|
||||||
|
slug: currentOrganizationSlug
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const backupsRate = await prisma.backup.groupBy({
|
const backupsRate = await prisma.backup.groupBy({
|
||||||
@@ -30,12 +41,22 @@ export default async function RoutePage(props: PageParams<{}>) {
|
|||||||
status: {
|
status: {
|
||||||
in: ['success', 'failed'],
|
in: ['success', 'failed'],
|
||||||
},
|
},
|
||||||
|
database: {
|
||||||
|
project: {
|
||||||
|
organization: {
|
||||||
|
slug: currentOrganizationSlug
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
_count: {
|
_count: {
|
||||||
id: true,
|
id: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log("data",backupsEvolution)
|
||||||
|
console.log("data",backupsRate)
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page>
|
<Page>
|
||||||
|
|||||||
Reference in New Issue
Block a user