Merge branch 'release/v2.3.0'
This commit is contained in:
@@ -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_API_URL = "https://crm.witel.ir/server"
|
||||||
NEXT_PUBLIC_SERVER_SOCKET_URL = "wss://crm.witel.ir"
|
NEXT_PUBLIC_SERVER_SOCKET_URL = "wss://crm.witel.ir"
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
|
import DashboardPage from "@/components/dashboard/dashboard";
|
||||||
|
|
||||||
export const metadata = {
|
export const metadata = {
|
||||||
title: "پیشخوان",
|
title: "پیشخوان",
|
||||||
};
|
};
|
||||||
|
|
||||||
const Page = () => {
|
const Page = () => {
|
||||||
return <></>;
|
return <DashboardPage />;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Page;
|
export default Page;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import WithWidgetMiddleware from "@/core/middlewares/withWidget";
|
|||||||
import { SocketProvider } from "@/lib/contexts/socket";
|
import { SocketProvider } from "@/lib/contexts/socket";
|
||||||
import { usePermissions } from "@/lib/hooks/usePermissions";
|
import { usePermissions } from "@/lib/hooks/usePermissions";
|
||||||
import { Stack } from "@mui/material";
|
import { Stack } from "@mui/material";
|
||||||
|
import { SWRConfig } from "swr";
|
||||||
|
|
||||||
const Layout = ({ children }) => {
|
const Layout = ({ children }) => {
|
||||||
const { data: permissions } = usePermissions();
|
const { data: permissions } = usePermissions();
|
||||||
@@ -14,9 +15,11 @@ const Layout = ({ children }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<SocketProvider>
|
<SocketProvider>
|
||||||
<Stack sx={{ width: "100%", height: "100%" }}>
|
<SWRConfig value={{ provider: () => new Map() }}>
|
||||||
<HeaderWithSidebar>{children}</HeaderWithSidebar>
|
<Stack sx={{ width: "100%", height: "100%" }}>
|
||||||
</Stack>
|
<HeaderWithSidebar>{children}</HeaderWithSidebar>
|
||||||
|
</Stack>
|
||||||
|
</SWRConfig>
|
||||||
<WithWidgetMiddleware enable={isCallWidgetEnabled}>
|
<WithWidgetMiddleware enable={isCallWidgetEnabled}>
|
||||||
<CallWidget />
|
<CallWidget />
|
||||||
</WithWidgetMiddleware>
|
</WithWidgetMiddleware>
|
||||||
|
|||||||
@@ -27,6 +27,43 @@ const DataTable = () => {
|
|||||||
grow: false,
|
grow: false,
|
||||||
size: 100,
|
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: "استان",
|
header: "استان",
|
||||||
id: "province_id",
|
id: "province_id",
|
||||||
@@ -65,18 +102,6 @@ const DataTable = () => {
|
|||||||
},
|
},
|
||||||
Cell: ({ renderedCellValue, row }) => <>{row.original.province_fa}</>,
|
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",
|
accessorKey: "username",
|
||||||
header: "نام کاربری",
|
header: "نام کاربری",
|
||||||
@@ -155,19 +180,6 @@ const DataTable = () => {
|
|||||||
grow: false,
|
grow: false,
|
||||||
size: 100,
|
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",
|
accessorKey: "gender",
|
||||||
header: "جنسیت",
|
header: "جنسیت",
|
||||||
|
|||||||
@@ -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;
|
||||||
12
src/components/dashboard/dashboard/index.jsx
Normal file
12
src/components/dashboard/dashboard/index.jsx
Normal 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;
|
||||||
Reference in New Issue
Block a user