From 1c0e25e83e8457a040fe0ee84b88a20a0930a0cd Mon Sep 17 00:00:00 2001 From: AmirHossein Mahmoodi Date: Sat, 10 May 2025 10:12:55 +0330 Subject: [PATCH 1/4] add fullname --- src/components/dashboard/Users/DataTable.jsx | 62 ++++++++++++-------- 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/src/components/dashboard/Users/DataTable.jsx b/src/components/dashboard/Users/DataTable.jsx index 65e4837..71da3fe 100644 --- a/src/components/dashboard/Users/DataTable.jsx +++ b/src/components/dashboard/Users/DataTable.jsx @@ -27,6 +27,43 @@ const DataTable = () => { grow: false, size: 100, }, + { + accessorKey: "full_name", + header: "نام و نام خانوادگی", + id: "full_name", + enableColumnFilter: true, + datatype: "text", + filterMode: "equals", + sortDescFirst: false, + columnFilterModeOptions: ["equals", "contains"], + grow: false, + size: 100, + }, + { + header: "شماره تماس داخلی", + id: "telephone_id", + enableColumnFilter: true, + datatype: "text", + filterMode: "equals", + sortDescFirst: false, + columnFilterModeOptions: ["equals", "contains"], + grow: false, + size: 100, + Cell: ({ row }) => , + }, + { + accessorKey: "is_online", + header: "وضعیت برخط", + id: "is_online", + enableColumnFilter: true, + datatype: "text", + filterMode: "equals", + sortDescFirst: false, + columnFilterModeOptions: ["equals", "contains"], + grow: false, + size: 100, + Cell: ({ row }) => , + }, { header: "استان", id: "province_id", @@ -65,18 +102,6 @@ const DataTable = () => { }, Cell: ({ renderedCellValue, row }) => <>{row.original.province_fa}, }, - { - header: "شماره تماس داخلی", - id: "telephone_id", - enableColumnFilter: true, - datatype: "text", - filterMode: "equals", - sortDescFirst: false, - columnFilterModeOptions: ["equals", "contains"], - grow: false, - size: 100, - Cell: ({ row }) => , - }, { accessorKey: "username", header: "نام کاربری", @@ -155,19 +180,6 @@ const DataTable = () => { grow: false, size: 100, }, - { - accessorKey: "is_online", - header: "وضعیت برخط", - id: "is_online", - enableColumnFilter: true, - datatype: "text", - filterMode: "equals", - sortDescFirst: false, - columnFilterModeOptions: ["equals", "contains"], - grow: false, - size: 100, - Cell: ({ row }) => , - }, { accessorKey: "gender", header: "جنسیت", From 1fb3c6f474256b643b1bd02dcff75f09351cca49 Mon Sep 17 00:00:00 2001 From: AmirHossein Mahmoodi Date: Sat, 10 May 2025 10:27:38 +0330 Subject: [PATCH 2/4] add new cache swr provider --- src/app/(withAuth)/(dashboardLayout)/layout.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/(withAuth)/(dashboardLayout)/layout.js b/src/app/(withAuth)/(dashboardLayout)/layout.js index 54c6ee0..544ff61 100644 --- a/src/app/(withAuth)/(dashboardLayout)/layout.js +++ b/src/app/(withAuth)/(dashboardLayout)/layout.js @@ -5,6 +5,7 @@ import WithWidgetMiddleware from "@/core/middlewares/withWidget"; import { SocketProvider } from "@/lib/contexts/socket"; import { usePermissions } from "@/lib/hooks/usePermissions"; import { Stack } from "@mui/material"; +import { SWRConfig } from "swr"; const Layout = ({ children }) => { const { data: permissions } = usePermissions(); @@ -14,9 +15,11 @@ const Layout = ({ children }) => { return ( - - {children} - + new Map() }}> + + {children} + + From 835c67346115138c7fa6a5943beae0af66be9c3c Mon Sep 17 00:00:00 2001 From: AmirHossein Mahmoodi Date: Mon, 26 May 2025 15:35:04 +0330 Subject: [PATCH 3/4] add client online --- .../(withAuth)/(dashboardLayout)/dashboard/page.js | 4 +++- .../dashboard/dashboard/OnlineUsersReport/index.jsx | 12 ++++++++++++ src/components/dashboard/dashboard/index.jsx | 12 ++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 src/components/dashboard/dashboard/OnlineUsersReport/index.jsx create mode 100644 src/components/dashboard/dashboard/index.jsx diff --git a/src/app/(withAuth)/(dashboardLayout)/dashboard/page.js b/src/app/(withAuth)/(dashboardLayout)/dashboard/page.js index ed0df92..3178277 100644 --- a/src/app/(withAuth)/(dashboardLayout)/dashboard/page.js +++ b/src/app/(withAuth)/(dashboardLayout)/dashboard/page.js @@ -1,9 +1,11 @@ +import DashboardPage from "@/components/dashboard/dashboard"; + export const metadata = { title: "پیشخوان", }; const Page = () => { - return <>; + return ; }; export default Page; diff --git a/src/components/dashboard/dashboard/OnlineUsersReport/index.jsx b/src/components/dashboard/dashboard/OnlineUsersReport/index.jsx new file mode 100644 index 0000000..ee62cbc --- /dev/null +++ b/src/components/dashboard/dashboard/OnlineUsersReport/index.jsx @@ -0,0 +1,12 @@ +import { useSocket } from "@/lib/contexts/socket"; +import { Stack } from "@mui/material"; + +const OnlineUsersReport = () => { + const { clientsOnline } = useSocket(); + return ( + + clientsOnline: {clientsOnline.length} + + ) +} +export default OnlineUsersReport; \ No newline at end of file diff --git a/src/components/dashboard/dashboard/index.jsx b/src/components/dashboard/dashboard/index.jsx new file mode 100644 index 0000000..ca6dc5b --- /dev/null +++ b/src/components/dashboard/dashboard/index.jsx @@ -0,0 +1,12 @@ +"use client" +import { Stack } from "@mui/material"; +import OnlineUsersReport from "./OnlineUsersReport"; + +const DashboardPage = () => { + return ( + + + + ) +} +export default DashboardPage; \ No newline at end of file From d1141f7fd25358b2892dcfd4d63e663151802e16 Mon Sep 17 00:00:00 2001 From: AmirHossein Mahmoodi Date: Mon, 26 May 2025 15:36:01 +0330 Subject: [PATCH 4/4] change version to 2.3.0 --- example.env.local => example.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename example.env.local => example.env (83%) diff --git a/example.env.local b/example.env similarity index 83% rename from example.env.local rename to example.env index a5122ce..6959864 100644 --- a/example.env.local +++ b/example.env @@ -1,4 +1,4 @@ -NEXT_PUBLIC_VERSION = "2.2.1" +NEXT_PUBLIC_VERSION = "2.3.0" NEXT_PUBLIC_API_URL = "https://crm.witel.ir/server" NEXT_PUBLIC_SERVER_SOCKET_URL = "wss://crm.witel.ir"