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