@feedmepos/mf-hrm-portal 2.0.17-dev.5 → 2.0.17
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/AuditLogList-DwCmJovS.js +980 -0
- package/dist/EmployeeList-8166DlII.js +736 -0
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-BVb8c4YU.js +71 -0
- package/dist/HorizontalSplitter-o860F4xM.js +12 -0
- package/dist/{Main-w0XUUaBp.js → Main-C4LaqZaa.js} +14 -16
- package/dist/{Main-pTgqNncY.js → Main-C7Q3OELU.js} +128 -128
- package/dist/{Main-CQ3KwxDY.js → Main-CCTDT_TG.js} +1371 -1368
- package/dist/PermissionSetList-trnHwNFR.js +341 -0
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Bc5nE9NF.js +3480 -0
- package/dist/RoleList-DJtbEUSC.js +530 -0
- package/dist/TeamMemberList-C6qx-yJi.js +1108 -0
- package/dist/{TimesheetList-Bwp9_xHe.js → TimesheetList-DhKfguOb.js} +6 -6
- package/dist/{app-COJbSNM4.js → app--3WguZOC.js} +711 -759
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-CcBi6N-K.js → dayjs.min-RrLy0N6G.js} +1 -1
- package/dist/{employee-xiV0LfnL.js → employee-DSAStcBv.js} +3 -3
- package/dist/{iteration-JOKbtlLf.js → iteration-BQA73VxD.js} +2 -2
- package/dist/{lodash-D5xlVzib.js → lodash-B1ouSWpG.js} +1 -1
- package/dist/{rule-3sXHiW0y.js → rule-BL-miuus.js} +181 -179
- package/dist/src/api/audit-log/index.d.ts +0 -9
- package/dist/src/components/CheckboxInput.vue.d.ts +1 -1
- package/dist/src/components/CollapsibleWrapper.vue.d.ts +0 -2
- package/dist/src/composables/useBasePermission.d.ts +0 -1
- package/dist/src/stores/team.d.ts +6 -6
- package/dist/src/types/team.d.ts +1 -1
- package/dist/src/views/hr/locales/index.d.ts +0 -16
- package/dist/src/views/team/components/BasePermission.vue.d.ts +7 -3
- package/dist/src/views/team/components/PosRolePermission.vue.d.ts +2 -2
- package/dist/src/views/team/locales/index.d.ts +0 -32
- package/dist/src/views/team/member/AddMemberForm.vue.d.ts +3 -5
- package/dist/style.css +1 -1
- package/dist/{timesheet-DkD3AysG.js → timesheet-BbtAYZ1B.js} +2 -2
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-CvmsaYSG.js → useAppStore-BHWapSDk.js} +1 -1
- package/dist/useDebounce-B8ZPVS5C.js +15 -0
- package/dist/useDiscardConfirm-BHni0LNu.js +28 -0
- package/dist/{useLoading-4TNmhm5N.js → useLoading-D7PklYeR.js} +1 -1
- package/dist/{useReportPermissions-CWMFFb8E.js → useReportPermissions-CNcISy8f.js} +3 -3
- package/dist/useSearch-B6WK1LBB.js +15 -0
- package/package.json +1 -1
- package/dist/AuditLogList-Dl3Nmf00.js +0 -1011
- package/dist/CollapsibleWrapper.vue_vue_type_script_setup_true_lang-BLJlmPVa.js +0 -58
- package/dist/EmployeeList-DBd_rVW2.js +0 -831
- package/dist/FormItem.vue_vue_type_script_setup_true_lang-CoorkndT.js +0 -34
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +0 -49
- package/dist/PermissionSetList-B8qNOWH6.js +0 -347
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-C9VUjAu_.js +0 -3443
- package/dist/RoleList-DMFJsUZv.js +0 -545
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-B4PxNMwq.js +0 -16
- package/dist/TeamMemberList-BLRTfKLz.js +0 -1031
- package/dist/src/components/Skeleton.vue.d.ts +0 -7
- package/dist/team-CyNektSD.js +0 -33
- package/dist/useDiscardConfirm-DPhEV6v0.js +0 -157
- package/dist/useSearch-BAPEUu1R.js +0 -15
|
@@ -1,1011 +0,0 @@
|
|
|
1
|
-
import { defineComponent as Ye, ref as b, computed as M, onMounted as _t, onBeforeUnmount as xt, watch as ce, resolveComponent as E, createElementBlock as x, openBlock as c, createBlock as Z, createCommentVNode as A, createElementVNode as a, Fragment as ee, renderList as ne, withCtx as K, createVNode as v, toDisplayString as n, unref as u, nextTick as Lt } from "vue";
|
|
2
|
-
import { d as _ } from "./dayjs.min-CcBi6N-K.js";
|
|
3
|
-
import { useI18n as Be, useCoreStore as St } from "@feedmepos/mf-common";
|
|
4
|
-
import { f as Ce, _ as kt } from "./app-COJbSNM4.js";
|
|
5
|
-
import { components as Re } from "@feedmepos/ui-library";
|
|
6
|
-
import { g as Ae, b as Ee } from "./iteration-JOKbtlLf.js";
|
|
7
|
-
import { S as de, _ as wt } from "./SelectFilter-DUj7GBtT.js";
|
|
8
|
-
import { _ as Mt } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
|
|
9
|
-
import { _ as Ft } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
|
|
10
|
-
import { p as Ue } from "./rule-3sXHiW0y.js";
|
|
11
|
-
import { u as Dt } from "./team-CyNektSD.js";
|
|
12
|
-
const ye = [
|
|
13
|
-
{ key: "all", label: "All", subjectPrefixes: [] },
|
|
14
|
-
{ key: "inventory", label: "Inventory", subjectPrefixes: ["business::inventory", "inventory"] },
|
|
15
|
-
{ key: "report", label: "Report", subjectPrefixes: ["business::report", "report"] },
|
|
16
|
-
{ key: "hrm", label: "HRM", subjectPrefixes: ["business::hrm", "hrm"] },
|
|
17
|
-
{ key: "payment", label: "Payment", subjectPrefixes: ["business::payment", "payment"] },
|
|
18
|
-
{ key: "menu", label: "Menu", subjectPrefixes: ["business::menu", "menu"] },
|
|
19
|
-
{ key: "crm", label: "CRM", subjectPrefixes: ["business::crm", "crm"] }
|
|
20
|
-
// Add more as modules are revamped with new actionguard:
|
|
21
|
-
// { key: 'restaurantOperation', label: 'Restaurant Operation', subjectPrefixes: ['restaurant'] },
|
|
22
|
-
], $e = "/audit-logs", _e = {
|
|
23
|
-
async count(o) {
|
|
24
|
-
var I, j, F, L, s;
|
|
25
|
-
const l = {
|
|
26
|
-
...o != null && o.from ? { from: o.from } : {},
|
|
27
|
-
...o != null && o.to ? { to: o.to } : {},
|
|
28
|
-
...(I = o == null ? void 0 : o.userIds) != null && I.length ? { userIds: o.userIds } : {},
|
|
29
|
-
...(j = o == null ? void 0 : o.subjects) != null && j.length ? { subjects: o.subjects } : {},
|
|
30
|
-
...(F = o == null ? void 0 : o.subjectPrefixes) != null && F.length ? { subjectPrefixes: o.subjectPrefixes } : {},
|
|
31
|
-
...(L = o == null ? void 0 : o.actions) != null && L.length ? { actions: o.actions } : {},
|
|
32
|
-
...(s = o == null ? void 0 : o.outcomes) != null && s.length ? { outcomes: o.outcomes } : {}
|
|
33
|
-
};
|
|
34
|
-
return (await Ae(
|
|
35
|
-
await Ee().get(`${$e}/count`, {
|
|
36
|
-
params: l,
|
|
37
|
-
paramsSerializer: (O) => {
|
|
38
|
-
const C = new URLSearchParams();
|
|
39
|
-
for (const [g, S] of Object.entries(O))
|
|
40
|
-
if (Array.isArray(S))
|
|
41
|
-
for (const Y of S) C.append(g, String(Y));
|
|
42
|
-
else S != null && C.append(g, String(S));
|
|
43
|
-
return C.toString();
|
|
44
|
-
}
|
|
45
|
-
})
|
|
46
|
-
)).total;
|
|
47
|
-
},
|
|
48
|
-
async read(o) {
|
|
49
|
-
var p, I, j, F, L;
|
|
50
|
-
const l = {
|
|
51
|
-
limit: (o == null ? void 0 : o.limit) ?? 100,
|
|
52
|
-
offset: (o == null ? void 0 : o.offset) ?? 0,
|
|
53
|
-
...o != null && o.from ? { from: o.from } : {},
|
|
54
|
-
...o != null && o.to ? { to: o.to } : {},
|
|
55
|
-
...(p = o == null ? void 0 : o.userIds) != null && p.length ? { userIds: o.userIds } : {},
|
|
56
|
-
...(I = o == null ? void 0 : o.subjects) != null && I.length ? { subjects: o.subjects } : {},
|
|
57
|
-
...(j = o == null ? void 0 : o.subjectPrefixes) != null && j.length ? { subjectPrefixes: o.subjectPrefixes } : {},
|
|
58
|
-
...(F = o == null ? void 0 : o.actions) != null && F.length ? { actions: o.actions } : {},
|
|
59
|
-
...(L = o == null ? void 0 : o.outcomes) != null && L.length ? { outcomes: o.outcomes } : {}
|
|
60
|
-
};
|
|
61
|
-
return Ae(
|
|
62
|
-
await Ee().get($e, {
|
|
63
|
-
params: l,
|
|
64
|
-
// Serialize arrays as repeated params: key=val1&key=val2
|
|
65
|
-
// (NestJS @Query expects this; axios default adds brackets which break matching)
|
|
66
|
-
paramsSerializer: (s) => {
|
|
67
|
-
const O = new URLSearchParams();
|
|
68
|
-
for (const [C, g] of Object.entries(s))
|
|
69
|
-
if (Array.isArray(g))
|
|
70
|
-
for (const S of g) O.append(C, String(S));
|
|
71
|
-
else g != null && O.append(C, String(g));
|
|
72
|
-
return O.toString();
|
|
73
|
-
}
|
|
74
|
-
})
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
}, It = { class: "flex h-[46px] items-center gap-8 rounded-sm px-16 hover:bg-fm-color-opacity-sm" }, Ot = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Tt = {
|
|
78
|
-
"data-more-measure": "",
|
|
79
|
-
class: "flex h-[46px] items-center gap-8 rounded-sm px-16"
|
|
80
|
-
}, Pt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Vt = /* @__PURE__ */ Ye({
|
|
81
|
-
__name: "AuditLogModuleTabs",
|
|
82
|
-
props: {
|
|
83
|
-
modelValue: {},
|
|
84
|
-
items: {}
|
|
85
|
-
},
|
|
86
|
-
emits: ["update:modelValue"],
|
|
87
|
-
setup(o, { emit: l }) {
|
|
88
|
-
const p = o, I = l, { t: j } = Be(), F = b(!1), L = b(null), s = b(null), O = b([]), C = b(0), g = b(0);
|
|
89
|
-
let S = null;
|
|
90
|
-
async function Y() {
|
|
91
|
-
if (await Lt(), !s.value) return;
|
|
92
|
-
const m = s.value.querySelectorAll("[data-tab-measure]");
|
|
93
|
-
O.value = Array.from(m).map((k) => k.offsetWidth);
|
|
94
|
-
const d = s.value.querySelector("[data-more-measure]");
|
|
95
|
-
C.value = (d == null ? void 0 : d.offsetWidth) ?? 0;
|
|
96
|
-
}
|
|
97
|
-
const me = M(() => {
|
|
98
|
-
const m = p.items.length;
|
|
99
|
-
if (m === 0) return 0;
|
|
100
|
-
if (!g.value || O.value.length !== m) return m;
|
|
101
|
-
const d = O.value;
|
|
102
|
-
if (d.reduce((i, J) => i + J, 0) <= g.value) return m;
|
|
103
|
-
const y = C.value;
|
|
104
|
-
let D = 0, T = 0;
|
|
105
|
-
for (let i = 0; i < m && !(D + d[i] + y > g.value); i++)
|
|
106
|
-
D += d[i], T++;
|
|
107
|
-
return T;
|
|
108
|
-
}), W = M(() => {
|
|
109
|
-
const m = me.value, d = p.items.length;
|
|
110
|
-
if (m >= d) return [...p.items];
|
|
111
|
-
const k = p.items.slice(0, m), y = p.items.find((U) => U.value === p.modelValue);
|
|
112
|
-
if (!y || k.some((U) => U.value === y.value)) return k;
|
|
113
|
-
if (m === 0) return [y];
|
|
114
|
-
const D = p.items.findIndex((U) => U.value === y.value), T = O.value, i = C.value, J = T[D] ?? 0;
|
|
115
|
-
let B = m, q = T.slice(0, B - 1).reduce((U, oe) => U + oe, 0);
|
|
116
|
-
for (; B > 1 && q + J + i > g.value; )
|
|
117
|
-
B--, q = T.slice(0, B - 1).reduce((U, oe) => U + oe, 0);
|
|
118
|
-
return [...p.items.slice(0, Math.max(B - 1, 0)), y];
|
|
119
|
-
}), te = M(() => {
|
|
120
|
-
const m = new Set(W.value.map((d) => d.value));
|
|
121
|
-
return p.items.filter((d) => !m.has(d.value));
|
|
122
|
-
});
|
|
123
|
-
function le(m) {
|
|
124
|
-
F.value = !1, I("update:modelValue", m);
|
|
125
|
-
}
|
|
126
|
-
return _t(async () => {
|
|
127
|
-
await Y(), L.value && (g.value = L.value.clientWidth, S = new ResizeObserver(() => {
|
|
128
|
-
L.value && (g.value = L.value.clientWidth);
|
|
129
|
-
}), S.observe(L.value));
|
|
130
|
-
}), xt(() => {
|
|
131
|
-
S == null || S.disconnect(), S = null;
|
|
132
|
-
}), ce(
|
|
133
|
-
() => p.items,
|
|
134
|
-
() => {
|
|
135
|
-
Y();
|
|
136
|
-
},
|
|
137
|
-
{ deep: !0 }
|
|
138
|
-
), (m, d) => {
|
|
139
|
-
const k = E("FmTab"), y = E("FmIcon"), D = E("FmMenuItem"), T = E("FmMenu");
|
|
140
|
-
return c(), x("div", {
|
|
141
|
-
ref_key: "containerRef",
|
|
142
|
-
ref: L,
|
|
143
|
-
class: "relative flex w-full flex-row items-center"
|
|
144
|
-
}, [
|
|
145
|
-
(c(!0), x(ee, null, ne(W.value, (i) => (c(), Z(k, {
|
|
146
|
-
key: i.value,
|
|
147
|
-
"model-value": o.modelValue,
|
|
148
|
-
label: i.label,
|
|
149
|
-
badge: i.badge,
|
|
150
|
-
disabled: i.disabled,
|
|
151
|
-
value: i.value,
|
|
152
|
-
"onUpdate:modelValue": le
|
|
153
|
-
}, null, 8, ["model-value", "label", "badge", "disabled", "value"]))), 128)),
|
|
154
|
-
te.value.length > 0 ? (c(), Z(T, {
|
|
155
|
-
key: 0,
|
|
156
|
-
"show-menu": F.value,
|
|
157
|
-
class: "max-w-[360px] min-w-[90px] rounded-sm",
|
|
158
|
-
placement: "bottom-start",
|
|
159
|
-
onMenuChanged: d[0] || (d[0] = (i) => F.value = i)
|
|
160
|
-
}, {
|
|
161
|
-
"menu-button": K(() => [
|
|
162
|
-
a("div", It, [
|
|
163
|
-
v(y, { name: "more_vert" }),
|
|
164
|
-
a("span", Ot, n(u(j)("auditLog.modules.more")), 1)
|
|
165
|
-
])
|
|
166
|
-
]),
|
|
167
|
-
default: K(() => [
|
|
168
|
-
(c(!0), x(ee, null, ne(te.value, (i) => (c(), Z(D, {
|
|
169
|
-
key: i.value,
|
|
170
|
-
"model-value": o.modelValue === i.value,
|
|
171
|
-
label: i.label,
|
|
172
|
-
disabled: i.disabled,
|
|
173
|
-
onClick: (J) => le(i.value)
|
|
174
|
-
}, null, 8, ["model-value", "label", "disabled", "onClick"]))), 128))
|
|
175
|
-
]),
|
|
176
|
-
_: 1
|
|
177
|
-
}, 8, ["show-menu"])) : A("", !0),
|
|
178
|
-
a("div", {
|
|
179
|
-
ref_key: "measurerRef",
|
|
180
|
-
ref: s,
|
|
181
|
-
"aria-hidden": "true",
|
|
182
|
-
class: "pointer-events-none invisible absolute -left-[9999px] -top-[9999px] flex flex-row items-center"
|
|
183
|
-
}, [
|
|
184
|
-
(c(!0), x(ee, null, ne(o.items, (i) => (c(), x("div", {
|
|
185
|
-
key: `measure-${i.value}`,
|
|
186
|
-
"data-tab-measure": ""
|
|
187
|
-
}, [
|
|
188
|
-
v(k, {
|
|
189
|
-
"model-value": o.modelValue,
|
|
190
|
-
label: i.label,
|
|
191
|
-
badge: i.badge,
|
|
192
|
-
disabled: i.disabled,
|
|
193
|
-
value: i.value
|
|
194
|
-
}, null, 8, ["model-value", "label", "badge", "disabled", "value"])
|
|
195
|
-
]))), 128)),
|
|
196
|
-
a("div", Tt, [
|
|
197
|
-
v(y, { name: "more_vert" }),
|
|
198
|
-
a("span", Pt, n(u(j)("auditLog.modules.more")), 1)
|
|
199
|
-
])
|
|
200
|
-
], 512)
|
|
201
|
-
], 512);
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
}), jt = {
|
|
205
|
-
class: "flex flex-col gap-4 p-12 w-[260px]"
|
|
206
|
-
}, Ct = {
|
|
207
|
-
class: "text-xs font-semibold text-fm-color-typo-secondary mb-4"
|
|
208
|
-
}, Rt = {
|
|
209
|
-
class: "flex min-h-0 flex-1 flex-col gap-16"
|
|
210
|
-
}, At = {
|
|
211
|
-
class: "space-y-16"
|
|
212
|
-
}, Et = {
|
|
213
|
-
class: "flex flex-wrap items-center gap-8"
|
|
214
|
-
}, Ut = {
|
|
215
|
-
class: "w-fit"
|
|
216
|
-
}, $t = {
|
|
217
|
-
key: 0,
|
|
218
|
-
class: "w-fit"
|
|
219
|
-
}, Nt = {
|
|
220
|
-
class: "w-fit"
|
|
221
|
-
}, Yt = {
|
|
222
|
-
class: "w-fit"
|
|
223
|
-
}, Bt = {
|
|
224
|
-
key: 0,
|
|
225
|
-
class: "space-y-12 p-4 text-sm"
|
|
226
|
-
}, Kt = {
|
|
227
|
-
class: "flex items-start justify-between gap-8 rounded-lg border border-fm-color-border-default p-12"
|
|
228
|
-
}, zt = {
|
|
229
|
-
class: "min-w-0 flex-1"
|
|
230
|
-
}, qt = {
|
|
231
|
-
class: "audit-log-operation-label-detail text-base font-bold leading-snug text-fm-color-typo-primary"
|
|
232
|
-
}, Ht = {
|
|
233
|
-
class: "rounded-lg border border-fm-color-border-default p-12"
|
|
234
|
-
}, Wt = {
|
|
235
|
-
class: "space-y-12"
|
|
236
|
-
}, Jt = {
|
|
237
|
-
class: "text-xs text-fm-color-typo-secondary"
|
|
238
|
-
}, Gt = {
|
|
239
|
-
class: "font-semibold"
|
|
240
|
-
}, Xt = {
|
|
241
|
-
class: "text-xs text-fm-color-typo-secondary"
|
|
242
|
-
}, Qt = {
|
|
243
|
-
class: "font-semibold"
|
|
244
|
-
}, Zt = {
|
|
245
|
-
class: "text-xs text-fm-color-typo-secondary"
|
|
246
|
-
}, el = {
|
|
247
|
-
class: "break-all font-semibold"
|
|
248
|
-
}, tl = {
|
|
249
|
-
class: "text-xs text-fm-color-typo-secondary"
|
|
250
|
-
}, ll = {
|
|
251
|
-
class: "font-semibold"
|
|
252
|
-
}, ol = {
|
|
253
|
-
key: 0
|
|
254
|
-
}, al = {
|
|
255
|
-
class: "text-xs text-fm-color-typo-secondary"
|
|
256
|
-
}, sl = {
|
|
257
|
-
class: "break-all font-mono text-xs font-semibold"
|
|
258
|
-
}, nl = {
|
|
259
|
-
class: "text-xs text-fm-color-typo-secondary"
|
|
260
|
-
}, ul = {
|
|
261
|
-
class: "break-all font-mono text-xs font-semibold"
|
|
262
|
-
}, il = {
|
|
263
|
-
class: "text-xs text-fm-color-typo-secondary"
|
|
264
|
-
}, rl = {
|
|
265
|
-
class: "font-semibold"
|
|
266
|
-
}, dl = {
|
|
267
|
-
key: 0,
|
|
268
|
-
class: "rounded-lg border border-fm-color-border-default"
|
|
269
|
-
}, cl = {
|
|
270
|
-
class: "p-12"
|
|
271
|
-
}, ml = {
|
|
272
|
-
class: "text-base font-bold text-fm-color-typo-primary"
|
|
273
|
-
}, fl = {
|
|
274
|
-
class: "space-y-12 p-12"
|
|
275
|
-
}, vl = {
|
|
276
|
-
class: "text-xs text-fm-color-typo-secondary"
|
|
277
|
-
}, gl = {
|
|
278
|
-
class: "font-semibold"
|
|
279
|
-
}, bl = {
|
|
280
|
-
class: "rounded-lg border border-fm-color-border-default"
|
|
281
|
-
}, pl = {
|
|
282
|
-
class: "p-12"
|
|
283
|
-
}, hl = {
|
|
284
|
-
class: "text-base font-bold text-fm-color-typo-primary"
|
|
285
|
-
}, yl = {
|
|
286
|
-
class: "space-y-12 p-12"
|
|
287
|
-
}, _l = {
|
|
288
|
-
class: "text-xs text-fm-color-typo-secondary"
|
|
289
|
-
}, xl = {
|
|
290
|
-
class: "font-semibold"
|
|
291
|
-
}, Ll = {
|
|
292
|
-
key: 0
|
|
293
|
-
}, Sl = {
|
|
294
|
-
class: "text-xs text-fm-color-typo-secondary"
|
|
295
|
-
}, kl = {
|
|
296
|
-
key: 0,
|
|
297
|
-
class: "font-semibold"
|
|
298
|
-
}, wl = {
|
|
299
|
-
key: 1,
|
|
300
|
-
class: "break-all font-mono text-xs text-fm-color-typo-secondary"
|
|
301
|
-
}, Ml = {
|
|
302
|
-
key: 1
|
|
303
|
-
}, Fl = {
|
|
304
|
-
class: "text-xs text-fm-color-typo-secondary"
|
|
305
|
-
}, Dl = {
|
|
306
|
-
class: "font-semibold whitespace-pre-line"
|
|
307
|
-
}, Il = {
|
|
308
|
-
class: "text-xs text-fm-color-typo-secondary"
|
|
309
|
-
}, Ol = {
|
|
310
|
-
class: "font-semibold"
|
|
311
|
-
}, Tl = {
|
|
312
|
-
class: "text-xs text-fm-color-typo-secondary"
|
|
313
|
-
}, Pl = {
|
|
314
|
-
class: "break-all font-mono text-xs font-semibold"
|
|
315
|
-
}, Vl = {
|
|
316
|
-
key: 2
|
|
317
|
-
}, jl = {
|
|
318
|
-
class: "text-xs text-fm-color-typo-secondary"
|
|
319
|
-
}, Cl = {
|
|
320
|
-
class: "mt-4 space-y-4"
|
|
321
|
-
}, Rl = {
|
|
322
|
-
class: "flex h-16 w-16 shrink-0 items-center justify-center rounded-full bg-fm-color-primary-default text-xs font-bold text-white"
|
|
323
|
-
}, Al = {
|
|
324
|
-
class: "text-xs font-semibold"
|
|
325
|
-
}, El = {
|
|
326
|
-
key: 0,
|
|
327
|
-
class: "text-fm-color-typo-secondary"
|
|
328
|
-
}, Ul = {
|
|
329
|
-
key: 3
|
|
330
|
-
}, $l = {
|
|
331
|
-
class: "text-xs text-fm-color-typo-secondary"
|
|
332
|
-
}, Nl = {
|
|
333
|
-
class: "mt-4 max-h-[400px] overflow-auto rounded bg-gray-100 p-8 font-mono text-xs leading-relaxed shadow-inner whitespace-pre-wrap break-all"
|
|
334
|
-
}, se = 100, xe = 1e3, Yl = "YYYY-MM-DD HH:mm", V = "YYYY-MM-DD", Ne = "audit-log-export-fields", Bl = /* @__PURE__ */ Ye({
|
|
335
|
-
__name: "AuditLogList",
|
|
336
|
-
setup(o) {
|
|
337
|
-
const {
|
|
338
|
-
t: l
|
|
339
|
-
} = Be(), p = St(), I = Dt(), j = b(!1), F = b(!1), L = b([]), s = b(null), O = b(!1);
|
|
340
|
-
async function C(e) {
|
|
341
|
-
const t = Uint8Array.from(atob(e), (h) => h.charCodeAt(0)), f = new DecompressionStream("gzip"), w = f.writable.getWriter();
|
|
342
|
-
return await w.write(t), await w.close(), new Response(f.readable).text();
|
|
343
|
-
}
|
|
344
|
-
const g = b("");
|
|
345
|
-
let S = 0;
|
|
346
|
-
ce(() => {
|
|
347
|
-
var e, t;
|
|
348
|
-
return (t = (e = s.value) == null ? void 0 : e.metadata) == null ? void 0 : t.requestBody;
|
|
349
|
-
}, async (e) => {
|
|
350
|
-
const t = ++S;
|
|
351
|
-
if (!e) {
|
|
352
|
-
g.value = "";
|
|
353
|
-
return;
|
|
354
|
-
}
|
|
355
|
-
if (typeof e == "object") {
|
|
356
|
-
g.value = JSON.stringify(e, null, 2);
|
|
357
|
-
return;
|
|
358
|
-
}
|
|
359
|
-
if (e.startsWith("gzip:")) {
|
|
360
|
-
try {
|
|
361
|
-
const f = await C(e.slice(5));
|
|
362
|
-
if (t !== S) return;
|
|
363
|
-
g.value = JSON.stringify(JSON.parse(f), null, 2);
|
|
364
|
-
} catch {
|
|
365
|
-
if (t !== S) return;
|
|
366
|
-
g.value = e;
|
|
367
|
-
}
|
|
368
|
-
return;
|
|
369
|
-
}
|
|
370
|
-
try {
|
|
371
|
-
g.value = JSON.stringify(JSON.parse(e), null, 2);
|
|
372
|
-
} catch {
|
|
373
|
-
g.value = e;
|
|
374
|
-
}
|
|
375
|
-
}, {
|
|
376
|
-
immediate: !0
|
|
377
|
-
});
|
|
378
|
-
const Y = b(1), me = b(!1), W = b(0), te = M(() => Math.max(1, Math.ceil(W.value / se))), le = _().format("YYYY-MM-DD"), m = b({
|
|
379
|
-
startDate: `${le} 00:00`,
|
|
380
|
-
endDate: `${le} 23:59`
|
|
381
|
-
}), d = b(), k = b(), y = b(), D = b(), T = b("all");
|
|
382
|
-
function i(e) {
|
|
383
|
-
return typeof e == "string" ? [e] : Array.isArray(e) ? e.filter((t) => typeof t == "string") : [];
|
|
384
|
-
}
|
|
385
|
-
const J = M(() => ye.map(({
|
|
386
|
-
key: e
|
|
387
|
-
}) => ({
|
|
388
|
-
label: l(`auditLog.modules.${e}`),
|
|
389
|
-
value: e
|
|
390
|
-
}))), B = M(() => ye.find((e) => e.key === T.value) ?? ye[0]), q = M(() => T.value === "all"), Le = M(() => I.members.map((e) => ({
|
|
391
|
-
label: e.name,
|
|
392
|
-
value: e.doc.userId
|
|
393
|
-
}))), U = M(() => {
|
|
394
|
-
const e = Ue.flatMap((h) => i(h.subject).map((P) => ({
|
|
395
|
-
label: h.label,
|
|
396
|
-
value: P
|
|
397
|
-
}))), t = Object.entries(Ce).map(([h, P]) => ({
|
|
398
|
-
label: P,
|
|
399
|
-
value: h
|
|
400
|
-
})), f = /* @__PURE__ */ new Set(), w = [];
|
|
401
|
-
for (const h of [...e, ...t])
|
|
402
|
-
f.has(h.value) || (f.add(h.value), w.push(h));
|
|
403
|
-
return w;
|
|
404
|
-
});
|
|
405
|
-
function oe(e, t) {
|
|
406
|
-
const f = t.toLowerCase();
|
|
407
|
-
return e.label.toLowerCase().includes(f) || e.value.replace(/^business::/, "").toLowerCase().includes(f) ? !0 : e.value.toLowerCase().includes(f);
|
|
408
|
-
}
|
|
409
|
-
const $ = M(() => ({
|
|
410
|
-
manage: l("auditLog.action.manage"),
|
|
411
|
-
create: l("auditLog.action.create"),
|
|
412
|
-
read: l("auditLog.action.read"),
|
|
413
|
-
update: l("auditLog.action.update"),
|
|
414
|
-
delete: l("auditLog.action.delete")
|
|
415
|
-
})), Ke = M(() => [{
|
|
416
|
-
label: $.value.manage,
|
|
417
|
-
value: "manage"
|
|
418
|
-
}, {
|
|
419
|
-
label: $.value.create,
|
|
420
|
-
value: "create"
|
|
421
|
-
}, {
|
|
422
|
-
label: $.value.read,
|
|
423
|
-
value: "read"
|
|
424
|
-
}, {
|
|
425
|
-
label: $.value.update,
|
|
426
|
-
value: "update"
|
|
427
|
-
}, {
|
|
428
|
-
label: $.value.delete,
|
|
429
|
-
value: "delete"
|
|
430
|
-
}]), ue = M(() => ({
|
|
431
|
-
allowed: l("auditLog.outcome.success"),
|
|
432
|
-
denied: l("auditLog.outcome.failed"),
|
|
433
|
-
skipped: l("auditLog.outcome.skipped")
|
|
434
|
-
})), ze = M(() => [{
|
|
435
|
-
label: ue.value.allowed,
|
|
436
|
-
value: "allowed"
|
|
437
|
-
}, {
|
|
438
|
-
label: ue.value.denied,
|
|
439
|
-
value: "denied"
|
|
440
|
-
}, {
|
|
441
|
-
label: ue.value.skipped,
|
|
442
|
-
value: "skipped"
|
|
443
|
-
}]), qe = M(() => ({
|
|
444
|
-
admin: l("auditLog.detail.resolvedFromValue.admin"),
|
|
445
|
-
staff: l("auditLog.detail.resolvedFromValue.staff"),
|
|
446
|
-
permissionSet: l("auditLog.detail.resolvedFromValue.permissionSet"),
|
|
447
|
-
systemPermissionSet: l("auditLog.detail.resolvedFromValue.systemPermissionSet"),
|
|
448
|
-
custom: l("auditLog.detail.resolvedFromValue.custom"),
|
|
449
|
-
"no-match": l("auditLog.detail.resolvedFromValue.noMatch"),
|
|
450
|
-
unknown: l("auditLog.detail.resolvedFromValue.unknown")
|
|
451
|
-
})), He = M(() => ({
|
|
452
|
-
GET: $.value.read,
|
|
453
|
-
POST: $.value.create,
|
|
454
|
-
PUT: $.value.update,
|
|
455
|
-
PATCH: $.value.update,
|
|
456
|
-
DELETE: $.value.delete
|
|
457
|
-
})), Se = {
|
|
458
|
-
allowed: "success",
|
|
459
|
-
denied: "critical",
|
|
460
|
-
skipped: "warning"
|
|
461
|
-
}, We = M(() => {
|
|
462
|
-
const {
|
|
463
|
-
startDate: e,
|
|
464
|
-
endDate: t
|
|
465
|
-
} = m.value;
|
|
466
|
-
return e && t ? `${e} – ${t}` : e || t || l("auditLog.dateRange.placeholder");
|
|
467
|
-
}), Je = M(() => [{
|
|
468
|
-
label: l("date.predefinedRanges.today"),
|
|
469
|
-
value: {
|
|
470
|
-
startDate: _().format(V),
|
|
471
|
-
endDate: _().format(V)
|
|
472
|
-
}
|
|
473
|
-
}, {
|
|
474
|
-
label: l("date.predefinedRanges.yesterday"),
|
|
475
|
-
value: {
|
|
476
|
-
startDate: _().subtract(1, "day").format(V),
|
|
477
|
-
endDate: _().subtract(1, "day").format(V)
|
|
478
|
-
}
|
|
479
|
-
}, {
|
|
480
|
-
label: l("date.predefinedRanges.thisWeek"),
|
|
481
|
-
value: {
|
|
482
|
-
startDate: _().startOf("week").format(V),
|
|
483
|
-
endDate: _().endOf("week").format(V)
|
|
484
|
-
}
|
|
485
|
-
}, {
|
|
486
|
-
label: l("date.predefinedRanges.lastWeek"),
|
|
487
|
-
value: {
|
|
488
|
-
startDate: _().subtract(1, "week").startOf("week").format(V),
|
|
489
|
-
endDate: _().subtract(1, "week").endOf("week").format(V)
|
|
490
|
-
}
|
|
491
|
-
}, {
|
|
492
|
-
label: l("date.predefinedRanges.last7Days"),
|
|
493
|
-
value: {
|
|
494
|
-
startDate: _().subtract(7, "day").format(V),
|
|
495
|
-
endDate: _().subtract(1, "day").format(V)
|
|
496
|
-
}
|
|
497
|
-
}, {
|
|
498
|
-
label: l("date.predefinedRanges.thisMonth"),
|
|
499
|
-
value: {
|
|
500
|
-
startDate: _().startOf("month").format(V),
|
|
501
|
-
endDate: _().endOf("month").format(V)
|
|
502
|
-
}
|
|
503
|
-
}, {
|
|
504
|
-
label: l("date.predefinedRanges.lastMonth"),
|
|
505
|
-
value: {
|
|
506
|
-
startDate: _().subtract(1, "month").startOf("month").format(V),
|
|
507
|
-
endDate: _().subtract(1, "month").endOf("month").format(V)
|
|
508
|
-
}
|
|
509
|
-
}]);
|
|
510
|
-
function fe(e) {
|
|
511
|
-
var t;
|
|
512
|
-
return ((t = Ue.find((f) => f.subject === e)) == null ? void 0 : t.label) ?? Ce[e];
|
|
513
|
-
}
|
|
514
|
-
function ie(e) {
|
|
515
|
-
return I.userIdToName[e.userId] || e.userId;
|
|
516
|
-
}
|
|
517
|
-
function ke(e) {
|
|
518
|
-
return I.userIdToPhone[e.userId] || "-";
|
|
519
|
-
}
|
|
520
|
-
function Ge(e) {
|
|
521
|
-
return I.userIdToEmail[e.userId] || "-";
|
|
522
|
-
}
|
|
523
|
-
function we(e) {
|
|
524
|
-
return _(e).format("DD MMM YYYY, HH:mm");
|
|
525
|
-
}
|
|
526
|
-
function Xe(e) {
|
|
527
|
-
return _(e).format("DD MMM YYYY, HH:mm:ss").toUpperCase();
|
|
528
|
-
}
|
|
529
|
-
function Me(e) {
|
|
530
|
-
return $.value[e] ?? e;
|
|
531
|
-
}
|
|
532
|
-
function ve(e) {
|
|
533
|
-
return e.metadata.operationLabel ?? Me(e.action);
|
|
534
|
-
}
|
|
535
|
-
function ge(e) {
|
|
536
|
-
return ue.value[e];
|
|
537
|
-
}
|
|
538
|
-
function Qe(e) {
|
|
539
|
-
return qe.value[e] ?? e;
|
|
540
|
-
}
|
|
541
|
-
function Ze(e) {
|
|
542
|
-
return e.metadata.requestMethod ? He.value[e.metadata.requestMethod] ?? e.metadata.requestMethod : Me(e.action);
|
|
543
|
-
}
|
|
544
|
-
function Fe(e) {
|
|
545
|
-
const t = String(e ?? "");
|
|
546
|
-
return `"${(/^[=+\-@\t\r]/.test(t) ? `'${t}` : t).replace(/"/g, '""')}"`;
|
|
547
|
-
}
|
|
548
|
-
const be = [{
|
|
549
|
-
key: "timestamp",
|
|
550
|
-
labelKey: "auditLog.exportFields.timestamp",
|
|
551
|
-
getValue: (e) => we(e.timestamp),
|
|
552
|
-
defaultSelected: !0
|
|
553
|
-
}, {
|
|
554
|
-
key: "userName",
|
|
555
|
-
labelKey: "auditLog.exportFields.userName",
|
|
556
|
-
getValue: (e) => ie(e),
|
|
557
|
-
defaultSelected: !0
|
|
558
|
-
}, {
|
|
559
|
-
key: "userPhone",
|
|
560
|
-
labelKey: "auditLog.exportFields.userPhone",
|
|
561
|
-
getValue: (e) => ke(e),
|
|
562
|
-
defaultSelected: !0
|
|
563
|
-
}, {
|
|
564
|
-
key: "subject",
|
|
565
|
-
labelKey: "auditLog.exportFields.subject",
|
|
566
|
-
getValue: (e) => fe(e.subject) ?? e.subject,
|
|
567
|
-
defaultSelected: !0
|
|
568
|
-
}, {
|
|
569
|
-
key: "action",
|
|
570
|
-
labelKey: "auditLog.exportFields.action",
|
|
571
|
-
getValue: (e) => e.action,
|
|
572
|
-
defaultSelected: !0
|
|
573
|
-
}, {
|
|
574
|
-
key: "operation",
|
|
575
|
-
labelKey: "auditLog.exportFields.operation",
|
|
576
|
-
getValue: (e) => ve(e),
|
|
577
|
-
defaultSelected: !0
|
|
578
|
-
}, {
|
|
579
|
-
key: "outcome",
|
|
580
|
-
labelKey: "auditLog.exportFields.outcome",
|
|
581
|
-
getValue: (e) => ge(e.outcome),
|
|
582
|
-
defaultSelected: !0
|
|
583
|
-
}, {
|
|
584
|
-
key: "businessId",
|
|
585
|
-
labelKey: "auditLog.exportFields.businessId",
|
|
586
|
-
getValue: (e) => e.businessId,
|
|
587
|
-
defaultSelected: !1
|
|
588
|
-
}, {
|
|
589
|
-
key: "restaurantId",
|
|
590
|
-
labelKey: "auditLog.exportFields.restaurantId",
|
|
591
|
-
getValue: (e) => e.restaurantId,
|
|
592
|
-
defaultSelected: !1
|
|
593
|
-
}, {
|
|
594
|
-
key: "country",
|
|
595
|
-
labelKey: "auditLog.exportFields.country",
|
|
596
|
-
getValue: (e) => e.country,
|
|
597
|
-
defaultSelected: !1
|
|
598
|
-
}, {
|
|
599
|
-
key: "resolvedFrom",
|
|
600
|
-
labelKey: "auditLog.exportFields.resolvedFrom",
|
|
601
|
-
getValue: (e) => {
|
|
602
|
-
var t;
|
|
603
|
-
return (t = e.metadata) == null ? void 0 : t.resolvedFrom;
|
|
604
|
-
},
|
|
605
|
-
defaultSelected: !1
|
|
606
|
-
}, {
|
|
607
|
-
key: "requestMethod",
|
|
608
|
-
labelKey: "auditLog.exportFields.requestMethod",
|
|
609
|
-
getValue: (e) => {
|
|
610
|
-
var t;
|
|
611
|
-
return (t = e.metadata) == null ? void 0 : t.requestMethod;
|
|
612
|
-
},
|
|
613
|
-
defaultSelected: !1
|
|
614
|
-
}, {
|
|
615
|
-
key: "requestPath",
|
|
616
|
-
labelKey: "auditLog.exportFields.requestPath",
|
|
617
|
-
getValue: (e) => {
|
|
618
|
-
var t;
|
|
619
|
-
return (t = e.metadata) == null ? void 0 : t.requestPath;
|
|
620
|
-
},
|
|
621
|
-
defaultSelected: !1
|
|
622
|
-
}];
|
|
623
|
-
function et() {
|
|
624
|
-
try {
|
|
625
|
-
const e = localStorage.getItem(Ne);
|
|
626
|
-
if (e) {
|
|
627
|
-
const t = JSON.parse(e);
|
|
628
|
-
if (Array.isArray(t) && t.length > 0) return new Set(t);
|
|
629
|
-
}
|
|
630
|
-
} catch {
|
|
631
|
-
}
|
|
632
|
-
return new Set(be.filter((e) => e.defaultSelected).map((e) => e.key));
|
|
633
|
-
}
|
|
634
|
-
const G = b(et());
|
|
635
|
-
function tt(e) {
|
|
636
|
-
const t = new Set(G.value);
|
|
637
|
-
if (t.has(e)) {
|
|
638
|
-
if (t.size <= 1) return;
|
|
639
|
-
t.delete(e);
|
|
640
|
-
} else
|
|
641
|
-
t.add(e);
|
|
642
|
-
G.value = t;
|
|
643
|
-
try {
|
|
644
|
-
localStorage.setItem(Ne, JSON.stringify([...t]));
|
|
645
|
-
} catch {
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
async function lt() {
|
|
649
|
-
var e, t, f, w, h, P;
|
|
650
|
-
if (!F.value) {
|
|
651
|
-
F.value = !0;
|
|
652
|
-
try {
|
|
653
|
-
const {
|
|
654
|
-
startDate: N,
|
|
655
|
-
endDate: z
|
|
656
|
-
} = m.value, H = B.value.subjectPrefixes, re = (/* @__PURE__ */ new Date()).toISOString().slice(0, 19).replace("T", " "), r = z ? X(z) : null, Q = r && r < re ? r : re, it = {
|
|
657
|
-
...N ? {
|
|
658
|
-
from: X(N)
|
|
659
|
-
} : {},
|
|
660
|
-
to: Q,
|
|
661
|
-
...(e = d.value) != null && e.length ? {
|
|
662
|
-
userIds: d.value
|
|
663
|
-
} : {},
|
|
664
|
-
...q.value && ((t = k.value) != null && t.length) ? {
|
|
665
|
-
subjects: k.value
|
|
666
|
-
} : {},
|
|
667
|
-
...H.length ? {
|
|
668
|
-
subjectPrefixes: [...H]
|
|
669
|
-
} : {},
|
|
670
|
-
...(f = D.value) != null && f.length ? {
|
|
671
|
-
actions: D.value
|
|
672
|
-
} : {},
|
|
673
|
-
...(w = y.value) != null && w.length ? {
|
|
674
|
-
outcomes: y.value
|
|
675
|
-
} : {}
|
|
676
|
-
}, Oe = [];
|
|
677
|
-
let Te = 0;
|
|
678
|
-
for (; ; ) {
|
|
679
|
-
const R = await _e.read({
|
|
680
|
-
...it,
|
|
681
|
-
limit: xe,
|
|
682
|
-
offset: Te
|
|
683
|
-
});
|
|
684
|
-
if (Oe.push(...R), R.length < xe) break;
|
|
685
|
-
Te += xe;
|
|
686
|
-
}
|
|
687
|
-
const Pe = be.filter((R) => G.value.has(R.key)), rt = Pe.map((R) => l(R.labelKey)), dt = Oe.map((R) => Pe.map((yt) => yt.getValue(R) ?? "")), he = -(/* @__PURE__ */ new Date()).getTimezoneOffset(), ct = he >= 0 ? "+" : "-", mt = String(Math.floor(Math.abs(he) / 60)).padStart(2, "0"), ft = String(Math.abs(he) % 60).padStart(2, "0"), vt = `UTC${ct}${mt}:${ft}`, Ve = ((h = p.currentBusiness.value) == null ? void 0 : h.name) || "", gt = [N, z].filter(Boolean).join(" – "), bt = [...[[l("auditLog.title")], [`${l("auditLog.frontMatter.date")}: ${gt}`], ...Ve ? [[`${l("auditLog.frontMatter.business")}: ${Ve}`]] : [], [`${l("auditLog.frontMatter.generatedBy")}: ${_().format("DD MMM YYYY, HH:mm")} (${vt})`], []].map((R) => R.map(Fe).join(",")), ...[rt, ...dt].map((R) => R.map(Fe).join(","))].join(`
|
|
688
|
-
`), pt = `audit-log_${(((P = p.currentBusiness.value) == null ? void 0 : P.name) || "business").replace(/[^a-z0-9_-]+/gi, "_")}_${_().format("YYYYMMDD_HHmmss")}.csv`, ht = new Blob([`\uFEFF${bt}`], {
|
|
689
|
-
type: "text/csv;charset=utf-8;"
|
|
690
|
-
}), je = window.URL.createObjectURL(ht), ae = document.createElement("a");
|
|
691
|
-
ae.href = je, ae.download = pt, document.body.appendChild(ae), ae.click(), ae.remove(), window.URL.revokeObjectURL(je);
|
|
692
|
-
} finally {
|
|
693
|
-
F.value = !1;
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
const ot = [{
|
|
698
|
-
accessorKey: "timestamp",
|
|
699
|
-
header: () => l("auditLog.columns.timestamp"),
|
|
700
|
-
cell(e) {
|
|
701
|
-
return we(e.row.original.timestamp);
|
|
702
|
-
}
|
|
703
|
-
}, {
|
|
704
|
-
accessorKey: "userId",
|
|
705
|
-
header: () => l("auditLog.columns.user"),
|
|
706
|
-
enableSorting: !1,
|
|
707
|
-
size: 220,
|
|
708
|
-
cell(e) {
|
|
709
|
-
const t = e.row.original;
|
|
710
|
-
return v("div", {
|
|
711
|
-
class: "flex items-center gap-8"
|
|
712
|
-
}, [v(Re.FmAvatar, {
|
|
713
|
-
initials: ie(t),
|
|
714
|
-
size: "sm",
|
|
715
|
-
class: "shrink-0"
|
|
716
|
-
}, null), v("div", {
|
|
717
|
-
class: "min-w-0"
|
|
718
|
-
}, [v("p", {
|
|
719
|
-
class: "truncate font-semibold"
|
|
720
|
-
}, [ie(t)]), v("p", {
|
|
721
|
-
class: "truncate text-fm-color-typo-secondary"
|
|
722
|
-
}, [ke(t)])])]);
|
|
723
|
-
}
|
|
724
|
-
}, {
|
|
725
|
-
accessorKey: "subject",
|
|
726
|
-
header: () => l("auditLog.columns.role"),
|
|
727
|
-
meta: {
|
|
728
|
-
cellClass: "text-left"
|
|
729
|
-
},
|
|
730
|
-
cell(e) {
|
|
731
|
-
const t = e.row.original;
|
|
732
|
-
return v("div", {
|
|
733
|
-
class: "text-left"
|
|
734
|
-
}, [fe(t.subject) ?? t.subject]);
|
|
735
|
-
}
|
|
736
|
-
}, {
|
|
737
|
-
accessorKey: "action",
|
|
738
|
-
header: () => l("auditLog.columns.action"),
|
|
739
|
-
enableSorting: !1,
|
|
740
|
-
size: 280,
|
|
741
|
-
meta: {
|
|
742
|
-
cellSpanClass: "audit-log-action-label"
|
|
743
|
-
},
|
|
744
|
-
cell(e) {
|
|
745
|
-
return ve(e.row.original);
|
|
746
|
-
}
|
|
747
|
-
}, {
|
|
748
|
-
accessorKey: "outcome",
|
|
749
|
-
header: () => l("auditLog.columns.outcome"),
|
|
750
|
-
enableSorting: !1,
|
|
751
|
-
cell(e) {
|
|
752
|
-
const t = e.row.original;
|
|
753
|
-
return v(Re.FmChip, {
|
|
754
|
-
variant: Se[t.outcome] ?? "neutral",
|
|
755
|
-
label: ge(t.outcome),
|
|
756
|
-
compact: !0
|
|
757
|
-
}, null);
|
|
758
|
-
}
|
|
759
|
-
}];
|
|
760
|
-
function X(e) {
|
|
761
|
-
const t = _(e, Yl);
|
|
762
|
-
return new Date(t.year(), t.month(), t.date(), t.hour(), t.minute(), 0).toISOString().slice(0, 19).replace("T", " ");
|
|
763
|
-
}
|
|
764
|
-
async function De() {
|
|
765
|
-
var e, t, f, w;
|
|
766
|
-
j.value = !0;
|
|
767
|
-
try {
|
|
768
|
-
const {
|
|
769
|
-
startDate: h,
|
|
770
|
-
endDate: P
|
|
771
|
-
} = m.value, N = (Y.value - 1) * se, z = B.value.subjectPrefixes, H = await _e.read({
|
|
772
|
-
limit: se,
|
|
773
|
-
offset: N,
|
|
774
|
-
...h ? {
|
|
775
|
-
from: X(h)
|
|
776
|
-
} : {},
|
|
777
|
-
...P ? {
|
|
778
|
-
to: X(P)
|
|
779
|
-
} : {},
|
|
780
|
-
...(e = d.value) != null && e.length ? {
|
|
781
|
-
userIds: d.value
|
|
782
|
-
} : {},
|
|
783
|
-
...q.value && ((t = k.value) != null && t.length) ? {
|
|
784
|
-
subjects: k.value
|
|
785
|
-
} : {},
|
|
786
|
-
...z.length ? {
|
|
787
|
-
subjectPrefixes: [...z]
|
|
788
|
-
} : {},
|
|
789
|
-
...(f = D.value) != null && f.length ? {
|
|
790
|
-
actions: D.value
|
|
791
|
-
} : {},
|
|
792
|
-
...(w = y.value) != null && w.length ? {
|
|
793
|
-
outcomes: y.value
|
|
794
|
-
} : {}
|
|
795
|
-
});
|
|
796
|
-
L.value = H, me.value = H.length === se;
|
|
797
|
-
} finally {
|
|
798
|
-
j.value = !1;
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
const Ie = M(() => {
|
|
802
|
-
var e;
|
|
803
|
-
return JSON.stringify({
|
|
804
|
-
businessId: ((e = p.currentBusiness.value) == null ? void 0 : e._id) ?? "",
|
|
805
|
-
dateRange: m.value,
|
|
806
|
-
users: [...d.value ?? []].sort(),
|
|
807
|
-
subjects: [...k.value ?? []].sort(),
|
|
808
|
-
outcomes: [...y.value ?? []].sort(),
|
|
809
|
-
actions: [...D.value ?? []].sort(),
|
|
810
|
-
moduleKey: T.value
|
|
811
|
-
});
|
|
812
|
-
});
|
|
813
|
-
async function at() {
|
|
814
|
-
var w, h, P, N;
|
|
815
|
-
const {
|
|
816
|
-
startDate: e,
|
|
817
|
-
endDate: t
|
|
818
|
-
} = m.value, f = B.value.subjectPrefixes;
|
|
819
|
-
W.value = await _e.count({
|
|
820
|
-
...e ? {
|
|
821
|
-
from: X(e)
|
|
822
|
-
} : {},
|
|
823
|
-
...t ? {
|
|
824
|
-
to: X(t)
|
|
825
|
-
} : {},
|
|
826
|
-
...(w = d.value) != null && w.length ? {
|
|
827
|
-
userIds: d.value
|
|
828
|
-
} : {},
|
|
829
|
-
...q.value && ((h = k.value) != null && h.length) ? {
|
|
830
|
-
subjects: k.value
|
|
831
|
-
} : {},
|
|
832
|
-
...f.length ? {
|
|
833
|
-
subjectPrefixes: [...f]
|
|
834
|
-
} : {},
|
|
835
|
-
...(P = D.value) != null && P.length ? {
|
|
836
|
-
actions: D.value
|
|
837
|
-
} : {},
|
|
838
|
-
...(N = y.value) != null && N.length ? {
|
|
839
|
-
outcomes: y.value
|
|
840
|
-
} : {}
|
|
841
|
-
});
|
|
842
|
-
}
|
|
843
|
-
ce(Ie, async () => {
|
|
844
|
-
var e;
|
|
845
|
-
Y.value = 1, (e = p.currentBusiness.value) != null && e._id && await Promise.all([at(), De()]);
|
|
846
|
-
}, {
|
|
847
|
-
immediate: !0
|
|
848
|
-
});
|
|
849
|
-
let pe = !1;
|
|
850
|
-
async function st({
|
|
851
|
-
pageIndex: e
|
|
852
|
-
}) {
|
|
853
|
-
var t;
|
|
854
|
-
if ((t = p.currentBusiness.value) != null && t._id && !pe && !(e === 0 && Y.value === 1 && L.value.length > 0)) {
|
|
855
|
-
pe = !0, Y.value = e + 1;
|
|
856
|
-
try {
|
|
857
|
-
await De();
|
|
858
|
-
} finally {
|
|
859
|
-
pe = !1;
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
|
-
}
|
|
863
|
-
function nt(e) {
|
|
864
|
-
s.value = e, O.value = !0;
|
|
865
|
-
}
|
|
866
|
-
function ut() {
|
|
867
|
-
O.value = !1, s.value = null;
|
|
868
|
-
}
|
|
869
|
-
return ce(p.currentBusiness, (e) => {
|
|
870
|
-
e && I.readTeamMembers();
|
|
871
|
-
}, {
|
|
872
|
-
immediate: !0
|
|
873
|
-
}), (e, t) => {
|
|
874
|
-
const f = E("FmSpacer"), w = E("FmButton"), h = E("FmMenuItem"), P = E("FmMenu"), N = E("FmChip"), z = E("FmDateRangePicker"), H = E("FmTable"), re = E("FmSideSheet");
|
|
875
|
-
return c(), x(ee, null, [v(Mt, {
|
|
876
|
-
heading: u(l)("auditLog.title")
|
|
877
|
-
}, {
|
|
878
|
-
"append-heading": K(() => [v(f), v(w, {
|
|
879
|
-
variant: "primary",
|
|
880
|
-
"prepend-icon": "upload",
|
|
881
|
-
label: u(l)("auditLog.export"),
|
|
882
|
-
disabled: L.value.length === 0 || F.value || u(I).isLoading || u(I).members.length === 0,
|
|
883
|
-
loading: F.value,
|
|
884
|
-
onClick: lt
|
|
885
|
-
}, null, 8, ["label", "disabled", "loading"]), v(P, {
|
|
886
|
-
"close-on-click": !1,
|
|
887
|
-
"z-index": 50
|
|
888
|
-
}, {
|
|
889
|
-
"menu-button": K(() => [v(w, {
|
|
890
|
-
variant: "tertiary",
|
|
891
|
-
icon: "settings",
|
|
892
|
-
"aria-label": u(l)("auditLog.exportSettings.title"),
|
|
893
|
-
disabled: F.value
|
|
894
|
-
}, null, 8, ["aria-label", "disabled"])]),
|
|
895
|
-
default: K(() => [a("div", jt, [a("p", Ct, n(u(l)("auditLog.exportSettings.title")), 1), (c(), x(ee, null, ne(be, (r) => v(h, {
|
|
896
|
-
key: r.key,
|
|
897
|
-
label: u(l)(r.labelKey),
|
|
898
|
-
"has-checkbox": "",
|
|
899
|
-
"model-value": G.value.has(r.key),
|
|
900
|
-
disabled: G.value.has(r.key) && G.value.size === 1,
|
|
901
|
-
onClick: (Q) => tt(r.key)
|
|
902
|
-
}, null, 8, ["label", "model-value", "disabled", "onClick"])), 64))])]),
|
|
903
|
-
_: 1
|
|
904
|
-
})]),
|
|
905
|
-
default: K(() => [a("div", Rt, [a("div", At, [v(Vt, {
|
|
906
|
-
modelValue: T.value,
|
|
907
|
-
"onUpdate:modelValue": t[0] || (t[0] = (r) => T.value = r),
|
|
908
|
-
items: J.value
|
|
909
|
-
}, null, 8, ["modelValue", "items"]), a("div", Et, [v(z, {
|
|
910
|
-
modelValue: m.value,
|
|
911
|
-
"onUpdate:modelValue": t[1] || (t[1] = (r) => m.value = r),
|
|
912
|
-
"show-predefined-range": "",
|
|
913
|
-
"show-time": "",
|
|
914
|
-
"predefined-range": Je.value
|
|
915
|
-
}, {
|
|
916
|
-
"trigger-button": K(() => [v(N, {
|
|
917
|
-
label: We.value,
|
|
918
|
-
icon: "calendar_month"
|
|
919
|
-
}, null, 8, ["label"])]),
|
|
920
|
-
_: 1
|
|
921
|
-
}, 8, ["modelValue", "predefined-range"]), a("div", Ut, [v(de, {
|
|
922
|
-
modelValue: d.value,
|
|
923
|
-
"onUpdate:modelValue": t[2] || (t[2] = (r) => d.value = r),
|
|
924
|
-
items: Le.value,
|
|
925
|
-
multiple: "",
|
|
926
|
-
variant: "dark",
|
|
927
|
-
placeholder: u(l)("auditLog.filter.user_placeholder"),
|
|
928
|
-
"selected-prefix": u(l)("auditLog.filter.selected_user_prefix"),
|
|
929
|
-
"chip-icon": "account_circle"
|
|
930
|
-
}, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])]), q.value ? (c(), x("div", $t, [v(de, {
|
|
931
|
-
modelValue: k.value,
|
|
932
|
-
"onUpdate:modelValue": t[3] || (t[3] = (r) => k.value = r),
|
|
933
|
-
items: U.value,
|
|
934
|
-
"filter-fn": oe,
|
|
935
|
-
multiple: "",
|
|
936
|
-
variant: "dark",
|
|
937
|
-
placeholder: u(l)("auditLog.filter.subject_placeholder"),
|
|
938
|
-
"selected-prefix": u(l)("auditLog.filter.selected_subject_prefix"),
|
|
939
|
-
"chip-icon": "badge"
|
|
940
|
-
}, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])])) : A("", !0), a("div", Nt, [v(de, {
|
|
941
|
-
modelValue: D.value,
|
|
942
|
-
"onUpdate:modelValue": t[4] || (t[4] = (r) => D.value = r),
|
|
943
|
-
items: Ke.value,
|
|
944
|
-
multiple: "",
|
|
945
|
-
variant: "dark",
|
|
946
|
-
placeholder: u(l)("auditLog.filter.action_placeholder"),
|
|
947
|
-
"selected-prefix": u(l)("auditLog.filter.selected_action_prefix"),
|
|
948
|
-
searchable: !1
|
|
949
|
-
}, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])]), a("div", Yt, [v(de, {
|
|
950
|
-
modelValue: y.value,
|
|
951
|
-
"onUpdate:modelValue": t[5] || (t[5] = (r) => y.value = r),
|
|
952
|
-
items: ze.value,
|
|
953
|
-
multiple: "",
|
|
954
|
-
variant: "dark",
|
|
955
|
-
placeholder: u(l)("auditLog.filter.status_placeholder"),
|
|
956
|
-
"selected-prefix": u(l)("auditLog.filter.selected_status_prefix"),
|
|
957
|
-
searchable: !1,
|
|
958
|
-
"chip-icon": "check_circle"
|
|
959
|
-
}, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])])])]), !j.value && L.value.length === 0 ? (c(), Z(u(Ft), {
|
|
960
|
-
key: 0,
|
|
961
|
-
title: u(l)("auditLog.noData.title"),
|
|
962
|
-
subtitle: u(l)("auditLog.noData.subtitle")
|
|
963
|
-
}, null, 8, ["title", "subtitle"])) : (c(), Z(kt, {
|
|
964
|
-
key: 1
|
|
965
|
-
}, {
|
|
966
|
-
default: K(() => [(c(), Z(H, {
|
|
967
|
-
key: Ie.value,
|
|
968
|
-
"column-defs": ot,
|
|
969
|
-
"row-data": L.value,
|
|
970
|
-
"page-size": se,
|
|
971
|
-
"page-count": te.value,
|
|
972
|
-
"row-count": W.value,
|
|
973
|
-
"fetch-fn": st,
|
|
974
|
-
"hide-footer": te.value <= 1,
|
|
975
|
-
loading: j.value,
|
|
976
|
-
"pin-header-row": "",
|
|
977
|
-
class: "audit-log-list-table min-h-0 flex-1 cursor-pointer",
|
|
978
|
-
onRowClick: t[6] || (t[6] = (r) => nt(r.original))
|
|
979
|
-
}, null, 8, ["row-data", "page-count", "row-count", "hide-footer", "loading"]))]),
|
|
980
|
-
_: 1
|
|
981
|
-
}))])]),
|
|
982
|
-
_: 1
|
|
983
|
-
}, 8, ["heading"]), v(re, {
|
|
984
|
-
header: u(l)("auditLog.detail.header"),
|
|
985
|
-
"model-value": O.value,
|
|
986
|
-
"max-width": 480,
|
|
987
|
-
"dismiss-away": "",
|
|
988
|
-
"onUpdate:modelValue": t[7] || (t[7] = (r) => {
|
|
989
|
-
r || ut();
|
|
990
|
-
})
|
|
991
|
-
}, {
|
|
992
|
-
default: K(() => [s.value ? (c(), x("div", Bt, [a("div", Kt, [a("div", zt, [a("p", qt, n(ve(s.value)), 1)]), v(N, {
|
|
993
|
-
variant: Se[s.value.outcome] ?? "neutral",
|
|
994
|
-
label: ge(s.value.outcome),
|
|
995
|
-
compact: ""
|
|
996
|
-
}, null, 8, ["variant", "label"])]), a("div", Ht, [a("div", Wt, [a("div", null, [a("p", Jt, n(u(l)("auditLog.detail.date")), 1), a("p", Gt, n(Xe(s.value.timestamp)), 1)]), a("div", null, [a("p", Xt, n(u(l)("auditLog.detail.user")), 1), a("p", Qt, n(ie(s.value)), 1)]), a("div", null, [a("p", Zt, n(u(l)("auditLog.detail.email")), 1), a("p", el, n(Ge(s.value)), 1)]), a("div", null, [a("p", tl, n(u(l)("auditLog.detail.role")), 1), a("p", ll, n(fe(s.value.subject) || s.value.subject), 1)]), s.value.field ? (c(), x("div", ol, [a("p", al, n(u(l)("auditLog.detail.field")), 1), a("p", sl, n(s.value.field), 1)])) : A("", !0), a("div", null, [a("p", nl, n(u(l)("auditLog.detail.business")), 1), a("p", ul, n(s.value.businessId || "-"), 1)]), a("div", null, [a("p", il, n(u(l)("auditLog.detail.restaurant")), 1), a("p", rl, n(s.value.restaurantId || "-"), 1)])])]), s.value.metadata.operationLabel ? (c(), x("div", dl, [a("div", cl, [a("p", ml, n(u(l)("auditLog.detail.changeDetails")), 1)]), t[8] || (t[8] = a("hr", {
|
|
997
|
-
class: "border-fm-color-border-default"
|
|
998
|
-
}, null, -1)), a("div", fl, [a("div", null, [a("p", vl, n(u(l)("auditLog.detail.eventType")), 1), a("p", gl, n(s.value.metadata.operationLabel), 1)])])])) : A("", !0), a("div", bl, [a("div", pl, [a("p", hl, n(u(l)("auditLog.detail.metadata")), 1)]), t[9] || (t[9] = a("hr", {
|
|
999
|
-
class: "border-fm-color-border-default"
|
|
1000
|
-
}, null, -1)), a("div", yl, [a("div", null, [a("p", _l, n(u(l)("auditLog.detail.resolvedFrom")), 1), a("p", xl, n(Qe(s.value.metadata.resolvedFrom)), 1)]), (s.value.metadata.resolvedFrom === "permissionSet" || s.value.metadata.resolvedFrom === "systemPermissionSet") && (s.value.metadata.permissionSetName || s.value.metadata.permissionSetId) ? (c(), x("div", Ll, [a("p", Sl, n(u(l)("auditLog.detail.permissionSet")), 1), s.value.metadata.permissionSetName ? (c(), x("p", kl, n(s.value.metadata.permissionSetName), 1)) : A("", !0), s.value.metadata.permissionSetId ? (c(), x("p", wl, n(s.value.metadata.permissionSetId), 1)) : A("", !0)])) : A("", !0), s.value.metadata.reason ? (c(), x("div", Ml, [a("p", Fl, n(u(l)("auditLog.detail.reason")), 1), a("p", Dl, n(s.value.metadata.reason), 1)])) : A("", !0), a("div", null, [a("p", Il, n(u(l)("auditLog.detail.requestMethod")), 1), a("p", Ol, n(Ze(s.value)), 1)]), a("div", null, [a("p", Tl, n(u(l)("auditLog.detail.requestPath")), 1), a("p", Pl, n(s.value.metadata.requestPath || "-"), 1)]), s.value.metadata.trace && s.value.metadata.trace.length > 0 ? (c(), x("div", Vl, [a("p", jl, n(u(l)("auditLog.detail.permissionTrace")), 1), a("ol", Cl, [(c(!0), x(ee, null, ne(s.value.metadata.trace, (r, Q) => (c(), x("li", {
|
|
1001
|
-
key: Q,
|
|
1002
|
-
class: "flex items-center gap-6"
|
|
1003
|
-
}, [a("span", Rl, n(Q + 1), 1), a("span", Al, n(r), 1), Q < s.value.metadata.trace.length - 1 ? (c(), x("span", El, "→")) : A("", !0)]))), 128))])])) : A("", !0), g.value ? (c(), x("div", Ul, [a("p", $l, n(u(l)("auditLog.detail.requestBody")), 1), a("pre", Nl, n(g.value), 1)])) : A("", !0)])])])) : A("", !0)]),
|
|
1004
|
-
_: 1
|
|
1005
|
-
}, 8, ["header", "model-value"])], 64);
|
|
1006
|
-
};
|
|
1007
|
-
}
|
|
1008
|
-
}), oo = /* @__PURE__ */ wt(Bl, [["__scopeId", "data-v-5566060e"]]);
|
|
1009
|
-
export {
|
|
1010
|
-
oo as default
|
|
1011
|
-
};
|