Merge branch 'release/v2.3.0'

This commit is contained in:
AmirHossein Mahmoodi
2025-05-26 15:36:20 +03:30
6 changed files with 71 additions and 30 deletions

View File

@@ -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"

View File

@@ -1,9 +1,11 @@
import DashboardPage from "@/components/dashboard/dashboard";
export const metadata = {
title: "پیشخوان",
};
const Page = () => {
return <></>;
return <DashboardPage />;
};
export default Page;

View File

@@ -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 (
<SocketProvider>
<Stack sx={{ width: "100%", height: "100%" }}>
<HeaderWithSidebar>{children}</HeaderWithSidebar>
</Stack>
<SWRConfig value={{ provider: () => new Map() }}>
<Stack sx={{ width: "100%", height: "100%" }}>
<HeaderWithSidebar>{children}</HeaderWithSidebar>
</Stack>
</SWRConfig>
<WithWidgetMiddleware enable={isCallWidgetEnabled}>
<CallWidget />
</WithWidgetMiddleware>

View File

@@ -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 }) => <TelephoneId user_id={row.original.id} />,
},
{
accessorKey: "is_online",
header: "وضعیت برخط",
id: "is_online",
enableColumnFilter: true,
datatype: "text",
filterMode: "equals",
sortDescFirst: false,
columnFilterModeOptions: ["equals", "contains"],
grow: false,
size: 100,
Cell: ({ row }) => <OnlineCell user_id={row.original.id} />,
},
{
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 }) => <TelephoneId user_id={row.original.id} />,
},
{
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 }) => <OnlineCell user_id={row.original.id} />,
},
{
accessorKey: "gender",
header: "جنسیت",

View File

@@ -0,0 +1,12 @@
import { useSocket } from "@/lib/contexts/socket";
import { Stack } from "@mui/material";
const OnlineUsersReport = () => {
const { clientsOnline } = useSocket();
return (
<Stack>
clientsOnline: {clientsOnline.length}
</Stack>
)
}
export default OnlineUsersReport;

View File

@@ -0,0 +1,12 @@
"use client"
import { Stack } from "@mui/material";
import OnlineUsersReport from "./OnlineUsersReport";
const DashboardPage = () => {
return (
<Stack>
<OnlineUsersReport />
</Stack>
)
}
export default DashboardPage;