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