@argusoft/medplat-core 1.0.17 → 1.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AddMenuConfiguration-QWfpcnuP.js → AddMenuConfiguration-DsnY0Rws.js} +544 -544
- package/dist/AddMenuConfiguration-DsnY0Rws.js.map +1 -0
- package/dist/{AddRoleDrawer-SvntLdRu.js → AddRoleDrawer-Bc655LQU.js} +17 -17
- package/dist/{AddRoleDrawer-SvntLdRu.js.map → AddRoleDrawer-Bc655LQU.js.map} +1 -1
- package/dist/ChangePasswordModalCore-50EzprTk.js +5495 -0
- package/dist/ChangePasswordModalCore-50EzprTk.js.map +1 -0
- package/dist/{ConditionConfig-DB0FqwgG.js → ConditionConfig-D2hOAa4n.js} +2 -2
- package/dist/{ConditionConfig-DB0FqwgG.js.map → ConditionConfig-D2hOAa4n.js.map} +1 -1
- package/dist/{EntityManagement-DQKXnEzz.js → EntityManagement-D4nG7wUX.js} +2 -2
- package/dist/{EntityManagement-DQKXnEzz.js.map → EntityManagement-D4nG7wUX.js.map} +1 -1
- package/dist/ImmunizationConfigurationBase-C5wnjI_-.js +5706 -0
- package/dist/ImmunizationConfigurationBase-C5wnjI_-.js.map +1 -0
- package/dist/ImmunizationConfigurationBase.css +1 -1
- package/dist/{ManageDynamicFeature-CsIett5x.js → ManageDynamicFeature-i6ARKe36.js} +2 -2
- package/dist/{ManageDynamicFeature-CsIett5x.js.map → ManageDynamicFeature-i6ARKe36.js.map} +1 -1
- package/dist/{ManageEventConfiguration-0YBDaxOI.js → ManageEventConfiguration-CHugu2vQ.js} +92 -92
- package/dist/ManageEventConfiguration-CHugu2vQ.js.map +1 -0
- package/dist/{ManageUser-eBS0yC5k.js → ManageUser-C6dlK-Mr.js} +3 -4
- package/dist/{ManageUser-eBS0yC5k.js.map → ManageUser-C6dlK-Mr.js.map} +1 -1
- package/dist/{MobileMenuManagement-BmrO-7MN.js → MobileMenuManagement-CV6QCeos.js} +15 -15
- package/dist/MobileMenuManagement-CV6QCeos.js.map +1 -0
- package/dist/{MobileTypeEventConfigModal-Ltm529jG.js → MobileTypeEventConfigModal-2w0WQ3WY.js} +2 -2
- package/dist/{MobileTypeEventConfigModal-Ltm529jG.js.map → MobileTypeEventConfigModal-2w0WQ3WY.js.map} +1 -1
- package/dist/{NewServerManagement-5YcAtF-g.js → NewServerManagement-Cxe0dV0O.js} +5 -5
- package/dist/NewServerManagement-Cxe0dV0O.js.map +1 -0
- package/dist/{OtherTypeEventConfigModal-dXt2qDg_.js → OtherTypeEventConfigModal-D1p8M39y.js} +43 -43
- package/dist/{OtherTypeEventConfigModal-dXt2qDg_.js.map → OtherTypeEventConfigModal-D1p8M39y.js.map} +1 -1
- package/dist/{QueryManagement-DGHV_-d5.js → QueryManagement-CRykYGum.js} +3 -3
- package/dist/QueryManagement-CRykYGum.js.map +1 -0
- package/dist/SecurityAuditLogList-Dod711KT.js +874 -0
- package/dist/SecurityAuditLogList-Dod711KT.js.map +1 -0
- package/dist/{TableDetails-DztbjsIA.js → TableDetails-Cf_YfnY2.js} +235 -235
- package/dist/TableDetails-Cf_YfnY2.js.map +1 -0
- package/dist/{TableList-DYwotUDO.js → TableList-HGbEN4bv.js} +28 -28
- package/dist/TableList-HGbEN4bv.js.map +1 -0
- package/dist/{TypeConfiguration-DYbBG_hZ.js → TypeConfiguration-D-3xNcyd.js} +2 -2
- package/dist/{TypeConfiguration-DYbBG_hZ.js.map → TypeConfiguration-D-3xNcyd.js.map} +1 -1
- package/dist/{UserList-BAeAFeXZ.js → UserList-D7GL7jvO.js} +420 -421
- package/dist/UserList-D7GL7jvO.js.map +1 -0
- package/dist/{WidgetList-D-fIf3N2.js → WidgetList-B3Sm9weK.js} +2 -2
- package/dist/{WidgetList-D-fIf3N2.js.map → WidgetList-B3Sm9weK.js.map} +1 -1
- package/dist/index-D9YNFPn9.js +1439 -0
- package/dist/index-D9YNFPn9.js.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.js +189 -174
- package/dist/index.js.map +1 -1
- package/dist/{index-BFznsakV.js → pdfmake-Cf-381ou.js} +13951 -15385
- package/dist/pdfmake-Cf-381ou.js.map +1 -0
- package/package.json +1 -1
- package/dist/AddMenuConfiguration-QWfpcnuP.js.map +0 -1
- package/dist/ChangePasswordModalCore-ClND1mel.js +0 -181
- package/dist/ChangePasswordModalCore-ClND1mel.js.map +0 -1
- package/dist/ImmunizationConfigurationBase-VqVvVR57.js +0 -5389
- package/dist/ImmunizationConfigurationBase-VqVvVR57.js.map +0 -1
- package/dist/ManageEventConfiguration-0YBDaxOI.js.map +0 -1
- package/dist/MobileMenuManagement-BmrO-7MN.js.map +0 -1
- package/dist/NewServerManagement-5YcAtF-g.js.map +0 -1
- package/dist/QueryManagement-DGHV_-d5.js.map +0 -1
- package/dist/SecurityAuditLogList-DHTcOtbx.js +0 -748
- package/dist/SecurityAuditLogList-DHTcOtbx.js.map +0 -1
- package/dist/TableDetails-DztbjsIA.js.map +0 -1
- package/dist/TableList-DYwotUDO.js.map +0 -1
- package/dist/UserList-BAeAFeXZ.js.map +0 -1
- package/dist/index-BFznsakV.js.map +0 -1
|
@@ -0,0 +1,1439 @@
|
|
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as f, useEffect as te, useMemo as ge } from "react";
|
|
3
|
+
import { useLocation as $e } from "react-router-dom";
|
|
4
|
+
import { Box as h, Typography as S, TextField as Z, Button as fe, IconButton as H, Tooltip as V, useTheme as Ue, alpha as O, FormControl as ze, InputLabel as Ee, Select as We, MenuItem as Q, InputAdornment as Le, Dialog as Oe, DialogTitle as Fe, DialogContent as Be, DialogActions as Pe } from "@mui/material";
|
|
5
|
+
import { useTheme as ue, alpha as q } from "@mui/material/styles";
|
|
6
|
+
import { execute as ye } from "@/common/services/GlobalApis";
|
|
7
|
+
import be from "@/views/custom-components/CustomizedTable/CustomizedTableV2";
|
|
8
|
+
import { FontAwesomeIcon as w } from "@fortawesome/react-fontawesome";
|
|
9
|
+
import { faSync as Ne, faUser as Ye, faEye as je, faCalendar as Ve, faSearch as me, faChartLine as He, faArrowLeft as qe, faInfo as Ge, faFilePdf as Je, faFileExcel as Ke, faFilter as Qe } from "@fortawesome/free-solid-svg-icons";
|
|
10
|
+
import { showToast as X } from "@/common/toaster/toaster.jsx";
|
|
11
|
+
import ve from "@/hooks/usePagination.js";
|
|
12
|
+
import { useTranslateProvider as Se } from "@/common/languageTranslator/TranslationContext";
|
|
13
|
+
import ee from "moment";
|
|
14
|
+
import Xe from "@/views/custom-components/SideOverlay.jsx";
|
|
15
|
+
import { DateRange as Ze } from "react-date-range";
|
|
16
|
+
import "react-date-range/dist/styles.css";
|
|
17
|
+
import "react-date-range/dist/theme/default.css";
|
|
18
|
+
import { x as le } from "./xlsx.min-D1LFqt_b.js";
|
|
19
|
+
import j from "dayjs";
|
|
20
|
+
import { p as ie } from "./pdfmake-Cf-381ou.js";
|
|
21
|
+
import et from "@/assets/fonts/vfs_fonts";
|
|
22
|
+
const Ce = (i) => {
|
|
23
|
+
if (!i) return "N/A";
|
|
24
|
+
const p = ee(), T = ee(i), d = ee.duration(p.diff(T)), t = d.years(), m = d.months(), u = d.days(), b = d.hours(), A = d.minutes(), C = d.seconds();
|
|
25
|
+
if (t > 0) return `${t} year${t > 1 ? "s" : ""} ago`;
|
|
26
|
+
if (m > 0) return `${m} month${m > 1 ? "s" : ""} ago`;
|
|
27
|
+
if (u > 0) return `${u} day${u > 1 ? "s" : ""} ago`;
|
|
28
|
+
let I = [];
|
|
29
|
+
return b > 0 && I.push(`${b} hour${b > 1 ? "s" : ""}`), A > 0 && I.push(`${A} minute${A > 1 ? "s" : ""}`), C > 0 && b === 0 && I.push(`${C} second${C > 1 ? "s" : ""}`), I.length === 0 ? "Just now" : I.join(" ") + " ago";
|
|
30
|
+
}, tt = (i) => i ? ee(i).format("DD/MM/YYYY hh:mm:ss A") : "N/A";
|
|
31
|
+
function rt({ onUserSelect: i }) {
|
|
32
|
+
const p = ue(), [T, d] = f([]), [t, m] = f(!0), [u, b] = f(!1), A = 50, { translate: C } = Se(), [I, F] = f(!1), [c, M] = f(""), $ = () => {
|
|
33
|
+
if (!c.trim()) return;
|
|
34
|
+
const s = parseInt(c, 10), o = T.find((D) => D.userId === s);
|
|
35
|
+
i(s, o == null ? void 0 : o.parsedAttributes);
|
|
36
|
+
}, z = [
|
|
37
|
+
{ field: "Sr. No.", label: "#", align: "left", width: "60px" },
|
|
38
|
+
{
|
|
39
|
+
field: "userId",
|
|
40
|
+
label: "User Identity".toUpperCase(),
|
|
41
|
+
align: "left",
|
|
42
|
+
render: (s) => {
|
|
43
|
+
var o, D, E, W, J, r, B, K;
|
|
44
|
+
return /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
45
|
+
/* @__PURE__ */ e("div", { className: "w-6 h-6 rounded-full bg-slate-100 dark:bg-slate-800 flex items-center justify-center", children: /* @__PURE__ */ e(w, { icon: Ye, className: "text-slate-400 text-[10px]" }) }),
|
|
46
|
+
/* @__PURE__ */ e(
|
|
47
|
+
V,
|
|
48
|
+
{
|
|
49
|
+
title: /* @__PURE__ */ n("div", { className: "flex flex-col gap-1 text-xs", children: [
|
|
50
|
+
/* @__PURE__ */ n("div", { children: [
|
|
51
|
+
/* @__PURE__ */ e("b", { children: "Username:" }),
|
|
52
|
+
" ",
|
|
53
|
+
((o = s.parsedAttributes) == null ? void 0 : o.user_name) || "N/A"
|
|
54
|
+
] }),
|
|
55
|
+
/* @__PURE__ */ n("div", { children: [
|
|
56
|
+
/* @__PURE__ */ e("b", { children: "Name:" }),
|
|
57
|
+
" ",
|
|
58
|
+
((D = s.parsedAttributes) == null ? void 0 : D.name) || "N/A"
|
|
59
|
+
] }),
|
|
60
|
+
/* @__PURE__ */ n("div", { children: [
|
|
61
|
+
/* @__PURE__ */ e("b", { children: "Role ID:" }),
|
|
62
|
+
" ",
|
|
63
|
+
((E = s.parsedAttributes) == null ? void 0 : E.role_id) || "N/A"
|
|
64
|
+
] }),
|
|
65
|
+
/* @__PURE__ */ n("div", { children: [
|
|
66
|
+
/* @__PURE__ */ e("b", { children: "Role Name:" }),
|
|
67
|
+
" ",
|
|
68
|
+
((W = s.parsedAttributes) == null ? void 0 : W.role_name) || "N/A"
|
|
69
|
+
] }),
|
|
70
|
+
/* @__PURE__ */ n("div", { children: [
|
|
71
|
+
/* @__PURE__ */ e("b", { children: "Role Code:" }),
|
|
72
|
+
" ",
|
|
73
|
+
((J = s.parsedAttributes) == null ? void 0 : J.role_code) || "N/A"
|
|
74
|
+
] })
|
|
75
|
+
] }),
|
|
76
|
+
arrow: !0,
|
|
77
|
+
placement: "top",
|
|
78
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col cursor-pointer", children: [
|
|
79
|
+
/* @__PURE__ */ n(S, { className: "text-sm font-black tracking-tight", sx: { color: p.palette.text.primary }, children: [
|
|
80
|
+
"User ID: ",
|
|
81
|
+
s.userId
|
|
82
|
+
] }),
|
|
83
|
+
/* @__PURE__ */ n(S, { variant: "caption", className: "font-bold opacity-60 uppercase tracking-tighter", children: [
|
|
84
|
+
((r = s.parsedAttributes) == null ? void 0 : r.user_name) || "System User",
|
|
85
|
+
" ",
|
|
86
|
+
(B = s.parsedAttributes) != null && B.name ? `• ${s.parsedAttributes.name}` : "",
|
|
87
|
+
" ",
|
|
88
|
+
(K = s.parsedAttributes) != null && K.role_code ? `(${s.parsedAttributes.role_code})` : ""
|
|
89
|
+
] })
|
|
90
|
+
] })
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
] });
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
field: "systemInfo",
|
|
98
|
+
label: "System Info".toUpperCase(),
|
|
99
|
+
align: "left",
|
|
100
|
+
render: (s) => {
|
|
101
|
+
var o, D, E;
|
|
102
|
+
return /* @__PURE__ */ n("div", { className: "flex flex-col max-w-[200px]", children: [
|
|
103
|
+
/* @__PURE__ */ n(S, { variant: "caption", className: "font-bold opacity-80", sx: { color: p.palette.text.primary }, children: [
|
|
104
|
+
"IP: ",
|
|
105
|
+
((o = s.parsedAttributes) == null ? void 0 : o.ip) || "N/A"
|
|
106
|
+
] }),
|
|
107
|
+
/* @__PURE__ */ e(V, { title: ((D = s.parsedAttributes) == null ? void 0 : D.user_agent) || "Unknown Device", arrow: !0, placement: "top", children: /* @__PURE__ */ e(S, { variant: "caption", className: "truncate font-mono opacity-60 text-[10px]", children: ((E = s.parsedAttributes) == null ? void 0 : E.user_agent) || "Unknown Device" }) })
|
|
108
|
+
] });
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
field: "lastActivityTimestamp",
|
|
113
|
+
label: "Last Active".toUpperCase(),
|
|
114
|
+
align: "left",
|
|
115
|
+
render: (s) => /* @__PURE__ */ e(V, { title: tt(s.lastActivityTimestamp), arrow: !0, placement: "top", children: /* @__PURE__ */ e(S, { className: "text-sm font-bold text-primary-main cursor-pointer", children: Ce(s.lastActivityTimestamp) }) })
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
field: "ActionButtons",
|
|
119
|
+
label: "Actions".toUpperCase(),
|
|
120
|
+
align: "left",
|
|
121
|
+
render: (s) => /* @__PURE__ */ e(V, { title: "View Detailed Activity History", arrow: !0, placement: "top", children: /* @__PURE__ */ e(
|
|
122
|
+
H,
|
|
123
|
+
{
|
|
124
|
+
onClick: () => i(s.userId, s.parsedAttributes),
|
|
125
|
+
ref: (o) => {
|
|
126
|
+
o && o.style.setProperty("border-radius", "50%", "important");
|
|
127
|
+
},
|
|
128
|
+
sx: {
|
|
129
|
+
color: p.palette.primary.main,
|
|
130
|
+
backgroundColor: q(p.palette.primary.main, 0.1),
|
|
131
|
+
border: `1px solid ${p.palette.primary.main}`,
|
|
132
|
+
borderRadius: "50% !important",
|
|
133
|
+
width: 36,
|
|
134
|
+
height: 36,
|
|
135
|
+
display: "inline-flex",
|
|
136
|
+
alignItems: "center",
|
|
137
|
+
justifyContent: "center",
|
|
138
|
+
marginTop: "-4px",
|
|
139
|
+
// Slightly raise to match symmetry with last active text
|
|
140
|
+
transition: "all 0.2s ease-in-out",
|
|
141
|
+
"&:hover": {
|
|
142
|
+
backgroundColor: p.palette.primary.main,
|
|
143
|
+
color: "white",
|
|
144
|
+
transform: "scale(1.1)"
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
children: /* @__PURE__ */ e(w, { icon: je, className: "text-base" })
|
|
148
|
+
}
|
|
149
|
+
) })
|
|
150
|
+
}
|
|
151
|
+
];
|
|
152
|
+
async function G(s, o) {
|
|
153
|
+
var D;
|
|
154
|
+
try {
|
|
155
|
+
o && b(!0);
|
|
156
|
+
const E = {
|
|
157
|
+
limit: s.limit,
|
|
158
|
+
offset: s.offset || 0
|
|
159
|
+
// userId: manualSearchId || null
|
|
160
|
+
}, W = await ye(
|
|
161
|
+
{
|
|
162
|
+
code: "LIVE_USER_ACTIVITY",
|
|
163
|
+
parameters: E
|
|
164
|
+
},
|
|
165
|
+
{ showLoader: !1 }
|
|
166
|
+
), r = (((D = W == null ? void 0 : W.data) == null ? void 0 : D.result) || []).map((B, K) => {
|
|
167
|
+
let re = null;
|
|
168
|
+
if (B.attributes)
|
|
169
|
+
try {
|
|
170
|
+
re = JSON.parse(B.attributes);
|
|
171
|
+
} catch {
|
|
172
|
+
}
|
|
173
|
+
return {
|
|
174
|
+
...B,
|
|
175
|
+
parsedAttributes: re,
|
|
176
|
+
index: (s.offset || 0) + K + 1
|
|
177
|
+
};
|
|
178
|
+
});
|
|
179
|
+
return o && b(!1), r;
|
|
180
|
+
} catch {
|
|
181
|
+
return X({ message: "Failed to fetch active users", type: "error" }), b(!1), [];
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
const { data: R, fetchNextPage: x, hasNextPage: N } = ve({
|
|
185
|
+
key: ["activeUsers", I],
|
|
186
|
+
queryFn: ({ pageParam: s }) => {
|
|
187
|
+
const o = !(s != null && s.offset) || (s == null ? void 0 : s.offset) === 0;
|
|
188
|
+
return G(s, o);
|
|
189
|
+
},
|
|
190
|
+
limit: A
|
|
191
|
+
});
|
|
192
|
+
te(() => {
|
|
193
|
+
var o;
|
|
194
|
+
const s = ((o = R == null ? void 0 : R.pages) == null ? void 0 : o.flat()) || [];
|
|
195
|
+
m(N), d(s);
|
|
196
|
+
}, [R, N]);
|
|
197
|
+
const g = () => {
|
|
198
|
+
F((s) => !s);
|
|
199
|
+
};
|
|
200
|
+
return /* @__PURE__ */ n(h, { className: "flex flex-col h-full w-full", children: [
|
|
201
|
+
/* @__PURE__ */ n(h, { className: "flex flex-col md:flex-row justify-between items-start md:items-center p-5 border-b border-slate-200/60 dark:border-slate-800/60 gap-4", children: [
|
|
202
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col", children: [
|
|
203
|
+
/* @__PURE__ */ e(S, { variant: "body2", className: "font-bold font-sans text-lg text-customBlue uppercase", children: C ? C("Live Activity") : "Live Activity" }),
|
|
204
|
+
/* @__PURE__ */ e(S, { variant: "caption", className: "font-bold uppercase tracking-widest", sx: { color: p.palette.text.primary, opacity: 0.9 }, children: "Currently Active System Users" })
|
|
205
|
+
] }),
|
|
206
|
+
/* @__PURE__ */ n(h, { className: "flex flex-wrap items-center gap-3 w-full md:w-auto ml-auto", children: [
|
|
207
|
+
/* @__PURE__ */ e(
|
|
208
|
+
Z,
|
|
209
|
+
{
|
|
210
|
+
size: "small",
|
|
211
|
+
placeholder: "User ID lookup...",
|
|
212
|
+
value: c,
|
|
213
|
+
onChange: (s) => M(s.target.value),
|
|
214
|
+
onKeyDown: (s) => s.key === "Enter" && $(),
|
|
215
|
+
sx: {
|
|
216
|
+
width: { xs: "100%", md: "200px" },
|
|
217
|
+
"& .MuiInputBase-root": {
|
|
218
|
+
backgroundColor: p.palette.background.paper,
|
|
219
|
+
borderRadius: "12px"
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
),
|
|
224
|
+
/* @__PURE__ */ e(
|
|
225
|
+
fe,
|
|
226
|
+
{
|
|
227
|
+
variant: "contained",
|
|
228
|
+
color: "primary",
|
|
229
|
+
disableElevation: !0,
|
|
230
|
+
onClick: $,
|
|
231
|
+
className: "rounded-xl font-black h-10 px-4 whitespace-nowrap",
|
|
232
|
+
size: "small",
|
|
233
|
+
children: "Show Activity"
|
|
234
|
+
}
|
|
235
|
+
),
|
|
236
|
+
/* @__PURE__ */ e("div", { className: "h-8 w-[1px] bg-slate-300 dark:bg-slate-700 mx-1 hidden md:block" }),
|
|
237
|
+
/* @__PURE__ */ e(
|
|
238
|
+
H,
|
|
239
|
+
{
|
|
240
|
+
color: "primary",
|
|
241
|
+
onClick: () => g(),
|
|
242
|
+
className: "rounded-none border border-slate-200 dark:border-slate-800 shadow-sm",
|
|
243
|
+
sx: {
|
|
244
|
+
backgroundColor: q(p.palette.primary.main, 0.1),
|
|
245
|
+
width: 40,
|
|
246
|
+
height: 40,
|
|
247
|
+
"&:hover": { backgroundColor: p.palette.primary.main, color: "white" }
|
|
248
|
+
},
|
|
249
|
+
children: /* @__PURE__ */ e(w, { icon: Ne, className: "text-sm" })
|
|
250
|
+
}
|
|
251
|
+
)
|
|
252
|
+
] })
|
|
253
|
+
] }),
|
|
254
|
+
/* @__PURE__ */ e(
|
|
255
|
+
h,
|
|
256
|
+
{
|
|
257
|
+
className: "flex-1 overflow-hidden",
|
|
258
|
+
sx: {
|
|
259
|
+
height: "100%",
|
|
260
|
+
"& *:not(.MuiIconButton-root):not(.MuiIconButton-root *)": { borderRadius: "0px !important" },
|
|
261
|
+
// Kill every single curve locally except action buttons
|
|
262
|
+
"& .MuiTableContainer-root": { height: "100% !important", maxHeight: "100% !important" }
|
|
263
|
+
},
|
|
264
|
+
children: /* @__PURE__ */ e(
|
|
265
|
+
be,
|
|
266
|
+
{
|
|
267
|
+
id: "active-user-list",
|
|
268
|
+
columns: z,
|
|
269
|
+
tableData: T,
|
|
270
|
+
actions: null,
|
|
271
|
+
styleConfig: {
|
|
272
|
+
cellStyle: { padding: "8px 16px", height: 40, maxLines: 1 }
|
|
273
|
+
},
|
|
274
|
+
paginationConfig: {
|
|
275
|
+
pagination: !0,
|
|
276
|
+
paginationType: "infinite-scroll",
|
|
277
|
+
rowsPerPageInTable: A,
|
|
278
|
+
hasMore: t,
|
|
279
|
+
loadMore: () => t && x({ cancelRefetch: !1 })
|
|
280
|
+
},
|
|
281
|
+
isLoading: u,
|
|
282
|
+
emptyBoxText: "Silence... No active users found at the moment."
|
|
283
|
+
}
|
|
284
|
+
)
|
|
285
|
+
}
|
|
286
|
+
)
|
|
287
|
+
] });
|
|
288
|
+
}
|
|
289
|
+
function at({
|
|
290
|
+
filter: i,
|
|
291
|
+
onApply: p,
|
|
292
|
+
handleOverlayState: T
|
|
293
|
+
}) {
|
|
294
|
+
const { translate: d } = Se(), t = Ue(), m = t.palette.mode === "dark", [u, b] = f(i), [A, C] = f(!1), [I, F] = f([
|
|
295
|
+
{
|
|
296
|
+
startDate: i.startTime ? new Date(i.startTime) : /* @__PURE__ */ new Date(),
|
|
297
|
+
endDate: i.endTime ? new Date(i.endTime) : /* @__PURE__ */ new Date(),
|
|
298
|
+
key: "selection"
|
|
299
|
+
}
|
|
300
|
+
]);
|
|
301
|
+
te(() => {
|
|
302
|
+
b(i), F([
|
|
303
|
+
{
|
|
304
|
+
startDate: i.startTime ? new Date(i.startTime) : /* @__PURE__ */ new Date(),
|
|
305
|
+
endDate: i.endTime ? new Date(i.endTime) : /* @__PURE__ */ new Date(),
|
|
306
|
+
key: "selection"
|
|
307
|
+
}
|
|
308
|
+
]);
|
|
309
|
+
}, [i]);
|
|
310
|
+
const c = (x) => {
|
|
311
|
+
const { selection: N } = x;
|
|
312
|
+
F([N]);
|
|
313
|
+
const g = N.startDate ? M(N.startDate) : null, s = N.endDate ? M(N.endDate) : null;
|
|
314
|
+
b((o) => ({
|
|
315
|
+
...o,
|
|
316
|
+
startTime: g,
|
|
317
|
+
endTime: s
|
|
318
|
+
}));
|
|
319
|
+
}, M = (x) => {
|
|
320
|
+
if (!x) return null;
|
|
321
|
+
const N = new Date(x);
|
|
322
|
+
return `${N.getFullYear()}-${String(N.getMonth() + 1).padStart(2, "0")}-${String(N.getDate()).padStart(2, "0")}`;
|
|
323
|
+
}, $ = () => {
|
|
324
|
+
if (!u.startTime && !u.endTime) return "Select date range";
|
|
325
|
+
const x = u.startTime ? new Date(u.startTime).toLocaleDateString() : "", N = u.endTime ? new Date(u.endTime).toLocaleDateString() : "";
|
|
326
|
+
return `${x} - ${N}`;
|
|
327
|
+
}, z = (x, N) => {
|
|
328
|
+
b((g) => ({ ...g, [x]: N }));
|
|
329
|
+
}, G = () => {
|
|
330
|
+
p(u);
|
|
331
|
+
}, R = {
|
|
332
|
+
"& .MuiInputLabel-root": {
|
|
333
|
+
color: t.palette.text.secondary,
|
|
334
|
+
fontSize: "0.85rem",
|
|
335
|
+
fontWeight: 500,
|
|
336
|
+
transform: "translate(0, -1.5px) scale(1)",
|
|
337
|
+
"&.Mui-focused": { color: t.palette.primary.main }
|
|
338
|
+
},
|
|
339
|
+
"& .MuiInputBase-root": {
|
|
340
|
+
backgroundColor: O(t.palette.text.primary, 0.05),
|
|
341
|
+
borderRadius: "12px",
|
|
342
|
+
color: t.palette.text.primary,
|
|
343
|
+
marginTop: "20px",
|
|
344
|
+
"& fieldset": {
|
|
345
|
+
borderColor: O(t.palette.text.primary, 0.1),
|
|
346
|
+
borderRadius: "12px"
|
|
347
|
+
},
|
|
348
|
+
"&:hover fieldset": { borderColor: O(t.palette.text.primary, 0.3) },
|
|
349
|
+
"&.Mui-focused fieldset": { borderColor: t.palette.primary.main, borderWidth: "2px" }
|
|
350
|
+
},
|
|
351
|
+
"& .MuiInputBase-input": {
|
|
352
|
+
padding: "10px 14px",
|
|
353
|
+
colorScheme: m ? "dark" : "light"
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
return /* @__PURE__ */ n(h, { className: "flex flex-col gap-6 p-6", children: [
|
|
357
|
+
/* @__PURE__ */ n(h, { className: "flex flex-col gap-1.5 pt-1", children: [
|
|
358
|
+
/* @__PURE__ */ e(S, { variant: "caption", sx: { color: t.palette.text.secondary, fontWeight: 500, fontSize: "0.85rem", transform: "translate(0, -1.5px)" }, children: d("Date Range") }),
|
|
359
|
+
/* @__PURE__ */ n(
|
|
360
|
+
h,
|
|
361
|
+
{
|
|
362
|
+
onClick: () => C(!A),
|
|
363
|
+
className: "flex items-center justify-between gap-2 px-3 py-2.5 rounded-xl cursor-pointer transition-all",
|
|
364
|
+
sx: {
|
|
365
|
+
backgroundColor: O(t.palette.text.primary, 0.05),
|
|
366
|
+
border: `1px solid ${O(t.palette.text.primary, 0.1)}`,
|
|
367
|
+
"&:hover": { borderColor: O(t.palette.text.primary, 0.3) }
|
|
368
|
+
},
|
|
369
|
+
children: [
|
|
370
|
+
/* @__PURE__ */ e(S, { variant: "body2", sx: { color: t.palette.text.primary, fontSize: "0.875rem" }, children: $() }),
|
|
371
|
+
/* @__PURE__ */ e(w, { icon: Ve, className: "opacity-50 text-sm" })
|
|
372
|
+
]
|
|
373
|
+
}
|
|
374
|
+
),
|
|
375
|
+
A && /* @__PURE__ */ e(
|
|
376
|
+
h,
|
|
377
|
+
{
|
|
378
|
+
className: "mt-2 p-2 rounded-xl flex justify-center overflow-hidden border",
|
|
379
|
+
sx: {
|
|
380
|
+
backgroundColor: t.palette.background.paper,
|
|
381
|
+
borderColor: O(t.palette.text.primary, 0.1),
|
|
382
|
+
"& .rdrCalendarWrapper": {
|
|
383
|
+
backgroundColor: t.palette.background.paper,
|
|
384
|
+
color: t.palette.text.primary
|
|
385
|
+
},
|
|
386
|
+
"& .rdrDateDisplayWrapper": {
|
|
387
|
+
backgroundColor: O(t.palette.text.primary, 0.05)
|
|
388
|
+
},
|
|
389
|
+
"& .rdrMonthAndYearWrapper": {
|
|
390
|
+
color: t.palette.text.primary
|
|
391
|
+
},
|
|
392
|
+
"& .rdrMonthName": {
|
|
393
|
+
color: t.palette.text.primary
|
|
394
|
+
},
|
|
395
|
+
"& .rdrDayNumber span": {
|
|
396
|
+
color: t.palette.text.primary
|
|
397
|
+
},
|
|
398
|
+
"& .rdrDayDisabled": {
|
|
399
|
+
backgroundColor: "transparent",
|
|
400
|
+
"& .rdrDayNumber span": {
|
|
401
|
+
color: O(t.palette.text.primary, 0.25)
|
|
402
|
+
}
|
|
403
|
+
},
|
|
404
|
+
"& .rdrDayPassive": {
|
|
405
|
+
"& .rdrDayNumber span": {
|
|
406
|
+
color: O(t.palette.text.primary, 0.3)
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
},
|
|
410
|
+
children: /* @__PURE__ */ e(
|
|
411
|
+
Ze,
|
|
412
|
+
{
|
|
413
|
+
editableDateInputs: !1,
|
|
414
|
+
onChange: c,
|
|
415
|
+
moveRangeOnFirstSelection: !1,
|
|
416
|
+
ranges: I,
|
|
417
|
+
rangeColors: [t.palette.primary.main]
|
|
418
|
+
}
|
|
419
|
+
)
|
|
420
|
+
}
|
|
421
|
+
)
|
|
422
|
+
] }),
|
|
423
|
+
/* @__PURE__ */ n(h, { className: "flex flex-col gap-4 pt-2", children: [
|
|
424
|
+
/* @__PURE__ */ e(
|
|
425
|
+
Z,
|
|
426
|
+
{
|
|
427
|
+
label: d("Session ID"),
|
|
428
|
+
placeholder: d("e.g. E561890..."),
|
|
429
|
+
value: u.sessionId || "",
|
|
430
|
+
onChange: (x) => z("sessionId", x.target.value),
|
|
431
|
+
fullWidth: !0,
|
|
432
|
+
size: "small",
|
|
433
|
+
slotProps: { inputLabel: { shrink: !0 } },
|
|
434
|
+
sx: R
|
|
435
|
+
}
|
|
436
|
+
),
|
|
437
|
+
/* @__PURE__ */ n(ze, { fullWidth: !0, size: "small", sx: R, children: [
|
|
438
|
+
/* @__PURE__ */ e(Ee, { shrink: !0, children: d("HTTP Method") }),
|
|
439
|
+
/* @__PURE__ */ n(
|
|
440
|
+
We,
|
|
441
|
+
{
|
|
442
|
+
value: u.httpMethod || "",
|
|
443
|
+
onChange: (x) => z("httpMethod", x.target.value),
|
|
444
|
+
label: d("HTTP Method"),
|
|
445
|
+
displayEmpty: !0,
|
|
446
|
+
children: [
|
|
447
|
+
/* @__PURE__ */ e(Q, { value: "", children: d("All Methods") }),
|
|
448
|
+
/* @__PURE__ */ e(Q, { value: "GET", children: "GET" }),
|
|
449
|
+
/* @__PURE__ */ e(Q, { value: "POST", children: "POST" }),
|
|
450
|
+
/* @__PURE__ */ e(Q, { value: "PUT", children: "PUT" }),
|
|
451
|
+
/* @__PURE__ */ e(Q, { value: "DELETE", children: "DELETE" }),
|
|
452
|
+
/* @__PURE__ */ e(Q, { value: "PATCH", children: "PATCH" })
|
|
453
|
+
]
|
|
454
|
+
}
|
|
455
|
+
)
|
|
456
|
+
] }),
|
|
457
|
+
/* @__PURE__ */ e(
|
|
458
|
+
Z,
|
|
459
|
+
{
|
|
460
|
+
label: d("Resource Path"),
|
|
461
|
+
placeholder: "/api/v1/...",
|
|
462
|
+
value: u.resource || "",
|
|
463
|
+
onChange: (x) => z("resource", x.target.value),
|
|
464
|
+
fullWidth: !0,
|
|
465
|
+
size: "small",
|
|
466
|
+
slotProps: { inputLabel: { shrink: !0 } },
|
|
467
|
+
sx: R
|
|
468
|
+
}
|
|
469
|
+
),
|
|
470
|
+
/* @__PURE__ */ e(
|
|
471
|
+
Z,
|
|
472
|
+
{
|
|
473
|
+
label: d("Response Code"),
|
|
474
|
+
placeholder: "200",
|
|
475
|
+
value: u.responseCode || "",
|
|
476
|
+
onChange: (x) => z("responseCode", x.target.value),
|
|
477
|
+
fullWidth: !0,
|
|
478
|
+
size: "small",
|
|
479
|
+
type: "number",
|
|
480
|
+
slotProps: { inputLabel: { shrink: !0 } },
|
|
481
|
+
sx: R
|
|
482
|
+
}
|
|
483
|
+
)
|
|
484
|
+
] }),
|
|
485
|
+
/* @__PURE__ */ e(h, { className: "flex justify-stretch mt-4", children: /* @__PURE__ */ e(
|
|
486
|
+
fe,
|
|
487
|
+
{
|
|
488
|
+
variant: "contained",
|
|
489
|
+
onClick: G,
|
|
490
|
+
fullWidth: !0,
|
|
491
|
+
startIcon: /* @__PURE__ */ e(w, { icon: me }),
|
|
492
|
+
sx: {
|
|
493
|
+
backgroundColor: t.palette.primary.main,
|
|
494
|
+
height: "45px",
|
|
495
|
+
borderRadius: "12px",
|
|
496
|
+
fontWeight: "bold",
|
|
497
|
+
textTransform: "uppercase",
|
|
498
|
+
letterSpacing: "1px",
|
|
499
|
+
"&:hover": { backgroundColor: t.palette.primary.dark }
|
|
500
|
+
},
|
|
501
|
+
children: d("Apply Filters")
|
|
502
|
+
}
|
|
503
|
+
) })
|
|
504
|
+
] });
|
|
505
|
+
}
|
|
506
|
+
function ot({ selectedUserId: i, initialSessionId: p, initialAttributes: T, onBack: d }) {
|
|
507
|
+
const t = ue(), [m, u] = f([]), [b, A] = f(!0), [C, I] = f(!1), F = 50, [c, M] = f(i), [$, z] = f((i == null ? void 0 : i.toString()) || ""), [G, R] = f(!1), [x, N] = f(!1), [g, s] = f({
|
|
508
|
+
sortBy: "timestamp",
|
|
509
|
+
sortOrder: "desc"
|
|
510
|
+
}), [o, D] = f({
|
|
511
|
+
startTime: null,
|
|
512
|
+
endTime: null,
|
|
513
|
+
sessionId: p || null,
|
|
514
|
+
httpMethod: null,
|
|
515
|
+
resource: null,
|
|
516
|
+
responseCode: null
|
|
517
|
+
}), [E, W] = f(!1), J = (a) => a ? a === "/oauth/token" || a === "/api/oauth/token" ? `${a} (Login)` : a === "/user/logout" || a === "/api/user/logout" ? `${a} (Logout)` : a : "", r = ge(() => {
|
|
518
|
+
if (T && (T.user_agent || T.userAgent || T.ip))
|
|
519
|
+
return T;
|
|
520
|
+
if (m && m.length > 0) {
|
|
521
|
+
const a = m[0];
|
|
522
|
+
if (a.attributes)
|
|
523
|
+
try {
|
|
524
|
+
return JSON.parse(a.attributes);
|
|
525
|
+
} catch {
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
return T || {};
|
|
529
|
+
}, [T, m]);
|
|
530
|
+
te(() => {
|
|
531
|
+
M(i), z((i == null ? void 0 : i.toString()) || ""), p && D((a) => ({ ...a, sessionId: p }));
|
|
532
|
+
}, [i, p]);
|
|
533
|
+
const B = () => {
|
|
534
|
+
if (!$.trim()) {
|
|
535
|
+
X({ message: "Please enter a valid User ID", type: "warning" });
|
|
536
|
+
return;
|
|
537
|
+
}
|
|
538
|
+
const a = parseInt($, 10);
|
|
539
|
+
if (isNaN(a)) {
|
|
540
|
+
X({ message: "User ID must be a number", type: "warning" });
|
|
541
|
+
return;
|
|
542
|
+
}
|
|
543
|
+
M(a);
|
|
544
|
+
}, K = () => {
|
|
545
|
+
N((a) => !a);
|
|
546
|
+
}, re = async (a) => {
|
|
547
|
+
const l = g.sortBy === a.field && g.sortOrder === "asc" ? "desc" : "asc";
|
|
548
|
+
s({ sortBy: a.field, sortOrder: l });
|
|
549
|
+
}, he = (a) => {
|
|
550
|
+
D(a), N((l) => !l), R(!1);
|
|
551
|
+
}, ce = () => {
|
|
552
|
+
R(!G);
|
|
553
|
+
}, ke = () => {
|
|
554
|
+
D({
|
|
555
|
+
startTime: null,
|
|
556
|
+
endTime: null,
|
|
557
|
+
sessionId: null,
|
|
558
|
+
httpMethod: null,
|
|
559
|
+
resource: null,
|
|
560
|
+
responseCode: null
|
|
561
|
+
}), R(!1);
|
|
562
|
+
}, Te = ge(() => {
|
|
563
|
+
const a = [
|
|
564
|
+
{ field: "Sr. No.", label: "#", align: "left", width: "60px" },
|
|
565
|
+
{
|
|
566
|
+
field: "timestamp",
|
|
567
|
+
label: "TIMESTAMP",
|
|
568
|
+
sortable: !0,
|
|
569
|
+
sortOrder: g.sortBy === "timestamp" ? g.sortOrder : "asc",
|
|
570
|
+
align: "left",
|
|
571
|
+
render: (l) => /* @__PURE__ */ e(V, { title: Ce(l.timestamp), arrow: !0, placement: "top", children: /* @__PURE__ */ n("div", { className: "inline-flex flex-col cursor-pointer", children: [
|
|
572
|
+
/* @__PURE__ */ e(S, { className: "text-sm font-black", sx: { color: t.palette.text.primary }, children: j(l.timestamp).format("DD/MM/YYYY") }),
|
|
573
|
+
/* @__PURE__ */ e(S, { variant: "caption", className: "font-bold text-primary-main opacity-80", children: j(l.timestamp).format("hh:mm:ss A") })
|
|
574
|
+
] }) })
|
|
575
|
+
}
|
|
576
|
+
];
|
|
577
|
+
return o.sessionId || a.push({
|
|
578
|
+
field: "session_id",
|
|
579
|
+
label: "SESSION ID",
|
|
580
|
+
align: "left",
|
|
581
|
+
render: (l) => /* @__PURE__ */ e(S, { variant: "caption", className: "font-mono font-bold opacity-70", children: l.session_id || "N/A" })
|
|
582
|
+
}), a.push(
|
|
583
|
+
{
|
|
584
|
+
field: "http_method",
|
|
585
|
+
label: "METHOD",
|
|
586
|
+
sortable: !0,
|
|
587
|
+
sortOrder: g.sortBy === "http_method" ? g.sortOrder : "asc",
|
|
588
|
+
align: "left",
|
|
589
|
+
render: (l) => /* @__PURE__ */ e(S, { variant: "caption", className: "font-black uppercase tracking-widest", sx: { color: t.palette.text.primary }, children: l.http_method || "GET" })
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
field: "resource",
|
|
593
|
+
label: "RESOURCE ACCESSED",
|
|
594
|
+
sortable: !0,
|
|
595
|
+
sortOrder: g.sortBy === "resource" ? g.sortOrder : "asc",
|
|
596
|
+
align: "left",
|
|
597
|
+
render: (l) => {
|
|
598
|
+
const v = l.resource === "/oauth/token" || l.resource === "/api/oauth/token", U = l.resource === "/user/logout" || l.resource === "/api/user/logout", k = v || U, _ = v ? " (Login)" : " (Logout)", L = /* @__PURE__ */ n(h, { children: [
|
|
599
|
+
/* @__PURE__ */ n(S, { variant: "body2", className: "font-bold", sx: { color: t.palette.text.primary }, children: [
|
|
600
|
+
l.resource,
|
|
601
|
+
k && /* @__PURE__ */ e("span", { className: "font-black text-primary-main ml-1", children: _ })
|
|
602
|
+
] }),
|
|
603
|
+
l.query_params && /* @__PURE__ */ e(S, { variant: "caption", className: "block font-mono opacity-50 truncate max-w-md", children: l.query_params })
|
|
604
|
+
] });
|
|
605
|
+
return l.query_params ? /* @__PURE__ */ e(V, { title: l.query_params, arrow: !0, placement: "top", children: L }) : L;
|
|
606
|
+
}
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
field: "response_code",
|
|
610
|
+
label: "STATUS",
|
|
611
|
+
sortable: !0,
|
|
612
|
+
sortOrder: g.sortBy === "response_code" ? g.sortOrder : "asc",
|
|
613
|
+
align: "center",
|
|
614
|
+
render: (l) => {
|
|
615
|
+
const v = l.response_code || 200, U = v >= 200 && v < 300, k = U ? t.palette.success.main : t.palette.error.main;
|
|
616
|
+
return /* @__PURE__ */ e("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
617
|
+
h,
|
|
618
|
+
{
|
|
619
|
+
className: "inline-flex items-center justify-center rounded-full text-[0.7rem] font-black px-3 py-1 border shadow-sm",
|
|
620
|
+
sx: {
|
|
621
|
+
backgroundColor: q(k, 0.1),
|
|
622
|
+
color: k,
|
|
623
|
+
borderColor: q(k, 0.2)
|
|
624
|
+
},
|
|
625
|
+
children: [
|
|
626
|
+
/* @__PURE__ */ e(
|
|
627
|
+
h,
|
|
628
|
+
{
|
|
629
|
+
component: "span",
|
|
630
|
+
className: `w-1.5 h-1.5 rounded-full mr-2 ${U ? "bg-emerald-500 animate-pulse" : "bg-red-500"}`
|
|
631
|
+
}
|
|
632
|
+
),
|
|
633
|
+
v
|
|
634
|
+
]
|
|
635
|
+
}
|
|
636
|
+
) });
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
), i && !o.sessionId && a.push({
|
|
640
|
+
field: "Actions",
|
|
641
|
+
label: "Trace Session".toUpperCase(),
|
|
642
|
+
align: "center",
|
|
643
|
+
render: (l) => /* @__PURE__ */ e(V, { title: "Filter Activity Analytics by this Session ID", arrow: !0, placement: "top", children: /* @__PURE__ */ e(
|
|
644
|
+
H,
|
|
645
|
+
{
|
|
646
|
+
onClick: () => D((v) => ({ ...v, sessionId: l.session_id })),
|
|
647
|
+
sx: { color: t.palette.secondary.main },
|
|
648
|
+
children: /* @__PURE__ */ e(w, { icon: He, className: "text-base" })
|
|
649
|
+
}
|
|
650
|
+
) })
|
|
651
|
+
}), a;
|
|
652
|
+
}, [t, g, i, o.sessionId]);
|
|
653
|
+
async function Ie(a, l) {
|
|
654
|
+
var v;
|
|
655
|
+
try {
|
|
656
|
+
if (!c && !o.sessionId) return [];
|
|
657
|
+
l && I(!0);
|
|
658
|
+
const U = {
|
|
659
|
+
limit: a.limit,
|
|
660
|
+
offset: a.offset || 0,
|
|
661
|
+
userId: c,
|
|
662
|
+
startTime: o.startTime ? j(o.startTime).startOf("day").valueOf() : null,
|
|
663
|
+
endTime: o.endTime ? j(o.endTime).endOf("day").valueOf() : null,
|
|
664
|
+
sessionId: o.sessionId || null,
|
|
665
|
+
httpMethod: o.httpMethod || null,
|
|
666
|
+
resource: o.resource || null,
|
|
667
|
+
responseCode: o.responseCode || null,
|
|
668
|
+
sortBy: g.sortBy,
|
|
669
|
+
sortOrder: g.sortOrder
|
|
670
|
+
}, k = await ye(
|
|
671
|
+
{
|
|
672
|
+
code: "GET_USER_ACTIVITY_BY_ID",
|
|
673
|
+
parameters: U
|
|
674
|
+
},
|
|
675
|
+
{ showLoader: !1 }
|
|
676
|
+
), L = (((v = k == null ? void 0 : k.data) == null ? void 0 : v.result) || []).map((Y, oe) => ({
|
|
677
|
+
...Y,
|
|
678
|
+
index: (a.offset || 0) + oe + 1
|
|
679
|
+
}));
|
|
680
|
+
return l && I(!1), L;
|
|
681
|
+
} catch {
|
|
682
|
+
return X({ message: "Failed to fetch user activities", type: "error" }), I(!1), [];
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
const { data: ae, fetchNextPage: De, hasNextPage: xe } = ve({
|
|
686
|
+
key: [
|
|
687
|
+
"userActivity",
|
|
688
|
+
c,
|
|
689
|
+
o.startTime,
|
|
690
|
+
o.endTime,
|
|
691
|
+
o.sessionId,
|
|
692
|
+
o.httpMethod,
|
|
693
|
+
o.resource,
|
|
694
|
+
o.responseCode,
|
|
695
|
+
g,
|
|
696
|
+
x
|
|
697
|
+
],
|
|
698
|
+
queryFn: ({ pageParam: a }) => {
|
|
699
|
+
const l = !(a != null && a.offset) || (a == null ? void 0 : a.offset) === 0;
|
|
700
|
+
return Ie(a, l);
|
|
701
|
+
},
|
|
702
|
+
limit: F,
|
|
703
|
+
enabled: !!c || !!o.sessionId
|
|
704
|
+
});
|
|
705
|
+
te(() => {
|
|
706
|
+
var l;
|
|
707
|
+
const a = ((l = ae == null ? void 0 : ae.pages) == null ? void 0 : l.flat()) || [];
|
|
708
|
+
A(a.length > 0 ? xe : !1), u(a);
|
|
709
|
+
}, [ae, xe]);
|
|
710
|
+
const we = async () => {
|
|
711
|
+
try {
|
|
712
|
+
if (m.length === 0) return;
|
|
713
|
+
const a = (y) => y ? y.split("&").map((P) => {
|
|
714
|
+
var ne;
|
|
715
|
+
return ((ne = P.match(/.{1,15}/g)) == null ? void 0 : ne.join("")) || P;
|
|
716
|
+
}).join(`
|
|
717
|
+
`) : "N/A", l = !o.sessionId, v = ["Date", "Time"];
|
|
718
|
+
l && v.push("Session ID"), v.push("Method", "API url", "Params", "Status");
|
|
719
|
+
const U = m.map((y) => {
|
|
720
|
+
const P = {
|
|
721
|
+
Date: j(y.timestamp).format("DD/MM/YYYY"),
|
|
722
|
+
Time: j(y.timestamp).format("hh:mm:ss A"),
|
|
723
|
+
Method: y.http_method || "N/A",
|
|
724
|
+
"API url": J(y.resource),
|
|
725
|
+
Params: a(y.query_params),
|
|
726
|
+
Status: y.response_code || "N/A"
|
|
727
|
+
};
|
|
728
|
+
return l && (P["Session ID"] = y.session_id || "N/A"), P;
|
|
729
|
+
}), k = /* @__PURE__ */ new Date(), _ = `UserActivityDetail_${c || "Session"}-${k.getDate()}-${k.getMonth() + 1}-${k.getFullYear()}.pdf`, L = l ? [20, 50, 55, 90, 35, "*", 130, 30] : [20, 55, 60, 35, "*", 140, 35];
|
|
730
|
+
ie.vfs = { ...et, ...ie.vfs }, ie.addFonts({
|
|
731
|
+
Roboto: {
|
|
732
|
+
normal: "Roboto-Regular.ttf",
|
|
733
|
+
bold: "Roboto-Medium.ttf",
|
|
734
|
+
italics: "Roboto-Regular.ttf",
|
|
735
|
+
bolditalics: "Roboto-Regular.ttf"
|
|
736
|
+
},
|
|
737
|
+
MuktaVaani: {
|
|
738
|
+
normal: "MuktaVaani-Regular.ttf",
|
|
739
|
+
bold: "MuktaVaani-Regular.ttf",
|
|
740
|
+
italics: "MuktaVaani-Regular.ttf",
|
|
741
|
+
bolditalics: "MuktaVaani-Regular.ttf"
|
|
742
|
+
}
|
|
743
|
+
});
|
|
744
|
+
const Y = (y) => /[\u0A80-\u0AFF]/.test(y), oe = [
|
|
745
|
+
{
|
|
746
|
+
text: "USER ACTIVITY TRACE REPORT",
|
|
747
|
+
fontSize: 12,
|
|
748
|
+
bold: !0,
|
|
749
|
+
alignment: "center",
|
|
750
|
+
margin: [0, 2],
|
|
751
|
+
font: "Roboto"
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
text: `User ID: ${c || (r == null ? void 0 : r.user_id) || "N/A"} | Username: ${(r == null ? void 0 : r.user_name) || "N/A"}`,
|
|
755
|
+
fontSize: 8.5,
|
|
756
|
+
alignment: "center",
|
|
757
|
+
margin: [0, 1],
|
|
758
|
+
font: "Roboto"
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
text: `Name: ${(r == null ? void 0 : r.name) || "N/A"} | Role ID: ${(r == null ? void 0 : r.role_id) || "N/A"} | Role Name: ${(r == null ? void 0 : r.role_name) || "N/A"} | Role Code: ${(r == null ? void 0 : r.role_code) || "N/A"}`,
|
|
762
|
+
fontSize: 8.5,
|
|
763
|
+
alignment: "center",
|
|
764
|
+
margin: [0, 1],
|
|
765
|
+
font: "Roboto"
|
|
766
|
+
},
|
|
767
|
+
{
|
|
768
|
+
text: `IP Address: ${(r == null ? void 0 : r.ip) || "N/A"} | Server Instance: ${window.location.hostname || "N/A"}`,
|
|
769
|
+
fontSize: 8.5,
|
|
770
|
+
alignment: "center",
|
|
771
|
+
margin: [0, 1],
|
|
772
|
+
font: "Roboto"
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
text: `User Agent: ${(r == null ? void 0 : r.user_agent) || (r == null ? void 0 : r.userAgent) || "N/A"}` + (o.sessionId ? ` | Session ID: ${o.sessionId}` : ""),
|
|
776
|
+
fontSize: 8,
|
|
777
|
+
alignment: "center",
|
|
778
|
+
margin: [0, 1],
|
|
779
|
+
font: "Roboto"
|
|
780
|
+
}
|
|
781
|
+
], de = ["S.No", ...v], Re = U.map((y, P) => [
|
|
782
|
+
{ text: P + 1, fontSize: 8 },
|
|
783
|
+
...v.map((ne) => {
|
|
784
|
+
const pe = y[ne], se = (pe == null ? void 0 : pe.toString()) || "", _e = se.includes("(Login)") || se.includes("(Logout)");
|
|
785
|
+
return {
|
|
786
|
+
text: se,
|
|
787
|
+
fontSize: 8,
|
|
788
|
+
bold: _e ? !0 : void 0,
|
|
789
|
+
font: Y(se) ? "MuktaVaani" : "Roboto"
|
|
790
|
+
};
|
|
791
|
+
})
|
|
792
|
+
]), Me = {
|
|
793
|
+
pageOrientation: "landscape",
|
|
794
|
+
content: [
|
|
795
|
+
...oe,
|
|
796
|
+
{
|
|
797
|
+
table: {
|
|
798
|
+
headerRows: 1,
|
|
799
|
+
widths: L,
|
|
800
|
+
body: [
|
|
801
|
+
de.map((y) => ({
|
|
802
|
+
text: y,
|
|
803
|
+
fillColor: "#243a50",
|
|
804
|
+
color: "#ffffff",
|
|
805
|
+
bold: !0,
|
|
806
|
+
fontSize: 8.5
|
|
807
|
+
})),
|
|
808
|
+
...Re
|
|
809
|
+
]
|
|
810
|
+
},
|
|
811
|
+
layout: {
|
|
812
|
+
fillColor: (y) => y === 0 ? "#243a50" : null,
|
|
813
|
+
hLineWidth: () => 0.1,
|
|
814
|
+
vLineWidth: () => 0.1
|
|
815
|
+
},
|
|
816
|
+
margin: [0, 8]
|
|
817
|
+
}
|
|
818
|
+
],
|
|
819
|
+
footer: (y, P) => ({
|
|
820
|
+
text: `Page ${y} of ${P} | User Activity Trace`,
|
|
821
|
+
alignment: "left",
|
|
822
|
+
margin: [14, 0],
|
|
823
|
+
fontSize: 7,
|
|
824
|
+
font: "Roboto"
|
|
825
|
+
}),
|
|
826
|
+
header: {
|
|
827
|
+
text: `User Activity Trace (${m.length} records)`,
|
|
828
|
+
alignment: "left",
|
|
829
|
+
margin: [14, 8],
|
|
830
|
+
fontSize: 8,
|
|
831
|
+
font: "Roboto"
|
|
832
|
+
},
|
|
833
|
+
defaultStyle: {
|
|
834
|
+
font: "MuktaVaani"
|
|
835
|
+
}
|
|
836
|
+
};
|
|
837
|
+
ie.createPdf(Me).download(_);
|
|
838
|
+
} catch {
|
|
839
|
+
X({ message: "Error generating PDF", type: "error" });
|
|
840
|
+
}
|
|
841
|
+
}, Ae = async () => {
|
|
842
|
+
if (m.length === 0) return;
|
|
843
|
+
const a = !o.sessionId, l = ["Date", "Time"];
|
|
844
|
+
a && l.push("Session ID"), l.push("Method", "Resource", "Params", "Status");
|
|
845
|
+
const v = [
|
|
846
|
+
["USER ACTIVITY TRACE REPORT"],
|
|
847
|
+
[`User ID: ${c || (r == null ? void 0 : r.user_id) || "N/A"}`],
|
|
848
|
+
[`Username: ${(r == null ? void 0 : r.user_name) || "N/A"}`],
|
|
849
|
+
[`Name: ${(r == null ? void 0 : r.name) || "N/A"}`],
|
|
850
|
+
[`Role Name: ${(r == null ? void 0 : r.role_name) || "N/A"} (Role Id: ${(r == null ? void 0 : r.role_id) || "N/A"}, Role Code: ${(r == null ? void 0 : r.role_code) || "N/A"})`],
|
|
851
|
+
[`IP Address: ${(r == null ? void 0 : r.ip) || "N/A"}`],
|
|
852
|
+
[`User Agent: ${(r == null ? void 0 : r.user_agent) || (r == null ? void 0 : r.userAgent) || "N/A"}`],
|
|
853
|
+
...o.sessionId ? [[`Session ID: ${o.sessionId}`]] : [],
|
|
854
|
+
[`Server Instance: ${window.location.hostname || "N/A"}`],
|
|
855
|
+
[],
|
|
856
|
+
// blank row separator
|
|
857
|
+
// Table headers
|
|
858
|
+
l
|
|
859
|
+
];
|
|
860
|
+
m.forEach((_) => {
|
|
861
|
+
const L = [
|
|
862
|
+
j(_.timestamp).format("DD/MM/YYYY"),
|
|
863
|
+
j(_.timestamp).format("hh:mm:ss A")
|
|
864
|
+
];
|
|
865
|
+
a && L.push(_.session_id || "N/A");
|
|
866
|
+
const Y = J(_.resource), de = Y.includes("(Login)") || Y.includes("(Logout)") ? { v: Y, s: { font: { bold: !0 } } } : Y;
|
|
867
|
+
L.push(
|
|
868
|
+
_.http_method || "N/A",
|
|
869
|
+
de,
|
|
870
|
+
_.query_params || "N/A",
|
|
871
|
+
_.response_code || "N/A"
|
|
872
|
+
), v.push(L);
|
|
873
|
+
});
|
|
874
|
+
const U = le.utils.aoa_to_sheet(v), k = le.utils.book_new();
|
|
875
|
+
le.utils.book_append_sheet(k, U, "UserActivityAnalytics"), le.writeFile(k, `UserActivity_${c || "Session"}_${ee().format("YYYYMMDD")}.xlsx`);
|
|
876
|
+
};
|
|
877
|
+
return /* @__PURE__ */ n(h, { className: "flex flex-col h-full w-full", children: [
|
|
878
|
+
/* @__PURE__ */ n(h, { className: "flex flex-col md:flex-row justify-between items-start md:items-center p-6 border-b border-slate-200/60 dark:border-slate-800/60 gap-4", children: [
|
|
879
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-4", children: [
|
|
880
|
+
/* @__PURE__ */ e(
|
|
881
|
+
H,
|
|
882
|
+
{
|
|
883
|
+
onClick: d,
|
|
884
|
+
size: "medium",
|
|
885
|
+
sx: {
|
|
886
|
+
backgroundColor: q(t.palette.primary.main, 0.1),
|
|
887
|
+
color: t.palette.primary.main,
|
|
888
|
+
"&:hover": { backgroundColor: t.palette.primary.main, color: "white" }
|
|
889
|
+
},
|
|
890
|
+
children: /* @__PURE__ */ e(w, { icon: qe, className: "text-sm" })
|
|
891
|
+
}
|
|
892
|
+
),
|
|
893
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col", children: [
|
|
894
|
+
/* @__PURE__ */ e(S, { variant: "body2", className: "font-bold font-sans text-lg text-customBlue uppercase", children: "USER ACTIVITY LOGS" }),
|
|
895
|
+
/* @__PURE__ */ e("div", { className: "flex items-center mt-1.5 font-semibold text-[13px] text-slate-600 dark:text-slate-400", children: /* @__PURE__ */ n("span", { className: "flex items-center gap-1.5", children: [
|
|
896
|
+
"User ID: ",
|
|
897
|
+
/* @__PURE__ */ e("span", { className: "text-primary-main font-black", children: c || r.user_id || "N/A" }),
|
|
898
|
+
/* @__PURE__ */ e(V, { title: "View User Info Details", arrow: !0, placement: "top", children: /* @__PURE__ */ e(
|
|
899
|
+
"span",
|
|
900
|
+
{
|
|
901
|
+
ref: (a) => {
|
|
902
|
+
a && a.style.setProperty("border-radius", "50%", "important");
|
|
903
|
+
},
|
|
904
|
+
onClick: () => W(!0),
|
|
905
|
+
className: "cursor-pointer inline-flex items-center justify-center",
|
|
906
|
+
style: {
|
|
907
|
+
width: "15px",
|
|
908
|
+
height: "15px",
|
|
909
|
+
border: `1.5px solid ${t.palette.primary.main}`,
|
|
910
|
+
color: t.palette.primary.main,
|
|
911
|
+
fontSize: "8px",
|
|
912
|
+
fontWeight: "bold",
|
|
913
|
+
lineHeight: 1,
|
|
914
|
+
display: "inline-flex",
|
|
915
|
+
alignItems: "center",
|
|
916
|
+
justifyContent: "center",
|
|
917
|
+
verticalAlign: "middle"
|
|
918
|
+
},
|
|
919
|
+
children: /* @__PURE__ */ e(w, { icon: Ge })
|
|
920
|
+
}
|
|
921
|
+
) })
|
|
922
|
+
] }) })
|
|
923
|
+
] })
|
|
924
|
+
] }),
|
|
925
|
+
/* @__PURE__ */ n(h, { className: "flex flex-wrap items-center gap-3 ml-auto", children: [
|
|
926
|
+
/* @__PURE__ */ e(
|
|
927
|
+
Z,
|
|
928
|
+
{
|
|
929
|
+
size: "small",
|
|
930
|
+
placeholder: "Search by User ID...",
|
|
931
|
+
value: $,
|
|
932
|
+
onChange: (a) => z(a.target.value),
|
|
933
|
+
onKeyDown: (a) => a.key === "Enter" && B(),
|
|
934
|
+
sx: {
|
|
935
|
+
width: { xs: "100%", md: "200px" },
|
|
936
|
+
"& .MuiInputBase-root": {
|
|
937
|
+
backgroundColor: t.palette.background.paper,
|
|
938
|
+
borderRadius: "12px"
|
|
939
|
+
}
|
|
940
|
+
},
|
|
941
|
+
InputProps: {
|
|
942
|
+
endAdornment: /* @__PURE__ */ e(Le, { position: "end", children: /* @__PURE__ */ e(H, { size: "small", onClick: B, color: "primary", children: /* @__PURE__ */ e(w, { icon: me }) }) })
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
),
|
|
946
|
+
/* @__PURE__ */ n("div", { className: `flex items-center rounded-2xl p-1 shadow-sm border ${t.palette.mode === "dark" ? "bg-slate-900 border-slate-800" : "bg-white border-slate-200"}`, children: [
|
|
947
|
+
/* @__PURE__ */ n(
|
|
948
|
+
"button",
|
|
949
|
+
{
|
|
950
|
+
disabled: C,
|
|
951
|
+
onClick: we,
|
|
952
|
+
className: `px-4 py-2 rounded-xl transition-all flex items-center gap-2 text-xs font-black uppercase tracking-wider ${t.palette.mode === "dark" ? "text-slate-400 hover:text-slate-100 hover:bg-slate-800" : "text-slate-600 hover:text-red-600 hover:bg-slate-50"}`,
|
|
953
|
+
children: [
|
|
954
|
+
/* @__PURE__ */ e(w, { icon: Je, className: "mr-1" }),
|
|
955
|
+
"Pdf"
|
|
956
|
+
]
|
|
957
|
+
}
|
|
958
|
+
),
|
|
959
|
+
/* @__PURE__ */ n(
|
|
960
|
+
"button",
|
|
961
|
+
{
|
|
962
|
+
disabled: C,
|
|
963
|
+
onClick: Ae,
|
|
964
|
+
className: `px-4 py-2 rounded-xl transition-all flex items-center gap-2 text-xs font-black uppercase tracking-wider ml-1 ${t.palette.mode === "dark" ? "bg-slate-800 text-slate-100 hover:bg-slate-700" : "bg-[var(--color-tableHeader)] text-white hover:bg-[var(--color-tableHeader)]"}`,
|
|
965
|
+
children: [
|
|
966
|
+
/* @__PURE__ */ e(w, { icon: Ke, className: "mr-1" }),
|
|
967
|
+
"Excel"
|
|
968
|
+
]
|
|
969
|
+
}
|
|
970
|
+
)
|
|
971
|
+
] }),
|
|
972
|
+
/* @__PURE__ */ e(
|
|
973
|
+
H,
|
|
974
|
+
{
|
|
975
|
+
color: "primary",
|
|
976
|
+
onClick: ce,
|
|
977
|
+
className: "rounded-xl border border-slate-200 dark:border-slate-800 shadow-sm",
|
|
978
|
+
sx: {
|
|
979
|
+
backgroundColor: q(t.palette.primary.main, 0.1),
|
|
980
|
+
width: 40,
|
|
981
|
+
height: 40,
|
|
982
|
+
"&:hover": { backgroundColor: t.palette.primary.main, color: "white" }
|
|
983
|
+
},
|
|
984
|
+
children: /* @__PURE__ */ e(w, { icon: Qe, className: "text-sm" })
|
|
985
|
+
}
|
|
986
|
+
),
|
|
987
|
+
/* @__PURE__ */ e(
|
|
988
|
+
H,
|
|
989
|
+
{
|
|
990
|
+
color: "primary",
|
|
991
|
+
onClick: K,
|
|
992
|
+
className: "rounded-xl border border-slate-200 dark:border-slate-800 shadow-sm",
|
|
993
|
+
sx: {
|
|
994
|
+
backgroundColor: q(t.palette.primary.main, 0.1),
|
|
995
|
+
width: 40,
|
|
996
|
+
height: 40,
|
|
997
|
+
"&:hover": { backgroundColor: t.palette.primary.main, color: "white" }
|
|
998
|
+
},
|
|
999
|
+
children: /* @__PURE__ */ e(w, { icon: Ne, className: "text-sm" })
|
|
1000
|
+
}
|
|
1001
|
+
)
|
|
1002
|
+
] })
|
|
1003
|
+
] }),
|
|
1004
|
+
/* @__PURE__ */ e(
|
|
1005
|
+
h,
|
|
1006
|
+
{
|
|
1007
|
+
className: "flex-1 overflow-hidden relative",
|
|
1008
|
+
sx: {
|
|
1009
|
+
height: "100%",
|
|
1010
|
+
"& *": { borderRadius: "0px !important" },
|
|
1011
|
+
// Kill every curve inside this box
|
|
1012
|
+
"& .MuiTableContainer-root": { height: "100% !important", maxHeight: "100% !important" }
|
|
1013
|
+
},
|
|
1014
|
+
children: !c && !o.sessionId ? /* @__PURE__ */ n(h, { className: "w-full h-full flex flex-col items-center justify-center space-y-4 opacity-50", children: [
|
|
1015
|
+
/* @__PURE__ */ e(w, { icon: me, className: "text-5xl text-slate-300" }),
|
|
1016
|
+
/* @__PURE__ */ e(S, { variant: "h6", className: "font-bold text-slate-400", children: "Search a User ID or Session to trace actions" })
|
|
1017
|
+
] }) : /* @__PURE__ */ e(
|
|
1018
|
+
be,
|
|
1019
|
+
{
|
|
1020
|
+
id: "user-activity-detail-list",
|
|
1021
|
+
columns: Te,
|
|
1022
|
+
tableData: m,
|
|
1023
|
+
paginationConfig: {
|
|
1024
|
+
pagination: !0,
|
|
1025
|
+
paginationType: "infinite-scroll",
|
|
1026
|
+
rowsPerPageInTable: F,
|
|
1027
|
+
hasMore: b,
|
|
1028
|
+
loadMore: () => b && De({ cancelRefetch: !1 })
|
|
1029
|
+
},
|
|
1030
|
+
styleConfig: {
|
|
1031
|
+
cellStyle: { padding: "8px 16px", height: 40, maxLines: 1 }
|
|
1032
|
+
},
|
|
1033
|
+
isLoading: C,
|
|
1034
|
+
handleSort: re,
|
|
1035
|
+
emptyBoxText: "Activity for this User ID doesn't exist in our logs.",
|
|
1036
|
+
getActions: () => []
|
|
1037
|
+
}
|
|
1038
|
+
)
|
|
1039
|
+
}
|
|
1040
|
+
),
|
|
1041
|
+
/* @__PURE__ */ e(
|
|
1042
|
+
Xe,
|
|
1043
|
+
{
|
|
1044
|
+
title: "Activity Filters",
|
|
1045
|
+
resetButtonLabel: "Reset",
|
|
1046
|
+
onResetClick: ke,
|
|
1047
|
+
FormBody: at,
|
|
1048
|
+
handleOverlayState: ce,
|
|
1049
|
+
overlayOpen: G,
|
|
1050
|
+
dataTestId: "user-activity-filter",
|
|
1051
|
+
ModalProps: {
|
|
1052
|
+
sx: {
|
|
1053
|
+
"& .MuiDrawer-paper": {
|
|
1054
|
+
backgroundColor: t.palette.background.paper,
|
|
1055
|
+
color: t.palette.text.primary,
|
|
1056
|
+
"& .p-2\\.5": {
|
|
1057
|
+
backgroundColor: t.palette.background.paper,
|
|
1058
|
+
borderBottom: `1px solid ${t.palette.divider}`,
|
|
1059
|
+
color: t.palette.primary.main,
|
|
1060
|
+
fontWeight: "bold",
|
|
1061
|
+
letterSpacing: "1px"
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
},
|
|
1066
|
+
formProps: {
|
|
1067
|
+
filter: o,
|
|
1068
|
+
onApply: he,
|
|
1069
|
+
handleOverlayState: ce
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
),
|
|
1073
|
+
/* @__PURE__ */ n(
|
|
1074
|
+
Oe,
|
|
1075
|
+
{
|
|
1076
|
+
open: E,
|
|
1077
|
+
onClose: () => W(!1),
|
|
1078
|
+
maxWidth: "sm",
|
|
1079
|
+
fullWidth: !0,
|
|
1080
|
+
PaperProps: {
|
|
1081
|
+
sx: {
|
|
1082
|
+
borderRadius: "16px",
|
|
1083
|
+
boxShadow: "0 10px 30px rgba(0,0,0,0.15)",
|
|
1084
|
+
backgroundImage: "none",
|
|
1085
|
+
backgroundColor: t.palette.background.paper,
|
|
1086
|
+
color: t.palette.text.primary
|
|
1087
|
+
}
|
|
1088
|
+
},
|
|
1089
|
+
children: [
|
|
1090
|
+
/* @__PURE__ */ e(Fe, { className: "border-b border-slate-200 dark:border-slate-800 pb-3 flex justify-between items-center", children: /* @__PURE__ */ e(
|
|
1091
|
+
S,
|
|
1092
|
+
{
|
|
1093
|
+
variant: "h6",
|
|
1094
|
+
style: {
|
|
1095
|
+
color: t.palette.text.primary,
|
|
1096
|
+
fontWeight: 900
|
|
1097
|
+
},
|
|
1098
|
+
children: "User Information"
|
|
1099
|
+
}
|
|
1100
|
+
) }),
|
|
1101
|
+
/* @__PURE__ */ e(Be, { className: "pt-4 pb-6", sx: { color: t.palette.text.primary }, children: /* @__PURE__ */ n("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
1102
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-0.5", children: [
|
|
1103
|
+
/* @__PURE__ */ e(
|
|
1104
|
+
"span",
|
|
1105
|
+
{
|
|
1106
|
+
style: {
|
|
1107
|
+
color: t.palette.text.secondary,
|
|
1108
|
+
fontWeight: 700,
|
|
1109
|
+
fontSize: "11.5px",
|
|
1110
|
+
textTransform: "uppercase",
|
|
1111
|
+
letterSpacing: "0.05em"
|
|
1112
|
+
},
|
|
1113
|
+
children: "User ID"
|
|
1114
|
+
}
|
|
1115
|
+
),
|
|
1116
|
+
/* @__PURE__ */ e(
|
|
1117
|
+
"span",
|
|
1118
|
+
{
|
|
1119
|
+
style: {
|
|
1120
|
+
color: t.palette.text.primary,
|
|
1121
|
+
fontWeight: 800,
|
|
1122
|
+
fontSize: "14px"
|
|
1123
|
+
},
|
|
1124
|
+
children: c || r.user_id || "N/A"
|
|
1125
|
+
}
|
|
1126
|
+
)
|
|
1127
|
+
] }),
|
|
1128
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-0.5", children: [
|
|
1129
|
+
/* @__PURE__ */ e(
|
|
1130
|
+
"span",
|
|
1131
|
+
{
|
|
1132
|
+
style: {
|
|
1133
|
+
color: t.palette.text.secondary,
|
|
1134
|
+
fontWeight: 700,
|
|
1135
|
+
fontSize: "11.5px",
|
|
1136
|
+
textTransform: "uppercase",
|
|
1137
|
+
letterSpacing: "0.05em"
|
|
1138
|
+
},
|
|
1139
|
+
children: "Username"
|
|
1140
|
+
}
|
|
1141
|
+
),
|
|
1142
|
+
/* @__PURE__ */ e(
|
|
1143
|
+
"span",
|
|
1144
|
+
{
|
|
1145
|
+
style: {
|
|
1146
|
+
color: t.palette.text.primary,
|
|
1147
|
+
fontWeight: 800,
|
|
1148
|
+
fontSize: "14px"
|
|
1149
|
+
},
|
|
1150
|
+
children: r.user_name || "N/A"
|
|
1151
|
+
}
|
|
1152
|
+
)
|
|
1153
|
+
] }),
|
|
1154
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-0.5", children: [
|
|
1155
|
+
/* @__PURE__ */ e(
|
|
1156
|
+
"span",
|
|
1157
|
+
{
|
|
1158
|
+
style: {
|
|
1159
|
+
color: t.palette.text.secondary,
|
|
1160
|
+
fontWeight: 700,
|
|
1161
|
+
fontSize: "11.5px",
|
|
1162
|
+
textTransform: "uppercase",
|
|
1163
|
+
letterSpacing: "0.05em"
|
|
1164
|
+
},
|
|
1165
|
+
children: "Full Name"
|
|
1166
|
+
}
|
|
1167
|
+
),
|
|
1168
|
+
/* @__PURE__ */ e(
|
|
1169
|
+
"span",
|
|
1170
|
+
{
|
|
1171
|
+
style: {
|
|
1172
|
+
color: t.palette.text.primary,
|
|
1173
|
+
fontWeight: 800,
|
|
1174
|
+
fontSize: "14px"
|
|
1175
|
+
},
|
|
1176
|
+
children: r.name || "N/A"
|
|
1177
|
+
}
|
|
1178
|
+
)
|
|
1179
|
+
] }),
|
|
1180
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-0.5", children: [
|
|
1181
|
+
/* @__PURE__ */ e(
|
|
1182
|
+
"span",
|
|
1183
|
+
{
|
|
1184
|
+
style: {
|
|
1185
|
+
color: t.palette.text.secondary,
|
|
1186
|
+
fontWeight: 700,
|
|
1187
|
+
fontSize: "11.5px",
|
|
1188
|
+
textTransform: "uppercase",
|
|
1189
|
+
letterSpacing: "0.05em"
|
|
1190
|
+
},
|
|
1191
|
+
children: "Role Name"
|
|
1192
|
+
}
|
|
1193
|
+
),
|
|
1194
|
+
/* @__PURE__ */ e(
|
|
1195
|
+
"span",
|
|
1196
|
+
{
|
|
1197
|
+
style: {
|
|
1198
|
+
color: t.palette.text.primary,
|
|
1199
|
+
fontWeight: 800,
|
|
1200
|
+
fontSize: "14px"
|
|
1201
|
+
},
|
|
1202
|
+
children: r.role_name || "N/A"
|
|
1203
|
+
}
|
|
1204
|
+
)
|
|
1205
|
+
] }),
|
|
1206
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-0.5", children: [
|
|
1207
|
+
/* @__PURE__ */ e(
|
|
1208
|
+
"span",
|
|
1209
|
+
{
|
|
1210
|
+
style: {
|
|
1211
|
+
color: t.palette.text.secondary,
|
|
1212
|
+
fontWeight: 700,
|
|
1213
|
+
fontSize: "11.5px",
|
|
1214
|
+
textTransform: "uppercase",
|
|
1215
|
+
letterSpacing: "0.05em"
|
|
1216
|
+
},
|
|
1217
|
+
children: "Role ID"
|
|
1218
|
+
}
|
|
1219
|
+
),
|
|
1220
|
+
/* @__PURE__ */ e(
|
|
1221
|
+
"span",
|
|
1222
|
+
{
|
|
1223
|
+
style: {
|
|
1224
|
+
color: t.palette.text.primary,
|
|
1225
|
+
fontWeight: 800,
|
|
1226
|
+
fontSize: "14px"
|
|
1227
|
+
},
|
|
1228
|
+
children: r.role_id || "N/A"
|
|
1229
|
+
}
|
|
1230
|
+
)
|
|
1231
|
+
] }),
|
|
1232
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-0.5", children: [
|
|
1233
|
+
/* @__PURE__ */ e(
|
|
1234
|
+
"span",
|
|
1235
|
+
{
|
|
1236
|
+
style: {
|
|
1237
|
+
color: t.palette.text.secondary,
|
|
1238
|
+
fontWeight: 700,
|
|
1239
|
+
fontSize: "11.5px",
|
|
1240
|
+
textTransform: "uppercase",
|
|
1241
|
+
letterSpacing: "0.05em"
|
|
1242
|
+
},
|
|
1243
|
+
children: "Role Code"
|
|
1244
|
+
}
|
|
1245
|
+
),
|
|
1246
|
+
/* @__PURE__ */ e(
|
|
1247
|
+
"span",
|
|
1248
|
+
{
|
|
1249
|
+
style: {
|
|
1250
|
+
color: t.palette.text.primary,
|
|
1251
|
+
fontWeight: 800,
|
|
1252
|
+
fontSize: "14px"
|
|
1253
|
+
},
|
|
1254
|
+
children: r.role_code || "N/A"
|
|
1255
|
+
}
|
|
1256
|
+
)
|
|
1257
|
+
] }),
|
|
1258
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-0.5", children: [
|
|
1259
|
+
/* @__PURE__ */ e(
|
|
1260
|
+
"span",
|
|
1261
|
+
{
|
|
1262
|
+
style: {
|
|
1263
|
+
color: t.palette.text.secondary,
|
|
1264
|
+
fontWeight: 700,
|
|
1265
|
+
fontSize: "11.5px",
|
|
1266
|
+
textTransform: "uppercase",
|
|
1267
|
+
letterSpacing: "0.05em"
|
|
1268
|
+
},
|
|
1269
|
+
children: "IP Address"
|
|
1270
|
+
}
|
|
1271
|
+
),
|
|
1272
|
+
/* @__PURE__ */ e(
|
|
1273
|
+
"span",
|
|
1274
|
+
{
|
|
1275
|
+
style: {
|
|
1276
|
+
color: t.palette.text.primary,
|
|
1277
|
+
fontWeight: 800,
|
|
1278
|
+
fontSize: "14px"
|
|
1279
|
+
},
|
|
1280
|
+
children: r.ip || "N/A"
|
|
1281
|
+
}
|
|
1282
|
+
)
|
|
1283
|
+
] }),
|
|
1284
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-0.5", children: [
|
|
1285
|
+
/* @__PURE__ */ e(
|
|
1286
|
+
"span",
|
|
1287
|
+
{
|
|
1288
|
+
style: {
|
|
1289
|
+
color: t.palette.text.secondary,
|
|
1290
|
+
fontWeight: 700,
|
|
1291
|
+
fontSize: "11.5px",
|
|
1292
|
+
textTransform: "uppercase",
|
|
1293
|
+
letterSpacing: "0.05em"
|
|
1294
|
+
},
|
|
1295
|
+
children: "Server Instance"
|
|
1296
|
+
}
|
|
1297
|
+
),
|
|
1298
|
+
/* @__PURE__ */ e(
|
|
1299
|
+
"span",
|
|
1300
|
+
{
|
|
1301
|
+
style: {
|
|
1302
|
+
color: t.palette.text.primary,
|
|
1303
|
+
fontWeight: 800,
|
|
1304
|
+
fontSize: "14px"
|
|
1305
|
+
},
|
|
1306
|
+
children: window.location.hostname || "N/A"
|
|
1307
|
+
}
|
|
1308
|
+
)
|
|
1309
|
+
] }),
|
|
1310
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-0.5 md:col-span-2", children: [
|
|
1311
|
+
/* @__PURE__ */ e(
|
|
1312
|
+
"span",
|
|
1313
|
+
{
|
|
1314
|
+
style: {
|
|
1315
|
+
color: t.palette.text.secondary,
|
|
1316
|
+
fontWeight: 700,
|
|
1317
|
+
fontSize: "11.5px",
|
|
1318
|
+
textTransform: "uppercase",
|
|
1319
|
+
letterSpacing: "0.05em"
|
|
1320
|
+
},
|
|
1321
|
+
children: "User Agent"
|
|
1322
|
+
}
|
|
1323
|
+
),
|
|
1324
|
+
/* @__PURE__ */ e(
|
|
1325
|
+
"span",
|
|
1326
|
+
{
|
|
1327
|
+
className: "text-xs font-mono break-all leading-relaxed",
|
|
1328
|
+
style: {
|
|
1329
|
+
color: t.palette.text.primary,
|
|
1330
|
+
fontWeight: 800
|
|
1331
|
+
},
|
|
1332
|
+
children: r.user_agent || r.userAgent || "N/A"
|
|
1333
|
+
}
|
|
1334
|
+
)
|
|
1335
|
+
] }),
|
|
1336
|
+
(o.sessionId || r.session_id || r.sessionId) && /* @__PURE__ */ n("div", { className: "flex flex-col gap-0.5 md:col-span-2", children: [
|
|
1337
|
+
/* @__PURE__ */ e(
|
|
1338
|
+
"span",
|
|
1339
|
+
{
|
|
1340
|
+
style: {
|
|
1341
|
+
color: t.palette.text.secondary,
|
|
1342
|
+
fontWeight: 700,
|
|
1343
|
+
fontSize: "11.5px",
|
|
1344
|
+
textTransform: "uppercase",
|
|
1345
|
+
letterSpacing: "0.05em"
|
|
1346
|
+
},
|
|
1347
|
+
children: "Session ID"
|
|
1348
|
+
}
|
|
1349
|
+
),
|
|
1350
|
+
/* @__PURE__ */ e(
|
|
1351
|
+
"span",
|
|
1352
|
+
{
|
|
1353
|
+
className: "text-xs font-mono break-all",
|
|
1354
|
+
style: {
|
|
1355
|
+
color: t.palette.text.primary,
|
|
1356
|
+
fontWeight: 800
|
|
1357
|
+
},
|
|
1358
|
+
children: o.sessionId || r.session_id || r.sessionId
|
|
1359
|
+
}
|
|
1360
|
+
)
|
|
1361
|
+
] })
|
|
1362
|
+
] }) }),
|
|
1363
|
+
/* @__PURE__ */ e(Pe, { className: "border-t border-slate-200 dark:border-slate-800 px-6 py-3", children: /* @__PURE__ */ e(
|
|
1364
|
+
fe,
|
|
1365
|
+
{
|
|
1366
|
+
onClick: () => W(!1),
|
|
1367
|
+
variant: "contained",
|
|
1368
|
+
sx: {
|
|
1369
|
+
borderRadius: "8px",
|
|
1370
|
+
textTransform: "none"
|
|
1371
|
+
},
|
|
1372
|
+
children: "Close"
|
|
1373
|
+
}
|
|
1374
|
+
) })
|
|
1375
|
+
]
|
|
1376
|
+
}
|
|
1377
|
+
)
|
|
1378
|
+
] });
|
|
1379
|
+
}
|
|
1380
|
+
function It() {
|
|
1381
|
+
const i = ue(), p = $e(), [T, d] = f(null), [t, m] = f(null), [u, b] = f(null), [A, C] = f("list");
|
|
1382
|
+
te(() => {
|
|
1383
|
+
const c = new URLSearchParams(p.search || window.location.hash.split("?")[1] || window.location.search), M = c.get("sessionId"), $ = c.get("attributes");
|
|
1384
|
+
if (M) {
|
|
1385
|
+
if (m(M), $)
|
|
1386
|
+
try {
|
|
1387
|
+
b(JSON.parse(decodeURIComponent($)));
|
|
1388
|
+
} catch {
|
|
1389
|
+
}
|
|
1390
|
+
C("detail");
|
|
1391
|
+
}
|
|
1392
|
+
}, [p.search]);
|
|
1393
|
+
const I = (c, M = null) => {
|
|
1394
|
+
d(c), m(null), b(M), C("detail");
|
|
1395
|
+
}, F = () => {
|
|
1396
|
+
d(null), m(null), b(null);
|
|
1397
|
+
const c = window.location.pathname + (window.location.hash ? window.location.hash.split("?")[0] : "");
|
|
1398
|
+
window.history.replaceState({}, "", c), C("list");
|
|
1399
|
+
};
|
|
1400
|
+
return /* @__PURE__ */ n(
|
|
1401
|
+
h,
|
|
1402
|
+
{
|
|
1403
|
+
id: "activity-analytics-root",
|
|
1404
|
+
className: "w-full h-full flex flex-col p-4 bg-[var(--color-gray4)] dark:bg-[#0f172a]",
|
|
1405
|
+
children: [
|
|
1406
|
+
/* @__PURE__ */ e("style", { children: `
|
|
1407
|
+
#activity-analytics-root *,
|
|
1408
|
+
#activity-analytics-root .MuiTableContainer-root,
|
|
1409
|
+
#activity-analytics-root .MuiPaper-root,
|
|
1410
|
+
#activity-analytics-root [class*="rounded-"] {
|
|
1411
|
+
border-radius: 0px !important;
|
|
1412
|
+
}
|
|
1413
|
+
` }),
|
|
1414
|
+
/* @__PURE__ */ e(
|
|
1415
|
+
h,
|
|
1416
|
+
{
|
|
1417
|
+
className: "w-full h-full flex flex-col",
|
|
1418
|
+
sx: {
|
|
1419
|
+
backgroundColor: i.palette.mode === "dark" ? "#0f172a" : "var(--color-gray4)"
|
|
1420
|
+
},
|
|
1421
|
+
children: /* @__PURE__ */ e(h, { className: "flex-1 overflow-hidden", children: A === "list" ? /* @__PURE__ */ e(rt, { onUserSelect: I }) : /* @__PURE__ */ e(
|
|
1422
|
+
ot,
|
|
1423
|
+
{
|
|
1424
|
+
selectedUserId: T,
|
|
1425
|
+
initialSessionId: t,
|
|
1426
|
+
initialAttributes: u,
|
|
1427
|
+
onBack: F
|
|
1428
|
+
}
|
|
1429
|
+
) })
|
|
1430
|
+
}
|
|
1431
|
+
)
|
|
1432
|
+
]
|
|
1433
|
+
}
|
|
1434
|
+
);
|
|
1435
|
+
}
|
|
1436
|
+
export {
|
|
1437
|
+
It as default
|
|
1438
|
+
};
|
|
1439
|
+
//# sourceMappingURL=index-D9YNFPn9.js.map
|