mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
Ready for release soon.
This commit is contained in:
@@ -3,7 +3,6 @@ import { Page, PageContent, PageHeader, PageTitle } from "@/features/layout/page
|
|||||||
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";
|
|
||||||
import { notFound } from "next/navigation";
|
import { notFound } from "next/navigation";
|
||||||
import { db } from "@/db";
|
import { db } from "@/db";
|
||||||
import { asc, count, eq, inArray } from "drizzle-orm";
|
import { asc, count, eq, inArray } from "drizzle-orm";
|
||||||
@@ -37,6 +36,7 @@ export default async function RoutePage(props: PageParams<{ }>) {
|
|||||||
orderBy: [asc(drizzleDb.schemas.backup.id)],
|
orderBy: [asc(drizzleDb.schemas.backup.id)],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
const backupsRate = await db
|
const backupsRate = await db
|
||||||
.select({
|
.select({
|
||||||
createdAt: drizzleDb.schemas.backup.createdAt,
|
createdAt: drizzleDb.schemas.backup.createdAt,
|
||||||
@@ -48,6 +48,9 @@ export default async function RoutePage(props: PageParams<{ }>) {
|
|||||||
.groupBy(drizzleDb.schemas.backup.createdAt, drizzleDb.schemas.backup.status)
|
.groupBy(drizzleDb.schemas.backup.createdAt, drizzleDb.schemas.backup.status)
|
||||||
.orderBy(drizzleDb.schemas.backup.createdAt);
|
.orderBy(drizzleDb.schemas.backup.createdAt);
|
||||||
|
|
||||||
|
console.log(backupsRate);
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page>
|
<Page>
|
||||||
<PageHeader>
|
<PageHeader>
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ echo " Community Edition v1.0.0 "
|
|||||||
echo " "
|
echo " "
|
||||||
|
|
||||||
|
|
||||||
npx drizzle-kit migrate
|
|
||||||
node server.js
|
node server.js
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
@@ -33,6 +33,8 @@ export function EvolutionLineChart(props: evolutionLineChartProps) {
|
|||||||
[] as { date: string; count: number }[]
|
[] as { date: string; count: number }[]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
console.log(cumulativeData);
|
||||||
|
|
||||||
const chartConfig = {
|
const chartConfig = {
|
||||||
date: {
|
date: {
|
||||||
label: "Date",
|
label: "Date",
|
||||||
@@ -48,7 +50,7 @@ export function EvolutionLineChart(props: evolutionLineChartProps) {
|
|||||||
<ChartContainer config={chartConfig}>
|
<ChartContainer config={chartConfig}>
|
||||||
<LineChart
|
<LineChart
|
||||||
accessibilityLayer
|
accessibilityLayer
|
||||||
data={data}
|
data={cumulativeData}
|
||||||
margin={{
|
margin={{
|
||||||
left: 12,
|
left: 12,
|
||||||
right: 12,
|
right: 12,
|
||||||
@@ -60,7 +62,9 @@ export function EvolutionLineChart(props: evolutionLineChartProps) {
|
|||||||
tickLine={false}
|
tickLine={false}
|
||||||
axisLine={false}
|
axisLine={false}
|
||||||
tickMargin={8}
|
tickMargin={8}
|
||||||
tickFormatter={(value) => humanReadableDate(new Date(value)).split(" ")[0]}
|
tickFormatter={(value) => {
|
||||||
|
return humanReadableDate(new Date(value)).split(" ")[0]
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<YAxis />
|
<YAxis />
|
||||||
<ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
|
<ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ export function PercentageLineChart(props: percentageLineChartProps) {
|
|||||||
acc[date] = { success: 0, failed: 0, total: 0 };
|
acc[date] = { success: 0, failed: 0, total: 0 };
|
||||||
}
|
}
|
||||||
|
|
||||||
acc[date][status === "success" ? "success" : "failed"] += backup._count.id;
|
acc[date][status === "success" ? "success" : "failed"] += backup._count;
|
||||||
acc[date].total += backup._count.id;
|
acc[date].total += backup._count;
|
||||||
|
|
||||||
return acc;
|
return acc;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {format} from "date-fns";
|
import {format} from "date-fns";
|
||||||
|
|
||||||
export function humanReadableDate(rawDate: string | number | Date) {
|
export function humanReadableDate(rawDate: string | number | Date) {
|
||||||
return format(new Date(rawDate), 'dd/MM/yyyy HH:mm')
|
return formatFrenchDate(rawDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function timeAgo(rawDate: string | number | Date) {
|
export function timeAgo(rawDate: string | number | Date) {
|
||||||
|
|||||||
+5
-6
@@ -1,16 +1,15 @@
|
|||||||
import { env } from "@/env.mjs";
|
import { env } from "@/env.mjs";
|
||||||
import { db } from "@/db";
|
import {db, makeMigration} from "@/db";
|
||||||
import { eq } from "drizzle-orm";
|
import { eq } from "drizzle-orm";
|
||||||
import * as drizzleDb from "@/db";
|
import * as drizzleDb from "@/db";
|
||||||
|
|
||||||
|
|
||||||
export function init() {
|
export async function init() {
|
||||||
consoleAscii();
|
consoleAscii();
|
||||||
console.log("====Init Functions====");
|
console.log("====Init Functions====");
|
||||||
|
await makeMigration();
|
||||||
createDefaultOrganization().then(() => {});
|
await createDefaultOrganization();
|
||||||
|
await createSettingsIfNotExist()
|
||||||
createSettingsIfNotExist()
|
|
||||||
.then(() => {
|
.then(() => {
|
||||||
console.log("====Initialization completed====");
|
console.log("====Initialization completed====");
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user