@argusoft/medplat-core 1.0.18 → 1.0.20

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.
Files changed (106) hide show
  1. package/dist/{AccessRights-Bvd5Bm5K.js → AccessRights-CupmTG3T.js} +2 -2
  2. package/dist/{AccessRights-Bvd5Bm5K.js.map → AccessRights-CupmTG3T.js.map} +1 -1
  3. package/dist/{AddEditQueryBuilder-Bcjl5mXE.js → AddEditQueryBuilder-C8ZSkOF0.js} +60 -60
  4. package/dist/AddEditQueryBuilder-C8ZSkOF0.js.map +1 -0
  5. package/dist/{AddFeatures-CE5rBxEG.js → AddFeatures-CiZZZ0GL.js} +2 -2
  6. package/dist/{AddFeatures-CE5rBxEG.js.map → AddFeatures-CiZZZ0GL.js.map} +1 -1
  7. package/dist/{AddMenuConfiguration-QWfpcnuP.js → AddMenuConfiguration-DsnY0Rws.js} +544 -544
  8. package/dist/AddMenuConfiguration-DsnY0Rws.js.map +1 -0
  9. package/dist/{AddRoleDrawer-SvntLdRu.js → AddRoleDrawer-CQdzQZLb.js} +39 -39
  10. package/dist/AddRoleDrawer-CQdzQZLb.js.map +1 -0
  11. package/dist/ChangePasswordModalCore-50EzprTk.js +5495 -0
  12. package/dist/ChangePasswordModalCore-50EzprTk.js.map +1 -0
  13. package/dist/{ConditionConfig-DB0FqwgG.js → ConditionConfig-C3rF2wXU.js} +2 -2
  14. package/dist/{ConditionConfig-DB0FqwgG.js.map → ConditionConfig-C3rF2wXU.js.map} +1 -1
  15. package/dist/{EntityManagement-DQKXnEzz.js → EntityManagement-D4nG7wUX.js} +2 -2
  16. package/dist/{EntityManagement-DQKXnEzz.js.map → EntityManagement-D4nG7wUX.js.map} +1 -1
  17. package/dist/{EventConfigurations-D8juDb29.js → EventConfigurations-BGffjVC7.js} +3 -3
  18. package/dist/{EventConfigurations-D8juDb29.js.map → EventConfigurations-BGffjVC7.js.map} +1 -1
  19. package/dist/{EventsExceptionModal-DsvngLi8.js → EventsExceptionModal-D4Bf1ilS.js} +2 -2
  20. package/dist/{EventsExceptionModal-DsvngLi8.js.map → EventsExceptionModal-D4Bf1ilS.js.map} +1 -1
  21. package/dist/EventsSkeleton-8iiETGcf.js +76 -0
  22. package/dist/EventsSkeleton-8iiETGcf.js.map +1 -0
  23. package/dist/{FeatureMenu-CLX8VNZ-.js → FeatureMenu-DUZL32RI.js} +3 -3
  24. package/dist/{FeatureMenu-CLX8VNZ-.js.map → FeatureMenu-DUZL32RI.js.map} +1 -1
  25. package/dist/Features-CObdzJp_.js +13 -0
  26. package/dist/Features-CObdzJp_.js.map +1 -0
  27. package/dist/ImmunizationConfigurationBase-C5wnjI_-.js +5706 -0
  28. package/dist/ImmunizationConfigurationBase-C5wnjI_-.js.map +1 -0
  29. package/dist/ImmunizationConfigurationBase.css +1 -1
  30. package/dist/{ManageDynamicFeature-CsIett5x.js → ManageDynamicFeature-BhONvfC_.js} +3 -3
  31. package/dist/{ManageDynamicFeature-CsIett5x.js.map → ManageDynamicFeature-BhONvfC_.js.map} +1 -1
  32. package/dist/{ManageEventConfiguration-0YBDaxOI.js → ManageEventConfiguration-BntUc_YI.js} +93 -93
  33. package/dist/ManageEventConfiguration-BntUc_YI.js.map +1 -0
  34. package/dist/{ManageNotification-BUAvg5Ge.js → ManageNotification-CSl02Wq7.js} +2 -2
  35. package/dist/{ManageNotification-BUAvg5Ge.js.map → ManageNotification-CSl02Wq7.js.map} +1 -1
  36. package/dist/{ManageRole-Cbs9dUhc.js → ManageRole-tdzAiCOE.js} +222 -229
  37. package/dist/ManageRole-tdzAiCOE.js.map +1 -0
  38. package/dist/{ManageUser-eBS0yC5k.js → ManageUser-C6dlK-Mr.js} +3 -4
  39. package/dist/{ManageUser-eBS0yC5k.js.map → ManageUser-C6dlK-Mr.js.map} +1 -1
  40. package/dist/{MobileMenuManagement-BmrO-7MN.js → MobileMenuManagement-CV6QCeos.js} +15 -15
  41. package/dist/MobileMenuManagement-CV6QCeos.js.map +1 -0
  42. package/dist/{MobileTypeEventConfigModal-Ltm529jG.js → MobileTypeEventConfigModal-BNjZ8pnq.js} +2 -2
  43. package/dist/{MobileTypeEventConfigModal-Ltm529jG.js.map → MobileTypeEventConfigModal-BNjZ8pnq.js.map} +1 -1
  44. package/dist/{NewServerManagement-5YcAtF-g.js → NewServerManagement-Cxe0dV0O.js} +5 -5
  45. package/dist/NewServerManagement-Cxe0dV0O.js.map +1 -0
  46. package/dist/{NotificationList-CUZSWp2J.js → NotificationList-D1U1LYnz.js} +140 -139
  47. package/dist/NotificationList-D1U1LYnz.js.map +1 -0
  48. package/dist/{OtherTypeEventConfigModal-dXt2qDg_.js → OtherTypeEventConfigModal-DiVhWDpG.js} +43 -43
  49. package/dist/{OtherTypeEventConfigModal-dXt2qDg_.js.map → OtherTypeEventConfigModal-DiVhWDpG.js.map} +1 -1
  50. package/dist/{QueryBuilder-DXexUIe8.js → QueryBuilder-DI0wCJbz.js} +85 -84
  51. package/dist/QueryBuilder-DI0wCJbz.js.map +1 -0
  52. package/dist/{QueryManagement-DGHV_-d5.js → QueryManagement-CRykYGum.js} +3 -3
  53. package/dist/QueryManagement-CRykYGum.js.map +1 -0
  54. package/dist/{RoleManagement-BThAL5LO.js → RoleManagement-Cg8-EiVr.js} +83 -82
  55. package/dist/RoleManagement-Cg8-EiVr.js.map +1 -0
  56. package/dist/SecurityAuditLogList-Dod711KT.js +874 -0
  57. package/dist/SecurityAuditLogList-Dod711KT.js.map +1 -0
  58. package/dist/{ShowFlywayQuery-BkyA6QaA.js → ShowFlywayQuery-tj42YQAS.js} +33 -33
  59. package/dist/ShowFlywayQuery-tj42YQAS.js.map +1 -0
  60. package/dist/{SubMenu-BGznOP2a.js → SubMenu-CM_4wNCR.js} +2 -2
  61. package/dist/{SubMenu-BGznOP2a.js.map → SubMenu-CM_4wNCR.js.map} +1 -1
  62. package/dist/{TableDetails-DztbjsIA.js → TableDetails-Cf_YfnY2.js} +235 -235
  63. package/dist/TableDetails-Cf_YfnY2.js.map +1 -0
  64. package/dist/{TableList-DYwotUDO.js → TableList-HGbEN4bv.js} +28 -28
  65. package/dist/TableList-HGbEN4bv.js.map +1 -0
  66. package/dist/{TypeConfiguration-DYbBG_hZ.js → TypeConfiguration-CupQxH9Y.js} +28 -28
  67. package/dist/TypeConfiguration-CupQxH9Y.js.map +1 -0
  68. package/dist/{UserList-BAeAFeXZ.js → UserList-BzHsbYel.js} +423 -423
  69. package/dist/UserList-BzHsbYel.js.map +1 -0
  70. package/dist/{WidgetList-D-fIf3N2.js → WidgetList-B7X8Awkg.js} +2 -2
  71. package/dist/{WidgetList-D-fIf3N2.js.map → WidgetList-B7X8Awkg.js.map} +1 -1
  72. package/dist/index-D9YNFPn9.js +1439 -0
  73. package/dist/index-D9YNFPn9.js.map +1 -0
  74. package/dist/index.css +1 -1
  75. package/dist/index.js +102 -100
  76. package/dist/index.js.map +1 -1
  77. package/dist/{index-BFznsakV.js → pdfmake-Cf-381ou.js} +13951 -15385
  78. package/dist/pdfmake-Cf-381ou.js.map +1 -0
  79. package/package.json +1 -1
  80. package/dist/AddEditQueryBuilder-Bcjl5mXE.js.map +0 -1
  81. package/dist/AddMenuConfiguration-QWfpcnuP.js.map +0 -1
  82. package/dist/AddRoleDrawer-SvntLdRu.js.map +0 -1
  83. package/dist/ChangePasswordModalCore-ClND1mel.js +0 -181
  84. package/dist/ChangePasswordModalCore-ClND1mel.js.map +0 -1
  85. package/dist/EventsSkeleton-DCXwwPbb.js +0 -76
  86. package/dist/EventsSkeleton-DCXwwPbb.js.map +0 -1
  87. package/dist/Features-Cpf1PDx0.js +0 -13
  88. package/dist/Features-Cpf1PDx0.js.map +0 -1
  89. package/dist/ImmunizationConfigurationBase-BqPTExSk.js +0 -5653
  90. package/dist/ImmunizationConfigurationBase-BqPTExSk.js.map +0 -1
  91. package/dist/ManageEventConfiguration-0YBDaxOI.js.map +0 -1
  92. package/dist/ManageRole-Cbs9dUhc.js.map +0 -1
  93. package/dist/MobileMenuManagement-BmrO-7MN.js.map +0 -1
  94. package/dist/NewServerManagement-5YcAtF-g.js.map +0 -1
  95. package/dist/NotificationList-CUZSWp2J.js.map +0 -1
  96. package/dist/QueryBuilder-DXexUIe8.js.map +0 -1
  97. package/dist/QueryManagement-DGHV_-d5.js.map +0 -1
  98. package/dist/RoleManagement-BThAL5LO.js.map +0 -1
  99. package/dist/SecurityAuditLogList-DHTcOtbx.js +0 -748
  100. package/dist/SecurityAuditLogList-DHTcOtbx.js.map +0 -1
  101. package/dist/ShowFlywayQuery-BkyA6QaA.js.map +0 -1
  102. package/dist/TableDetails-DztbjsIA.js.map +0 -1
  103. package/dist/TableList-DYwotUDO.js.map +0 -1
  104. package/dist/TypeConfiguration-DYbBG_hZ.js.map +0 -1
  105. package/dist/UserList-BAeAFeXZ.js.map +0 -1
  106. package/dist/index-BFznsakV.js.map +0 -1
@@ -1,748 +0,0 @@
1
- import { jsxs as A, jsx as t } from "react/jsx-runtime";
2
- import { useTranslateProvider as pe } from "@/common/languageTranslator/TranslationContext";
3
- import { showToast as R } from "@/common/toaster/toaster.jsx";
4
- import Se from "@/hooks/usePagination.js";
5
- import Te from "@/views/custom-components/CustomizedTable/CustomizedTableV2";
6
- import Ce from "@/views/custom-components/SideOverlay.jsx";
7
- import { useState as v, useEffect as ee, useMemo as ke, useCallback as Ie } from "react";
8
- import { useTheme as Ee, alpha as T, Box as _, Typography as E, TextField as F, Button as te, Tooltip as Re, IconButton as Oe, CircularProgress as ce, Dialog as Me, DialogTitle as $e, DialogContent as ze } from "@mui/material";
9
- import { FontAwesomeIcon as k } from "@fortawesome/react-fontawesome";
10
- import { faCalendar as Le, faSearch as Ue, faEye as Ye, faChartLine as Pe, faSync as Fe, faFilePdf as ue, faFileExcel as We } from "@fortawesome/free-solid-svg-icons";
11
- import { DateRange as Be } from "react-date-range";
12
- import "react-date-range/dist/styles.css";
13
- import "react-date-range/dist/theme/default.css";
14
- import { useTheme as je, alpha as Z } from "@mui/material/styles";
15
- import { execute as Ge } from "@/common/services/GlobalApis";
16
- import d from "@mui/material/Grid2";
17
- import { F as He } from "./FileSaver.min-CN9EpL2h.js";
18
- import Ve from "@/hooks/useTrackEvent";
19
- import { x as H } from "./xlsx.min-D1LFqt_b.js";
20
- import qe from "@/hooks/useDownloadPdf.js";
21
- import C from "dayjs";
22
- import w from "moment";
23
- function Je({
24
- filter: g,
25
- setFilter: s,
26
- handleOverlayState: O
27
- }) {
28
- const { translate: D } = pe(), n = Ee(), W = n.palette.mode === "dark", [x, M] = v(g), [B, I] = v(!1), [V, $] = v([
29
- {
30
- startDate: g.startTime ? new Date(g.startTime) : /* @__PURE__ */ new Date(),
31
- endDate: g.endTime ? new Date(g.endTime) : /* @__PURE__ */ new Date(),
32
- key: "selection"
33
- }
34
- ]);
35
- ee(() => {
36
- M(g), $([
37
- {
38
- startDate: g.startTime ? new Date(g.startTime) : /* @__PURE__ */ new Date(),
39
- endDate: g.endTime ? new Date(g.endTime) : /* @__PURE__ */ new Date(),
40
- key: "selection"
41
- }
42
- ]);
43
- }, [g]);
44
- const q = (o) => {
45
- const { selection: b } = o;
46
- $([b]);
47
- const L = b.startDate ? z(b.startDate) : null, U = b.endDate ? z(b.endDate) : null;
48
- M((Y) => ({
49
- ...Y,
50
- startTime: L,
51
- endTime: U
52
- }));
53
- }, z = (o) => {
54
- if (!o) return null;
55
- const b = new Date(o);
56
- return `${b.getFullYear()}-${String(b.getMonth() + 1).padStart(2, "0")}-${String(b.getDate()).padStart(2, "0")}`;
57
- }, j = () => {
58
- if (!x.startTime && !x.endTime) return "Select date range";
59
- const o = x.startTime ? new Date(x.startTime).toLocaleDateString() : "", b = x.endTime ? new Date(x.endTime).toLocaleDateString() : "";
60
- return `${o} - ${b}`;
61
- }, p = (o, b) => {
62
- M((L) => ({ ...L, [o]: b }));
63
- }, J = () => {
64
- s(x), O();
65
- }, h = {
66
- "& .MuiInputLabel-root": {
67
- color: n.palette.text.secondary,
68
- fontSize: "0.85rem",
69
- fontWeight: 500,
70
- transform: "translate(0, -1.5px) scale(1)",
71
- "&.Mui-focused": { color: n.palette.primary.main }
72
- },
73
- "& .MuiInputBase-root": {
74
- backgroundColor: T(n.palette.text.primary, 0.05),
75
- borderRadius: "12px",
76
- color: n.palette.text.primary,
77
- marginTop: "20px",
78
- "& fieldset": {
79
- borderColor: T(n.palette.text.primary, 0.1),
80
- borderRadius: "12px"
81
- },
82
- "&:hover fieldset": { borderColor: T(n.palette.text.primary, 0.3) },
83
- "&.Mui-focused fieldset": { borderColor: n.palette.primary.main, borderWidth: "2px" }
84
- },
85
- "& .MuiInputBase-input": {
86
- padding: "10px 14px",
87
- colorScheme: W ? "dark" : "light"
88
- }
89
- };
90
- return /* @__PURE__ */ A(_, { className: "flex flex-col gap-6 p-6", children: [
91
- /* @__PURE__ */ A(_, { className: "flex flex-col gap-1.5 pt-1", children: [
92
- /* @__PURE__ */ t(E, { variant: "caption", sx: { color: n.palette.text.secondary, fontWeight: 500, fontSize: "0.85rem", transform: "translate(0, -1.5px)" }, children: D("Date Range") }),
93
- /* @__PURE__ */ A(
94
- _,
95
- {
96
- onClick: () => I(!B),
97
- className: "flex items-center justify-between gap-2 px-3 py-2.5 rounded-xl cursor-pointer transition-all",
98
- sx: {
99
- backgroundColor: T(n.palette.text.primary, 0.05),
100
- border: `1px solid ${T(n.palette.text.primary, 0.1)}`,
101
- "&:hover": { borderColor: T(n.palette.text.primary, 0.3) }
102
- },
103
- children: [
104
- /* @__PURE__ */ t(E, { variant: "body2", sx: { color: n.palette.text.primary, fontSize: "0.875rem" }, children: j() }),
105
- /* @__PURE__ */ t(k, { icon: Le, className: "opacity-50 text-sm" })
106
- ]
107
- }
108
- ),
109
- B && /* @__PURE__ */ t(
110
- _,
111
- {
112
- className: "mt-2 p-2 rounded-xl flex justify-center overflow-hidden border",
113
- sx: {
114
- backgroundColor: n.palette.background.paper,
115
- borderColor: T(n.palette.text.primary, 0.1),
116
- "& .rdrCalendarWrapper": {
117
- backgroundColor: n.palette.background.paper,
118
- color: n.palette.text.primary
119
- },
120
- "& .rdrDateDisplayWrapper": {
121
- backgroundColor: T(n.palette.text.primary, 0.05)
122
- },
123
- "& .rdrMonthAndYearWrapper": {
124
- color: n.palette.text.primary
125
- },
126
- "& .rdrMonthName": {
127
- color: n.palette.text.primary
128
- },
129
- "& .rdrDayNumber span": {
130
- color: n.palette.text.primary
131
- },
132
- "& .rdrDayDisabled": {
133
- backgroundColor: "transparent",
134
- "& .rdrDayNumber span": {
135
- color: T(n.palette.text.primary, 0.25)
136
- }
137
- },
138
- "& .rdrDayPassive": {
139
- "& .rdrDayNumber span": {
140
- color: T(n.palette.text.primary, 0.3)
141
- }
142
- }
143
- },
144
- children: /* @__PURE__ */ t(
145
- Be,
146
- {
147
- editableDateInputs: !1,
148
- onChange: q,
149
- moveRangeOnFirstSelection: !1,
150
- ranges: V,
151
- rangeColors: [n.palette.primary.main]
152
- }
153
- )
154
- }
155
- )
156
- ] }),
157
- /* @__PURE__ */ A(_, { className: "flex flex-col gap-4 pt-2", children: [
158
- /* @__PURE__ */ t(
159
- F,
160
- {
161
- label: D("User ID"),
162
- placeholder: D("e.g. 101"),
163
- value: x.userId || "",
164
- onChange: (o) => p("userId", o.target.value),
165
- fullWidth: !0,
166
- size: "small",
167
- slotProps: { inputLabel: { shrink: !0 } },
168
- sx: h
169
- }
170
- ),
171
- /* @__PURE__ */ t(
172
- F,
173
- {
174
- label: D("IP Address"),
175
- placeholder: "192.168.1.1",
176
- value: x.ip || "",
177
- onChange: (o) => p("ip", o.target.value),
178
- fullWidth: !0,
179
- size: "small",
180
- slotProps: { inputLabel: { shrink: !0 } },
181
- sx: h
182
- }
183
- ),
184
- /* @__PURE__ */ t(
185
- F,
186
- {
187
- label: D("Session ID"),
188
- placeholder: D("e.g. E561890..."),
189
- value: x.sessionId || "",
190
- onChange: (o) => p("sessionId", o.target.value),
191
- fullWidth: !0,
192
- size: "small",
193
- slotProps: { inputLabel: { shrink: !0 } },
194
- sx: h
195
- }
196
- ),
197
- /* @__PURE__ */ t(
198
- F,
199
- {
200
- label: D("Event Type"),
201
- placeholder: "LOGIN_SUCCESS",
202
- value: x.eventType || "",
203
- onChange: (o) => p("eventType", o.target.value),
204
- fullWidth: !0,
205
- size: "small",
206
- slotProps: { inputLabel: { shrink: !0 } },
207
- sx: h
208
- }
209
- ),
210
- /* @__PURE__ */ t(
211
- F,
212
- {
213
- label: D("Resource Path"),
214
- placeholder: "/api/v1/...",
215
- value: x.resource || "",
216
- onChange: (o) => p("resource", o.target.value),
217
- fullWidth: !0,
218
- size: "small",
219
- slotProps: { inputLabel: { shrink: !0 } },
220
- sx: h
221
- }
222
- )
223
- ] }),
224
- /* @__PURE__ */ t(_, { className: "flex justify-stretch mt-4", children: /* @__PURE__ */ t(
225
- te,
226
- {
227
- variant: "contained",
228
- onClick: J,
229
- fullWidth: !0,
230
- startIcon: /* @__PURE__ */ t(k, { icon: Ue }),
231
- sx: {
232
- backgroundColor: n.palette.primary.main,
233
- height: "45px",
234
- borderRadius: "12px",
235
- fontWeight: "bold",
236
- textTransform: "uppercase",
237
- letterSpacing: "1px",
238
- "&:hover": { backgroundColor: n.palette.primary.dark }
239
- },
240
- children: D("Apply Filters")
241
- }
242
- ) })
243
- ] });
244
- }
245
- function yt() {
246
- const g = (e) => {
247
- if (!e) return "N/A";
248
- const l = w(), i = w(e), a = w.duration(l.diff(i)), c = a.years(), r = a.months(), y = a.days(), m = a.hours(), u = a.minutes(), S = a.seconds();
249
- if (c > 0) return `${c} year${c > 1 ? "s" : ""} ago`;
250
- if (r > 0) return `${r} month${r > 1 ? "s" : ""} ago`;
251
- if (y > 0) return `${y} day${y > 1 ? "s" : ""} ago`;
252
- let N = [];
253
- return m > 0 && N.push(`${m} hour${m > 1 ? "s" : ""}`), u > 0 && N.push(`${u} minute${u > 1 ? "s" : ""}`), S > 0 && m === 0 && N.push(`${S} second${S > 1 ? "s" : ""}`), N.length === 0 ? "Just now" : N.join(" ") + " ago";
254
- };
255
- Ve();
256
- const s = je(), O = s.palette.mode === "dark", [D, n] = v(!1), [W, x] = v(""), [M, B] = v(""), [I, V] = v([]), [$, q] = v(!0), [z, j] = v(!1), [p, J] = v({
257
- sortColumn: "timestamp",
258
- sortOrder: "desc"
259
- }), [h, o] = v({
260
- startTime: null,
261
- endTime: null,
262
- userId: null,
263
- username: null,
264
- ip: null,
265
- sessionId: null,
266
- eventType: null,
267
- resource: null
268
- }), b = 50, { translate: L } = pe(), [U, Y] = v(!1), [me, K] = v(!1), [re, he] = v(null);
269
- ee(() => {
270
- const e = setTimeout(() => {
271
- B(W);
272
- }, 1e3);
273
- return () => clearTimeout(e);
274
- }, [W]);
275
- const be = ke(
276
- () => [
277
- { field: "Sr. No.", label: "#", align: "left" },
278
- {
279
- field: "timestamp",
280
- label: "Time".toUpperCase(),
281
- sortable: !0,
282
- sortOrder: p.sortColumn === "timestamp" ? p.sortOrder : "asc",
283
- align: "left",
284
- render: (e) => /* @__PURE__ */ t(Re, { title: g(e == null ? void 0 : e.timestamp), arrow: !0, placement: "top", children: /* @__PURE__ */ t(_, { className: "flex items-center h-full cursor-pointer", children: C(e == null ? void 0 : e.timestamp).format("DD/MM/YYYY hh:mm:ss A") }) })
285
- },
286
- {
287
- field: "session_id",
288
- label: "Session ID".toUpperCase(),
289
- align: "left",
290
- render: (e) => /* @__PURE__ */ t(E, { variant: "caption", className: "font-mono opacity-70", children: (e == null ? void 0 : e.session_id) || "N/A" })
291
- },
292
- {
293
- field: "user_id",
294
- label: "User ID".toUpperCase(),
295
- sortable: !0,
296
- sortOrder: p.sortColumn === "user_id" ? p.sortOrder : "asc",
297
- align: "left",
298
- render: (e) => /* @__PURE__ */ t(E, { variant: "body2", className: "font-bold", sx: { color: s.palette.text.primary }, children: (e == null ? void 0 : e.user_id) || "System" })
299
- },
300
- {
301
- field: "resource",
302
- label: "Resource".toUpperCase(),
303
- sortable: !0,
304
- sortOrder: p.sortColumn === "resource" ? p.sortOrder : "asc",
305
- align: "left",
306
- render: (e) => /* @__PURE__ */ t(_, { className: "max-w-xs truncate font-mono text-[0.7rem] opacity-80", title: e == null ? void 0 : e.resource, children: (e == null ? void 0 : e.resource) || "N/A" })
307
- },
308
- {
309
- field: "Actions",
310
- label: "View Details".toUpperCase(),
311
- align: "center"
312
- }
313
- ],
314
- [p]
315
- ), fe = Ie(
316
- (e) => [
317
- {
318
- label: "",
319
- icon: /* @__PURE__ */ t(k, { icon: Ye, size: "lg", title: "View Event Details" }),
320
- onClick: () => {
321
- he(e), K(!0);
322
- },
323
- iconColor: s.palette.primary.main,
324
- backgroundColor: Z(s.palette.primary.main, 0.1),
325
- hoverBackgroundColor: s.palette.primary.main,
326
- hoverIconColor: "white",
327
- borderColor: s.palette.primary.main
328
- },
329
- {
330
- label: "Trace Detailed Session Logs",
331
- icon: /* @__PURE__ */ t(k, { icon: Pe, size: "lg", title: "Filter Activity Analytics by this Session ID" }),
332
- onClick: () => {
333
- if (e.session_id) {
334
- const l = window.location.origin + window.location.pathname.split("/medplat/")[0];
335
- let i = {};
336
- try {
337
- e.attributes && (i = JSON.parse(e.attributes));
338
- } catch {
339
- }
340
- e.user_id && (i.user_id = e.user_id);
341
- const a = `&attributes=${encodeURIComponent(JSON.stringify(i))}`, c = `${l}/medplat/manage/activityAnalytics?sessionId=${e.session_id}${a}`;
342
- window.open(c, "_blank");
343
- } else
344
- R({ message: "No Session ID available for this log", type: "warning" });
345
- },
346
- iconColor: s.palette.secondary.main,
347
- backgroundColor: Z(s.palette.secondary.main, 0.1),
348
- hoverBackgroundColor: s.palette.secondary.main,
349
- hoverIconColor: "white",
350
- borderColor: s.palette.secondary.main
351
- }
352
- ],
353
- [s]
354
- ), ye = async (e) => {
355
- const l = p.sortColumn === e.field && p.sortOrder === "asc" ? "desc" : "asc";
356
- J({ sortColumn: e.field, sortOrder: l });
357
- }, ae = () => {
358
- j(!z);
359
- }, ve = () => {
360
- o({
361
- startTime: null,
362
- endTime: null,
363
- userId: null,
364
- username: null,
365
- ip: null,
366
- sessionId: null,
367
- eventType: null,
368
- resource: null
369
- }), x(""), j(!1);
370
- };
371
- async function xe(e, l) {
372
- var i;
373
- try {
374
- l && Y(!0);
375
- const a = {
376
- limit: e.limit,
377
- offset: e.offset,
378
- userId: h.userId || null,
379
- ip: h.ip || null,
380
- sessionId: h.sessionId || null,
381
- eventType: h.eventType || null,
382
- resource: h.resource || null,
383
- startTime: h.startTime ? C(h.startTime).startOf("day").valueOf() : null,
384
- endTime: h.endTime ? C(h.endTime).endOf("day").valueOf() : null,
385
- sortBy: p.sortColumn,
386
- sortOrder: p.sortOrder
387
- }, c = await Ge(
388
- {
389
- code: "GET_SECURITY_AUDIT_LOGS",
390
- parameters: a
391
- },
392
- { showLoader: !1 }
393
- ), y = (((i = c == null ? void 0 : c.data) == null ? void 0 : i.result) || []).map((m) => {
394
- let u = null;
395
- if (m.attributes)
396
- try {
397
- u = JSON.parse(m.attributes);
398
- } catch {
399
- }
400
- return { ...m, parsedAttributes: u };
401
- });
402
- return l && Y(!1), y;
403
- } catch (a) {
404
- return R({ message: `Error fetching logs: ${a.message}`, type: "error" }), Y(!1), [];
405
- }
406
- }
407
- const {
408
- data: G,
409
- fetchNextPage: Ae,
410
- hasNextPage: se
411
- } = Se({
412
- key: [
413
- "security_audit_logs",
414
- M,
415
- p.sortOrder,
416
- p.sortColumn,
417
- h,
418
- D
419
- ],
420
- queryFn: ({ pageParam: e }) => {
421
- const l = !(e != null && e.offset) || (e == null ? void 0 : e.offset) === 0;
422
- return xe(e, l);
423
- },
424
- limit: b
425
- });
426
- ee(() => {
427
- var l;
428
- const e = ((l = G == null ? void 0 : G.pages) == null ? void 0 : l.flat()) || [];
429
- q(e.length > 0 ? se : !1), V(e);
430
- }, [G, se]);
431
- const [ne, Q] = v(!1), ge = async () => {
432
- try {
433
- let e = function(r) {
434
- const y = new ArrayBuffer(r.length), m = new Uint8Array(y);
435
- for (let u = 0; u !== r.length; ++u) m[u] = r.charCodeAt(u) & 255;
436
- return y;
437
- };
438
- if (I.length === 0) {
439
- R({ message: "No data to export", type: "warning" });
440
- return;
441
- }
442
- Q(!0);
443
- const l = [
444
- ["SECURITY AUDIT LOGS REPORT"],
445
- [`Server Instance: ${window.location.hostname || "NA"}`],
446
- [],
447
- // blank spacer row
448
- // Table Headers
449
- [
450
- "No.",
451
- "TIME",
452
- "EVENT CATEGORY",
453
- "EVENT TYPE",
454
- "SEVERITY",
455
- "USER ID",
456
- "USERNAME",
457
- "NAME",
458
- "ROLE ID",
459
- "IP ADDRESS",
460
- "SESSION ID",
461
- "HTTP METHOD",
462
- "RESOURCE",
463
- "RESPONSE CODE",
464
- "USER AGENT"
465
- ]
466
- ];
467
- I.forEach((r, y) => {
468
- var m, u, S, N, P;
469
- l.push([
470
- y + 1,
471
- C(r == null ? void 0 : r.timestamp).format("DD/MM/YYYY hh:mm:ss A"),
472
- (r == null ? void 0 : r.event_category) || "NA",
473
- (r == null ? void 0 : r.event_type) || "NA",
474
- (r == null ? void 0 : r.severity) || "NA",
475
- (r == null ? void 0 : r.user_id) || "NA",
476
- ((m = r == null ? void 0 : r.parsedAttributes) == null ? void 0 : m.user_name) || "NA",
477
- ((u = r == null ? void 0 : r.parsedAttributes) == null ? void 0 : u.name) || "NA",
478
- ((S = r == null ? void 0 : r.parsedAttributes) == null ? void 0 : S.role_id) || "NA",
479
- ((N = r == null ? void 0 : r.parsedAttributes) == null ? void 0 : N.ip) || (r == null ? void 0 : r.ip_address) || "NA",
480
- (r == null ? void 0 : r.session_id) || "NA",
481
- (r == null ? void 0 : r.http_method) || "NA",
482
- (r == null ? void 0 : r.resource) || "NA",
483
- (r == null ? void 0 : r.response_code) || "NA",
484
- ((P = r == null ? void 0 : r.parsedAttributes) == null ? void 0 : P.user_agent) || (r == null ? void 0 : r.user_agent) || "NA"
485
- ]);
486
- });
487
- const i = H.utils.aoa_to_sheet(l), a = H.utils.book_new();
488
- H.utils.book_append_sheet(a, i, "Logs");
489
- const c = H.write(a, { bookType: "xlsx", type: "binary" });
490
- He.saveAs(new Blob([e(c)], { type: "application/octet-stream" }), `SecurityAuditLogs-${(/* @__PURE__ */ new Date()).getTime()}.xlsx`), Q(!1);
491
- } catch {
492
- Q(!1), R({ message: "Error in downloading excel", type: "error" });
493
- }
494
- }, le = qe(), [ie, X] = v(!1), De = async () => {
495
- try {
496
- if (I.length === 0) {
497
- R({ message: "No data to export", type: "warning" });
498
- return;
499
- }
500
- X(!0);
501
- const e = ["TIME", "CATEGORY", "TYPE", "USER ID", "USERNAME", "IP", "STATUS", "METHOD", "URI"], l = ["timeStr", "event_category", "event_type", "user_id", "username", "ip_address", "response_code", "http_method", "request_uri"], i = I.map((a) => {
502
- var c, r;
503
- return {
504
- timeStr: C(a.timestamp).format("DD/MM/YYYY hh:mm:ss A"),
505
- event_category: a.event_category || "NA",
506
- event_type: a.event_type || "NA",
507
- user_id: a.user_id || "NA",
508
- username: ((c = a.parsedAttributes) == null ? void 0 : c.user_name) || "NA",
509
- ip_address: ((r = a.parsedAttributes) == null ? void 0 : r.ip) || a.ip_address || "NA",
510
- response_code: a.response_code || "NA",
511
- http_method: a.http_method || "NA",
512
- request_uri: a.resource || "NA"
513
- };
514
- });
515
- le({
516
- title: [
517
- "SECURITY AUDIT LOGS REPORT",
518
- `Server Instance: ${window.location.hostname || "NA"}`
519
- ],
520
- columns: e,
521
- keys: l,
522
- data: i,
523
- fileName: `AuditLogs-${(/* @__PURE__ */ new Date()).getTime()}`,
524
- headerText: "Security Audit Logs",
525
- footerText: "Audit Log Report",
526
- orientation: "landscape"
527
- }), X(!1);
528
- } catch (e) {
529
- X(!1), console.error(e), R({ message: "Error in downloading pdf", type: "error" });
530
- }
531
- }, Ne = (e) => {
532
- var i, a, c, r, y, m, u;
533
- if (!e) return;
534
- const l = [
535
- { label: "User ID", value: String(e.user_id || "N/A") },
536
- { label: "Username", value: String(((i = e.parsedAttributes) == null ? void 0 : i.user_name) || "N/A") },
537
- { label: "Name", value: String(((a = e.parsedAttributes) == null ? void 0 : a.name) || "N/A") },
538
- { label: "Role ID", value: String(((c = e.parsedAttributes) == null ? void 0 : c.role_id) || "N/A") },
539
- { label: "Role Name", value: String(((r = e.parsedAttributes) == null ? void 0 : r.role_name) || "N/A") },
540
- { label: "Role Code", value: String(((y = e.parsedAttributes) == null ? void 0 : y.role_code) || "N/A") },
541
- { label: "Event Timestamp", value: C(e.timestamp).format("DD/MM/YYYY hh:mm:ss A") },
542
- { label: "Event Category", value: String(e.event_category || "N/A") },
543
- { label: "Event Type", value: String(e.event_type || "N/A") },
544
- { label: "Severity", value: String(e.severity || "N/A") },
545
- { label: "IP Address", value: String(((m = e.parsedAttributes) == null ? void 0 : m.ip) || e.ip_address || "N/A") },
546
- { label: "Session ID", value: String(e.session_id || "N/A") },
547
- { label: "HTTP Method", value: String(e.http_method || "N/A") },
548
- { label: "Request URI", value: String(e.resource || "N/A") },
549
- { label: "Response Code", value: String(e.response_code || "N/A") },
550
- { label: "Server Instance", value: String(window.location.hostname || "N/A") },
551
- { label: "User Agent", value: String(((u = e.parsedAttributes) == null ? void 0 : u.user_agent) || e.user_agent || "N/A") }
552
- ];
553
- le({
554
- columns: ["Field", "Value"],
555
- keys: ["label", "value"],
556
- data: l,
557
- fileName: `AuditLog_Detail_${e.id || (/* @__PURE__ */ new Date()).getTime()}`,
558
- headerText: `Security Audit Log - Entry #${e.id || ""}`,
559
- footerText: `Generated on ${(/* @__PURE__ */ new Date()).toLocaleString()}`,
560
- orientation: "portrait"
561
- });
562
- }, _e = (e) => {
563
- var l, i, a, c, r, y, m, u, S, N, P, oe, de;
564
- return e ? (C(e.timestamp).format("DD/MM/YYYY hh:mm:ss A"), e.event_category, e.event_type, e.severity, e.user_id, (l = e.parsedAttributes) == null || l.user_name, (i = e.parsedAttributes) == null || i.name, (a = e.parsedAttributes) == null || a.role_id, (c = e.parsedAttributes) == null || c.role_name, (r = e.parsedAttributes) == null || r.role_code, (y = e.parsedAttributes) != null && y.ip || e.ip_address, e.session_id, e.http_method, e.resource, e.response_code, /* @__PURE__ */ A(d, { container: !0, spacing: 2, children: [
565
- /* @__PURE__ */ t(d, { size: 6, children: /* @__PURE__ */ t(f, { label: "Event Category", value: e.event_category }) }),
566
- /* @__PURE__ */ t(d, { size: 6, children: /* @__PURE__ */ t(f, { label: "Event Type", value: e.event_type }) }),
567
- /* @__PURE__ */ t(d, { size: 6, children: /* @__PURE__ */ t(f, { label: "User ID", value: e.user_id }) }),
568
- /* @__PURE__ */ t(d, { size: 6, children: /* @__PURE__ */ t(f, { label: "Username", value: ((m = e.parsedAttributes) == null ? void 0 : m.user_name) || "N/A" }) }),
569
- /* @__PURE__ */ t(d, { size: 6, children: /* @__PURE__ */ t(f, { label: "Name", value: ((u = e.parsedAttributes) == null ? void 0 : u.name) || "N/A" }) }),
570
- /* @__PURE__ */ t(d, { size: 6, children: /* @__PURE__ */ t(f, { label: "Role ID", value: ((S = e.parsedAttributes) == null ? void 0 : S.role_id) || "N/A" }) }),
571
- /* @__PURE__ */ t(d, { size: 6, children: /* @__PURE__ */ t(f, { label: "Role Name", value: ((N = e.parsedAttributes) == null ? void 0 : N.role_name) || "N/A" }) }),
572
- /* @__PURE__ */ t(d, { size: 6, children: /* @__PURE__ */ t(f, { label: "Role Code", value: ((P = e.parsedAttributes) == null ? void 0 : P.role_code) || "N/A" }) }),
573
- /* @__PURE__ */ t(d, { size: 6, children: /* @__PURE__ */ t(f, { label: "HTTP Method", value: e.http_method }) }),
574
- /* @__PURE__ */ t(d, { size: 6, children: /* @__PURE__ */ t(f, { label: "Resource", value: e.resource }) }),
575
- /* @__PURE__ */ t(d, { size: 6, children: /* @__PURE__ */ t(f, { label: "Response Code", value: e.response_code }) }),
576
- /* @__PURE__ */ t(d, { size: 6, children: /* @__PURE__ */ t(f, { label: "Severity", value: e.severity }) }),
577
- /* @__PURE__ */ t(d, { size: 6, children: /* @__PURE__ */ t(f, { label: "IP Address", value: ((oe = e.parsedAttributes) == null ? void 0 : oe.ip) || e.ip_address || "N/A" }) }),
578
- /* @__PURE__ */ t(d, { size: 6, children: /* @__PURE__ */ t(f, { label: "Timestamp", value: C(e.timestamp).format("DD/MM/YYYY hh:mm:ss A") }) }),
579
- /* @__PURE__ */ t(d, { size: 12, children: /* @__PURE__ */ t(f, { label: "Session ID", value: e.session_id || "N/A" }) }),
580
- /* @__PURE__ */ t(d, { size: 12, children: /* @__PURE__ */ t(f, { label: "User Agent", value: ((de = e.parsedAttributes) == null ? void 0 : de.user_agent) || e.user_agent || "N/A" }) })
581
- ] })) : null;
582
- }, f = ({ label: e, value: l, isCode: i }) => /* @__PURE__ */ A(_, { sx: { mb: 1, borderBottom: `1px solid ${s.palette.divider}`, pb: 0.5 }, children: [
583
- /* @__PURE__ */ t(E, { variant: "caption", sx: { color: s.palette.text.secondary, textTransform: "uppercase", fontWeight: "bold", fontSize: "0.65rem" }, children: e }),
584
- /* @__PURE__ */ t(
585
- E,
586
- {
587
- variant: "body2",
588
- sx: {
589
- color: s.palette.text.primary,
590
- wordBreak: "break-word",
591
- whiteSpace: i ? "pre-wrap" : "normal",
592
- fontFamily: i ? "monospace" : "inherit",
593
- fontSize: i ? "0.75rem" : "0.875rem"
594
- },
595
- children: String(l || "N/A")
596
- }
597
- )
598
- ] });
599
- return /* @__PURE__ */ A(d, { className: "w-[98%] mt-4", children: [
600
- /* @__PURE__ */ A(
601
- d,
602
- {
603
- container: !0,
604
- spacing: 2,
605
- className: "mb-4 justify-between items-center",
606
- children: [
607
- /* @__PURE__ */ t(d, { size: { xs: 12, md: 4 }, children: /* @__PURE__ */ t(
608
- E,
609
- {
610
- variant: "h6",
611
- sx: { fontWeight: "bold", color: s.palette.primary.main, textTransform: "uppercase" },
612
- children: L("Security Audit Logs")
613
- }
614
- ) }),
615
- /* @__PURE__ */ A(d, { size: { xs: 12, md: 8 }, className: "flex flex-col md:flex-row gap-3 justify-end items-center", children: [
616
- /* @__PURE__ */ t("div", { className: "flex items-center gap-3 w-full md:w-auto", children: /* @__PURE__ */ t(
617
- Oe,
618
- {
619
- color: "primary",
620
- onClick: () => n((e) => !e),
621
- className: "rounded-xl border border-slate-200 dark:border-slate-800 shadow-sm",
622
- sx: {
623
- backgroundColor: Z(s.palette.primary.main, 0.1),
624
- width: 40,
625
- height: 40,
626
- "&:hover": { backgroundColor: s.palette.primary.main, color: "white" }
627
- },
628
- children: /* @__PURE__ */ t(k, { icon: Fe, className: "text-sm" })
629
- }
630
- ) }),
631
- /* @__PURE__ */ t("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ A("div", { className: `flex items-center rounded-2xl p-1 shadow-sm transition-all border ${O ? "bg-slate-900 border-slate-800" : "bg-white border-slate-200"}`, children: [
632
- /* @__PURE__ */ A(
633
- "button",
634
- {
635
- disabled: ie || U,
636
- onClick: De,
637
- className: `px-4 py-2 rounded-xl transition-all flex items-center gap-2 text-xs font-black uppercase tracking-wider ${O ? "text-slate-400 hover:text-slate-100 hover:bg-slate-800" : "text-slate-600 hover:text-red-600 hover:bg-slate-50"}`,
638
- children: [
639
- ie ? /* @__PURE__ */ t(ce, { size: 14, sx: { color: "inherit" } }) : /* @__PURE__ */ t(k, { icon: ue }),
640
- "Pdf"
641
- ]
642
- }
643
- ),
644
- /* @__PURE__ */ A(
645
- "button",
646
- {
647
- disabled: ne || U,
648
- onClick: ge,
649
- className: `px-4 py-2 rounded-xl transition-all flex items-center gap-2 text-xs font-black uppercase tracking-wider ml-1 ${O ? "bg-slate-800 text-slate-100 hover:bg-slate-700" : "bg-[#243A50] text-white hover:bg-[#1a2b3c]"}`,
650
- children: [
651
- ne ? /* @__PURE__ */ t(ce, { size: 14, sx: { color: "inherit" } }) : /* @__PURE__ */ t(k, { icon: We }),
652
- "Excel Data"
653
- ]
654
- }
655
- )
656
- ] }) })
657
- ] })
658
- ]
659
- }
660
- ),
661
- /* @__PURE__ */ t(
662
- Te,
663
- {
664
- columns: be,
665
- tableData: I,
666
- actions: fe,
667
- paginationConfig: {
668
- pagination: !0,
669
- paginationType: "infinite-scroll",
670
- rowsPerPageInTable: b,
671
- hasMore: $,
672
- loadMore: () => $ && Ae({ cancelRefetch: !1 })
673
- },
674
- isLoading: U,
675
- handleSort: ye
676
- }
677
- ),
678
- /* @__PURE__ */ t(
679
- Ce,
680
- {
681
- title: "Audit Filter",
682
- resetButtonLabel: "Reset",
683
- onResetClick: ve,
684
- FormBody: Je,
685
- handleOverlayState: ae,
686
- overlayOpen: z,
687
- dataTestId: "security-audit-log-filter",
688
- ModalProps: {
689
- sx: {
690
- "& .MuiDrawer-paper": {
691
- backgroundColor: s.palette.background.paper,
692
- color: s.palette.text.primary,
693
- "& .p-2\\.5": {
694
- backgroundColor: s.palette.background.paper,
695
- borderBottom: `1px solid ${s.palette.divider}`,
696
- color: s.palette.primary.main,
697
- fontWeight: "bold",
698
- letterSpacing: "1px"
699
- }
700
- }
701
- }
702
- },
703
- formProps: {
704
- filter: h,
705
- setFilter: o,
706
- handleOverlayState: ae
707
- }
708
- }
709
- ),
710
- /* @__PURE__ */ A(
711
- Me,
712
- {
713
- open: me,
714
- onClose: () => K(!1),
715
- maxWidth: "sm",
716
- fullWidth: !0,
717
- PaperProps: {
718
- sx: {
719
- backgroundColor: s.palette.background.paper,
720
- color: s.palette.text.primary
721
- }
722
- },
723
- children: [
724
- /* @__PURE__ */ t($e, { sx: { borderBottom: `1px solid ${s.palette.divider}`, fontWeight: "bold", color: s.palette.primary.main }, children: "Log Entry Details" }),
725
- /* @__PURE__ */ t(ze, { dividers: !0, sx: { borderColor: s.palette.divider }, children: /* @__PURE__ */ t(_, { className: "p-2", children: _e(re) }) }),
726
- /* @__PURE__ */ A(_, { sx: { p: 2, display: "flex", justifyContent: "flex-end", gap: 2 }, children: [
727
- /* @__PURE__ */ t(
728
- te,
729
- {
730
- onClick: () => Ne(re),
731
- variant: "outlined",
732
- color: "primary",
733
- startIcon: /* @__PURE__ */ t(k, { icon: ue }),
734
- sx: { borderRadius: "12px" },
735
- children: "Download PDF"
736
- }
737
- ),
738
- /* @__PURE__ */ t(te, { onClick: () => K(!1), variant: "contained", color: "primary", sx: { borderRadius: "12px" }, children: "Close" })
739
- ] })
740
- ]
741
- }
742
- )
743
- ] });
744
- }
745
- export {
746
- yt as default
747
- };
748
- //# sourceMappingURL=SecurityAuditLogList-DHTcOtbx.js.map