Update Bridge file layout
This commit is contained in:
parent
2c43e81436
commit
b0fb643b6a
47 changed files with 2488 additions and 2087 deletions
|
|
@ -0,0 +1,3 @@
|
|||
export default function Page() {
|
||||
return <h1>Facebook view</h1>;
|
||||
}
|
||||
3
apps/bridge-frontend/app/(main)/facebook/[id]/page.tsx
Normal file
3
apps/bridge-frontend/app/(main)/facebook/[id]/page.tsx
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
export default function Page() {
|
||||
return <h1>Facebook view</h1>;
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
"use client";
|
||||
|
||||
import { FC } from "react";
|
||||
import { GridColDef } from "@mui/x-data-grid-pro";
|
||||
import { List } from "@/app/_components/List";
|
||||
|
||||
type FacebookBotsListProps = {
|
||||
rows: any[];
|
||||
};
|
||||
|
||||
export const FacebookBotsList: FC<FacebookBotsListProps> = ({ rows }) => {
|
||||
const columns: GridColDef[] = [
|
||||
{
|
||||
field: "id",
|
||||
headerName: "ID",
|
||||
flex: 1,
|
||||
},
|
||||
{
|
||||
field: "phoneNumber",
|
||||
headerName: "Phone Number",
|
||||
flex: 2,
|
||||
},
|
||||
{
|
||||
field: "createdAt",
|
||||
headerName: "Created At",
|
||||
valueGetter: (params: any) =>
|
||||
new Date(params.row?.createdAt).toLocaleString(),
|
||||
flex: 1,
|
||||
},
|
||||
{
|
||||
field: "updatedAt",
|
||||
headerName: "Updated At",
|
||||
valueGetter: (params: any) =>
|
||||
new Date(params.row?.updatedAt).toLocaleString(),
|
||||
flex: 1,
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<List
|
||||
title="Facebook Bots"
|
||||
entity="facebook"
|
||||
rows={rows}
|
||||
columns={columns}
|
||||
/>
|
||||
);
|
||||
};
|
||||
3
apps/bridge-frontend/app/(main)/facebook/new/page.tsx
Normal file
3
apps/bridge-frontend/app/(main)/facebook/new/page.tsx
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
export default function Page() {
|
||||
return <h1>Facebook Home</h1>;
|
||||
}
|
||||
10
apps/bridge-frontend/app/(main)/facebook/page.tsx
Normal file
10
apps/bridge-frontend/app/(main)/facebook/page.tsx
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import { FacebookBotsList } from "./_components/FacebookBotsList";
|
||||
import { db } from "@/app/_lib/database";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export default async function Page() {
|
||||
const rows = await db.selectFrom("FacebookBot").selectAll().execute();
|
||||
|
||||
return <FacebookBotsList rows={rows} />;
|
||||
}
|
||||
9
apps/bridge-frontend/app/(main)/layout.tsx
Normal file
9
apps/bridge-frontend/app/(main)/layout.tsx
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import { InternalLayout } from "@/app/_components/InternalLayout";
|
||||
|
||||
export default function Layout({
|
||||
children,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
return <InternalLayout>{children}</InternalLayout>;
|
||||
}
|
||||
4
apps/bridge-frontend/app/(main)/page.tsx
Normal file
4
apps/bridge-frontend/app/(main)/page.tsx
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
export default function Page() {
|
||||
return <h1>Home</h1>;
|
||||
}
|
||||
|
||||
9
apps/bridge-frontend/app/(main)/signal/[id]/page.tsx
Normal file
9
apps/bridge-frontend/app/(main)/signal/[id]/page.tsx
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import { Detail } from "@/app/_components/Detail";
|
||||
|
||||
export default function Page() {
|
||||
return (
|
||||
<Detail title="Signal Detail" entity="signal">
|
||||
<p>Cool</p>
|
||||
</Detail>
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
"use client";
|
||||
|
||||
import { FC } from "react";
|
||||
import { GridColDef } from "@mui/x-data-grid-pro";
|
||||
import { List } from "@/app/_components/List";
|
||||
|
||||
type SignalBotsListProps = {
|
||||
rows: any[];
|
||||
};
|
||||
|
||||
export const SignalBotsList: FC<SignalBotsListProps> = ({ rows }) => {
|
||||
const columns: GridColDef[] = [
|
||||
{
|
||||
field: "id",
|
||||
headerName: "ID",
|
||||
flex: 1,
|
||||
},
|
||||
{
|
||||
field: "phoneNumber",
|
||||
headerName: "Phone Number",
|
||||
flex: 2,
|
||||
},
|
||||
{
|
||||
field: "createdAt",
|
||||
headerName: "Created At",
|
||||
valueGetter: (params: any) =>
|
||||
new Date(params.row?.createdAt).toLocaleString(),
|
||||
flex: 1,
|
||||
},
|
||||
{
|
||||
field: "updatedAt",
|
||||
headerName: "Updated At",
|
||||
valueGetter: (params: any) =>
|
||||
new Date(params.row?.updatedAt).toLocaleString(),
|
||||
flex: 1,
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<List title="Signal Bots" entity="signal" rows={rows} columns={columns} />
|
||||
);
|
||||
};
|
||||
3
apps/bridge-frontend/app/(main)/signal/new/page.tsx
Normal file
3
apps/bridge-frontend/app/(main)/signal/new/page.tsx
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
export default function Page() {
|
||||
return <h1>Signal new</h1>;
|
||||
}
|
||||
10
apps/bridge-frontend/app/(main)/signal/page.tsx
Normal file
10
apps/bridge-frontend/app/(main)/signal/page.tsx
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import { SignalBotsList } from "./_components/SignalBotsList";
|
||||
import { db } from "@/app/_lib/database";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export default async function Page() {
|
||||
const rows = await db.selectFrom("SignalBot").selectAll().execute();
|
||||
|
||||
return <SignalBotsList rows={rows} />;
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
"use client";
|
||||
|
||||
import { FC } from "react";
|
||||
import { GridColDef } from "@mui/x-data-grid-pro";
|
||||
import { List } from "@/app/_components/List";
|
||||
|
||||
type UsersListProps = {
|
||||
rows: any[];
|
||||
};
|
||||
|
||||
export const UsersList: FC<UsersListProps> = ({ rows }) => {
|
||||
const columns: GridColDef[] = [
|
||||
{
|
||||
field: "name",
|
||||
headerName: "Name",
|
||||
flex: 2,
|
||||
},
|
||||
{
|
||||
field: "email",
|
||||
headerName: "Email",
|
||||
flex: 2,
|
||||
},
|
||||
{
|
||||
field: "emailVerified",
|
||||
headerName: "Verified",
|
||||
flex: 1,
|
||||
},
|
||||
];
|
||||
|
||||
return <List title="Users" entity="users" rows={rows} columns={columns} />;
|
||||
};
|
||||
11
apps/bridge-frontend/app/(main)/users/page.tsx
Normal file
11
apps/bridge-frontend/app/(main)/users/page.tsx
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { UsersList } from "./_components/UsersList";
|
||||
import { db } from "@/app/_lib/database";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export default async function Page() {
|
||||
const rows = await db.selectFrom("User").selectAll().execute();
|
||||
console.log(rows);
|
||||
|
||||
return <UsersList rows={rows} />;
|
||||
}
|
||||
3
apps/bridge-frontend/app/(main)/voice/[id]/edit/page.tsx
Normal file
3
apps/bridge-frontend/app/(main)/voice/[id]/edit/page.tsx
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
export default function Page() {
|
||||
return <h1>Voice Edit</h1>;
|
||||
}
|
||||
3
apps/bridge-frontend/app/(main)/voice/[id]/page.tsx
Normal file
3
apps/bridge-frontend/app/(main)/voice/[id]/page.tsx
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
export default function Page() {
|
||||
return <h1>Voice detail</h1>;
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
"use client";
|
||||
|
||||
import { FC } from "react";
|
||||
import { GridColDef } from "@mui/x-data-grid-pro";
|
||||
import { List } from "@/app/_components/List";
|
||||
|
||||
type VoiceBotsListProps = {
|
||||
rows: any[];
|
||||
};
|
||||
|
||||
export const VoiceBotsList: FC<VoiceBotsListProps> = ({ rows }) => {
|
||||
const columns: GridColDef[] = [
|
||||
{
|
||||
field: "id",
|
||||
headerName: "ID",
|
||||
flex: 1,
|
||||
},
|
||||
{
|
||||
field: "phoneNumber",
|
||||
headerName: "Phone Number",
|
||||
flex: 2,
|
||||
},
|
||||
{
|
||||
field: "createdAt",
|
||||
headerName: "Created At",
|
||||
valueGetter: (params: any) =>
|
||||
new Date(params.row?.createdAt).toLocaleString(),
|
||||
flex: 1,
|
||||
},
|
||||
{
|
||||
field: "updatedAt",
|
||||
headerName: "Updated At",
|
||||
valueGetter: (params: any) =>
|
||||
new Date(params.row?.updatedAt).toLocaleString(),
|
||||
flex: 1,
|
||||
},
|
||||
];
|
||||
|
||||
return <List title="Voice Bots" entity="voice" rows={rows} columns={columns} />;
|
||||
};
|
||||
3
apps/bridge-frontend/app/(main)/voice/new/page.tsx
Normal file
3
apps/bridge-frontend/app/(main)/voice/new/page.tsx
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
export default function Page() {
|
||||
return <h1>Voice Home</h1>;
|
||||
}
|
||||
10
apps/bridge-frontend/app/(main)/voice/page.tsx
Normal file
10
apps/bridge-frontend/app/(main)/voice/page.tsx
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import { VoiceBotsList } from "./_components/VoiceBotsList";
|
||||
import { db } from "@/app/_lib/database";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export default async function Page() {
|
||||
const rows = await db.selectFrom("VoiceLine").selectAll().execute();
|
||||
|
||||
return <VoiceBotsList rows={rows} />;
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
"use client";
|
||||
|
||||
import { FC } from "react";
|
||||
import { GridColDef } from "@mui/x-data-grid-pro";
|
||||
import { List } from "@/app/_components/List";
|
||||
|
||||
type WebhooksListProps = {
|
||||
rows: any[];
|
||||
};
|
||||
|
||||
export const WebhooksList: FC<WebhooksListProps> = ({ rows }) => {
|
||||
const columns: GridColDef[] = [
|
||||
{
|
||||
field: "id",
|
||||
headerName: "ID",
|
||||
flex: 1,
|
||||
},
|
||||
{
|
||||
field: "phoneNumber",
|
||||
headerName: "Phone Number",
|
||||
flex: 2,
|
||||
},
|
||||
{
|
||||
field: "createdAt",
|
||||
headerName: "Created At",
|
||||
valueGetter: (params: any) =>
|
||||
new Date(params.row?.createdAt).toLocaleString(),
|
||||
flex: 1,
|
||||
},
|
||||
{
|
||||
field: "updatedAt",
|
||||
headerName: "Updated At",
|
||||
valueGetter: (params: any) =>
|
||||
new Date(params.row?.updatedAt).toLocaleString(),
|
||||
flex: 1,
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<List title="Webhooks" entity="webhooks" rows={rows} columns={columns} />
|
||||
);
|
||||
};
|
||||
11
apps/bridge-frontend/app/(main)/webhooks/page.tsx
Normal file
11
apps/bridge-frontend/app/(main)/webhooks/page.tsx
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { WebhooksList } from "./_components/WebhooksList";
|
||||
import { db } from "@/app/_lib/database";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export default async function Page() {
|
||||
const rows = await db.selectFrom("Webhook").selectAll().execute();
|
||||
console.log(rows);
|
||||
|
||||
return <WebhooksList rows={rows} />;
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
export default function Page() {
|
||||
return <h1>Whatsapp edit</h1>;
|
||||
}
|
||||
6
apps/bridge-frontend/app/(main)/whatsapp/[id]/page.tsx
Normal file
6
apps/bridge-frontend/app/(main)/whatsapp/[id]/page.tsx
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
// import { db } from "@/app/_lib/database";
|
||||
|
||||
export default async function Page() {
|
||||
const rows = []; // await db.selectFrom("WhatsAppBot").
|
||||
return <h1>Whatsapp View</h1>;
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
"use client";
|
||||
|
||||
import { FC } from "react";
|
||||
import { GridColDef } from "@mui/x-data-grid-pro";
|
||||
import { List } from "@/app/_components/List";
|
||||
|
||||
type WhatsappListProps = {
|
||||
rows: any[];
|
||||
};
|
||||
|
||||
export const WhatsappList: FC<WhatsappListProps> = ({ rows }) => {
|
||||
const columns: GridColDef[] = [
|
||||
{
|
||||
field: "id",
|
||||
headerName: "ID",
|
||||
flex: 1,
|
||||
},
|
||||
{
|
||||
field: "phoneNumber",
|
||||
headerName: "Phone Number",
|
||||
flex: 2,
|
||||
},
|
||||
{
|
||||
field: "createdAt",
|
||||
headerName: "Created At",
|
||||
valueGetter: (params: any) =>
|
||||
new Date(params.row?.createdAt).toLocaleString(),
|
||||
flex: 1,
|
||||
},
|
||||
{
|
||||
field: "updatedAt",
|
||||
headerName: "Updated At",
|
||||
valueGetter: (params: any) =>
|
||||
new Date(params.row?.updatedAt).toLocaleString(),
|
||||
flex: 1,
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<List
|
||||
title="WhatsApp Bots"
|
||||
entity="whatsapp"
|
||||
rows={rows}
|
||||
columns={columns}
|
||||
/>
|
||||
);
|
||||
};
|
||||
3
apps/bridge-frontend/app/(main)/whatsapp/new/page.tsx
Normal file
3
apps/bridge-frontend/app/(main)/whatsapp/new/page.tsx
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
export default function Page() {
|
||||
return <h1>Whatsapp new</h1>;
|
||||
}
|
||||
11
apps/bridge-frontend/app/(main)/whatsapp/page.tsx
Normal file
11
apps/bridge-frontend/app/(main)/whatsapp/page.tsx
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { WhatsappList } from "./_components/WhatsappList";
|
||||
import { db } from "@/app/_lib/database";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export default async function Page() {
|
||||
const rows = await db.selectFrom("WhatsappBot").selectAll().execute();
|
||||
console.log(rows);
|
||||
|
||||
return <WhatsappList rows={rows} />;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue