Skip to content

Commit 4ae8bc8

Browse files
committed
feat: payments screens
feat: router screens
1 parent ffbcb8a commit 4ae8bc8

29 files changed

Lines changed: 5221 additions & 1 deletion

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { CustomersTable } from '@/components/payments/customers/customers-table';
2+
3+
export default function CustomersPage() {
4+
return (
5+
<div className="container mx-auto py-6">
6+
<div className="flex flex-col gap-4">
7+
<div className="flex items-center justify-between">
8+
<div>
9+
<h1 className="text-3xl font-bold tracking-tight">Customers</h1>
10+
<p className="text-muted-foreground">
11+
Manage your customer information and payment details.
12+
</p>
13+
</div>
14+
</div>
15+
16+
<CustomersTable />
17+
</div>
18+
</div>
19+
);
20+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function PaymentsDashboard() {
2+
return <></>;
3+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { ProductsTable } from '@/components/payments/products/products-table';
2+
3+
export default function ProductsPage() {
4+
return (
5+
<div className="flex flex-col gap-4">
6+
<div className="flex items-center justify-between">
7+
<div>
8+
<h1 className="text-3xl font-bold tracking-tight">Products</h1>
9+
<p className="text-muted-foreground">
10+
Manage your products and subscription offerings.
11+
</p>
12+
</div>
13+
</div>
14+
15+
<ProductsTable />
16+
</div>
17+
);
18+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { PaymentsSettings } from '@/components/payments/settings/payments-settings';
2+
3+
export default function PaymentsSettingsPage() {
4+
return (
5+
<div className="flex flex-col gap-4">
6+
<div className="flex items-center justify-between">
7+
<div>
8+
<h1 className="text-3xl font-bold tracking-tight">
9+
Payment Settings
10+
</h1>
11+
<p className="text-muted-foreground">
12+
Configure your payment providers and settings.
13+
</p>
14+
</div>
15+
</div>
16+
17+
<PaymentsSettings />
18+
</div>
19+
);
20+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { SubscriptionsTable } from '@/components/payments/subscriptions/subscriptions-table';
2+
3+
export default function SubscriptionsPage() {
4+
return (
5+
<div className="flex flex-col gap-4">
6+
<div className="flex items-center justify-between">
7+
<div>
8+
<h1 className="text-3xl font-bold tracking-tight">Subscriptions</h1>
9+
<p className="text-muted-foreground">
10+
View and manage active subscriptions.
11+
</p>
12+
</div>
13+
</div>
14+
15+
<SubscriptionsTable />
16+
</div>
17+
);
18+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { TransactionsTable } from '@/components/payments/transactions/transactions-table';
2+
3+
export default function TransactionsPage() {
4+
return (
5+
<div className="flex flex-col gap-4">
6+
<div className="flex items-center justify-between">
7+
<div>
8+
<h1 className="text-3xl font-bold tracking-tight">Transactions</h1>
9+
<p className="text-muted-foreground">
10+
View and manage payment transactions.
11+
</p>
12+
</div>
13+
</div>
14+
15+
<TransactionsTable />
16+
</div>
17+
);
18+
}
Lines changed: 142 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,144 @@
1+
import Link from 'next/link';
2+
import {
3+
Card,
4+
CardContent,
5+
CardDescription,
6+
CardHeader,
7+
CardTitle,
8+
} from '@/components/ui/card';
9+
import { Button } from '@/components/ui/button';
10+
import { Route, Shield, Settings, BarChart3 } from 'lucide-react';
11+
112
export default function RouterDashboard() {
2-
return <></>;
13+
return (
14+
<div className="space-y-6">
15+
<div>
16+
<h2 className="text-2xl font-bold tracking-tight">Router Dashboard</h2>
17+
<p className="text-muted-foreground">
18+
Manage your router configuration, security, and monitor routes
19+
</p>
20+
</div>
21+
22+
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
23+
<Card>
24+
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
25+
<CardTitle className="text-sm font-medium">
26+
Route Visualization
27+
</CardTitle>
28+
<BarChart3 className="h-4 w-4 text-muted-foreground" />
29+
</CardHeader>
30+
<CardContent>
31+
<div className="text-2xl font-bold">Visualize</div>
32+
<p className="text-xs text-muted-foreground">
33+
Interactive graph view of your routes and middlewares
34+
</p>
35+
<Button asChild className="mt-4 w-full">
36+
<Link href="/router/vizualize">
37+
<Route className="h-4 w-4 mr-2" />
38+
View Routes
39+
</Link>
40+
</Button>
41+
</CardContent>
42+
</Card>
43+
44+
<Card>
45+
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
46+
<CardTitle className="text-sm font-medium">
47+
Security Clients
48+
</CardTitle>
49+
<Shield className="h-4 w-4 text-muted-foreground" />
50+
</CardHeader>
51+
<CardContent>
52+
<div className="text-2xl font-bold">Manage</div>
53+
<p className="text-xs text-muted-foreground">
54+
Create and manage security clients for your applications
55+
</p>
56+
<Button asChild className="mt-4 w-full">
57+
<Link href="/router/security">
58+
<Shield className="h-4 w-4 mr-2" />
59+
Security Clients
60+
</Link>
61+
</Button>
62+
</CardContent>
63+
</Card>
64+
65+
<Card>
66+
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
67+
<CardTitle className="text-sm font-medium">
68+
Router Settings
69+
</CardTitle>
70+
<Settings className="h-4 w-4 text-muted-foreground" />
71+
</CardHeader>
72+
<CardContent>
73+
<div className="text-2xl font-bold">Configure</div>
74+
<p className="text-xs text-muted-foreground">
75+
Configure CORS, rate limiting, and transport settings
76+
</p>
77+
<Button asChild className="mt-4 w-full">
78+
<Link href="/router/settings">
79+
<Settings className="h-4 w-4 mr-2" />
80+
Settings
81+
</Link>
82+
</Button>
83+
</CardContent>
84+
</Card>
85+
</div>
86+
87+
<div className="grid gap-4 md:grid-cols-2">
88+
<Card>
89+
<CardHeader>
90+
<CardTitle>Quick Actions</CardTitle>
91+
<CardDescription>Common router management tasks</CardDescription>
92+
</CardHeader>
93+
<CardContent className="space-y-2">
94+
<Button asChild variant="outline" className="w-full justify-start">
95+
<Link href="/router/vizualize">
96+
<BarChart3 className="h-4 w-4 mr-2" />
97+
View Route Graph
98+
</Link>
99+
</Button>
100+
<Button asChild variant="outline" className="w-full justify-start">
101+
<Link href="/router/security">
102+
<Shield className="h-4 w-4 mr-2" />
103+
Manage Security Clients
104+
</Link>
105+
</Button>
106+
<Button asChild variant="outline" className="w-full justify-start">
107+
<Link href="/router/settings">
108+
<Settings className="h-4 w-4 mr-2" />
109+
Configure Router
110+
</Link>
111+
</Button>
112+
</CardContent>
113+
</Card>
114+
115+
<Card>
116+
<CardHeader>
117+
<CardTitle>Router Overview</CardTitle>
118+
<CardDescription>
119+
Key information about your router configuration
120+
</CardDescription>
121+
</CardHeader>
122+
<CardContent className="space-y-4">
123+
<div className="flex items-center justify-between">
124+
<span className="text-sm font-medium">Status</span>
125+
<span className="text-sm text-green-600">Active</span>
126+
</div>
127+
<div className="flex items-center justify-between">
128+
<span className="text-sm font-medium">Transport Protocols</span>
129+
<span className="text-sm text-muted-foreground">
130+
REST, GraphQL, WebSocket
131+
</span>
132+
</div>
133+
<div className="flex items-center justify-between">
134+
<span className="text-sm font-medium">Security</span>
135+
<span className="text-sm text-muted-foreground">
136+
Client validation enabled
137+
</span>
138+
</div>
139+
</CardContent>
140+
</Card>
141+
</div>
142+
</div>
143+
);
3144
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { getSecurityClients } from '@/lib/api/router';
2+
import { SecurityClients } from '@/components/router/security';
3+
4+
export default async function RouterSecurityPage() {
5+
const data = await getSecurityClients();
6+
return <SecurityClients data={data} />;
7+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { getRoutes } from '@/lib/api/router';
2+
import { RouterVisualization } from '@/components/router/visualization';
3+
4+
export default async function RouterVisualizationPage() {
5+
const data = await getRoutes();
6+
console.log('Router visualization API response:', data);
7+
return <RouterVisualization data={data} />;
8+
}

src/app/(dashboard)/template.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const MODULE_NAMES: { [key: string]: string } = {
3535
router: 'Router',
3636
functions: 'Functions',
3737
'push-notifications': 'Notifications',
38+
payments: 'Payments',
3839
};
3940
export default function ModuleHeader({
4041
children,

0 commit comments

Comments
 (0)