@archbase/security-ui 4.2.6 → 4.3.1
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/UserModal.d.ts +11 -0
- package/dist/archbase-security-ui-4.3.1.tgz +0 -0
- package/dist/index.js +1405 -1277
- package/dist/securityDiagnostics/AuditTrailPanel.d.ts +17 -0
- package/dist/securityDiagnostics/explorer/selection.d.ts +1 -1
- package/dist/securityDiagnostics/types.d.ts +7 -0
- package/package.json +6 -6
- package/dist/archbase-security-ui-4.2.6.tgz +0 -0
package/dist/index.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
import { jsx as e, jsxs as r, Fragment as xe } from "react/jsx-runtime";
|
|
2
|
-
import { Modal as $e, ScrollArea as
|
|
3
|
-
import { getI18nextInstance as
|
|
4
|
-
import { ArchbaseEdit as
|
|
5
|
-
import { useArchbaseV1V2Compatibility as
|
|
6
|
-
import { useState as
|
|
7
|
-
import { IconArrowRight as
|
|
8
|
-
import { UserGroupDto as
|
|
9
|
-
import { DateTimePicker as
|
|
10
|
-
import { useFocusTrap as
|
|
11
|
-
import { ArchbaseSpaceFixed as
|
|
12
|
-
const
|
|
13
|
-
const t = { ...a.options ?? {} },
|
|
14
|
-
a.onCustomSave ? a.onCustomSave(a.dataSource.getCurrentRecord(), (
|
|
15
|
-
|
|
2
|
+
import { Modal as $e, ScrollArea as ue, Stack as U, Grid as W, Group as O, Button as X, Paper as re, Box as Y, Text as c, List as Me, Checkbox as ca, Tooltip as Ie, ActionIcon as ye, Flex as Fe, Space as za, Input as Ce, useTree as da, useMantineColorScheme as qe, TextInput as he, Tree as ua, Badge as j, Tabs as we, RingProgress as Xa, SimpleGrid as We, Table as m, Drawer as _a, Loader as se, Alert as ce, Pagination as Ia, CloseButton as Ya, Chip as ha, Popover as Je, UnstyledButton as ze, Select as er } from "@mantine/core";
|
|
3
|
+
import { getI18nextInstance as f, resolveArchbasePasswordPolicy as ar, ARCHBASE_IOC_API_TYPE as K, emit as Ue, builder as Ne, validateArchbasePassword as rr, convertDateToISOString as tr, processErrorMessage as Te, getKeyByEnumValue as Se, useArchbaseTheme as na, useArchbaseValidator as ir, useArchbaseTranslation as or, useValidationErrors as nr, processDetailErrorMessage as Ve } from "@archbase/core";
|
|
4
|
+
import { ArchbaseEdit as le, ArchbaseNotifications as ne, ArchbasePasswordEdit as lr, ArchbaseSelect as sr, ArchbaseCheckbox as Ae, ArchbaseAvatarEdit as cr, ArchbaseAsyncSelect as dr, Columns as Ee, ArchbaseDataGridColumn as L, ArchbaseDataGrid as ka, ArchbaseDialog as ve } from "@archbase/components";
|
|
5
|
+
import { useArchbaseV1V2Compatibility as Oe, useArchbaseDataSourceListener as pa, useArchbaseRemoteServiceApi as J, useArchbaseRemoteDataSource as ia, ArchbaseDataSource as ur, useArchbaseStore as Ea, useArchbaseRemoteDataSourceV2 as Pe, useArchbaseDataSource as hr } from "@archbase/data";
|
|
6
|
+
import { useState as S, useCallback as ae, useEffect as ee, forwardRef as pr, useMemo as ie, useRef as Re } from "react";
|
|
7
|
+
import { IconArrowRight as Pa, IconArrowLeft as Da, IconChevronDown as ma, IconBorderCornerSquare as ga, IconEye as mr, IconEdit as Fa, IconTrashX as la, IconShieldCheckered as gr, IconPlus as Na } from "@tabler/icons-react";
|
|
8
|
+
import { UserGroupDto as fa, SecurityType as _, UserDto as fr, GroupDto as br, ProfileDto as vr, ApiTokenDto as yr } from "@archbase/security";
|
|
9
|
+
import { DateTimePicker as Tr } from "@mantine/dates";
|
|
10
|
+
import { useFocusTrap as wr, useDebouncedValue as oa } from "@mantine/hooks";
|
|
11
|
+
import { ArchbaseSpaceFixed as Sr, ArchbaseSpaceFill as xr, ArchbaseSpaceBottom as Cr } from "@archbase/layout";
|
|
12
|
+
const Ar = (a) => {
|
|
13
|
+
const t = { ...a.options ?? {} }, l = () => {
|
|
14
|
+
a.onCustomSave ? a.onCustomSave(a.dataSource.getCurrentRecord(), (u) => {
|
|
15
|
+
u && a.onAfterSave && a.onAfterSave(a.dataSource.getCurrentRecord()), a.onClickOk(a.dataSource.getCurrentRecord(), u);
|
|
16
16
|
}) : a.onClickOk(a.dataSource.getCurrentRecord(), !0);
|
|
17
|
-
},
|
|
17
|
+
}, n = () => {
|
|
18
18
|
a.onClickCancel(a.dataSource.getCurrentRecord());
|
|
19
19
|
};
|
|
20
20
|
return /* @__PURE__ */ e(
|
|
21
21
|
$e,
|
|
22
22
|
{
|
|
23
23
|
opened: a.opened,
|
|
24
|
-
onClose:
|
|
25
|
-
title:
|
|
24
|
+
onClose: n,
|
|
25
|
+
title: f().t("archbase:Perfil"),
|
|
26
26
|
size: "60%",
|
|
27
27
|
styles: { content: { maxWidth: 1e3 } },
|
|
28
|
-
children: /* @__PURE__ */ e(
|
|
28
|
+
children: /* @__PURE__ */ e(ue, { style: { height: "460px" }, children: /* @__PURE__ */ r(U, { w: "98%", children: [
|
|
29
29
|
t?.customContentBefore && t.customContentBefore(a.dataSource.getCurrentRecord()),
|
|
30
|
-
/* @__PURE__ */ r(
|
|
31
|
-
/* @__PURE__ */ e(
|
|
32
|
-
|
|
30
|
+
/* @__PURE__ */ r(W, { children: [
|
|
31
|
+
/* @__PURE__ */ e(W.Col, { span: { base: 12, md: 12, lg: 12 }, children: /* @__PURE__ */ e(
|
|
32
|
+
le,
|
|
33
33
|
{
|
|
34
|
-
label: `${
|
|
35
|
-
placeholder: `${
|
|
34
|
+
label: `${f().t("archbase:Nome do perfil")}`,
|
|
35
|
+
placeholder: `${f().t("archbase:Informe o nome do perfil")}`,
|
|
36
36
|
dataSource: a.dataSource,
|
|
37
37
|
dataField: "name"
|
|
38
38
|
}
|
|
39
39
|
) }),
|
|
40
|
-
/* @__PURE__ */ e(
|
|
41
|
-
|
|
40
|
+
/* @__PURE__ */ e(W.Col, { span: { base: 12, md: 12, lg: 12 }, children: /* @__PURE__ */ e(
|
|
41
|
+
le,
|
|
42
42
|
{
|
|
43
|
-
label: `${
|
|
44
|
-
placeholder: `${
|
|
43
|
+
label: `${f().t("archbase:Descrição do perfil")}`,
|
|
44
|
+
placeholder: `${f().t("archbase:Informe a descrição do perfil")}`,
|
|
45
45
|
dataSource: a.dataSource,
|
|
46
46
|
dataField: "description"
|
|
47
47
|
}
|
|
@@ -49,71 +49,71 @@ const xr = (a) => {
|
|
|
49
49
|
] }),
|
|
50
50
|
t?.customContentAfter && t.customContentAfter(a.dataSource.getCurrentRecord()),
|
|
51
51
|
/* @__PURE__ */ r(O, { justify: "flex-end", mt: "md", children: [
|
|
52
|
-
/* @__PURE__ */ e(X, { variant: "default", onClick:
|
|
53
|
-
/* @__PURE__ */ e(X, { onClick:
|
|
52
|
+
/* @__PURE__ */ e(X, { variant: "default", onClick: n, children: f().t("archbase:Cancelar") }),
|
|
53
|
+
/* @__PURE__ */ e(X, { onClick: l, children: f().t("archbase:Salvar") })
|
|
54
54
|
] })
|
|
55
55
|
] }) })
|
|
56
56
|
}
|
|
57
57
|
);
|
|
58
58
|
};
|
|
59
|
-
function
|
|
59
|
+
function Rr({
|
|
60
60
|
availableItemsDS: a,
|
|
61
61
|
assignedItemsDS: t,
|
|
62
|
-
idFieldAvailable:
|
|
63
|
-
labelFieldAvailable:
|
|
64
|
-
idFieldAssigned:
|
|
62
|
+
idFieldAvailable: l,
|
|
63
|
+
labelFieldAvailable: n,
|
|
64
|
+
idFieldAssigned: u,
|
|
65
65
|
labelFieldAssigned: d,
|
|
66
|
-
handleCreateAssociationObject:
|
|
67
|
-
width:
|
|
68
|
-
height:
|
|
69
|
-
titleAvailable:
|
|
70
|
-
titleAssigned:
|
|
66
|
+
handleCreateAssociationObject: h,
|
|
67
|
+
width: A = "400px",
|
|
68
|
+
height: z = "200px",
|
|
69
|
+
titleAvailable: g = "Disponíveis",
|
|
70
|
+
titleAssigned: T = "Selecionados"
|
|
71
71
|
}) {
|
|
72
|
-
|
|
72
|
+
Oe(
|
|
73
73
|
"ArchbaseDualListSelector-Available",
|
|
74
74
|
a,
|
|
75
75
|
void 0,
|
|
76
76
|
[]
|
|
77
77
|
);
|
|
78
|
-
const
|
|
78
|
+
const R = Oe(
|
|
79
79
|
"ArchbaseDualListSelector-Assigned",
|
|
80
80
|
t,
|
|
81
81
|
void 0,
|
|
82
82
|
[]
|
|
83
|
-
), [
|
|
84
|
-
a &&
|
|
83
|
+
), [x, D] = S([]), [b, w] = S([]), [o, s] = S([]), [p, v] = S([]), $ = ae(() => {
|
|
84
|
+
a && D(a.browseRecords()), t && w(t.browseRecords());
|
|
85
85
|
}, [a, t]);
|
|
86
|
-
|
|
86
|
+
pa({
|
|
87
87
|
dataSource: a,
|
|
88
|
-
listener: () =>
|
|
89
|
-
}),
|
|
88
|
+
listener: () => $()
|
|
89
|
+
}), pa({
|
|
90
90
|
dataSource: t,
|
|
91
|
-
listener: () =>
|
|
91
|
+
listener: () => $()
|
|
92
92
|
}), ee(() => {
|
|
93
|
-
|
|
94
|
-
}, [
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
},
|
|
98
|
-
o.forEach((
|
|
99
|
-
const C =
|
|
93
|
+
$();
|
|
94
|
+
}, [$]);
|
|
95
|
+
const y = (F, C) => typeof C == "function" ? C(F) : F[C], i = (F, C) => typeof C == "function" ? C(F) : F[C], N = (F, C) => {
|
|
96
|
+
F((k) => k.includes(C) ? k.filter((oe) => oe !== C) : [...k, C]);
|
|
97
|
+
}, I = () => {
|
|
98
|
+
o.forEach((F) => {
|
|
99
|
+
const C = x.find((k) => y(k, l) === F);
|
|
100
100
|
if (C) {
|
|
101
|
-
const
|
|
102
|
-
|
|
101
|
+
const k = h(C);
|
|
102
|
+
R.isDataSourceV2 ? (t.insert(k), t.save()) : (t.insert(k), t.save(), R.v1State.forceUpdate());
|
|
103
103
|
}
|
|
104
|
-
}),
|
|
105
|
-
},
|
|
106
|
-
p.forEach((
|
|
107
|
-
const C =
|
|
104
|
+
}), s([]);
|
|
105
|
+
}, M = () => {
|
|
106
|
+
p.forEach((F) => {
|
|
107
|
+
const C = b.find((k) => y(k, u) === F);
|
|
108
108
|
if (C) {
|
|
109
|
-
const
|
|
110
|
-
|
|
109
|
+
const k = typeof u == "function" ? { customId: u(C) } : { [u]: F };
|
|
110
|
+
R.isDataSourceV2 ? t.remove(() => t.locate(k)) : (t.remove(() => t.locate(k)), R.v1State.forceUpdate());
|
|
111
111
|
}
|
|
112
|
-
}),
|
|
112
|
+
}), v([]);
|
|
113
113
|
};
|
|
114
|
-
return /* @__PURE__ */ r(re, { withBorder: !0, style: { display: "flex", width:
|
|
115
|
-
/* @__PURE__ */ r(
|
|
116
|
-
/* @__PURE__ */ e(
|
|
114
|
+
return /* @__PURE__ */ r(re, { withBorder: !0, style: { display: "flex", width: A, height: z }, children: [
|
|
115
|
+
/* @__PURE__ */ r(Y, { style: { minWidth: "44%", minHeight: z }, children: [
|
|
116
|
+
/* @__PURE__ */ e(c, { children: g }),
|
|
117
117
|
/* @__PURE__ */ e(
|
|
118
118
|
Me,
|
|
119
119
|
{
|
|
@@ -127,26 +127,26 @@ function Tr({
|
|
|
127
127
|
overflowX: "hidden",
|
|
128
128
|
height: "calc(100% - 32px)"
|
|
129
129
|
},
|
|
130
|
-
children:
|
|
131
|
-
|
|
130
|
+
children: x.map((F) => /* @__PURE__ */ e(Me.Item, { children: /* @__PURE__ */ e(
|
|
131
|
+
ca,
|
|
132
132
|
{
|
|
133
|
-
label: i(
|
|
134
|
-
checked: o.includes(
|
|
135
|
-
onChange: () => N(
|
|
136
|
-
disabled:
|
|
137
|
-
(C) =>
|
|
133
|
+
label: i(F, n),
|
|
134
|
+
checked: o.includes(y(F, l)),
|
|
135
|
+
onChange: () => N(s, y(F, l)),
|
|
136
|
+
disabled: b.some(
|
|
137
|
+
(C) => y(C, u) === y(F, l)
|
|
138
138
|
)
|
|
139
139
|
}
|
|
140
|
-
) },
|
|
140
|
+
) }, y(F, l)))
|
|
141
141
|
}
|
|
142
142
|
)
|
|
143
143
|
] }),
|
|
144
|
-
/* @__PURE__ */ r(
|
|
145
|
-
/* @__PURE__ */ e(
|
|
146
|
-
/* @__PURE__ */ e(
|
|
144
|
+
/* @__PURE__ */ r(U, { gap: 5, style: { minWidth: "10%" }, justify: "center", align: "center", children: [
|
|
145
|
+
/* @__PURE__ */ e(Ie, { label: "Adicionar", children: /* @__PURE__ */ e(ye, { onClick: I, disabled: !o.length, children: /* @__PURE__ */ e(Pa, {}) }) }),
|
|
146
|
+
/* @__PURE__ */ e(Ie, { label: "Remover", children: /* @__PURE__ */ e(ye, { onClick: M, disabled: !p.length, children: /* @__PURE__ */ e(Da, {}) }) })
|
|
147
147
|
] }),
|
|
148
|
-
/* @__PURE__ */ r(
|
|
149
|
-
/* @__PURE__ */ e(
|
|
148
|
+
/* @__PURE__ */ r(Y, { style: { minWidth: "44%", minHeight: z }, children: [
|
|
149
|
+
/* @__PURE__ */ e(c, { children: T }),
|
|
150
150
|
/* @__PURE__ */ e(
|
|
151
151
|
Me,
|
|
152
152
|
{
|
|
@@ -160,27 +160,29 @@ function Tr({
|
|
|
160
160
|
overflowX: "hidden",
|
|
161
161
|
height: "calc(100% - 32px)"
|
|
162
162
|
},
|
|
163
|
-
children:
|
|
164
|
-
|
|
163
|
+
children: b.map((F) => /* @__PURE__ */ e(Me.Item, { children: /* @__PURE__ */ e(
|
|
164
|
+
ca,
|
|
165
165
|
{
|
|
166
|
-
label: i(
|
|
167
|
-
checked: p.includes(
|
|
168
|
-
onChange: () => N(
|
|
166
|
+
label: i(F, d),
|
|
167
|
+
checked: p.includes(y(F, u)),
|
|
168
|
+
onChange: () => N(v, y(F, u))
|
|
169
169
|
}
|
|
170
|
-
) },
|
|
170
|
+
) }, y(F, u)))
|
|
171
171
|
}
|
|
172
172
|
)
|
|
173
173
|
] })
|
|
174
174
|
] });
|
|
175
175
|
}
|
|
176
|
-
const
|
|
177
|
-
({ image: a, label: t, description:
|
|
178
|
-
/* @__PURE__ */ e(
|
|
179
|
-
/* @__PURE__ */ e(
|
|
176
|
+
const zr = pr(
|
|
177
|
+
({ image: a, label: t, description: l, origin: n, ...u }, d) => /* @__PURE__ */ e("div", { ref: d, ...u, children: /* @__PURE__ */ r(Fe, { children: [
|
|
178
|
+
/* @__PURE__ */ e(c, { size: "sm", fw: 600, children: n ? n.name : "" }),
|
|
179
|
+
/* @__PURE__ */ e(za, { w: "lg" })
|
|
180
180
|
] }) })
|
|
181
|
-
),
|
|
181
|
+
), Ir = {
|
|
182
182
|
// Campos de identificação
|
|
183
183
|
showNickname: !0,
|
|
184
|
+
// Desligada por padrão: ver a justificativa em UserModalOptions.showEmployeeId.
|
|
185
|
+
showEmployeeId: !1,
|
|
184
186
|
// Campos de perfil e grupos
|
|
185
187
|
showProfile: !0,
|
|
186
188
|
showGroups: !0,
|
|
@@ -202,68 +204,68 @@ const Ar = ur(
|
|
|
202
204
|
avatarImageQuality: 1,
|
|
203
205
|
avatarMaxOutputSizePx: 512,
|
|
204
206
|
allowEditEmail: !0
|
|
205
|
-
},
|
|
206
|
-
const [t,
|
|
207
|
-
const p = a.dataSource.getFieldValue(
|
|
208
|
-
return
|
|
209
|
-
}).filter((
|
|
210
|
-
...
|
|
211
|
-
blocklist: [...
|
|
212
|
-
} : void 0,
|
|
207
|
+
}, kr = (a) => {
|
|
208
|
+
const [t, l] = S(""), n = { ...Ir, ...a.options ?? {} }, u = a.dataSource.getFieldValue("passwordChangedAt"), d = u ? new Date(u) : void 0, h = d && !Number.isNaN(d.getTime()) ? d.toLocaleString() : void 0, A = ar(n.passwordPolicy), z = n.forbidPersonalDataInPassword ? ["name", "nickname", "email"].map((s) => {
|
|
209
|
+
const p = a.dataSource.getFieldValue(s);
|
|
210
|
+
return s === "email" && p ? p.split("@")[0] : p;
|
|
211
|
+
}).filter((s) => typeof s == "string" && s.trim().length >= 3) : [], g = A ? {
|
|
212
|
+
...A,
|
|
213
|
+
blocklist: [...A.blocklist ?? [], ...z]
|
|
214
|
+
} : void 0, T = J(K.Group), { dataSource: R } = ia({
|
|
213
215
|
name: "dsGroups",
|
|
214
|
-
service:
|
|
216
|
+
service: T,
|
|
215
217
|
pageSize: 9999,
|
|
216
218
|
loadOnStart: !0,
|
|
217
219
|
sort: ["name:asc"],
|
|
218
|
-
onError: (
|
|
219
|
-
ne.showError(
|
|
220
|
+
onError: (s, p) => {
|
|
221
|
+
ne.showError(f().t("archbase:WARNING"), s, p);
|
|
220
222
|
}
|
|
221
223
|
});
|
|
222
224
|
console.log("versão 12/05/2026");
|
|
223
|
-
const
|
|
225
|
+
const x = J(K.Profile), { dataSource: D } = ia({
|
|
224
226
|
name: "dsProfiles",
|
|
225
|
-
service:
|
|
227
|
+
service: x,
|
|
226
228
|
pageSize: 9999,
|
|
227
229
|
loadOnStart: !0,
|
|
228
230
|
sort: ["name:asc"],
|
|
229
|
-
onError: (
|
|
230
|
-
ne.showError(
|
|
231
|
+
onError: (s, p) => {
|
|
232
|
+
ne.showError(f().t("archbase:WARNING"), s, p);
|
|
231
233
|
}
|
|
232
234
|
});
|
|
233
235
|
ee(() => {
|
|
234
|
-
|
|
236
|
+
l("");
|
|
235
237
|
}, [a.dataSource.getFieldValue("password")]);
|
|
236
|
-
const
|
|
238
|
+
const b = async () => {
|
|
237
239
|
if (a.dataSource.isInserting()) {
|
|
238
|
-
if (
|
|
239
|
-
const
|
|
240
|
+
if (n.userDefaultProfile) {
|
|
241
|
+
const s = Ue(Ne.eq("name", n.userDefaultProfile)), p = await x.findAllWithFilter(s, 0, 1);
|
|
240
242
|
p && p.content.length > 0 && a.dataSource.setFieldValue("profile", p.content[0]);
|
|
241
243
|
}
|
|
242
|
-
if (
|
|
243
|
-
const
|
|
244
|
-
p && p.content.length > 0 && a.dataSource.setFieldValue("groups", p.content.map((
|
|
244
|
+
if (n.userDefaultGroups) {
|
|
245
|
+
const s = Ue(Ne.in("name", n.userDefaultGroups)), p = await T.findAllWithFilter(s, 0, 500);
|
|
246
|
+
p && p.content.length > 0 && a.dataSource.setFieldValue("groups", p.content.map((v) => fa.newInstance(v)));
|
|
245
247
|
}
|
|
246
248
|
}
|
|
247
249
|
};
|
|
248
250
|
ee(() => {
|
|
249
|
-
a.opened &&
|
|
251
|
+
a.opened && b();
|
|
250
252
|
}, [a.opened]);
|
|
251
253
|
const w = () => {
|
|
252
|
-
const
|
|
253
|
-
if (!
|
|
254
|
-
|
|
254
|
+
const s = a.dataSource.getCurrentRecord();
|
|
255
|
+
if (!s.password && a.dataSource.isInserting()) {
|
|
256
|
+
l(f().t("archbase:Informe a senha"));
|
|
255
257
|
return;
|
|
256
258
|
}
|
|
257
|
-
if (
|
|
258
|
-
const p =
|
|
259
|
+
if (g && s.password) {
|
|
260
|
+
const p = rr(s.password, g);
|
|
259
261
|
if (!p.valid) {
|
|
260
|
-
|
|
262
|
+
l(p.error);
|
|
261
263
|
return;
|
|
262
264
|
}
|
|
263
265
|
}
|
|
264
|
-
a.onCustomSave ? a.onCustomSave(
|
|
265
|
-
p && a.onAfterSave && a.onAfterSave(
|
|
266
|
-
}) : a.onClickOk(
|
|
266
|
+
a.onCustomSave ? a.onCustomSave(s, (p) => {
|
|
267
|
+
p && a.onAfterSave && a.onAfterSave(s), a.onClickOk(s, p);
|
|
268
|
+
}) : a.onClickOk(s, !0);
|
|
267
269
|
}, o = () => {
|
|
268
270
|
a.onClickCancel(a.dataSource.getCurrentRecord());
|
|
269
271
|
};
|
|
@@ -272,169 +274,181 @@ const Ar = ur(
|
|
|
272
274
|
{
|
|
273
275
|
opened: a.opened,
|
|
274
276
|
onClose: o,
|
|
275
|
-
title:
|
|
277
|
+
title: f().t("archbase:Usuário"),
|
|
276
278
|
size: "80%",
|
|
277
279
|
styles: { content: { maxWidth: 1e3 } },
|
|
278
280
|
children: [
|
|
279
|
-
/* @__PURE__ */ e(
|
|
280
|
-
|
|
281
|
-
/* @__PURE__ */ r(
|
|
282
|
-
/* @__PURE__ */ e(
|
|
281
|
+
/* @__PURE__ */ e(ue, { style: { height: "500px" }, children: /* @__PURE__ */ r(U, { w: "98%", children: [
|
|
282
|
+
n?.customContentBefore && /* @__PURE__ */ e(xe, { children: n.customContentBefore(a.dataSource.getCurrentRecord()) }),
|
|
283
|
+
/* @__PURE__ */ r(W, { children: [
|
|
284
|
+
/* @__PURE__ */ e(W.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ r(O, { children: [
|
|
283
285
|
/* @__PURE__ */ e(
|
|
284
|
-
|
|
286
|
+
le,
|
|
285
287
|
{
|
|
286
|
-
label: `${
|
|
287
|
-
placeholder: `${
|
|
288
|
+
label: `${f().t("archbase:Nome completo")}`,
|
|
289
|
+
placeholder: `${f().t("archbase:Informe o nome completo do usuário")}`,
|
|
288
290
|
dataSource: a.dataSource,
|
|
289
291
|
dataField: "name",
|
|
290
292
|
required: !0,
|
|
291
293
|
width: "calc(100% - 208px)"
|
|
292
294
|
}
|
|
293
295
|
),
|
|
294
|
-
|
|
295
|
-
|
|
296
|
+
n.showNickname && /* @__PURE__ */ e(
|
|
297
|
+
le,
|
|
296
298
|
{
|
|
297
|
-
label: `${
|
|
298
|
-
placeholder: `${
|
|
299
|
+
label: `${f().t("archbase:Apelido")}`,
|
|
300
|
+
placeholder: `${f().t("archbase:Apelido")}`,
|
|
299
301
|
dataSource: a.dataSource,
|
|
300
302
|
dataField: "nickname",
|
|
301
|
-
required:
|
|
303
|
+
required: n.requiredNickname
|
|
302
304
|
}
|
|
303
305
|
)
|
|
304
306
|
] }) }),
|
|
305
|
-
/* @__PURE__ */ e(
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
307
|
+
/* @__PURE__ */ e(W.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ r(O, { children: [
|
|
308
|
+
/* @__PURE__ */ e(
|
|
309
|
+
le,
|
|
310
|
+
{
|
|
311
|
+
label: `${f().t("archbase:Descrição do usuário")}`,
|
|
312
|
+
placeholder: `${f().t("archbase:Informe a descrição do usuário")}`,
|
|
313
|
+
dataSource: a.dataSource,
|
|
314
|
+
dataField: "description",
|
|
315
|
+
required: !0,
|
|
316
|
+
width: n.showEmployeeId ? "calc(100% - 208px)" : void 0
|
|
317
|
+
}
|
|
318
|
+
),
|
|
319
|
+
n.showEmployeeId && /* @__PURE__ */ e(
|
|
320
|
+
le,
|
|
321
|
+
{
|
|
322
|
+
label: `${f().t("archbase:Matrícula")}`,
|
|
323
|
+
placeholder: `${f().t("archbase:Matrícula do funcionário")}`,
|
|
324
|
+
dataSource: a.dataSource,
|
|
325
|
+
dataField: "employeeId"
|
|
326
|
+
}
|
|
327
|
+
)
|
|
328
|
+
] }) })
|
|
315
329
|
] }),
|
|
316
|
-
/* @__PURE__ */ r(
|
|
317
|
-
/* @__PURE__ */ e(
|
|
318
|
-
|
|
330
|
+
/* @__PURE__ */ r(W, { children: [
|
|
331
|
+
/* @__PURE__ */ e(W.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e(
|
|
332
|
+
le,
|
|
319
333
|
{
|
|
320
|
-
label: `${
|
|
321
|
-
placeholder: `${
|
|
334
|
+
label: `${f().t("archbase:E-mail")}`,
|
|
335
|
+
placeholder: `${f().t("archbase:Informe o e-mail do usuário")}`,
|
|
322
336
|
dataSource: a.dataSource,
|
|
323
|
-
onChangeValue: (
|
|
337
|
+
onChangeValue: (s) => a.dataSource.setFieldValue("userName", s),
|
|
324
338
|
dataField: "email",
|
|
325
|
-
readOnly: a.dataSource.isEditing() ? !
|
|
339
|
+
readOnly: a.dataSource.isEditing() ? !n.allowEditEmail : !1,
|
|
326
340
|
required: !0
|
|
327
341
|
}
|
|
328
342
|
) }),
|
|
329
|
-
/* @__PURE__ */ e(
|
|
330
|
-
|
|
343
|
+
/* @__PURE__ */ e(W.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e(
|
|
344
|
+
lr,
|
|
331
345
|
{
|
|
332
|
-
label: `${
|
|
346
|
+
label: `${f().t("archbase:Senha usuário")}`,
|
|
333
347
|
dataSource: a.dataSource,
|
|
334
348
|
dataField: "password",
|
|
335
349
|
error: t,
|
|
336
350
|
required: a.dataSource.getFieldValue("isNewUser"),
|
|
337
|
-
passwordPolicy:
|
|
338
|
-
showPasswordRequirements:
|
|
351
|
+
passwordPolicy: g,
|
|
352
|
+
showPasswordRequirements: n.showPasswordRequirements
|
|
339
353
|
}
|
|
340
354
|
) })
|
|
341
355
|
] }),
|
|
342
|
-
/* @__PURE__ */ e(
|
|
343
|
-
|
|
356
|
+
/* @__PURE__ */ e(W, { children: n.showProfile && /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e(
|
|
357
|
+
sr,
|
|
344
358
|
{
|
|
345
|
-
label: `${
|
|
359
|
+
label: `${f().t("archbase:Perfil do usuário")}`,
|
|
346
360
|
dataSource: a.dataSource,
|
|
347
361
|
dataField: "profile",
|
|
348
|
-
options:
|
|
362
|
+
options: D,
|
|
349
363
|
allowDeselect: !0,
|
|
350
364
|
optionsLabelField: "nome",
|
|
351
|
-
itemComponent:
|
|
352
|
-
getOptionLabel: (
|
|
353
|
-
getOptionValue: (
|
|
365
|
+
itemComponent: zr,
|
|
366
|
+
getOptionLabel: (s) => s.name,
|
|
367
|
+
getOptionValue: (s) => s.id
|
|
354
368
|
}
|
|
355
369
|
) }) }),
|
|
356
|
-
/* @__PURE__ */ r(
|
|
357
|
-
/* @__PURE__ */ e(
|
|
358
|
-
/* @__PURE__ */ e(
|
|
359
|
-
|
|
370
|
+
/* @__PURE__ */ r(W, { children: [
|
|
371
|
+
/* @__PURE__ */ e(W.Col, { span: { base: 12 }, children: n.showAccountConfigLabel && /* @__PURE__ */ e(c, { fz: 14, fw: 500, children: "Informe" }) }),
|
|
372
|
+
/* @__PURE__ */ e(W.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ r(U, { gap: "lg", children: [
|
|
373
|
+
n.showChangePasswordOnNextLogin && /* @__PURE__ */ e(Ce.Wrapper, { label: "", children: /* @__PURE__ */ e(
|
|
360
374
|
Ae,
|
|
361
375
|
{
|
|
362
376
|
dataSource: a.dataSource,
|
|
363
377
|
dataField: "changePasswordOnNextLogin",
|
|
364
|
-
label: `${
|
|
378
|
+
label: `${f().t("archbase:Deve alterar senha próximo login ?")}`
|
|
365
379
|
}
|
|
366
380
|
) }),
|
|
367
|
-
|
|
381
|
+
n.showAllowPasswordChange && /* @__PURE__ */ e(Ce.Wrapper, { label: "", children: /* @__PURE__ */ e(
|
|
368
382
|
Ae,
|
|
369
383
|
{
|
|
370
384
|
dataSource: a.dataSource,
|
|
371
385
|
dataField: "allowPasswordChange",
|
|
372
|
-
label: `${
|
|
386
|
+
label: `${f().t("archbase:Pode alterar a senha ?")}`
|
|
373
387
|
}
|
|
374
388
|
) }),
|
|
375
|
-
|
|
389
|
+
n.showPasswordNeverExpires && /* @__PURE__ */ r(Ce.Wrapper, { label: "", children: [
|
|
376
390
|
/* @__PURE__ */ e(
|
|
377
391
|
Ae,
|
|
378
392
|
{
|
|
379
393
|
dataSource: a.dataSource,
|
|
380
394
|
dataField: "passwordNeverExpires",
|
|
381
|
-
label: `${
|
|
395
|
+
label: `${f().t("archbase:Senha nunca expira ?")}`
|
|
382
396
|
}
|
|
383
397
|
),
|
|
384
|
-
/* @__PURE__ */ e(
|
|
398
|
+
/* @__PURE__ */ e(c, { fz: 12, c: "dimmed", children: f().t(
|
|
385
399
|
'archbase:Desmarcado, a senha expira conforme a política de validade do servidor. Para exigir a troca agora, use "Deve alterar senha próximo login".'
|
|
386
400
|
) })
|
|
387
401
|
] }),
|
|
388
|
-
|
|
402
|
+
n.showPasswordChangedAt && h && /* @__PURE__ */ e(c, { fz: 12, c: "dimmed", children: `${f().t("archbase:Última troca de senha")}: ${h}` })
|
|
389
403
|
] }) }),
|
|
390
|
-
/* @__PURE__ */ e(
|
|
391
|
-
|
|
404
|
+
/* @__PURE__ */ e(W.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ r(U, { gap: "lg", children: [
|
|
405
|
+
n.showAccountDeactivated && /* @__PURE__ */ e(Ce.Wrapper, { label: "", children: /* @__PURE__ */ e(
|
|
392
406
|
Ae,
|
|
393
407
|
{
|
|
394
408
|
dataSource: a.dataSource,
|
|
395
409
|
dataField: "accountDeactivated",
|
|
396
|
-
label: `${
|
|
410
|
+
label: `${f().t("archbase:Conta desativada ?")}`
|
|
397
411
|
}
|
|
398
412
|
) }),
|
|
399
|
-
|
|
413
|
+
n.showAccountLocked && /* @__PURE__ */ e(Ce.Wrapper, { label: "", children: /* @__PURE__ */ e(
|
|
400
414
|
Ae,
|
|
401
415
|
{
|
|
402
416
|
dataSource: a.dataSource,
|
|
403
417
|
dataField: "accountLocked",
|
|
404
|
-
label: `${
|
|
418
|
+
label: `${f().t("archbase:Conta bloqueada ?")}`
|
|
405
419
|
}
|
|
406
420
|
) }),
|
|
407
|
-
|
|
421
|
+
n.showIsAdministrator && /* @__PURE__ */ e(Ce.Wrapper, { label: "", children: /* @__PURE__ */ e(
|
|
408
422
|
Ae,
|
|
409
423
|
{
|
|
410
424
|
dataSource: a.dataSource,
|
|
411
425
|
dataField: "isAdministrator",
|
|
412
|
-
label: `${
|
|
426
|
+
label: `${f().t("archbase:Administrador ?")}`
|
|
413
427
|
}
|
|
414
428
|
) })
|
|
415
429
|
] }) }),
|
|
416
|
-
/* @__PURE__ */ e(
|
|
417
|
-
|
|
430
|
+
/* @__PURE__ */ e(W.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e(U, { gap: "lg", children: /* @__PURE__ */ e(
|
|
431
|
+
cr,
|
|
418
432
|
{
|
|
419
|
-
label:
|
|
433
|
+
label: f().t("archbase:Foto do usuário"),
|
|
420
434
|
dataSource: a.dataSource,
|
|
421
435
|
dataField: "avatar",
|
|
422
436
|
width: 120,
|
|
423
437
|
height: 120,
|
|
424
|
-
maxSizeKB:
|
|
425
|
-
imageQuality:
|
|
426
|
-
maxOutputSizePx:
|
|
438
|
+
maxSizeKB: n.avatarMaxSizeKB,
|
|
439
|
+
imageQuality: n.avatarImageQuality,
|
|
440
|
+
maxOutputSizePx: n.avatarMaxOutputSizePx
|
|
427
441
|
}
|
|
428
442
|
) }) })
|
|
429
443
|
] }),
|
|
430
|
-
|
|
431
|
-
/* @__PURE__ */ e(
|
|
432
|
-
/* @__PURE__ */ e(
|
|
433
|
-
|
|
444
|
+
n.showGroups && /* @__PURE__ */ r(W, { children: [
|
|
445
|
+
/* @__PURE__ */ e(W.Col, { span: { base: 12 }, children: /* @__PURE__ */ e(c, { fz: 14, fw: 500, children: "Grupos" }) }),
|
|
446
|
+
/* @__PURE__ */ e(W.Col, { span: { base: 12 }, children: /* @__PURE__ */ e(
|
|
447
|
+
Rr,
|
|
434
448
|
{
|
|
435
|
-
titleAvailable:
|
|
436
|
-
titleAssigned:
|
|
437
|
-
assignedItemsDS: new
|
|
449
|
+
titleAvailable: f().t("archbase:Disponíveis"),
|
|
450
|
+
titleAssigned: f().t("archbase:Selecionados"),
|
|
451
|
+
assignedItemsDS: new ur("dsDualList", {
|
|
438
452
|
records: a.dataSource.getFieldValue("groups"),
|
|
439
453
|
grandTotalRecords: a.dataSource.getFieldValue("groups").length,
|
|
440
454
|
currentPage: 0,
|
|
@@ -443,58 +457,58 @@ const Ar = ur(
|
|
|
443
457
|
}),
|
|
444
458
|
width: "100%",
|
|
445
459
|
height: "200px",
|
|
446
|
-
availableItemsDS:
|
|
447
|
-
handleCreateAssociationObject: (
|
|
448
|
-
idFieldAssigned: (
|
|
460
|
+
availableItemsDS: R,
|
|
461
|
+
handleCreateAssociationObject: (s) => fa.newInstance(s),
|
|
462
|
+
idFieldAssigned: (s) => s && s.group ? s.group.id : "",
|
|
449
463
|
idFieldAvailable: "id",
|
|
450
|
-
labelFieldAssigned: (
|
|
464
|
+
labelFieldAssigned: (s) => s && s.group ? s.group.name : "",
|
|
451
465
|
labelFieldAvailable: "name"
|
|
452
466
|
}
|
|
453
467
|
) })
|
|
454
468
|
] }),
|
|
455
|
-
|
|
456
|
-
/* @__PURE__ */ e(
|
|
469
|
+
n?.customContentAfter && /* @__PURE__ */ e(xe, { children: n.customContentAfter(a.dataSource.getCurrentRecord()) }),
|
|
470
|
+
/* @__PURE__ */ e(za, { h: "12px" })
|
|
457
471
|
] }) }),
|
|
458
472
|
/* @__PURE__ */ r(O, { justify: "flex-end", mt: "md", children: [
|
|
459
|
-
/* @__PURE__ */ e(X, { variant: "default", onClick: o, children:
|
|
460
|
-
/* @__PURE__ */ e(X, { onClick: w, children:
|
|
473
|
+
/* @__PURE__ */ e(X, { variant: "default", onClick: o, children: f().t("archbase:Cancelar") }),
|
|
474
|
+
/* @__PURE__ */ e(X, { onClick: w, children: f().t("archbase:Salvar") })
|
|
461
475
|
] })
|
|
462
476
|
]
|
|
463
477
|
}
|
|
464
478
|
);
|
|
465
|
-
},
|
|
466
|
-
const t = { ...a.options ?? {} },
|
|
467
|
-
a.onCustomSave ? a.onCustomSave(a.dataSource.getCurrentRecord(), (
|
|
468
|
-
|
|
479
|
+
}, Er = (a) => {
|
|
480
|
+
const t = { ...a.options ?? {} }, l = () => {
|
|
481
|
+
a.onCustomSave ? a.onCustomSave(a.dataSource.getCurrentRecord(), (u) => {
|
|
482
|
+
u && a.onAfterSave && a.onAfterSave(a.dataSource.getCurrentRecord()), a.onClickOk(a.dataSource.getCurrentRecord(), u);
|
|
469
483
|
}) : a.onClickOk(a.dataSource.getCurrentRecord(), !0);
|
|
470
|
-
},
|
|
484
|
+
}, n = () => {
|
|
471
485
|
a.onClickCancel(a.dataSource.getCurrentRecord());
|
|
472
486
|
};
|
|
473
487
|
return /* @__PURE__ */ e(
|
|
474
488
|
$e,
|
|
475
489
|
{
|
|
476
490
|
opened: a.opened,
|
|
477
|
-
onClose:
|
|
478
|
-
title:
|
|
491
|
+
onClose: n,
|
|
492
|
+
title: f().t("archbase:Grupo"),
|
|
479
493
|
size: "60%",
|
|
480
494
|
styles: { content: { maxWidth: 1e3 } },
|
|
481
|
-
children: /* @__PURE__ */ e(
|
|
495
|
+
children: /* @__PURE__ */ e(ue, { style: { height: "460px" }, children: /* @__PURE__ */ r(U, { w: "98%", children: [
|
|
482
496
|
t?.customContentBefore && t.customContentBefore(a.dataSource.getCurrentRecord()),
|
|
483
|
-
/* @__PURE__ */ r(
|
|
484
|
-
/* @__PURE__ */ e(
|
|
485
|
-
|
|
497
|
+
/* @__PURE__ */ r(W, { children: [
|
|
498
|
+
/* @__PURE__ */ e(W.Col, { span: { base: 12 }, children: /* @__PURE__ */ e(
|
|
499
|
+
le,
|
|
486
500
|
{
|
|
487
|
-
label: `${
|
|
488
|
-
placeholder: `${
|
|
501
|
+
label: `${f().t("archbase:Nome do grupo")}`,
|
|
502
|
+
placeholder: `${f().t("archbase:Informe o nome do grupo")}`,
|
|
489
503
|
dataSource: a.dataSource,
|
|
490
504
|
dataField: "name"
|
|
491
505
|
}
|
|
492
506
|
) }),
|
|
493
|
-
/* @__PURE__ */ e(
|
|
494
|
-
|
|
507
|
+
/* @__PURE__ */ e(W.Col, { span: { base: 12 }, children: /* @__PURE__ */ e(
|
|
508
|
+
le,
|
|
495
509
|
{
|
|
496
|
-
label: `${
|
|
497
|
-
placeholder: `${
|
|
510
|
+
label: `${f().t("archbase:Descrição do grupo")}`,
|
|
511
|
+
placeholder: `${f().t("archbase:Informe a descrição do grupo")}`,
|
|
498
512
|
dataSource: a.dataSource,
|
|
499
513
|
dataField: "description"
|
|
500
514
|
}
|
|
@@ -502,82 +516,82 @@ const Ar = ur(
|
|
|
502
516
|
] }),
|
|
503
517
|
t?.customContentAfter && t.customContentAfter(a.dataSource.getCurrentRecord()),
|
|
504
518
|
/* @__PURE__ */ r(O, { justify: "flex-end", mt: "md", children: [
|
|
505
|
-
/* @__PURE__ */ e(X, { variant: "default", onClick:
|
|
506
|
-
/* @__PURE__ */ e(X, { onClick:
|
|
519
|
+
/* @__PURE__ */ e(X, { variant: "default", onClick: n, children: f().t("archbase:Cancelar") }),
|
|
520
|
+
/* @__PURE__ */ e(X, { onClick: l, children: f().t("archbase:Salvar") })
|
|
507
521
|
] })
|
|
508
522
|
] }) })
|
|
509
523
|
}
|
|
510
524
|
);
|
|
511
|
-
},
|
|
525
|
+
}, Pr = ({ image: a, label: t, description: l, ...n }) => /* @__PURE__ */ e("div", { ...n, children: /* @__PURE__ */ r(O, { grow: !0, children: [
|
|
512
526
|
/* @__PURE__ */ e("img", { style: { maxWidth: "32px" }, src: a }),
|
|
513
527
|
/* @__PURE__ */ r("div", { children: [
|
|
514
|
-
/* @__PURE__ */ e(
|
|
515
|
-
/* @__PURE__ */ e(
|
|
528
|
+
/* @__PURE__ */ e(c, { size: "sm", children: t }),
|
|
529
|
+
/* @__PURE__ */ e(c, { size: "xs", opacity: 0.65, children: l })
|
|
516
530
|
] })
|
|
517
|
-
] }) }),
|
|
518
|
-
|
|
519
|
-
const [t,
|
|
531
|
+
] }) }), Dr = (a) => {
|
|
532
|
+
wr();
|
|
533
|
+
const [t, l] = S(), n = J(K.User), u = Oe(
|
|
520
534
|
"ApiTokenModal",
|
|
521
535
|
a.dataSource,
|
|
522
536
|
"expirationDate",
|
|
523
537
|
""
|
|
524
538
|
);
|
|
525
|
-
process.env.NODE_ENV === "development" && a.dataSource && console.log(`[ApiTokenModal] DataSource version: ${
|
|
526
|
-
const d = (
|
|
527
|
-
if (!
|
|
528
|
-
|
|
539
|
+
process.env.NODE_ENV === "development" && a.dataSource && console.log(`[ApiTokenModal] DataSource version: ${u.dataSourceVersion}`);
|
|
540
|
+
const d = (g) => {
|
|
541
|
+
if (!g)
|
|
542
|
+
u.handleValueChange(void 0);
|
|
529
543
|
else {
|
|
530
|
-
const
|
|
531
|
-
|
|
544
|
+
const T = typeof g == "string" ? new Date(g) : g, R = tr(T);
|
|
545
|
+
u.handleValueChange(R);
|
|
532
546
|
}
|
|
533
|
-
|
|
534
|
-
},
|
|
547
|
+
l(g);
|
|
548
|
+
}, h = async (g, T) => new Promise(async (R, x) => {
|
|
535
549
|
try {
|
|
536
|
-
const
|
|
537
|
-
|
|
538
|
-
options:
|
|
539
|
-
page:
|
|
540
|
-
totalPages:
|
|
550
|
+
const D = Ue(Ne.or(Ne.eq("name", `^*${T.trim()}*`))), b = await n.findAllWithFilter(D, g, 20);
|
|
551
|
+
R({
|
|
552
|
+
options: b.content,
|
|
553
|
+
page: b.pageable.pageNumber,
|
|
554
|
+
totalPages: b.totalPages
|
|
541
555
|
});
|
|
542
|
-
} catch (
|
|
543
|
-
|
|
556
|
+
} catch (D) {
|
|
557
|
+
x(Te(D));
|
|
544
558
|
}
|
|
545
|
-
}),
|
|
546
|
-
a.onCustomSave ? a.onCustomSave(a.dataSource.current, (
|
|
547
|
-
|
|
559
|
+
}), A = () => {
|
|
560
|
+
a.onCustomSave ? a.onCustomSave(a.dataSource.current, (g) => {
|
|
561
|
+
g && a.onAfterSave && a.onAfterSave(a.dataSource.current), a.onClickOk(a.dataSource.current, g);
|
|
548
562
|
}) : a.onClickOk(a.dataSource.current, !0);
|
|
549
|
-
},
|
|
563
|
+
}, z = () => {
|
|
550
564
|
a.onClickCancel(a.dataSource.current);
|
|
551
565
|
};
|
|
552
566
|
return /* @__PURE__ */ r(
|
|
553
567
|
$e,
|
|
554
568
|
{
|
|
555
569
|
opened: a.opened,
|
|
556
|
-
onClose:
|
|
557
|
-
title:
|
|
570
|
+
onClose: z,
|
|
571
|
+
title: f().t("archbase:Token de API"),
|
|
558
572
|
size: "50%",
|
|
559
573
|
children: [
|
|
560
|
-
/* @__PURE__ */ r(
|
|
574
|
+
/* @__PURE__ */ r(ue, { style: { height: "300px" }, children: [
|
|
561
575
|
/* @__PURE__ */ e(
|
|
562
|
-
|
|
576
|
+
le,
|
|
563
577
|
{
|
|
564
|
-
label: `${
|
|
565
|
-
placeholder: `${
|
|
578
|
+
label: `${f().t("archbase:Nome do token")}`,
|
|
579
|
+
placeholder: `${f().t("archbase:Informe o nome do token")}`,
|
|
566
580
|
dataSource: a.dataSource,
|
|
567
581
|
dataField: "name"
|
|
568
582
|
}
|
|
569
583
|
),
|
|
570
584
|
/* @__PURE__ */ e(
|
|
571
|
-
|
|
585
|
+
le,
|
|
572
586
|
{
|
|
573
|
-
label: `${
|
|
574
|
-
placeholder: `${
|
|
587
|
+
label: `${f().t("archbase:Descrição do token")}`,
|
|
588
|
+
placeholder: `${f().t("archbase:Informe a descrição do token")}`,
|
|
575
589
|
dataSource: a.dataSource,
|
|
576
590
|
dataField: "description"
|
|
577
591
|
}
|
|
578
592
|
),
|
|
579
593
|
/* @__PURE__ */ e(
|
|
580
|
-
|
|
594
|
+
Tr,
|
|
581
595
|
{
|
|
582
596
|
withSeconds: !0,
|
|
583
597
|
value: t,
|
|
@@ -587,191 +601,191 @@ const Ar = ur(
|
|
|
587
601
|
}
|
|
588
602
|
),
|
|
589
603
|
/* @__PURE__ */ e(
|
|
590
|
-
|
|
604
|
+
dr,
|
|
591
605
|
{
|
|
592
|
-
label: `${
|
|
606
|
+
label: `${f().t("archbase:Usuário")}`,
|
|
593
607
|
dataSource: a.dataSource,
|
|
594
608
|
dataField: "user",
|
|
595
|
-
placeholder: `${
|
|
596
|
-
getOptionLabel: (
|
|
597
|
-
getOptionValue: (
|
|
598
|
-
getOptions:
|
|
609
|
+
placeholder: `${f().t("archbase:Digite aqui o nome do usuário")}`,
|
|
610
|
+
getOptionLabel: (g) => g && g.email ? g.email : "",
|
|
611
|
+
getOptionValue: (g) => g && g.id ? g.id.toString() : "",
|
|
612
|
+
getOptions: h,
|
|
599
613
|
debounceTime: 500,
|
|
600
614
|
minCharsToSearch: 1,
|
|
601
|
-
itemComponent:
|
|
615
|
+
itemComponent: Pr
|
|
602
616
|
}
|
|
603
617
|
)
|
|
604
618
|
] }),
|
|
605
619
|
/* @__PURE__ */ r(O, { justify: "flex-end", mt: "md", children: [
|
|
606
|
-
/* @__PURE__ */ e(X, { variant: "default", onClick:
|
|
607
|
-
/* @__PURE__ */ e(X, { onClick:
|
|
620
|
+
/* @__PURE__ */ e(X, { variant: "default", onClick: z, children: f().t("archbase:Cancelar") }),
|
|
621
|
+
/* @__PURE__ */ e(X, { onClick: A, children: f().t("archbase:Salvar") })
|
|
608
622
|
] })
|
|
609
623
|
]
|
|
610
624
|
}
|
|
611
625
|
);
|
|
612
|
-
},
|
|
626
|
+
}, ba = (a) => {
|
|
613
627
|
const t = "->";
|
|
614
|
-
return a.includes(t) ? a.split(t).map((
|
|
628
|
+
return a.includes(t) ? a.split(t).map((u) => u.trim()).map((u) => f().t(u)).join(` ${t} `) : f().t(a);
|
|
615
629
|
};
|
|
616
|
-
function Xe({ dataSource: a, opened: t, close:
|
|
617
|
-
const
|
|
618
|
-
value:
|
|
619
|
-
label:
|
|
620
|
-
children:
|
|
621
|
-
value:
|
|
622
|
-
label:
|
|
630
|
+
function Xe({ dataSource: a, opened: t, close: l }) {
|
|
631
|
+
const n = ie(() => a?.getFieldValue("name") || "", [a]), u = ie(() => a?.getFieldValue("id") || "", [a]), d = ie(() => a?.getFieldValue("type") || "", [a]), h = da(), A = da(), [z, g] = S([]), [T, R] = S([]), [x, D] = S(), [b, w] = S(), [o, s] = S(""), [p] = oa(o, 200), [v, $] = S(""), [y] = oa(v, 200), i = J(K.Resource), { colorScheme: N } = qe(), I = N === "dark" ? "var(--mantine-primary-color-7)" : "var(--mantine-primary-color-4)", M = ie(() => T.sort((E, P) => E.resourceDescription.localeCompare(P.resourceDescription)).map((E) => ({
|
|
632
|
+
value: E.resourceId,
|
|
633
|
+
label: E.resourceDescription,
|
|
634
|
+
children: E.permissions.filter((P) => P.actionDescription.toLowerCase().includes(y.toLowerCase())).sort((P, q) => P.actionDescription.localeCompare(q.actionDescription)).map((P) => ({
|
|
635
|
+
value: P.actionId,
|
|
636
|
+
label: P.actionDescription,
|
|
623
637
|
nodeProps: {
|
|
624
|
-
permissionId:
|
|
625
|
-
types:
|
|
626
|
-
owner:
|
|
638
|
+
permissionId: P.permissionId,
|
|
639
|
+
types: P.types ?? [],
|
|
640
|
+
owner: E
|
|
627
641
|
}
|
|
628
642
|
}))
|
|
629
|
-
})), [
|
|
630
|
-
value:
|
|
631
|
-
label:
|
|
632
|
-
children:
|
|
633
|
-
const q =
|
|
643
|
+
})), [T, y]), F = ie(() => T.map((E) => E.permissions.map((P) => P.actionId)).flat(), [T]), C = ie(() => z.sort((E, P) => E.resourceDescription.localeCompare(P.resourceDescription)).map((E) => ({
|
|
644
|
+
value: E.resourceId,
|
|
645
|
+
label: E.resourceDescription,
|
|
646
|
+
children: E.permissions.filter((P) => P.actionDescription.toLowerCase().includes(p.toLowerCase())).sort((P, q) => P.actionDescription.localeCompare(q.actionDescription)).map((P) => {
|
|
647
|
+
const q = T.find((G) => G.resourceId === E.resourceId)?.permissions.find((G) => G.actionId === P.actionId);
|
|
634
648
|
return {
|
|
635
|
-
value:
|
|
636
|
-
label:
|
|
649
|
+
value: P.actionId,
|
|
650
|
+
label: P.actionDescription,
|
|
637
651
|
nodeProps: {
|
|
638
|
-
granted:
|
|
639
|
-
owner:
|
|
652
|
+
granted: F.includes(P.actionId) && q?.types?.includes(Se(_, d)),
|
|
653
|
+
owner: E
|
|
640
654
|
}
|
|
641
655
|
};
|
|
642
656
|
})
|
|
643
|
-
})), [
|
|
644
|
-
if (
|
|
645
|
-
const
|
|
646
|
-
|
|
657
|
+
})), [z, T, F, d, p]), k = ae(async () => {
|
|
658
|
+
if (u) {
|
|
659
|
+
const E = await i.getPermissionsBySecurityId(u, d), P = await i.getAllPermissionsAvailable();
|
|
660
|
+
g(P), R(E);
|
|
647
661
|
}
|
|
648
|
-
}, [
|
|
649
|
-
|
|
650
|
-
if (
|
|
651
|
-
|
|
662
|
+
}, [u, d]), oe = ae(() => {
|
|
663
|
+
x?.value && u && i.createPermission(u, x.value, d).then((E) => {
|
|
664
|
+
if (E) {
|
|
665
|
+
R((Z) => {
|
|
652
666
|
let B;
|
|
653
|
-
return
|
|
654
|
-
...
|
|
655
|
-
permissions:
|
|
656
|
-
(
|
|
657
|
-
...
|
|
658
|
-
permissionId:
|
|
659
|
-
types: [...
|
|
660
|
-
} :
|
|
667
|
+
return Z.map((Q) => Q.resourceId).includes(E.resourceId) ? B = Z.map((Q) => Q.resourceId === E.resourceId ? Q.permissions.map((H) => H.actionId).includes(x.value) ? {
|
|
668
|
+
...Q,
|
|
669
|
+
permissions: Q.permissions.map(
|
|
670
|
+
(H) => H.actionId === x.value ? {
|
|
671
|
+
...H,
|
|
672
|
+
permissionId: E.permissionId,
|
|
673
|
+
types: [...H.types ?? [], Se(_, d)]
|
|
674
|
+
} : H
|
|
661
675
|
)
|
|
662
676
|
} : {
|
|
663
|
-
...
|
|
677
|
+
...Q,
|
|
664
678
|
permissions: [
|
|
665
|
-
...
|
|
679
|
+
...Q.permissions ?? [],
|
|
666
680
|
{
|
|
667
|
-
actionId:
|
|
668
|
-
actionDescription:
|
|
669
|
-
permissionId:
|
|
670
|
-
types: [Se(
|
|
681
|
+
actionId: E.actionId,
|
|
682
|
+
actionDescription: E.actionDescription,
|
|
683
|
+
permissionId: E.permissionId,
|
|
684
|
+
types: [Se(_, d)]
|
|
671
685
|
}
|
|
672
686
|
]
|
|
673
|
-
} :
|
|
674
|
-
...
|
|
687
|
+
} : Q) : B = [
|
|
688
|
+
...Z,
|
|
675
689
|
{
|
|
676
|
-
resourceId:
|
|
677
|
-
resourceDescription:
|
|
690
|
+
resourceId: E.resourceId,
|
|
691
|
+
resourceDescription: E.resourceDescription,
|
|
678
692
|
permissions: [
|
|
679
693
|
{
|
|
680
|
-
actionId:
|
|
681
|
-
actionDescription:
|
|
682
|
-
permissionId:
|
|
683
|
-
types: [Se(
|
|
694
|
+
actionId: E.actionId,
|
|
695
|
+
actionDescription: E.actionDescription,
|
|
696
|
+
permissionId: E.permissionId,
|
|
697
|
+
types: [Se(_, d)]
|
|
684
698
|
}
|
|
685
699
|
]
|
|
686
700
|
}
|
|
687
701
|
], B;
|
|
688
702
|
});
|
|
689
|
-
const
|
|
690
|
-
|
|
703
|
+
const P = C.filter((Z) => Z.value === x?.nodeProps?.owner?.resourceId).map((Z) => Z.children).flat(), q = P.map((Z) => Z.value).indexOf(x.value), G = P.find((Z, B) => !Z?.nodeProps?.granted && Z?.value !== x.value && (P.length > q + 1 ? B > q : !0));
|
|
704
|
+
G?.value && h.select(G.value), A.expand(E.resourceId), D(G);
|
|
691
705
|
}
|
|
692
706
|
});
|
|
693
|
-
}, [
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
let
|
|
697
|
-
return B.permissions?.forEach((
|
|
698
|
-
|
|
699
|
-
}),
|
|
707
|
+
}, [x, u, d, i, C, z, T, h, A]), me = ae(() => {
|
|
708
|
+
b?.nodeProps?.permissionId && i.deletePermission(b.nodeProps.permissionId).then(() => {
|
|
709
|
+
R((G) => [...G].filter((B) => {
|
|
710
|
+
let Q = !0;
|
|
711
|
+
return B.permissions?.forEach((H) => {
|
|
712
|
+
H.permissionId !== void 0 && H.permissionId === b?.nodeProps?.permissionId && B.permissions.length === 1 && H?.types?.length === 1 && H.types[0] === Se(_, d) && (Q = !1);
|
|
713
|
+
}), Q;
|
|
700
714
|
}).map((B) => {
|
|
701
|
-
const
|
|
702
|
-
return B.resourceId ===
|
|
715
|
+
const Q = b?.nodeProps?.owner;
|
|
716
|
+
return B.resourceId === Q.resourceId ? b?.nodeProps?.types?.length === 1 ? {
|
|
703
717
|
...B,
|
|
704
|
-
permissions: [...(B.permissions ?? []).filter((
|
|
718
|
+
permissions: [...(B.permissions ?? []).filter((H) => H.permissionId !== b?.nodeProps?.permissionId)]
|
|
705
719
|
} : {
|
|
706
720
|
...B,
|
|
707
|
-
permissions: (B.permissions ?? []).map((
|
|
708
|
-
actionId:
|
|
709
|
-
actionDescription:
|
|
710
|
-
types: [...
|
|
711
|
-
} :
|
|
721
|
+
permissions: (B.permissions ?? []).map((H) => H.actionId === b.value ? {
|
|
722
|
+
actionId: H.actionId,
|
|
723
|
+
actionDescription: H.actionDescription,
|
|
724
|
+
types: [...H.types?.filter((de) => de && de !== Se(_, d)) ?? []]
|
|
725
|
+
} : H)
|
|
712
726
|
} : B;
|
|
713
727
|
}));
|
|
714
|
-
const
|
|
715
|
-
q?.value &&
|
|
728
|
+
const E = M.filter((G) => G.value === b?.nodeProps?.owner?.resourceId).map((G) => G.children).flat(), P = E.map((G) => G.value).indexOf(b.value), q = E.find((G, Z) => G?.nodeProps?.types.includes(Se(_, d)) && G?.value !== b.value && (E.length > P + 1 ? Z > P : !0));
|
|
729
|
+
q?.value && A.select(q.value), w(q);
|
|
716
730
|
});
|
|
717
|
-
}, [
|
|
731
|
+
}, [b, i, d, M, T, A]);
|
|
718
732
|
return ee(() => {
|
|
719
|
-
t && a && (
|
|
720
|
-
}, [t, d,
|
|
721
|
-
/* @__PURE__ */ e(
|
|
733
|
+
t && a && (D(void 0), w(void 0), s(""), $(""), A.collapseAllNodes(), h.collapseAllNodes(), k());
|
|
734
|
+
}, [t, d, u, k]), a ? /* @__PURE__ */ e($e, { opened: t, onClose: l, title: `${f().t(`archbase:${d}`)}: ${n}`, size: "80%", styles: { root: { overflow: "hidden" } }, children: /* @__PURE__ */ r(Sr, { height: "540px", children: [
|
|
735
|
+
/* @__PURE__ */ e(xr, { children: /* @__PURE__ */ e(re, { withBorder: !0, my: 20, p: 20, style: { height: "calc(100% - 40px)", overflow: "hidden", display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ r("div", { style: { flex: 1, display: "flex", flexDirection: "row", overflow: "hidden", minHeight: 0, gap: "8px" }, children: [
|
|
722
736
|
/* @__PURE__ */ r("div", { style: { flex: 9, display: "flex", flexDirection: "column", overflow: "hidden", minHeight: 0 }, children: [
|
|
723
737
|
/* @__PURE__ */ r(O, { mb: 20, children: [
|
|
724
|
-
/* @__PURE__ */ e(
|
|
738
|
+
/* @__PURE__ */ e(c, { children: f().t("archbase:Available") }),
|
|
725
739
|
/* @__PURE__ */ e(
|
|
726
|
-
|
|
740
|
+
he,
|
|
727
741
|
{
|
|
728
742
|
size: "xs",
|
|
729
743
|
value: o,
|
|
730
|
-
onChange: (
|
|
731
|
-
placeholder:
|
|
744
|
+
onChange: (E) => s(E.target.value),
|
|
745
|
+
placeholder: f().t("archbase:Filter available permissions")
|
|
732
746
|
}
|
|
733
747
|
)
|
|
734
748
|
] }),
|
|
735
|
-
/* @__PURE__ */ e(
|
|
736
|
-
|
|
749
|
+
/* @__PURE__ */ e(ue, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e(
|
|
750
|
+
ua,
|
|
737
751
|
{
|
|
738
752
|
data: C,
|
|
739
753
|
selectOnClick: !0,
|
|
740
754
|
allowRangeSelection: !1,
|
|
741
|
-
tree:
|
|
742
|
-
renderNode: ({ level:
|
|
743
|
-
const
|
|
744
|
-
P
|
|
745
|
-
}, [
|
|
755
|
+
tree: h,
|
|
756
|
+
renderNode: ({ level: E, node: P, expanded: q, hasChildren: G, selected: Z, elementProps: B }) => {
|
|
757
|
+
const Q = P?.nodeProps?.granted, H = Q ? "dimmed" : void 0, de = Q ? "line-through" : void 0, je = ae((Ze) => {
|
|
758
|
+
D(P), B.onClick(Ze);
|
|
759
|
+
}, [P, B.onClick]);
|
|
746
760
|
return /* @__PURE__ */ r(
|
|
747
761
|
O,
|
|
748
762
|
{
|
|
749
|
-
ml:
|
|
763
|
+
ml: G ? 0 : 5,
|
|
750
764
|
gap: 5,
|
|
751
765
|
...B,
|
|
752
|
-
bg:
|
|
766
|
+
bg: Z && E === 2 ? I : "",
|
|
753
767
|
onClick: je,
|
|
754
768
|
children: [
|
|
755
|
-
|
|
756
|
-
|
|
769
|
+
G && /* @__PURE__ */ e(
|
|
770
|
+
ma,
|
|
757
771
|
{
|
|
758
772
|
size: 18,
|
|
759
773
|
style: { transform: q ? "rotate(0deg)" : "rotate(-90deg)" }
|
|
760
774
|
}
|
|
761
775
|
),
|
|
762
|
-
!
|
|
763
|
-
|
|
776
|
+
!G && /* @__PURE__ */ e(
|
|
777
|
+
ga,
|
|
764
778
|
{
|
|
765
779
|
size: 12,
|
|
766
780
|
style: { transform: "rotate(-90deg)", marginTop: "-5px" }
|
|
767
781
|
}
|
|
768
782
|
),
|
|
769
783
|
/* @__PURE__ */ e(
|
|
770
|
-
|
|
784
|
+
c,
|
|
771
785
|
{
|
|
772
|
-
c:
|
|
773
|
-
td:
|
|
774
|
-
children:
|
|
786
|
+
c: H,
|
|
787
|
+
td: de,
|
|
788
|
+
children: ba(P.label)
|
|
775
789
|
}
|
|
776
790
|
)
|
|
777
791
|
]
|
|
@@ -781,61 +795,61 @@ function Xe({ dataSource: a, opened: t, close: n }) {
|
|
|
781
795
|
}
|
|
782
796
|
) })
|
|
783
797
|
] }),
|
|
784
|
-
/* @__PURE__ */ e("div", { style: { flex: 2, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ r(
|
|
785
|
-
/* @__PURE__ */ e(
|
|
786
|
-
/* @__PURE__ */ e(
|
|
798
|
+
/* @__PURE__ */ e("div", { style: { flex: 2, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ r(U, { gap: 5, align: "center", children: [
|
|
799
|
+
/* @__PURE__ */ e(Ie, { label: f().t("archbase:Add"), children: /* @__PURE__ */ e(ye, { onClick: oe, disabled: !x || x?.nodeProps?.granted || !x.nodeProps, children: /* @__PURE__ */ e(Pa, {}) }) }),
|
|
800
|
+
/* @__PURE__ */ e(Ie, { label: f().t("archbase:Remove"), children: /* @__PURE__ */ e(ye, { onClick: me, disabled: !b || !b?.nodeProps?.permissionId || !b.nodeProps, children: /* @__PURE__ */ e(Da, {}) }) })
|
|
787
801
|
] }) }),
|
|
788
802
|
/* @__PURE__ */ r("div", { style: { flex: 9, display: "flex", flexDirection: "column", overflow: "hidden", minHeight: 0 }, children: [
|
|
789
803
|
/* @__PURE__ */ r(O, { mb: 20, children: [
|
|
790
|
-
/* @__PURE__ */ e(
|
|
804
|
+
/* @__PURE__ */ e(c, { children: f().t("archbase:Granted") }),
|
|
791
805
|
/* @__PURE__ */ e(
|
|
792
|
-
|
|
806
|
+
he,
|
|
793
807
|
{
|
|
794
808
|
size: "xs",
|
|
795
|
-
value:
|
|
796
|
-
onChange: (
|
|
797
|
-
placeholder:
|
|
809
|
+
value: v,
|
|
810
|
+
onChange: (E) => $(E.target.value),
|
|
811
|
+
placeholder: f().t("archbase:Filter granted permissions")
|
|
798
812
|
}
|
|
799
813
|
)
|
|
800
814
|
] }),
|
|
801
|
-
/* @__PURE__ */ e(
|
|
802
|
-
|
|
815
|
+
/* @__PURE__ */ e(ue, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e(
|
|
816
|
+
ua,
|
|
803
817
|
{
|
|
804
|
-
data:
|
|
818
|
+
data: M,
|
|
805
819
|
selectOnClick: !0,
|
|
806
820
|
allowRangeSelection: !1,
|
|
807
|
-
tree:
|
|
808
|
-
renderNode: ({ level:
|
|
809
|
-
const
|
|
810
|
-
w(
|
|
811
|
-
}, [
|
|
821
|
+
tree: A,
|
|
822
|
+
renderNode: ({ level: E, node: P, expanded: q, hasChildren: G, selected: Z, elementProps: B }) => {
|
|
823
|
+
const Q = ae((H) => {
|
|
824
|
+
w(P), B.onClick(H);
|
|
825
|
+
}, [P, B.onClick]);
|
|
812
826
|
return /* @__PURE__ */ r(
|
|
813
827
|
O,
|
|
814
828
|
{
|
|
815
|
-
ml:
|
|
829
|
+
ml: G ? 0 : 5,
|
|
816
830
|
gap: 5,
|
|
817
831
|
...B,
|
|
818
|
-
bg:
|
|
819
|
-
onClick:
|
|
832
|
+
bg: Z && E === 2 ? I : "",
|
|
833
|
+
onClick: Q,
|
|
820
834
|
children: [
|
|
821
|
-
|
|
822
|
-
|
|
835
|
+
G && /* @__PURE__ */ e(
|
|
836
|
+
ma,
|
|
823
837
|
{
|
|
824
838
|
size: 18,
|
|
825
839
|
style: { transform: q ? "rotate(0deg)" : "rotate(-90deg)" }
|
|
826
840
|
}
|
|
827
841
|
),
|
|
828
|
-
!
|
|
829
|
-
|
|
842
|
+
!G && /* @__PURE__ */ e(
|
|
843
|
+
ga,
|
|
830
844
|
{
|
|
831
845
|
size: 12,
|
|
832
846
|
style: { transform: "rotate(-90deg)", marginTop: "-5px" }
|
|
833
847
|
}
|
|
834
848
|
),
|
|
835
|
-
/* @__PURE__ */ e(
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
849
|
+
/* @__PURE__ */ e(c, { children: ba(P.label) }),
|
|
850
|
+
P?.nodeProps?.types?.includes("USER") && /* @__PURE__ */ e(j, { color: "blue", children: f().t("archbase:user") }),
|
|
851
|
+
P?.nodeProps?.types?.includes("GROUP") && /* @__PURE__ */ e(j, { color: "orange", children: f().t("archbase:group") }),
|
|
852
|
+
P?.nodeProps?.types?.includes("PROFILE") && /* @__PURE__ */ e(j, { color: "pink", children: f().t("archbase:profile") })
|
|
839
853
|
]
|
|
840
854
|
}
|
|
841
855
|
);
|
|
@@ -844,12 +858,12 @@ function Xe({ dataSource: a, opened: t, close: n }) {
|
|
|
844
858
|
) })
|
|
845
859
|
] })
|
|
846
860
|
] }) }) }),
|
|
847
|
-
/* @__PURE__ */ e(
|
|
861
|
+
/* @__PURE__ */ e(Cr, { size: "40px", children: /* @__PURE__ */ e(O, { justify: "flex-end", children: /* @__PURE__ */ e(X, { onClick: l, children: f().t("archbase:Close") }) }) })
|
|
848
862
|
] }) }) : null;
|
|
849
863
|
}
|
|
850
|
-
const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAAABj1BMVEUAAADMzMzLy8vAwMDLy8vLy8vLy8vMzMzKysrR0dHPz8/MzMzNzc3KysrMzMzKysrLy8vLy8vLy8vJycnR0dHMzMzPz8/Ozs7MzMxPT0/Nzc1UVFTJyclTU1PMzMzKysrMzMzJycldXV1iYmLMzMzIyMhNTU1NTU3MzMzLy8vNzc3MzMxVVVXLy8vMzMzLy8vLy8tNTU3MzMzOzs5QUFDLy8vKyspRUVFRUVHMzMxZWVlycnLLy8tUVFTJycnKyspZWVlXV1dhYWHGxsZMTExQUFBPT0/Ozs7Ly8vPz89SUlJSUlLMzMxVVVVWVlZVVVXKysptbW1bW1t6enpmZmbLy8tKSkrQ0NDOzs5FRUXNzc1NTU3S0tLU1NRHR0dSUlKzs7ORkZF4eHhPT0/Jycm9vb26urp8fHxYWFisrKylpaWdnZ11dXVubm5fX1+8vLy3t7ehoaFkZGRVVVXBwcG/v7+vr6+ZmZmUlJSNjY2GhoZzc3NcXFzGxsbDw8Ofn5+WlpaBgYGwsLCpqalqampaWRCJAAAAVXRSTlMA+YUG1M7Df1AQ8urbdWdiXjo2HQkE+/vu4qqIcV1bRDEpIRwXFO/q2ZiObWJZSiv+9uTe3cq8s6qkgX55b1pWR0YVDfvJyLCcmZWTi2lZVz82LRcUQGGNCgAAA9pJREFUWMPll2db2zAQgJ0AgUIYDSl7tZRZ6N57793akizZCSSEEJKw9yi0/eHtEwgid5IxfOX9mnvenM93J8s4tZw5391Q3/Hu0mj3lTMnllys+hi6HqBCCCIEDVwPDVddPEEqXW9qiEOoeQAlDqlpGz1eYo2VYSFsE2ELcSPY6FvTV1njUFMDdVqCff48DWGgAdhOuMtPie8JrUaWq+3I5zs76Jg+cG50e3seVxPTF6S63svT0URNn1BSqffUEhvHE/ofgn8x9aZLKJpcja/sZnO57Pp0yqbIVKv2VDUBD93amedsn0QuA1U2eazynG8BceRPnrnWAczdmAERtLoHe6IhAaJWLWaVwNLLBPxXxQskCjogZse1ICz2G+TkDKNGbAb5THELwzaXQB2bzpZ6zt0GD5acZ5bKNA4LGSorET2BDz/NLDVT0FQywGW34GT81YhYForKo4dbCHjsVMLSEJuxgWnUkMAKkTmmE7E52ExhuX2vBGDzj+lFa7AKzRHUQ1K0qheNQZETPHj3FQSKfulF0zCYlpcVpyyAlseypcOdojC6uThxdQLt94mYTpRI2WjvduyL3kqRbGxXk1A+iYJFmywRhEyCIuEZwUXqq7Hxb+M60QYOtlsaZa3BT7PazuZxisP3VkA3/MX79a8QHH5574iWtfbZ2RDRUBDVA5HPzsbvvw6LaMZraLGodu9YdEzPhsRrBCIq985FLDKpto8mKY4WD+VWQymlXWVjpydshaiuILpcEKGxjSkfLE4VwaSqIOq5aioQ40w1IMRUEUEjgrctXkaqEZFDi1lccL1fGd5s94RKRLMMJZSTHrBGcEfiMxJ3Ne5HeYhg7CX03vgsVUZGiuesLBJqSrzUcNxgFBxHMGA2gVeRAjFkFOkJmCqSebekqzeTyrDmQ182IV8NEJtQNtytc+irBn5rwUHLqMJEvSGJlitCCCr2BsVRNFzyGdklcEQcHwAZop58SRmqEt2aZ3iJpChMuyJqlPC1CQRs51RDm08RdIAAhpzD6dCpvPpjNJ2hh5NyhvCFb5DIq0F83NKd/VY2LlWkXHFXjlTTfU1qlzNLC+OTs8Tev0JElHfZQkpkaT0GNEiVWJ8oqIjm8vdQ2GR7bAFrsGphbZHYQnthC5orm8y1fOCy9Fhy2NDyANVYr3IfGB6MXOM+Rdc+GZ48venLxG8+M46g9y734bl7wTiazlZ+hKZ1xPBFb/sA99D0t/cafrnQ3sq50sJb2+FTefOz804/50DC+++MPDeOTe+XD68GeJGXA6/ff4bJ+OfHt2edj+7ff9T59Ptz47TyD0dpv5fjoIC3AAAAAElFTkSuQmCC",
|
|
864
|
+
const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAAABj1BMVEUAAADMzMzLy8vAwMDLy8vLy8vLy8vMzMzKysrR0dHPz8/MzMzNzc3KysrMzMzKysrLy8vLy8vLy8vJycnR0dHMzMzPz8/Ozs7MzMxPT0/Nzc1UVFTJyclTU1PMzMzKysrMzMzJycldXV1iYmLMzMzIyMhNTU1NTU3MzMzLy8vNzc3MzMxVVVXLy8vMzMzLy8vLy8tNTU3MzMzOzs5QUFDLy8vKyspRUVFRUVHMzMxZWVlycnLLy8tUVFTJycnKyspZWVlXV1dhYWHGxsZMTExQUFBPT0/Ozs7Ly8vPz89SUlJSUlLMzMxVVVVWVlZVVVXKysptbW1bW1t6enpmZmbLy8tKSkrQ0NDOzs5FRUXNzc1NTU3S0tLU1NRHR0dSUlKzs7ORkZF4eHhPT0/Jycm9vb26urp8fHxYWFisrKylpaWdnZ11dXVubm5fX1+8vLy3t7ehoaFkZGRVVVXBwcG/v7+vr6+ZmZmUlJSNjY2GhoZzc3NcXFzGxsbDw8Ofn5+WlpaBgYGwsLCpqalqampaWRCJAAAAVXRSTlMA+YUG1M7Df1AQ8urbdWdiXjo2HQkE+/vu4qqIcV1bRDEpIRwXFO/q2ZiObWJZSiv+9uTe3cq8s6qkgX55b1pWR0YVDfvJyLCcmZWTi2lZVz82LRcUQGGNCgAAA9pJREFUWMPll2db2zAQgJ0AgUIYDSl7tZRZ6N57793akizZCSSEEJKw9yi0/eHtEwgid5IxfOX9mnvenM93J8s4tZw5391Q3/Hu0mj3lTMnllys+hi6HqBCCCIEDVwPDVddPEEqXW9qiEOoeQAlDqlpGz1eYo2VYSFsE2ELcSPY6FvTV1njUFMDdVqCff48DWGgAdhOuMtPie8JrUaWq+3I5zs76Jg+cG50e3seVxPTF6S63svT0URNn1BSqffUEhvHE/ofgn8x9aZLKJpcja/sZnO57Pp0yqbIVKv2VDUBD93amedsn0QuA1U2eazynG8BceRPnrnWAczdmAERtLoHe6IhAaJWLWaVwNLLBPxXxQskCjogZse1ICz2G+TkDKNGbAb5THELwzaXQB2bzpZ6zt0GD5acZ5bKNA4LGSorET2BDz/NLDVT0FQywGW34GT81YhYForKo4dbCHjsVMLSEJuxgWnUkMAKkTmmE7E52ExhuX2vBGDzj+lFa7AKzRHUQ1K0qheNQZETPHj3FQSKfulF0zCYlpcVpyyAlseypcOdojC6uThxdQLt94mYTpRI2WjvduyL3kqRbGxXk1A+iYJFmywRhEyCIuEZwUXqq7Hxb+M60QYOtlsaZa3BT7PazuZxisP3VkA3/MX79a8QHH5574iWtfbZ2RDRUBDVA5HPzsbvvw6LaMZraLGodu9YdEzPhsRrBCIq985FLDKpto8mKY4WD+VWQymlXWVjpydshaiuILpcEKGxjSkfLE4VwaSqIOq5aioQ40w1IMRUEUEjgrctXkaqEZFDi1lccL1fGd5s94RKRLMMJZSTHrBGcEfiMxJ3Ne5HeYhg7CX03vgsVUZGiuesLBJqSrzUcNxgFBxHMGA2gVeRAjFkFOkJmCqSebekqzeTyrDmQ182IV8NEJtQNtytc+irBn5rwUHLqMJEvSGJlitCCCr2BsVRNFzyGdklcEQcHwAZop58SRmqEt2aZ3iJpChMuyJqlPC1CQRs51RDm08RdIAAhpzD6dCpvPpjNJ2hh5NyhvCFb5DIq0F83NKd/VY2LlWkXHFXjlTTfU1qlzNLC+OTs8Tev0JElHfZQkpkaT0GNEiVWJ8oqIjm8vdQ2GR7bAFrsGphbZHYQnthC5orm8y1fOCy9Fhy2NDyANVYr3IfGB6MXOM+Rdc+GZ48venLxG8+M46g9y734bl7wTiazlZ+hKZ1xPBFb/sA99D0t/cafrnQ3sq50sJb2+FTefOz804/50DC+++MPDeOTe+XD68GeJGXA6/ff4bJ+OfHt2edj+7ff9T59Ptz47TyD0dpv5fjoIC3AAAAAElFTkSuQmCC", Fr = (a) => a.groups ? /* @__PURE__ */ e("div", { style: { display: "flex" }, children: a.groups.slice().sort((t, l) => (t.group?.name ?? "").localeCompare(l.group?.name ?? "")).map((t, l) => /* @__PURE__ */ e("div", { style: { paddingRight: "2px" }, children: /* @__PURE__ */ e(j, { color: "blue", children: t.group?.name }) }, l)) }) : null, Nr = (a) => a.profile ? /* @__PURE__ */ e(j, { color: "green", children: a.profile?.name }) : null, Or = (a) => /* @__PURE__ */ r(Ee, { children: [
|
|
851
865
|
/* @__PURE__ */ e(
|
|
852
|
-
|
|
866
|
+
L,
|
|
853
867
|
{
|
|
854
868
|
dataField: "user.avatar",
|
|
855
869
|
dataType: "image",
|
|
@@ -868,7 +882,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
|
|
|
868
882
|
}
|
|
869
883
|
),
|
|
870
884
|
/* @__PURE__ */ e(
|
|
871
|
-
|
|
885
|
+
L,
|
|
872
886
|
{
|
|
873
887
|
dataField: "user.userName",
|
|
874
888
|
dataType: "text",
|
|
@@ -878,7 +892,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
|
|
|
878
892
|
}
|
|
879
893
|
),
|
|
880
894
|
/* @__PURE__ */ e(
|
|
881
|
-
|
|
895
|
+
L,
|
|
882
896
|
{
|
|
883
897
|
dataField: "user.email",
|
|
884
898
|
dataType: "text",
|
|
@@ -888,18 +902,18 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
|
|
|
888
902
|
}
|
|
889
903
|
),
|
|
890
904
|
/* @__PURE__ */ e(
|
|
891
|
-
|
|
905
|
+
L,
|
|
892
906
|
{
|
|
893
907
|
dataField: "expirationDate",
|
|
894
908
|
dataType: "text",
|
|
895
909
|
size: 300,
|
|
896
910
|
header: `${a("archbase:Expira em")}`,
|
|
897
|
-
render: (t) => /* @__PURE__ */ e(
|
|
911
|
+
render: (t) => /* @__PURE__ */ e(c, { size: "sm", children: t.row.expirationDate }),
|
|
898
912
|
inputFilterType: "text"
|
|
899
913
|
}
|
|
900
914
|
),
|
|
901
915
|
/* @__PURE__ */ e(
|
|
902
|
-
|
|
916
|
+
L,
|
|
903
917
|
{
|
|
904
918
|
dataField: "revoked",
|
|
905
919
|
dataType: "boolean",
|
|
@@ -908,7 +922,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
|
|
|
908
922
|
}
|
|
909
923
|
),
|
|
910
924
|
/* @__PURE__ */ e(
|
|
911
|
-
|
|
925
|
+
L,
|
|
912
926
|
{
|
|
913
927
|
dataField: "expired",
|
|
914
928
|
dataType: "boolean",
|
|
@@ -917,7 +931,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
|
|
|
917
931
|
}
|
|
918
932
|
),
|
|
919
933
|
/* @__PURE__ */ e(
|
|
920
|
-
|
|
934
|
+
L,
|
|
921
935
|
{
|
|
922
936
|
dataField: "token",
|
|
923
937
|
dataType: "text",
|
|
@@ -926,9 +940,9 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
|
|
|
926
940
|
inputFilterType: "text"
|
|
927
941
|
}
|
|
928
942
|
)
|
|
929
|
-
] }),
|
|
943
|
+
] }), $r = (a) => /* @__PURE__ */ r(Ee, { children: [
|
|
930
944
|
/* @__PURE__ */ e(
|
|
931
|
-
|
|
945
|
+
L,
|
|
932
946
|
{
|
|
933
947
|
dataField: "avatar",
|
|
934
948
|
dataType: "image",
|
|
@@ -949,7 +963,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
|
|
|
949
963
|
}
|
|
950
964
|
),
|
|
951
965
|
/* @__PURE__ */ e(
|
|
952
|
-
|
|
966
|
+
L,
|
|
953
967
|
{
|
|
954
968
|
dataField: "name",
|
|
955
969
|
dataType: "text",
|
|
@@ -960,7 +974,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
|
|
|
960
974
|
}
|
|
961
975
|
),
|
|
962
976
|
/* @__PURE__ */ e(
|
|
963
|
-
|
|
977
|
+
L,
|
|
964
978
|
{
|
|
965
979
|
dataField: "nickname",
|
|
966
980
|
dataType: "text",
|
|
@@ -971,7 +985,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
|
|
|
971
985
|
}
|
|
972
986
|
),
|
|
973
987
|
/* @__PURE__ */ e(
|
|
974
|
-
|
|
988
|
+
L,
|
|
975
989
|
{
|
|
976
990
|
dataField: "email",
|
|
977
991
|
dataType: "text",
|
|
@@ -982,7 +996,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
|
|
|
982
996
|
}
|
|
983
997
|
),
|
|
984
998
|
/* @__PURE__ */ e(
|
|
985
|
-
|
|
999
|
+
L,
|
|
986
1000
|
{
|
|
987
1001
|
dataField: "accountDeactivated",
|
|
988
1002
|
dataType: "boolean",
|
|
@@ -992,32 +1006,32 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
|
|
|
992
1006
|
}
|
|
993
1007
|
),
|
|
994
1008
|
/* @__PURE__ */ e(
|
|
995
|
-
|
|
1009
|
+
L,
|
|
996
1010
|
{
|
|
997
1011
|
dataField: "profile.name",
|
|
998
1012
|
dataType: "text",
|
|
999
1013
|
header: `${a("archbase:Perfil")}`,
|
|
1000
1014
|
size: 200,
|
|
1001
|
-
render: (t) =>
|
|
1015
|
+
render: (t) => Nr(t.row),
|
|
1002
1016
|
inputFilterType: "text"
|
|
1003
1017
|
}
|
|
1004
1018
|
),
|
|
1005
1019
|
/* @__PURE__ */ e(
|
|
1006
|
-
|
|
1020
|
+
L,
|
|
1007
1021
|
{
|
|
1008
1022
|
dataField: "groups",
|
|
1009
1023
|
dataType: "text",
|
|
1010
1024
|
size: 300,
|
|
1011
1025
|
header: `${a("archbase:Grupos")}`,
|
|
1012
|
-
render: (t) =>
|
|
1013
|
-
exportValue: (t) => t.groups?.slice().sort((
|
|
1026
|
+
render: (t) => Fr(t.row),
|
|
1027
|
+
exportValue: (t) => t.groups?.slice().sort((l, n) => (l.group?.name ?? "").localeCompare(n.group?.name ?? "")).map((l) => l.group?.name).filter(Boolean).join(", ") || "",
|
|
1014
1028
|
enableSorting: !1,
|
|
1015
1029
|
enableColumnFilter: !1,
|
|
1016
1030
|
enableGlobalFilter: !1
|
|
1017
1031
|
}
|
|
1018
1032
|
),
|
|
1019
1033
|
/* @__PURE__ */ e(
|
|
1020
|
-
|
|
1034
|
+
L,
|
|
1021
1035
|
{
|
|
1022
1036
|
dataField: "isAdministrator",
|
|
1023
1037
|
dataType: "boolean",
|
|
@@ -1026,7 +1040,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
|
|
|
1026
1040
|
}
|
|
1027
1041
|
),
|
|
1028
1042
|
/* @__PURE__ */ e(
|
|
1029
|
-
|
|
1043
|
+
L,
|
|
1030
1044
|
{
|
|
1031
1045
|
dataField: "changePasswordOnNextLogin",
|
|
1032
1046
|
dataType: "boolean",
|
|
@@ -1036,7 +1050,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
|
|
|
1036
1050
|
}
|
|
1037
1051
|
),
|
|
1038
1052
|
/* @__PURE__ */ e(
|
|
1039
|
-
|
|
1053
|
+
L,
|
|
1040
1054
|
{
|
|
1041
1055
|
dataField: "allowPasswordChange",
|
|
1042
1056
|
dataType: "boolean",
|
|
@@ -1046,7 +1060,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
|
|
|
1046
1060
|
}
|
|
1047
1061
|
),
|
|
1048
1062
|
/* @__PURE__ */ e(
|
|
1049
|
-
|
|
1063
|
+
L,
|
|
1050
1064
|
{
|
|
1051
1065
|
dataField: "allowMultipleLogins",
|
|
1052
1066
|
dataType: "boolean",
|
|
@@ -1056,7 +1070,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
|
|
|
1056
1070
|
}
|
|
1057
1071
|
),
|
|
1058
1072
|
/* @__PURE__ */ e(
|
|
1059
|
-
|
|
1073
|
+
L,
|
|
1060
1074
|
{
|
|
1061
1075
|
dataField: "passwordNeverExpires",
|
|
1062
1076
|
dataType: "boolean",
|
|
@@ -1066,7 +1080,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
|
|
|
1066
1080
|
}
|
|
1067
1081
|
),
|
|
1068
1082
|
/* @__PURE__ */ e(
|
|
1069
|
-
|
|
1083
|
+
L,
|
|
1070
1084
|
{
|
|
1071
1085
|
dataField: "passwordChangedAt",
|
|
1072
1086
|
dataType: "datetime",
|
|
@@ -1076,7 +1090,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
|
|
|
1076
1090
|
}
|
|
1077
1091
|
),
|
|
1078
1092
|
/* @__PURE__ */ e(
|
|
1079
|
-
|
|
1093
|
+
L,
|
|
1080
1094
|
{
|
|
1081
1095
|
dataField: "accountLocked",
|
|
1082
1096
|
dataType: "boolean",
|
|
@@ -1086,7 +1100,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
|
|
|
1086
1100
|
}
|
|
1087
1101
|
),
|
|
1088
1102
|
/* @__PURE__ */ e(
|
|
1089
|
-
|
|
1103
|
+
L,
|
|
1090
1104
|
{
|
|
1091
1105
|
dataField: "unlimitedAccessHours",
|
|
1092
1106
|
dataType: "boolean",
|
|
@@ -1095,9 +1109,9 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
|
|
|
1095
1109
|
size: 140
|
|
1096
1110
|
}
|
|
1097
1111
|
)
|
|
1098
|
-
] }),
|
|
1112
|
+
] }), Lr = (a) => /* @__PURE__ */ r(Ee, { children: [
|
|
1099
1113
|
/* @__PURE__ */ e(
|
|
1100
|
-
|
|
1114
|
+
L,
|
|
1101
1115
|
{
|
|
1102
1116
|
dataField: "name",
|
|
1103
1117
|
dataType: "text",
|
|
@@ -1107,7 +1121,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
|
|
|
1107
1121
|
}
|
|
1108
1122
|
),
|
|
1109
1123
|
/* @__PURE__ */ e(
|
|
1110
|
-
|
|
1124
|
+
L,
|
|
1111
1125
|
{
|
|
1112
1126
|
dataField: "description",
|
|
1113
1127
|
dataType: "text",
|
|
@@ -1116,9 +1130,9 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
|
|
|
1116
1130
|
inputFilterType: "text"
|
|
1117
1131
|
}
|
|
1118
1132
|
)
|
|
1119
|
-
] }),
|
|
1133
|
+
] }), Mr = (a) => /* @__PURE__ */ r(Ee, { children: [
|
|
1120
1134
|
/* @__PURE__ */ e(
|
|
1121
|
-
|
|
1135
|
+
L,
|
|
1122
1136
|
{
|
|
1123
1137
|
dataField: "name",
|
|
1124
1138
|
dataType: "text",
|
|
@@ -1128,7 +1142,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
|
|
|
1128
1142
|
}
|
|
1129
1143
|
),
|
|
1130
1144
|
/* @__PURE__ */ e(
|
|
1131
|
-
|
|
1145
|
+
L,
|
|
1132
1146
|
{
|
|
1133
1147
|
dataField: "description",
|
|
1134
1148
|
dataType: "text",
|
|
@@ -1137,9 +1151,9 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
|
|
|
1137
1151
|
inputFilterType: "text"
|
|
1138
1152
|
}
|
|
1139
1153
|
)
|
|
1140
|
-
] }),
|
|
1154
|
+
] }), Vr = (a) => /* @__PURE__ */ r(Ee, { children: [
|
|
1141
1155
|
/* @__PURE__ */ e(
|
|
1142
|
-
|
|
1156
|
+
L,
|
|
1143
1157
|
{
|
|
1144
1158
|
dataField: "name",
|
|
1145
1159
|
dataType: "text",
|
|
@@ -1149,7 +1163,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
|
|
|
1149
1163
|
}
|
|
1150
1164
|
),
|
|
1151
1165
|
/* @__PURE__ */ e(
|
|
1152
|
-
|
|
1166
|
+
L,
|
|
1153
1167
|
{
|
|
1154
1168
|
dataField: "description",
|
|
1155
1169
|
dataType: "text",
|
|
@@ -1159,20 +1173,20 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
|
|
|
1159
1173
|
}
|
|
1160
1174
|
)
|
|
1161
1175
|
] });
|
|
1162
|
-
function
|
|
1176
|
+
function De({
|
|
1163
1177
|
active: a,
|
|
1164
1178
|
printTitle: t,
|
|
1165
|
-
gridRef:
|
|
1166
|
-
dataSource:
|
|
1167
|
-
isLoading:
|
|
1179
|
+
gridRef: l,
|
|
1180
|
+
dataSource: n,
|
|
1181
|
+
isLoading: u,
|
|
1168
1182
|
error: d,
|
|
1169
|
-
getRowId:
|
|
1170
|
-
striped:
|
|
1171
|
-
enableRowActions:
|
|
1172
|
-
toolbarLeftContent:
|
|
1173
|
-
renderRowActions:
|
|
1174
|
-
actionsColumnWidth:
|
|
1175
|
-
children:
|
|
1183
|
+
getRowId: h,
|
|
1184
|
+
striped: A = !1,
|
|
1185
|
+
enableRowActions: z = !0,
|
|
1186
|
+
toolbarLeftContent: g,
|
|
1187
|
+
renderRowActions: T,
|
|
1188
|
+
actionsColumnWidth: R,
|
|
1189
|
+
children: x
|
|
1176
1190
|
}) {
|
|
1177
1191
|
return /* @__PURE__ */ e(
|
|
1178
1192
|
re,
|
|
@@ -1187,62 +1201,62 @@ function Pe({
|
|
|
1187
1201
|
overflow: "auto"
|
|
1188
1202
|
},
|
|
1189
1203
|
children: /* @__PURE__ */ e(
|
|
1190
|
-
|
|
1204
|
+
ka,
|
|
1191
1205
|
{
|
|
1192
|
-
gridRef:
|
|
1206
|
+
gridRef: l,
|
|
1193
1207
|
printTitle: t,
|
|
1194
1208
|
width: "100%",
|
|
1195
1209
|
height: "100%",
|
|
1196
1210
|
withBorder: !1,
|
|
1197
|
-
dataSource:
|
|
1211
|
+
dataSource: n,
|
|
1198
1212
|
withColumnBorders: !0,
|
|
1199
|
-
striped:
|
|
1213
|
+
striped: A,
|
|
1200
1214
|
enableTopToolbar: !0,
|
|
1201
|
-
enableRowActions:
|
|
1215
|
+
enableRowActions: z,
|
|
1202
1216
|
pageSize: 50,
|
|
1203
|
-
isLoading:
|
|
1217
|
+
isLoading: u,
|
|
1204
1218
|
isError: !!d,
|
|
1205
1219
|
error: d,
|
|
1206
1220
|
enableGlobalFilter: !0,
|
|
1207
|
-
getRowId:
|
|
1208
|
-
toolbarLeftContent:
|
|
1209
|
-
renderRowActions:
|
|
1210
|
-
actionsColumnWidth:
|
|
1211
|
-
children:
|
|
1221
|
+
getRowId: h,
|
|
1222
|
+
toolbarLeftContent: g,
|
|
1223
|
+
renderRowActions: T,
|
|
1224
|
+
actionsColumnWidth: R,
|
|
1225
|
+
children: x
|
|
1212
1226
|
}
|
|
1213
1227
|
)
|
|
1214
1228
|
}
|
|
1215
1229
|
);
|
|
1216
1230
|
}
|
|
1217
|
-
function
|
|
1231
|
+
function _e({
|
|
1218
1232
|
dataSource: a,
|
|
1219
1233
|
securityType: t,
|
|
1220
|
-
newInstance:
|
|
1221
|
-
createEntitiesWithId:
|
|
1222
|
-
removeMessageKey:
|
|
1234
|
+
newInstance: l,
|
|
1235
|
+
createEntitiesWithId: n,
|
|
1236
|
+
removeMessageKey: u,
|
|
1223
1237
|
setOpenedModal: d,
|
|
1224
|
-
setOpenedPermissionsModal:
|
|
1225
|
-
validationContext:
|
|
1226
|
-
t:
|
|
1238
|
+
setOpenedPermissionsModal: h,
|
|
1239
|
+
validationContext: A,
|
|
1240
|
+
t: z
|
|
1227
1241
|
}) {
|
|
1228
|
-
const
|
|
1242
|
+
const g = a, T = (p) => g.isEmpty() ? null : g.gotoRecordByData(p) ?? null;
|
|
1229
1243
|
return {
|
|
1230
1244
|
handleAdd: () => {
|
|
1231
|
-
const p =
|
|
1232
|
-
|
|
1245
|
+
const p = l();
|
|
1246
|
+
n || (p.id = void 0), g.insert(p), d(t);
|
|
1233
1247
|
},
|
|
1234
1248
|
handleViewRow: (p) => {
|
|
1235
|
-
|
|
1249
|
+
T(p) && d(t);
|
|
1236
1250
|
},
|
|
1237
1251
|
handleEditRow: (p) => {
|
|
1238
|
-
|
|
1252
|
+
T(p) && (g.isEditing() || g.edit(), d(t));
|
|
1239
1253
|
},
|
|
1240
1254
|
handleRemoveRow: (p) => {
|
|
1241
|
-
|
|
1242
|
-
`${
|
|
1243
|
-
`${
|
|
1255
|
+
T(p) && ve.showConfirmDialogYesNo(
|
|
1256
|
+
`${z("archbase:Confirme")}`,
|
|
1257
|
+
`${z(u)}${p.name} ?`,
|
|
1244
1258
|
() => {
|
|
1245
|
-
|
|
1259
|
+
g.remove();
|
|
1246
1260
|
},
|
|
1247
1261
|
() => {
|
|
1248
1262
|
}
|
|
@@ -1250,203 +1264,203 @@ function Ye({
|
|
|
1250
1264
|
},
|
|
1251
1265
|
handleSaveModal: async () => {
|
|
1252
1266
|
try {
|
|
1253
|
-
await
|
|
1267
|
+
await g.save();
|
|
1254
1268
|
} catch {
|
|
1255
1269
|
return;
|
|
1256
1270
|
}
|
|
1257
|
-
d(""),
|
|
1271
|
+
d(""), A?.clearAll();
|
|
1258
1272
|
},
|
|
1259
1273
|
handleCancelModal: () => {
|
|
1260
|
-
d(""),
|
|
1274
|
+
d(""), g.isBrowsing() || g.cancel(), A?.clearAll();
|
|
1261
1275
|
},
|
|
1262
1276
|
handleOpenPermissionsModal: () => {
|
|
1263
|
-
|
|
1277
|
+
h(t);
|
|
1264
1278
|
}
|
|
1265
1279
|
};
|
|
1266
1280
|
}
|
|
1267
|
-
function
|
|
1281
|
+
function Ye({
|
|
1268
1282
|
row: a,
|
|
1269
1283
|
onView: t,
|
|
1270
|
-
onEdit:
|
|
1271
|
-
onRemove:
|
|
1272
|
-
onEditPermissions:
|
|
1284
|
+
onEdit: l,
|
|
1285
|
+
onRemove: n,
|
|
1286
|
+
onEditPermissions: u,
|
|
1273
1287
|
before: d,
|
|
1274
|
-
after:
|
|
1275
|
-
t:
|
|
1288
|
+
after: h,
|
|
1289
|
+
t: A
|
|
1276
1290
|
}) {
|
|
1277
|
-
const
|
|
1291
|
+
const z = na(), { colorScheme: g } = qe(), T = g === "dark", R = (x) => T ? z.colors[x][8] : z.colors[x][4];
|
|
1278
1292
|
return /* @__PURE__ */ r(O, { gap: 1, wrap: "nowrap", children: [
|
|
1279
1293
|
d?.(a),
|
|
1280
|
-
/* @__PURE__ */ e(
|
|
1281
|
-
/* @__PURE__ */ e(
|
|
1282
|
-
/* @__PURE__ */ e(
|
|
1283
|
-
/* @__PURE__ */ e(
|
|
1284
|
-
|
|
1294
|
+
/* @__PURE__ */ e(ye, { variant: "transparent", onClick: () => t(a), children: /* @__PURE__ */ e(mr, { size: 20, color: R("blue") }) }),
|
|
1295
|
+
/* @__PURE__ */ e(ye, { variant: "transparent", onClick: () => l(a), children: /* @__PURE__ */ e(Fa, { size: 20, color: R("yellow") }) }),
|
|
1296
|
+
/* @__PURE__ */ e(ye, { variant: "transparent", onClick: () => n(a), children: /* @__PURE__ */ e(la, { size: 20, color: R("red") }) }),
|
|
1297
|
+
/* @__PURE__ */ e(Ie, { withinPortal: !0, withArrow: !0, position: "left", label: `${A("archbase:Edit permissions")}`, children: /* @__PURE__ */ e(ye, { variant: "transparent", onClick: u, children: /* @__PURE__ */ e(gr, { size: 20, color: R("green") }) }) }),
|
|
1298
|
+
h?.(a)
|
|
1285
1299
|
] });
|
|
1286
1300
|
}
|
|
1287
|
-
const ea = ({ onAdd: a, onEditPermissions: t, t:
|
|
1301
|
+
const ea = ({ onAdd: a, onEditPermissions: t, t: l }) => /* @__PURE__ */ r(Fe, { justify: "space-between", style: { width: "50%" }, children: [
|
|
1288
1302
|
/* @__PURE__ */ r(O, { align: "end", gap: "4px", wrap: "nowrap", children: [
|
|
1289
|
-
/* @__PURE__ */ e(X, { color: "green", leftSection: /* @__PURE__ */ e(
|
|
1290
|
-
/* @__PURE__ */ e(X, { color: "blue", leftSection: /* @__PURE__ */ e(
|
|
1303
|
+
/* @__PURE__ */ e(X, { color: "green", leftSection: /* @__PURE__ */ e(Na, {}), onClick: a, children: `${l("archbase:New")}` }),
|
|
1304
|
+
/* @__PURE__ */ e(X, { color: "blue", leftSection: /* @__PURE__ */ e(Fa, {}), onClick: t, children: `${l("archbase:Edit permissions")}` })
|
|
1291
1305
|
] }),
|
|
1292
1306
|
/* @__PURE__ */ e(Fe, { align: "flex-start", justify: "flex-end", style: { width: "200px" } })
|
|
1293
1307
|
] });
|
|
1294
|
-
function
|
|
1308
|
+
function Tt({
|
|
1295
1309
|
height: a = "400px",
|
|
1296
1310
|
width: t = "100%",
|
|
1297
|
-
createEntitiesWithId:
|
|
1298
|
-
userModalOptions:
|
|
1299
|
-
profileModalOptions:
|
|
1311
|
+
createEntitiesWithId: l = !0,
|
|
1312
|
+
userModalOptions: n,
|
|
1313
|
+
profileModalOptions: u,
|
|
1300
1314
|
groupModalOptions: d,
|
|
1301
|
-
options:
|
|
1315
|
+
options: h
|
|
1302
1316
|
}) {
|
|
1303
|
-
|
|
1304
|
-
const
|
|
1317
|
+
na(), Ea("securityStore");
|
|
1318
|
+
const A = ir(), { colorScheme: z } = qe(), [g, T] = S(void 0), [R, x] = S("users"), D = J(K.User), b = J(K.Group), w = J(K.Resource), o = J(K.Profile), [s, p] = S(""), [v, $] = S(""), y = J(K.AccessToken), { t: i } = or(), N = Re(null), I = Re(null), M = Re(null), F = Re(null), C = Re(null), k = (V) => V.id, oe = (V) => V.id, me = (V) => V.id, E = (V) => V.id, P = (V) => V.id, {
|
|
1305
1319
|
dataSource: q,
|
|
1306
|
-
isLoading:
|
|
1307
|
-
refreshData:
|
|
1308
|
-
} =
|
|
1320
|
+
isLoading: G,
|
|
1321
|
+
refreshData: Z
|
|
1322
|
+
} = Pe({
|
|
1309
1323
|
name: "accessTokenApi",
|
|
1310
|
-
service:
|
|
1311
|
-
validator:
|
|
1324
|
+
service: y,
|
|
1325
|
+
validator: A,
|
|
1312
1326
|
pageSize: 25,
|
|
1313
1327
|
defaultSortFields: ["user.email", "expirationTime:desc"],
|
|
1314
|
-
onError: (
|
|
1315
|
-
|
|
1328
|
+
onError: (V, te) => {
|
|
1329
|
+
T(V), ne.showError(`${i("archbase:WARNING")}`, V, te);
|
|
1316
1330
|
}
|
|
1317
1331
|
}), {
|
|
1318
1332
|
dataSource: B,
|
|
1319
|
-
isLoading:
|
|
1320
|
-
refreshData:
|
|
1321
|
-
} =
|
|
1333
|
+
isLoading: Q,
|
|
1334
|
+
refreshData: H
|
|
1335
|
+
} = Pe({
|
|
1322
1336
|
name: "dsUsers",
|
|
1323
|
-
service:
|
|
1324
|
-
validator:
|
|
1337
|
+
service: D,
|
|
1338
|
+
validator: A,
|
|
1325
1339
|
pageSize: 25,
|
|
1326
|
-
onError: (
|
|
1327
|
-
|
|
1340
|
+
onError: (V, te) => {
|
|
1341
|
+
T(V), ne.showError(`${i("archbase:WARNING")}`, V, te);
|
|
1328
1342
|
}
|
|
1329
1343
|
}), {
|
|
1330
|
-
dataSource:
|
|
1344
|
+
dataSource: de,
|
|
1331
1345
|
isLoading: je,
|
|
1332
1346
|
refreshData: Ze
|
|
1333
|
-
} =
|
|
1347
|
+
} = Pe({
|
|
1334
1348
|
name: "dsGroups",
|
|
1335
|
-
service:
|
|
1336
|
-
validator:
|
|
1349
|
+
service: b,
|
|
1350
|
+
validator: A,
|
|
1337
1351
|
pageSize: 25,
|
|
1338
|
-
onError: (
|
|
1339
|
-
|
|
1352
|
+
onError: (V, te) => {
|
|
1353
|
+
T(V), ne.showError(`${i("archbase:WARNING")}`, V, te);
|
|
1340
1354
|
}
|
|
1341
1355
|
}), {
|
|
1342
1356
|
dataSource: Le,
|
|
1343
|
-
isLoading:
|
|
1344
|
-
refreshData:
|
|
1345
|
-
} =
|
|
1357
|
+
isLoading: $a,
|
|
1358
|
+
refreshData: La
|
|
1359
|
+
} = Pe({
|
|
1346
1360
|
name: "dsProfile",
|
|
1347
1361
|
service: o,
|
|
1348
|
-
validator:
|
|
1362
|
+
validator: A,
|
|
1349
1363
|
pageSize: 25,
|
|
1350
|
-
onError: (
|
|
1351
|
-
|
|
1364
|
+
onError: (V, te) => {
|
|
1365
|
+
T(V), ne.showError(`${i("archbase:WARNING")}`, V, te);
|
|
1352
1366
|
}
|
|
1353
1367
|
}), {
|
|
1354
|
-
dataSource:
|
|
1355
|
-
isLoading:
|
|
1356
|
-
refreshData:
|
|
1357
|
-
} =
|
|
1368
|
+
dataSource: Ma,
|
|
1369
|
+
isLoading: Va,
|
|
1370
|
+
refreshData: Ua
|
|
1371
|
+
} = Pe({
|
|
1358
1372
|
name: "dsResources",
|
|
1359
1373
|
service: w,
|
|
1360
|
-
validator:
|
|
1374
|
+
validator: A,
|
|
1361
1375
|
pageSize: 25,
|
|
1362
|
-
onError: (
|
|
1363
|
-
|
|
1376
|
+
onError: (V, te) => {
|
|
1377
|
+
T(V), ne.showError(`${i("archbase:WARNING")}`, V, te);
|
|
1364
1378
|
}
|
|
1365
1379
|
});
|
|
1366
1380
|
ee(() => {
|
|
1367
|
-
|
|
1381
|
+
Z({ filter: Ue(Ne.eq("revoked", "false")) }), H(), Ze(), La(), Ua();
|
|
1368
1382
|
}, []);
|
|
1369
|
-
const
|
|
1383
|
+
const Ga = Or(i), Ba = $r(i), Ha = Lr(i), qa = Mr(i), Wa = Vr(i), Qe = nr(), ge = _e({
|
|
1370
1384
|
dataSource: B,
|
|
1371
|
-
securityType:
|
|
1372
|
-
newInstance: () =>
|
|
1373
|
-
createEntitiesWithId:
|
|
1385
|
+
securityType: _.USER,
|
|
1386
|
+
newInstance: () => fr.newInstance(),
|
|
1387
|
+
createEntitiesWithId: l,
|
|
1374
1388
|
removeMessageKey: "archbase:Deseja remover o usuário ",
|
|
1375
1389
|
setOpenedModal: p,
|
|
1376
|
-
setOpenedPermissionsModal:
|
|
1390
|
+
setOpenedPermissionsModal: $,
|
|
1377
1391
|
validationContext: Qe,
|
|
1378
1392
|
t: i
|
|
1379
|
-
}),
|
|
1380
|
-
dataSource:
|
|
1381
|
-
securityType:
|
|
1382
|
-
newInstance: () =>
|
|
1383
|
-
createEntitiesWithId:
|
|
1393
|
+
}), fe = _e({
|
|
1394
|
+
dataSource: de,
|
|
1395
|
+
securityType: _.GROUP,
|
|
1396
|
+
newInstance: () => br.newInstance(),
|
|
1397
|
+
createEntitiesWithId: l,
|
|
1384
1398
|
removeMessageKey: "archbase:Deseja remover o grupo ",
|
|
1385
1399
|
setOpenedModal: p,
|
|
1386
|
-
setOpenedPermissionsModal:
|
|
1400
|
+
setOpenedPermissionsModal: $,
|
|
1387
1401
|
validationContext: Qe,
|
|
1388
1402
|
t: i
|
|
1389
|
-
}),
|
|
1403
|
+
}), be = _e({
|
|
1390
1404
|
dataSource: Le,
|
|
1391
|
-
securityType:
|
|
1392
|
-
newInstance: () =>
|
|
1393
|
-
createEntitiesWithId:
|
|
1405
|
+
securityType: _.PROFILE,
|
|
1406
|
+
newInstance: () => vr.newInstance(),
|
|
1407
|
+
createEntitiesWithId: l,
|
|
1394
1408
|
removeMessageKey: "archbase:Deseja remover o perfil ",
|
|
1395
1409
|
setOpenedModal: p,
|
|
1396
|
-
setOpenedPermissionsModal:
|
|
1410
|
+
setOpenedPermissionsModal: $,
|
|
1397
1411
|
validationContext: Qe,
|
|
1398
1412
|
t: i
|
|
1399
|
-
}),
|
|
1400
|
-
|
|
1413
|
+
}), ja = (V) => /* @__PURE__ */ e(
|
|
1414
|
+
Ye,
|
|
1401
1415
|
{
|
|
1402
|
-
row:
|
|
1403
|
-
onView:
|
|
1404
|
-
onEdit:
|
|
1405
|
-
onRemove:
|
|
1406
|
-
onEditPermissions:
|
|
1407
|
-
before:
|
|
1408
|
-
after:
|
|
1416
|
+
row: V,
|
|
1417
|
+
onView: ge.handleViewRow,
|
|
1418
|
+
onEdit: ge.handleEditRow,
|
|
1419
|
+
onRemove: ge.handleRemoveRow,
|
|
1420
|
+
onEditPermissions: ge.handleOpenPermissionsModal,
|
|
1421
|
+
before: h?.beforeDefaultUserActions,
|
|
1422
|
+
after: h?.afterDefaultUserActions,
|
|
1409
1423
|
t: i
|
|
1410
1424
|
}
|
|
1411
|
-
),
|
|
1412
|
-
|
|
1425
|
+
), Za = (V) => /* @__PURE__ */ e(
|
|
1426
|
+
Ye,
|
|
1413
1427
|
{
|
|
1414
|
-
row:
|
|
1415
|
-
onView:
|
|
1416
|
-
onEdit:
|
|
1417
|
-
onRemove:
|
|
1418
|
-
onEditPermissions:
|
|
1419
|
-
before:
|
|
1420
|
-
after:
|
|
1428
|
+
row: V,
|
|
1429
|
+
onView: fe.handleViewRow,
|
|
1430
|
+
onEdit: fe.handleEditRow,
|
|
1431
|
+
onRemove: fe.handleRemoveRow,
|
|
1432
|
+
onEditPermissions: fe.handleOpenPermissionsModal,
|
|
1433
|
+
before: h?.beforeDefaultGroupActions,
|
|
1434
|
+
after: h?.afterDefaultGroupActions,
|
|
1421
1435
|
t: i
|
|
1422
1436
|
}
|
|
1423
|
-
),
|
|
1424
|
-
|
|
1437
|
+
), Qa = (V) => /* @__PURE__ */ e(
|
|
1438
|
+
Ye,
|
|
1425
1439
|
{
|
|
1426
|
-
row:
|
|
1427
|
-
onView:
|
|
1428
|
-
onEdit:
|
|
1429
|
-
onRemove:
|
|
1430
|
-
onEditPermissions:
|
|
1431
|
-
before:
|
|
1432
|
-
after:
|
|
1440
|
+
row: V,
|
|
1441
|
+
onView: be.handleViewRow,
|
|
1442
|
+
onEdit: be.handleEditRow,
|
|
1443
|
+
onRemove: be.handleRemoveRow,
|
|
1444
|
+
onEditPermissions: be.handleOpenPermissionsModal,
|
|
1445
|
+
before: h?.beforeDefaultProfileActions,
|
|
1446
|
+
after: h?.afterDefaultProfileActions,
|
|
1433
1447
|
t: i
|
|
1434
1448
|
}
|
|
1435
|
-
),
|
|
1436
|
-
const
|
|
1437
|
-
|
|
1449
|
+
), Ka = () => {
|
|
1450
|
+
const V = q.getCurrentRecord();
|
|
1451
|
+
V && ve.showConfirmDialogYesNo(
|
|
1438
1452
|
`${i("archbase:Confirme")}`,
|
|
1439
|
-
`${i("archbase:Deseja revogar o token de Acesso do usuário ")}${
|
|
1453
|
+
`${i("archbase:Deseja revogar o token de Acesso do usuário ")}${V.user.name} ?`,
|
|
1440
1454
|
async () => {
|
|
1441
|
-
await
|
|
1455
|
+
await y.revoke(V.token).then(async () => {
|
|
1442
1456
|
ne.showSuccess(
|
|
1443
1457
|
`${i("mentors:Informação")}`,
|
|
1444
1458
|
`${i("mentors:Token de Acesso revogado com sucesso!")}`
|
|
1445
1459
|
), q.refreshData();
|
|
1446
1460
|
}).catch((te) => {
|
|
1447
|
-
|
|
1461
|
+
ve.showErrorWithDetails(
|
|
1448
1462
|
`${i("mentors:Atenção")}`,
|
|
1449
|
-
|
|
1463
|
+
Te(te),
|
|
1450
1464
|
Ve(te)
|
|
1451
1465
|
);
|
|
1452
1466
|
});
|
|
@@ -1455,223 +1469,223 @@ function mt({
|
|
|
1455
1469
|
}
|
|
1456
1470
|
);
|
|
1457
1471
|
}, Ke = () => {
|
|
1458
|
-
|
|
1459
|
-
},
|
|
1472
|
+
$("");
|
|
1473
|
+
}, Ja = () => /* @__PURE__ */ e(Fe, { justify: "space-between", style: { width: "50%" }, children: /* @__PURE__ */ e(O, { align: "start", gap: "4px", wrap: "nowrap", children: /* @__PURE__ */ e(
|
|
1460
1474
|
X,
|
|
1461
1475
|
{
|
|
1462
1476
|
disabled: !q.getCurrentRecord(),
|
|
1463
1477
|
color: "red",
|
|
1464
|
-
leftSection: /* @__PURE__ */ e(
|
|
1465
|
-
onClick:
|
|
1478
|
+
leftSection: /* @__PURE__ */ e(la, {}),
|
|
1479
|
+
onClick: Ka,
|
|
1466
1480
|
children: `${i("archbase:Revoke")}`
|
|
1467
1481
|
}
|
|
1468
1482
|
) }) });
|
|
1469
1483
|
return /* @__PURE__ */ r(re, { p: "md", style: { height: a, display: "flex", flexDirection: "column" }, children: [
|
|
1470
|
-
/* @__PURE__ */ e(
|
|
1471
|
-
/* @__PURE__ */ e(
|
|
1472
|
-
/* @__PURE__ */ e(
|
|
1473
|
-
/* @__PURE__ */ e(
|
|
1474
|
-
/* @__PURE__ */ e(
|
|
1475
|
-
/* @__PURE__ */ e(
|
|
1484
|
+
/* @__PURE__ */ e(we, { variant: "pills", value: R, onChange: x, children: /* @__PURE__ */ r(we.List, { children: [
|
|
1485
|
+
/* @__PURE__ */ e(we.Tab, { value: "users", children: `${i("Usuários")}` }),
|
|
1486
|
+
/* @__PURE__ */ e(we.Tab, { value: "groups", children: `${i("Grupos")}` }),
|
|
1487
|
+
/* @__PURE__ */ e(we.Tab, { value: "profiles", children: `${i("Perfis")}` }),
|
|
1488
|
+
/* @__PURE__ */ e(we.Tab, { value: "resources", children: `${i("Recursos")}` }),
|
|
1489
|
+
/* @__PURE__ */ e(we.Tab, { value: "accessTokens", children: `${i("Tokens Acesso")}` })
|
|
1476
1490
|
] }) }),
|
|
1477
1491
|
/* @__PURE__ */ e(
|
|
1478
|
-
|
|
1492
|
+
De,
|
|
1479
1493
|
{
|
|
1480
|
-
active:
|
|
1494
|
+
active: R === "users",
|
|
1481
1495
|
printTitle: "Usuários",
|
|
1482
1496
|
gridRef: N,
|
|
1483
1497
|
dataSource: B,
|
|
1484
|
-
isLoading:
|
|
1485
|
-
error:
|
|
1486
|
-
getRowId:
|
|
1498
|
+
isLoading: Q,
|
|
1499
|
+
error: g,
|
|
1500
|
+
getRowId: k,
|
|
1487
1501
|
striped: !0,
|
|
1488
1502
|
toolbarLeftContent: /* @__PURE__ */ e(
|
|
1489
1503
|
ea,
|
|
1490
1504
|
{
|
|
1491
|
-
onAdd:
|
|
1492
|
-
onEditPermissions:
|
|
1505
|
+
onAdd: ge.handleAdd,
|
|
1506
|
+
onEditPermissions: ge.handleOpenPermissionsModal,
|
|
1493
1507
|
t: i
|
|
1494
1508
|
}
|
|
1495
1509
|
),
|
|
1496
|
-
renderRowActions:
|
|
1497
|
-
actionsColumnWidth:
|
|
1498
|
-
children:
|
|
1510
|
+
renderRowActions: ja,
|
|
1511
|
+
actionsColumnWidth: h?.userActionsColumnWidth,
|
|
1512
|
+
children: Ba
|
|
1499
1513
|
}
|
|
1500
1514
|
),
|
|
1501
1515
|
/* @__PURE__ */ e(
|
|
1502
|
-
|
|
1516
|
+
De,
|
|
1503
1517
|
{
|
|
1504
|
-
active:
|
|
1518
|
+
active: R === "groups",
|
|
1505
1519
|
printTitle: "Grupos",
|
|
1506
|
-
gridRef:
|
|
1507
|
-
dataSource:
|
|
1520
|
+
gridRef: I,
|
|
1521
|
+
dataSource: de,
|
|
1508
1522
|
isLoading: je,
|
|
1509
|
-
error:
|
|
1523
|
+
error: g,
|
|
1510
1524
|
getRowId: oe,
|
|
1511
1525
|
toolbarLeftContent: /* @__PURE__ */ e(
|
|
1512
1526
|
ea,
|
|
1513
1527
|
{
|
|
1514
|
-
onAdd:
|
|
1515
|
-
onEditPermissions:
|
|
1528
|
+
onAdd: fe.handleAdd,
|
|
1529
|
+
onEditPermissions: fe.handleOpenPermissionsModal,
|
|
1516
1530
|
t: i
|
|
1517
1531
|
}
|
|
1518
1532
|
),
|
|
1519
|
-
renderRowActions:
|
|
1520
|
-
actionsColumnWidth:
|
|
1521
|
-
children:
|
|
1533
|
+
renderRowActions: Za,
|
|
1534
|
+
actionsColumnWidth: h?.groupActionsColumnWidth,
|
|
1535
|
+
children: Ha
|
|
1522
1536
|
}
|
|
1523
1537
|
),
|
|
1524
1538
|
/* @__PURE__ */ e(
|
|
1525
|
-
|
|
1539
|
+
De,
|
|
1526
1540
|
{
|
|
1527
|
-
active:
|
|
1541
|
+
active: R === "profiles",
|
|
1528
1542
|
printTitle: "Perfis",
|
|
1529
|
-
gridRef:
|
|
1543
|
+
gridRef: M,
|
|
1530
1544
|
dataSource: Le,
|
|
1531
|
-
isLoading:
|
|
1532
|
-
error:
|
|
1533
|
-
getRowId:
|
|
1545
|
+
isLoading: $a,
|
|
1546
|
+
error: g,
|
|
1547
|
+
getRowId: me,
|
|
1534
1548
|
toolbarLeftContent: /* @__PURE__ */ e(
|
|
1535
1549
|
ea,
|
|
1536
1550
|
{
|
|
1537
|
-
onAdd:
|
|
1538
|
-
onEditPermissions:
|
|
1551
|
+
onAdd: be.handleAdd,
|
|
1552
|
+
onEditPermissions: be.handleOpenPermissionsModal,
|
|
1539
1553
|
t: i
|
|
1540
1554
|
}
|
|
1541
1555
|
),
|
|
1542
|
-
renderRowActions:
|
|
1543
|
-
actionsColumnWidth:
|
|
1544
|
-
children:
|
|
1556
|
+
renderRowActions: Qa,
|
|
1557
|
+
actionsColumnWidth: h?.profileActionsColumnWidth,
|
|
1558
|
+
children: qa
|
|
1545
1559
|
}
|
|
1546
1560
|
),
|
|
1547
1561
|
/* @__PURE__ */ e(
|
|
1548
|
-
|
|
1562
|
+
De,
|
|
1549
1563
|
{
|
|
1550
|
-
active:
|
|
1564
|
+
active: R === "resources",
|
|
1551
1565
|
printTitle: "Recursos",
|
|
1552
|
-
gridRef:
|
|
1553
|
-
dataSource:
|
|
1554
|
-
isLoading:
|
|
1555
|
-
error:
|
|
1556
|
-
getRowId:
|
|
1566
|
+
gridRef: F,
|
|
1567
|
+
dataSource: Ma,
|
|
1568
|
+
isLoading: Va,
|
|
1569
|
+
error: g,
|
|
1570
|
+
getRowId: E,
|
|
1557
1571
|
enableRowActions: !1,
|
|
1558
1572
|
children: Wa
|
|
1559
1573
|
}
|
|
1560
1574
|
),
|
|
1561
1575
|
/* @__PURE__ */ e(
|
|
1562
|
-
|
|
1576
|
+
De,
|
|
1563
1577
|
{
|
|
1564
|
-
active:
|
|
1578
|
+
active: R === "accessTokens",
|
|
1565
1579
|
printTitle: "Tokens de API",
|
|
1566
1580
|
gridRef: C,
|
|
1567
1581
|
dataSource: q,
|
|
1568
|
-
isLoading:
|
|
1569
|
-
error:
|
|
1570
|
-
getRowId:
|
|
1582
|
+
isLoading: G,
|
|
1583
|
+
error: g,
|
|
1584
|
+
getRowId: P,
|
|
1571
1585
|
striped: !0,
|
|
1572
1586
|
enableRowActions: !1,
|
|
1573
|
-
toolbarLeftContent:
|
|
1574
|
-
children:
|
|
1587
|
+
toolbarLeftContent: Ja(),
|
|
1588
|
+
children: Ga
|
|
1575
1589
|
}
|
|
1576
1590
|
),
|
|
1577
|
-
|
|
1578
|
-
|
|
1591
|
+
s === _.USER ? /* @__PURE__ */ e(
|
|
1592
|
+
kr,
|
|
1579
1593
|
{
|
|
1580
|
-
onClickOk:
|
|
1594
|
+
onClickOk: ge.handleSaveModal,
|
|
1581
1595
|
opened: !0,
|
|
1582
1596
|
dataSource: B,
|
|
1583
|
-
onClickCancel:
|
|
1584
|
-
options:
|
|
1597
|
+
onClickCancel: ge.handleCancelModal,
|
|
1598
|
+
options: n
|
|
1585
1599
|
}
|
|
1586
1600
|
) : null,
|
|
1587
|
-
|
|
1588
|
-
|
|
1601
|
+
s === _.GROUP ? /* @__PURE__ */ e(
|
|
1602
|
+
Er,
|
|
1589
1603
|
{
|
|
1590
|
-
onClickOk:
|
|
1604
|
+
onClickOk: fe.handleSaveModal,
|
|
1591
1605
|
opened: !0,
|
|
1592
|
-
dataSource:
|
|
1593
|
-
onClickCancel:
|
|
1606
|
+
dataSource: de,
|
|
1607
|
+
onClickCancel: fe.handleCancelModal,
|
|
1594
1608
|
options: d
|
|
1595
1609
|
}
|
|
1596
1610
|
) : null,
|
|
1597
|
-
|
|
1598
|
-
|
|
1611
|
+
s === _.PROFILE ? /* @__PURE__ */ e(
|
|
1612
|
+
Ar,
|
|
1599
1613
|
{
|
|
1600
|
-
onClickOk:
|
|
1614
|
+
onClickOk: be.handleSaveModal,
|
|
1601
1615
|
opened: !0,
|
|
1602
1616
|
dataSource: Le,
|
|
1603
|
-
onClickCancel:
|
|
1604
|
-
options:
|
|
1617
|
+
onClickCancel: be.handleCancelModal,
|
|
1618
|
+
options: u
|
|
1605
1619
|
}
|
|
1606
1620
|
) : null,
|
|
1607
|
-
|
|
1621
|
+
v === _.USER ? /* @__PURE__ */ e(
|
|
1608
1622
|
Xe,
|
|
1609
1623
|
{
|
|
1610
1624
|
dataSource: B,
|
|
1611
|
-
opened: !!
|
|
1625
|
+
opened: !!v,
|
|
1612
1626
|
close: Ke
|
|
1613
1627
|
}
|
|
1614
1628
|
) : null,
|
|
1615
|
-
|
|
1629
|
+
v === _.GROUP ? /* @__PURE__ */ e(
|
|
1616
1630
|
Xe,
|
|
1617
1631
|
{
|
|
1618
|
-
dataSource:
|
|
1619
|
-
opened: !!
|
|
1632
|
+
dataSource: de,
|
|
1633
|
+
opened: !!v,
|
|
1620
1634
|
close: Ke
|
|
1621
1635
|
}
|
|
1622
1636
|
) : null,
|
|
1623
|
-
|
|
1637
|
+
v === _.PROFILE ? /* @__PURE__ */ e(
|
|
1624
1638
|
Xe,
|
|
1625
1639
|
{
|
|
1626
1640
|
dataSource: Le,
|
|
1627
|
-
opened: !!
|
|
1641
|
+
opened: !!v,
|
|
1628
1642
|
close: Ke
|
|
1629
1643
|
}
|
|
1630
1644
|
) : null
|
|
1631
1645
|
] });
|
|
1632
1646
|
}
|
|
1633
|
-
function
|
|
1634
|
-
|
|
1635
|
-
const
|
|
1647
|
+
function wt({ height: a = "400px", width: t = "100%" }) {
|
|
1648
|
+
na();
|
|
1649
|
+
const l = Ea("apiTokenStore"), n = { validateEntity: () => [] }, { colorScheme: u } = qe(), [d, h] = S(void 0), A = J(K.ApiToken), [z, g] = S(""), T = Re(null), R = (I) => I.id, { dataSource: x } = hr({
|
|
1636
1650
|
initialData: [],
|
|
1637
1651
|
name: "dataSource"
|
|
1638
|
-
}),
|
|
1652
|
+
}), D = Oe(
|
|
1639
1653
|
"ArchbaseApiTokenView-LocalDataSource",
|
|
1640
|
-
|
|
1654
|
+
x,
|
|
1641
1655
|
void 0,
|
|
1642
1656
|
void 0
|
|
1643
|
-
), { dataSource:
|
|
1657
|
+
), { dataSource: b, isLoading: w } = ia({
|
|
1644
1658
|
name: "dsApiToken",
|
|
1645
|
-
service:
|
|
1646
|
-
store:
|
|
1647
|
-
validator:
|
|
1659
|
+
service: A,
|
|
1660
|
+
store: l,
|
|
1661
|
+
validator: n,
|
|
1648
1662
|
pageSize: 25,
|
|
1649
1663
|
loadOnStart: !0,
|
|
1650
|
-
onLoadComplete: (
|
|
1664
|
+
onLoadComplete: (I) => {
|
|
1651
1665
|
},
|
|
1652
|
-
onDestroy: (
|
|
1666
|
+
onDestroy: (I) => {
|
|
1653
1667
|
},
|
|
1654
|
-
onError: (
|
|
1655
|
-
|
|
1668
|
+
onError: (I, M) => {
|
|
1669
|
+
h(I), ne.showError(f().t("archbase:WARNING"), I, M);
|
|
1656
1670
|
}
|
|
1657
|
-
}), o =
|
|
1671
|
+
}), o = Oe(
|
|
1658
1672
|
"ArchbaseApiTokenView-RemoteDataSource",
|
|
1659
|
-
|
|
1673
|
+
b,
|
|
1660
1674
|
void 0,
|
|
1661
1675
|
void 0
|
|
1662
|
-
),
|
|
1676
|
+
), s = `calc(${a} - 40px)`, p = /* @__PURE__ */ r(Ee, { children: [
|
|
1663
1677
|
/* @__PURE__ */ e(
|
|
1664
|
-
|
|
1678
|
+
L,
|
|
1665
1679
|
{
|
|
1666
1680
|
dataField: "user.avatar",
|
|
1667
1681
|
dataType: "image",
|
|
1668
1682
|
size: 80,
|
|
1669
1683
|
header: "Foto",
|
|
1670
|
-
render: (
|
|
1684
|
+
render: (I) => /* @__PURE__ */ e(
|
|
1671
1685
|
"img",
|
|
1672
1686
|
{
|
|
1673
1687
|
style: { borderRadius: 50, height: "32px", maxHeight: "32px" },
|
|
1674
|
-
src:
|
|
1688
|
+
src: I.row.user && I.row.user.avatar ? atob(I.row.user.avatar) : sa
|
|
1675
1689
|
}
|
|
1676
1690
|
),
|
|
1677
1691
|
inputFilterType: "text",
|
|
@@ -1679,7 +1693,7 @@ function gt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1679
1693
|
}
|
|
1680
1694
|
),
|
|
1681
1695
|
/* @__PURE__ */ e(
|
|
1682
|
-
|
|
1696
|
+
L,
|
|
1683
1697
|
{
|
|
1684
1698
|
dataField: "user.userName",
|
|
1685
1699
|
dataType: "text",
|
|
@@ -1689,7 +1703,7 @@ function gt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1689
1703
|
}
|
|
1690
1704
|
),
|
|
1691
1705
|
/* @__PURE__ */ e(
|
|
1692
|
-
|
|
1706
|
+
L,
|
|
1693
1707
|
{
|
|
1694
1708
|
dataField: "user.email",
|
|
1695
1709
|
dataType: "text",
|
|
@@ -1699,7 +1713,7 @@ function gt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1699
1713
|
}
|
|
1700
1714
|
),
|
|
1701
1715
|
/* @__PURE__ */ e(
|
|
1702
|
-
|
|
1716
|
+
L,
|
|
1703
1717
|
{
|
|
1704
1718
|
dataField: "name",
|
|
1705
1719
|
dataType: "text",
|
|
@@ -1709,7 +1723,7 @@ function gt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1709
1723
|
}
|
|
1710
1724
|
),
|
|
1711
1725
|
/* @__PURE__ */ e(
|
|
1712
|
-
|
|
1726
|
+
L,
|
|
1713
1727
|
{
|
|
1714
1728
|
dataField: "description",
|
|
1715
1729
|
dataType: "text",
|
|
@@ -1719,7 +1733,7 @@ function gt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1719
1733
|
}
|
|
1720
1734
|
),
|
|
1721
1735
|
/* @__PURE__ */ e(
|
|
1722
|
-
|
|
1736
|
+
L,
|
|
1723
1737
|
{
|
|
1724
1738
|
dataField: "token",
|
|
1725
1739
|
dataType: "text",
|
|
@@ -1730,7 +1744,7 @@ function gt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1730
1744
|
}
|
|
1731
1745
|
),
|
|
1732
1746
|
/* @__PURE__ */ e(
|
|
1733
|
-
|
|
1747
|
+
L,
|
|
1734
1748
|
{
|
|
1735
1749
|
dataField: "tenantId",
|
|
1736
1750
|
dataType: "text",
|
|
@@ -1741,41 +1755,41 @@ function gt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1741
1755
|
}
|
|
1742
1756
|
),
|
|
1743
1757
|
/* @__PURE__ */ e(
|
|
1744
|
-
|
|
1758
|
+
L,
|
|
1745
1759
|
{
|
|
1746
1760
|
dataField: "expirationDate",
|
|
1747
1761
|
dataType: "text",
|
|
1748
1762
|
size: 240,
|
|
1749
1763
|
header: "Validade",
|
|
1750
|
-
render: (
|
|
1751
|
-
if (!
|
|
1752
|
-
return /* @__PURE__ */ e(
|
|
1753
|
-
const
|
|
1754
|
-
|
|
1755
|
-
const
|
|
1756
|
-
|
|
1757
|
-
const C =
|
|
1758
|
-
let
|
|
1759
|
-
|
|
1760
|
-
const q =
|
|
1761
|
-
return /* @__PURE__ */ e(
|
|
1764
|
+
render: (I) => {
|
|
1765
|
+
if (!I.row.expirationDate)
|
|
1766
|
+
return /* @__PURE__ */ e(c, { c: "dimmed", children: "Sem expiração" });
|
|
1767
|
+
const M = /* @__PURE__ */ new Date();
|
|
1768
|
+
M.setHours(0, 0, 0, 0);
|
|
1769
|
+
const F = new Date(I.row.expirationDate);
|
|
1770
|
+
F.setHours(0, 0, 0, 0);
|
|
1771
|
+
const C = F.getTime() - M.getTime(), k = Math.ceil(C / (1e3 * 60 * 60 * 24));
|
|
1772
|
+
let me = Math.max(0, Math.min(100, k / 365 * 100)), E = "green", P = "";
|
|
1773
|
+
k < 0 ? (E = "red", me = 100, P = `Vencido há ${Math.abs(k)} dia${Math.abs(k) !== 1 ? "s" : ""}`) : k === 0 ? (E = "red", me = 5, P = "Vence hoje") : k <= 7 ? (E = "red", P = `${k} dia${k !== 1 ? "s" : ""}`) : k <= 30 ? (E = "orange", P = `${k} dias`) : k <= 90 ? (E = "yellow", P = `${k} dias`) : (E = "green", P = `${k} dias`);
|
|
1774
|
+
const q = k < 0 ? `Vencido em ${F.toLocaleDateString()}` : `Expira em ${F.toLocaleDateString()}`;
|
|
1775
|
+
return /* @__PURE__ */ e(Ie, { label: q, withArrow: !0, children: /* @__PURE__ */ r(O, { gap: "xs", wrap: "nowrap", children: [
|
|
1762
1776
|
/* @__PURE__ */ e(
|
|
1763
|
-
|
|
1777
|
+
Xa,
|
|
1764
1778
|
{
|
|
1765
1779
|
size: 36,
|
|
1766
1780
|
thickness: 4,
|
|
1767
1781
|
roundCaps: !0,
|
|
1768
|
-
sections: [{ value:
|
|
1782
|
+
sections: [{ value: k < 0 ? 100 : me, color: E }]
|
|
1769
1783
|
}
|
|
1770
1784
|
),
|
|
1771
|
-
/* @__PURE__ */ e(
|
|
1785
|
+
/* @__PURE__ */ e(c, { size: "sm", c: k < 0 ? "red" : void 0, fw: k <= 7 ? 600 : void 0, children: P })
|
|
1772
1786
|
] }) });
|
|
1773
1787
|
},
|
|
1774
1788
|
inputFilterType: "text"
|
|
1775
1789
|
}
|
|
1776
1790
|
),
|
|
1777
1791
|
/* @__PURE__ */ e(
|
|
1778
|
-
|
|
1792
|
+
L,
|
|
1779
1793
|
{
|
|
1780
1794
|
dataField: "activated",
|
|
1781
1795
|
dataType: "boolean",
|
|
@@ -1784,7 +1798,7 @@ function gt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1784
1798
|
}
|
|
1785
1799
|
),
|
|
1786
1800
|
/* @__PURE__ */ e(
|
|
1787
|
-
|
|
1801
|
+
L,
|
|
1788
1802
|
{
|
|
1789
1803
|
dataField: "revoked",
|
|
1790
1804
|
dataType: "boolean",
|
|
@@ -1792,59 +1806,59 @@ function gt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1792
1806
|
inputFilterType: "checkbox"
|
|
1793
1807
|
}
|
|
1794
1808
|
)
|
|
1795
|
-
] }),
|
|
1796
|
-
|
|
1797
|
-
},
|
|
1798
|
-
|
|
1799
|
-
`${
|
|
1800
|
-
`${
|
|
1809
|
+
] }), v = () => {
|
|
1810
|
+
x.insert(yr.newInstance()), x && !D.isDataSourceV2 && D.v1State.forceUpdate(), g("apiToken");
|
|
1811
|
+
}, $ = () => {
|
|
1812
|
+
b.getCurrentRecord() && ve.showConfirmDialogYesNo(
|
|
1813
|
+
`${f().t("archbase:Confirme")}`,
|
|
1814
|
+
`${f().t("archbase:Deseja revogar o token de API do usuário ")}${b.getCurrentRecord().user.name} ?`,
|
|
1801
1815
|
async () => {
|
|
1802
|
-
await
|
|
1816
|
+
await A.revoke(b.getCurrentRecord().token).then(async () => {
|
|
1803
1817
|
ne.showSuccess(
|
|
1804
|
-
`${
|
|
1805
|
-
`${
|
|
1806
|
-
),
|
|
1807
|
-
}).catch((
|
|
1808
|
-
|
|
1809
|
-
`${
|
|
1810
|
-
|
|
1811
|
-
Ve(
|
|
1818
|
+
`${f().t("mentors:Informação")}`,
|
|
1819
|
+
`${f().t("mentors:Token de API revogado com sucesso!")}`
|
|
1820
|
+
), b.refreshData(), b && !o.isDataSourceV2 && o.v1State.forceUpdate();
|
|
1821
|
+
}).catch((I) => {
|
|
1822
|
+
ve.showErrorWithDetails(
|
|
1823
|
+
`${f().t("mentors:Atenção")}`,
|
|
1824
|
+
Te(I),
|
|
1825
|
+
Ve(I)
|
|
1812
1826
|
);
|
|
1813
1827
|
});
|
|
1814
1828
|
},
|
|
1815
1829
|
() => {
|
|
1816
1830
|
}
|
|
1817
1831
|
);
|
|
1818
|
-
},
|
|
1819
|
-
|
|
1820
|
-
}, i = async (
|
|
1821
|
-
const
|
|
1822
|
-
if (
|
|
1832
|
+
}, y = () => {
|
|
1833
|
+
g("");
|
|
1834
|
+
}, i = async (I, M) => {
|
|
1835
|
+
const F = x.getCurrentRecord();
|
|
1836
|
+
if (F)
|
|
1823
1837
|
try {
|
|
1824
|
-
if (
|
|
1825
|
-
|
|
1826
|
-
`${
|
|
1827
|
-
`${
|
|
1838
|
+
if (x.validate(), !F.user || !F.user.email) {
|
|
1839
|
+
ve.showErrorWithDetails(
|
|
1840
|
+
`${f().t("archbase:WARNING")}`,
|
|
1841
|
+
`${f().t("archbase:Selecione um usuário para o token de API")}`,
|
|
1828
1842
|
""
|
|
1829
1843
|
);
|
|
1830
1844
|
return;
|
|
1831
1845
|
}
|
|
1832
|
-
await
|
|
1833
|
-
|
|
1834
|
-
`${
|
|
1835
|
-
`${
|
|
1836
|
-
),
|
|
1846
|
+
await A.create(F.user.email, F.expirationDate, F.name, F.description).then(async (C) => {
|
|
1847
|
+
x.cancel(), x && !D.isDataSourceV2 && D.v1State.forceUpdate(), b.append(C), b && !o.isDataSourceV2 && o.v1State.forceUpdate(), ne.showSuccess(
|
|
1848
|
+
`${f().t("mentors:Informação")}`,
|
|
1849
|
+
`${f().t("mentors:Token de API gerado com sucesso!")}`
|
|
1850
|
+
), M && M(!0);
|
|
1837
1851
|
}).catch((C) => {
|
|
1838
|
-
|
|
1839
|
-
`${
|
|
1840
|
-
|
|
1852
|
+
ve.showErrorWithDetails(
|
|
1853
|
+
`${f().t("mentors:Atenção")}`,
|
|
1854
|
+
Te(C),
|
|
1841
1855
|
Ve(C)
|
|
1842
1856
|
);
|
|
1843
1857
|
});
|
|
1844
1858
|
} catch (C) {
|
|
1845
|
-
|
|
1846
|
-
`${
|
|
1847
|
-
|
|
1859
|
+
ve.showErrorWithDetails(
|
|
1860
|
+
`${f().t("mentors:Atenção")}`,
|
|
1861
|
+
Te(C),
|
|
1848
1862
|
Ve(C)
|
|
1849
1863
|
);
|
|
1850
1864
|
}
|
|
@@ -1855,7 +1869,7 @@ function gt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1855
1869
|
{
|
|
1856
1870
|
withBorder: !0,
|
|
1857
1871
|
style: {
|
|
1858
|
-
height:
|
|
1872
|
+
height: s,
|
|
1859
1873
|
display: "flex",
|
|
1860
1874
|
width: "100%",
|
|
1861
1875
|
flex: 1,
|
|
@@ -1863,14 +1877,14 @@ function gt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1863
1877
|
overflow: "auto"
|
|
1864
1878
|
},
|
|
1865
1879
|
children: /* @__PURE__ */ e(
|
|
1866
|
-
|
|
1880
|
+
ka,
|
|
1867
1881
|
{
|
|
1868
|
-
gridRef:
|
|
1882
|
+
gridRef: T,
|
|
1869
1883
|
printTitle: "Tokens de API",
|
|
1870
1884
|
width: "100%",
|
|
1871
1885
|
height: "100%",
|
|
1872
1886
|
withBorder: !1,
|
|
1873
|
-
dataSource:
|
|
1887
|
+
dataSource: b,
|
|
1874
1888
|
withColumnBorders: !0,
|
|
1875
1889
|
striped: !0,
|
|
1876
1890
|
enableTopToolbar: !0,
|
|
@@ -1880,29 +1894,29 @@ function gt({ height: a = "400px", width: t = "100%" }) {
|
|
|
1880
1894
|
isError: !!d,
|
|
1881
1895
|
error: d,
|
|
1882
1896
|
enableGlobalFilter: !0,
|
|
1883
|
-
getRowId:
|
|
1897
|
+
getRowId: R,
|
|
1884
1898
|
toolbarLeftContent: /* @__PURE__ */ e(Fe, { justify: "space-between", style: { width: "50%" }, children: /* @__PURE__ */ r(O, { align: "start", gap: "2px", wrap: "nowrap", children: [
|
|
1885
|
-
/* @__PURE__ */ e(X, { color: "green", leftSection: /* @__PURE__ */ e(
|
|
1886
|
-
/* @__PURE__ */ e(X, { disabled: !
|
|
1899
|
+
/* @__PURE__ */ e(X, { color: "green", leftSection: /* @__PURE__ */ e(Na, {}), onClick: v, children: f().t("archbase:New") }),
|
|
1900
|
+
/* @__PURE__ */ e(X, { disabled: !b.getCurrentRecord(), color: "red", leftSection: /* @__PURE__ */ e(la, {}), onClick: $, children: f().t("archbase:Revoke") })
|
|
1887
1901
|
] }) }),
|
|
1888
1902
|
children: p
|
|
1889
1903
|
}
|
|
1890
1904
|
)
|
|
1891
1905
|
}
|
|
1892
1906
|
),
|
|
1893
|
-
|
|
1894
|
-
|
|
1907
|
+
z === "apiToken" ? /* @__PURE__ */ e(
|
|
1908
|
+
Dr,
|
|
1895
1909
|
{
|
|
1896
|
-
onClickOk:
|
|
1910
|
+
onClickOk: y,
|
|
1897
1911
|
opened: !0,
|
|
1898
|
-
dataSource:
|
|
1912
|
+
dataSource: x,
|
|
1899
1913
|
onCustomSave: i,
|
|
1900
|
-
onClickCancel:
|
|
1914
|
+
onClickCancel: y
|
|
1901
1915
|
}
|
|
1902
1916
|
) : null
|
|
1903
1917
|
] });
|
|
1904
1918
|
}
|
|
1905
|
-
const
|
|
1919
|
+
const Ge = (a) => {
|
|
1906
1920
|
switch (a) {
|
|
1907
1921
|
case "critical":
|
|
1908
1922
|
return "red";
|
|
@@ -1913,114 +1927,114 @@ const Ue = (a) => {
|
|
|
1913
1927
|
default:
|
|
1914
1928
|
return "gray";
|
|
1915
1929
|
}
|
|
1916
|
-
},
|
|
1917
|
-
const
|
|
1930
|
+
}, Ur = ({ card: a, onOpen: t }) => {
|
|
1931
|
+
const l = !!(t && a.metric);
|
|
1918
1932
|
return /* @__PURE__ */ e(
|
|
1919
1933
|
re,
|
|
1920
1934
|
{
|
|
1921
1935
|
withBorder: !0,
|
|
1922
1936
|
radius: "md",
|
|
1923
1937
|
p: "sm",
|
|
1924
|
-
role:
|
|
1925
|
-
tabIndex:
|
|
1926
|
-
"aria-label":
|
|
1927
|
-
onClick:
|
|
1928
|
-
onKeyDown:
|
|
1929
|
-
(
|
|
1938
|
+
role: l ? "button" : void 0,
|
|
1939
|
+
tabIndex: l ? 0 : void 0,
|
|
1940
|
+
"aria-label": l ? `Ver os itens de ${a.label}` : void 0,
|
|
1941
|
+
onClick: l ? () => t?.(a) : void 0,
|
|
1942
|
+
onKeyDown: l ? (n) => {
|
|
1943
|
+
(n.key === "Enter" || n.key === " ") && (n.preventDefault(), t?.(a));
|
|
1930
1944
|
} : void 0,
|
|
1931
1945
|
style: {
|
|
1932
|
-
borderLeft: `3px solid var(--mantine-color-${
|
|
1933
|
-
cursor:
|
|
1946
|
+
borderLeft: `3px solid var(--mantine-color-${Ge(a.severity)}-6)`,
|
|
1947
|
+
cursor: l ? "pointer" : void 0
|
|
1934
1948
|
},
|
|
1935
|
-
children: /* @__PURE__ */ r(
|
|
1949
|
+
children: /* @__PURE__ */ r(U, { gap: 4, children: [
|
|
1936
1950
|
/* @__PURE__ */ r(O, { gap: 8, align: "baseline", wrap: "wrap", children: [
|
|
1937
|
-
/* @__PURE__ */ e(
|
|
1938
|
-
a.of ? /* @__PURE__ */ e(
|
|
1951
|
+
/* @__PURE__ */ e(c, { fw: 600, size: "1.7rem", lh: 1.05, c: Ge(a.severity), children: a.value }),
|
|
1952
|
+
a.of ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: a.of }) : null
|
|
1939
1953
|
] }),
|
|
1940
|
-
/* @__PURE__ */ e(
|
|
1941
|
-
a.description ? /* @__PURE__ */ e(
|
|
1954
|
+
/* @__PURE__ */ e(c, { size: "sm", fw: 550, children: a.label }),
|
|
1955
|
+
a.description ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", lh: 1.45, children: a.description }) : null
|
|
1942
1956
|
] })
|
|
1943
1957
|
}
|
|
1944
1958
|
);
|
|
1945
|
-
},
|
|
1946
|
-
/* @__PURE__ */ e(
|
|
1959
|
+
}, Gr = ({ cards: a, onOpenCard: t }) => /* @__PURE__ */ e(We, { cols: { base: 1, sm: 2, lg: 3, xl: 4 }, spacing: "xs", children: a.map((l, n) => /* @__PURE__ */ e(Ur, { card: l, onOpen: t }, `${l.label}-${n}`)) }), Br = ({ flags: a }) => /* @__PURE__ */ e(We, { cols: { base: 1, sm: 2, lg: 4 }, spacing: "xs", children: a.map((t) => /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "sm", children: /* @__PURE__ */ r(U, { gap: 3, children: [
|
|
1960
|
+
/* @__PURE__ */ e(c, { size: "10px", c: "dimmed", ff: "monospace", style: { wordBreak: "break-all" }, children: t.key }),
|
|
1947
1961
|
/* @__PURE__ */ r(O, { gap: 7, wrap: "nowrap", children: [
|
|
1948
|
-
/* @__PURE__ */ e(
|
|
1949
|
-
/* @__PURE__ */ e(
|
|
1962
|
+
/* @__PURE__ */ e(j, { size: "xs", circle: !0, color: Ge(t.severity) }),
|
|
1963
|
+
/* @__PURE__ */ e(c, { size: "sm", fw: 550, children: t.value })
|
|
1950
1964
|
] }),
|
|
1951
|
-
t.description ? /* @__PURE__ */ e(
|
|
1952
|
-
] }) }, t.key)) }),
|
|
1953
|
-
/* @__PURE__ */ e(
|
|
1954
|
-
/* @__PURE__ */ e(
|
|
1955
|
-
] }, `${t.label}-${
|
|
1965
|
+
t.description ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", lh: 1.4, children: t.description }) : null
|
|
1966
|
+
] }) }, t.key)) }), Hr = ({ attributes: a }) => /* @__PURE__ */ e(U, { gap: 7, children: a.map((t, l) => /* @__PURE__ */ r(O, { gap: 12, wrap: "nowrap", justify: "space-between", children: [
|
|
1967
|
+
/* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: t.label }),
|
|
1968
|
+
/* @__PURE__ */ e(c, { size: "sm", fw: 600, ta: "right", children: t.value })
|
|
1969
|
+
] }, `${t.label}-${l}`)) }), pe = ({ title: a, hint: t, children: l }) => /* @__PURE__ */ r(U, { gap: "xs", children: [
|
|
1956
1970
|
/* @__PURE__ */ r(O, { gap: 10, align: "baseline", wrap: "wrap", children: [
|
|
1957
|
-
/* @__PURE__ */ e(
|
|
1958
|
-
t ? /* @__PURE__ */ e(
|
|
1971
|
+
/* @__PURE__ */ e(c, { size: "xs", fw: 650, tt: "uppercase", style: { letterSpacing: ".05em" }, children: a }),
|
|
1972
|
+
t ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: t }) : null
|
|
1959
1973
|
] }),
|
|
1960
|
-
|
|
1961
|
-
] }),
|
|
1962
|
-
const
|
|
1974
|
+
l
|
|
1975
|
+
] }), ke = ({ children: a, maxHeight: t = 420 }) => /* @__PURE__ */ e(ue.Autosize, { mah: t, type: "hover", offsetScrollbars: !0, children: /* @__PURE__ */ e(m.ScrollContainer, { minWidth: 480, type: "native", children: a }) }), qr = 25, Wr = ({ card: a, onClose: t }) => {
|
|
1976
|
+
const l = J(
|
|
1963
1977
|
K.SecurityDiagnostics
|
|
1964
|
-
), [
|
|
1978
|
+
), [n, u] = S([]), [d, h] = S(1), [A, z] = S(1), [g, T] = S(0), [R, x] = S(!1), [D, b] = S(null), w = a?.metric;
|
|
1965
1979
|
return ee(() => {
|
|
1966
|
-
|
|
1980
|
+
h(1);
|
|
1967
1981
|
}, [w]), ee(() => {
|
|
1968
1982
|
if (!w)
|
|
1969
1983
|
return;
|
|
1970
1984
|
let o = !1;
|
|
1971
|
-
return
|
|
1972
|
-
o || (
|
|
1973
|
-
}).catch((
|
|
1974
|
-
o ||
|
|
1985
|
+
return x(!0), b(null), l.getOverviewItems(w, d - 1, qr).then((s) => {
|
|
1986
|
+
o || (u(s.content ?? []), T(s.totalElements ?? 0), z(Math.max(s.totalPages ?? 1, 1)));
|
|
1987
|
+
}).catch((s) => {
|
|
1988
|
+
o || b(s instanceof Error ? s.message : "Não foi possível carregar os itens.");
|
|
1975
1989
|
}).finally(() => {
|
|
1976
|
-
o ||
|
|
1990
|
+
o || x(!1);
|
|
1977
1991
|
}), () => {
|
|
1978
1992
|
o = !0;
|
|
1979
1993
|
};
|
|
1980
|
-
}, [
|
|
1981
|
-
|
|
1994
|
+
}, [l, w, d]), /* @__PURE__ */ e(
|
|
1995
|
+
_a,
|
|
1982
1996
|
{
|
|
1983
1997
|
opened: !!a,
|
|
1984
1998
|
onClose: t,
|
|
1985
1999
|
position: "right",
|
|
1986
2000
|
size: "xl",
|
|
1987
|
-
title: /* @__PURE__ */ r(
|
|
1988
|
-
/* @__PURE__ */ e(
|
|
1989
|
-
a?.description ? /* @__PURE__ */ e(
|
|
2001
|
+
title: /* @__PURE__ */ r(U, { gap: 2, children: [
|
|
2002
|
+
/* @__PURE__ */ e(c, { fw: 600, children: a?.label }),
|
|
2003
|
+
a?.description ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", lh: 1.4, children: a.description }) : null
|
|
1990
2004
|
] }),
|
|
1991
|
-
children: /* @__PURE__ */ r(
|
|
2005
|
+
children: /* @__PURE__ */ r(U, { gap: "sm", children: [
|
|
1992
2006
|
/* @__PURE__ */ r(O, { gap: 8, children: [
|
|
1993
|
-
/* @__PURE__ */ r(
|
|
1994
|
-
|
|
2007
|
+
/* @__PURE__ */ r(j, { variant: "light", children: [
|
|
2008
|
+
g,
|
|
1995
2009
|
" ",
|
|
1996
|
-
|
|
2010
|
+
g === 1 ? "item" : "itens"
|
|
1997
2011
|
] }),
|
|
1998
|
-
|
|
2012
|
+
R ? /* @__PURE__ */ e(se, { size: "xs" }) : null
|
|
1999
2013
|
] }),
|
|
2000
|
-
|
|
2001
|
-
!
|
|
2002
|
-
|
|
2014
|
+
D ? /* @__PURE__ */ e(ce, { color: "red", title: "Erro ao carregar", children: D }) : null,
|
|
2015
|
+
!R && !D && n.length === 0 ? /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: "Nada aqui — o número é zero." }) : null,
|
|
2016
|
+
n.length > 0 ? (
|
|
2003
2017
|
// O scroll fica NA TABELA, não no drawer: rolando o drawer, o cabeçalho some e
|
|
2004
2018
|
// uma coluna de valores sem cabeçalho deixa de dizer o que é. Aqui o cabeçalho
|
|
2005
2019
|
// gruda e o título, a contagem e a paginação ficam onde estavam.
|
|
2006
|
-
/* @__PURE__ */ e(
|
|
2007
|
-
/* @__PURE__ */ e(
|
|
2008
|
-
/* @__PURE__ */ e(
|
|
2009
|
-
/* @__PURE__ */ e(
|
|
2010
|
-
/* @__PURE__ */ e(
|
|
2020
|
+
/* @__PURE__ */ e(ke, { maxHeight: "calc(100vh - 260px)", children: /* @__PURE__ */ r(m, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
|
|
2021
|
+
/* @__PURE__ */ e(m.Thead, { children: /* @__PURE__ */ r(m.Tr, { children: [
|
|
2022
|
+
/* @__PURE__ */ e(m.Th, { children: "Item" }),
|
|
2023
|
+
/* @__PURE__ */ e(m.Th, { children: "Onde" }),
|
|
2024
|
+
/* @__PURE__ */ e(m.Th, { children: "Por que está aqui" })
|
|
2011
2025
|
] }) }),
|
|
2012
|
-
/* @__PURE__ */ e(
|
|
2013
|
-
/* @__PURE__ */ e(
|
|
2014
|
-
/* @__PURE__ */ e(
|
|
2015
|
-
/* @__PURE__ */ e(
|
|
2026
|
+
/* @__PURE__ */ e(m.Tbody, { children: n.map((o) => /* @__PURE__ */ r(m.Tr, { children: [
|
|
2027
|
+
/* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(c, { size: "sm", fw: 550, children: o.label }) }),
|
|
2028
|
+
/* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: o.detail }) }),
|
|
2029
|
+
/* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(c, { size: "xs", children: o.reason }) })
|
|
2016
2030
|
] }, o.id)) })
|
|
2017
2031
|
] }) })
|
|
2018
2032
|
) : null,
|
|
2019
|
-
|
|
2033
|
+
A > 1 ? /* @__PURE__ */ e(O, { justify: "center", children: /* @__PURE__ */ e(Ia, { value: d, onChange: h, total: A, size: "sm" }) }) : null
|
|
2020
2034
|
] })
|
|
2021
2035
|
}
|
|
2022
2036
|
);
|
|
2023
|
-
},
|
|
2037
|
+
}, jr = (a, t) => t > 0 ? ` · ${Math.round(a / t * 100)}%` : "", Zr = (a) => {
|
|
2024
2038
|
const t = a.flags;
|
|
2025
2039
|
return [
|
|
2026
2040
|
{
|
|
@@ -2052,12 +2066,12 @@ const Ue = (a) => {
|
|
|
2052
2066
|
description: t.scanConfigured ? "O catálogo se alimenta do código." : "O catálogo não se alimenta do código."
|
|
2053
2067
|
}
|
|
2054
2068
|
];
|
|
2055
|
-
},
|
|
2069
|
+
}, Qr = (a) => [
|
|
2056
2070
|
{
|
|
2057
2071
|
severity: "critical",
|
|
2058
2072
|
value: a.permissionsPointingToInactive,
|
|
2059
2073
|
metric: "PERMISSIONS_POINTING_TO_INACTIVE",
|
|
2060
|
-
of: `de ${a.permissions}${
|
|
2074
|
+
of: `de ${a.permissions}${jr(a.permissionsPointingToInactive, a.permissions)}`,
|
|
2061
2075
|
label: "Permissões inertes",
|
|
2062
2076
|
description: "Apontam para ação ou recurso inativo. É o acesso que o operador acredita ter concedido."
|
|
2063
2077
|
},
|
|
@@ -2101,575 +2115,575 @@ const Ue = (a) => {
|
|
|
2101
2115
|
label: "Ninguém tem",
|
|
2102
2116
|
description: "Capacidade existe no catálogo e não foi concedida a ninguém."
|
|
2103
2117
|
}
|
|
2104
|
-
],
|
|
2105
|
-
const
|
|
2118
|
+
], va = ({ slots: a, onError: t }) => {
|
|
2119
|
+
const l = J(
|
|
2106
2120
|
K.SecurityDiagnostics
|
|
2107
|
-
), [
|
|
2121
|
+
), [n, u] = S(void 0), [d, h] = S(!0), [A, z] = S(void 0), [g, T] = S(null);
|
|
2108
2122
|
ee(() => {
|
|
2109
|
-
let
|
|
2110
|
-
return
|
|
2111
|
-
|
|
2112
|
-
}).catch((
|
|
2113
|
-
if (
|
|
2114
|
-
const w =
|
|
2115
|
-
|
|
2123
|
+
let D = !0;
|
|
2124
|
+
return h(!0), l.getOverview().then((b) => {
|
|
2125
|
+
D && (u(b), z(void 0));
|
|
2126
|
+
}).catch((b) => {
|
|
2127
|
+
if (D) {
|
|
2128
|
+
const w = Te(b);
|
|
2129
|
+
z(w), t?.(w);
|
|
2116
2130
|
}
|
|
2117
2131
|
}).finally(() => {
|
|
2118
|
-
|
|
2132
|
+
D && h(!1);
|
|
2119
2133
|
}), () => {
|
|
2120
|
-
|
|
2134
|
+
D = !1;
|
|
2121
2135
|
};
|
|
2122
|
-
}, [
|
|
2123
|
-
const
|
|
2124
|
-
() =>
|
|
2125
|
-
[
|
|
2126
|
-
),
|
|
2127
|
-
() =>
|
|
2128
|
-
[
|
|
2136
|
+
}, [l]);
|
|
2137
|
+
const R = ie(
|
|
2138
|
+
() => n ? [...Zr(n), ...a?.additionalFlags?.(n) ?? []] : [],
|
|
2139
|
+
[n, a]
|
|
2140
|
+
), x = ie(
|
|
2141
|
+
() => n ? [...Qr(n), ...a?.additionalOverviewCards?.(n) ?? []] : [],
|
|
2142
|
+
[n, a]
|
|
2129
2143
|
);
|
|
2130
|
-
return d ? /* @__PURE__ */ e(
|
|
2131
|
-
/* @__PURE__ */ r(
|
|
2132
|
-
/* @__PURE__ */ e(
|
|
2133
|
-
/* @__PURE__ */ e(
|
|
2144
|
+
return d ? /* @__PURE__ */ e(se, { size: "sm" }) : A ? /* @__PURE__ */ e(ce, { color: "red", title: "Não foi possível ler o diagnóstico", children: A }) : n ? /* @__PURE__ */ r(U, { gap: "lg", children: [
|
|
2145
|
+
/* @__PURE__ */ r(pe, { title: "Proteções", hint: "de AccessOverview.flags", children: [
|
|
2146
|
+
/* @__PURE__ */ e(Br, { flags: R }),
|
|
2147
|
+
/* @__PURE__ */ e(c, { size: "xs", c: "dimmed", lh: 1.45, children: "Todas nascem com o padrão compatível — ligadas só quando alguém decide." })
|
|
2134
2148
|
] }),
|
|
2135
|
-
/* @__PURE__ */ e(
|
|
2136
|
-
a?.afterOverview?.(
|
|
2137
|
-
/* @__PURE__ */ e(Wr, { card:
|
|
2149
|
+
/* @__PURE__ */ e(pe, { title: "Catálogo e concessões", hint: "contagens vivas", children: /* @__PURE__ */ e(Gr, { cards: x, onOpenCard: T }) }),
|
|
2150
|
+
a?.afterOverview?.(n),
|
|
2151
|
+
/* @__PURE__ */ e(Wr, { card: g, onClose: () => T(null) })
|
|
2138
2152
|
] }) : null;
|
|
2139
|
-
}, Be = ({ value: a, onChange: t, assunto:
|
|
2140
|
-
const d = typeof
|
|
2153
|
+
}, Be = ({ value: a, onChange: t, assunto: l, visiveis: n, total: u }) => {
|
|
2154
|
+
const d = typeof n == "number" && typeof u == "number" && n < u;
|
|
2141
2155
|
return /* @__PURE__ */ e(
|
|
2142
|
-
|
|
2156
|
+
he,
|
|
2143
2157
|
{
|
|
2144
2158
|
size: "xs",
|
|
2145
2159
|
value: a,
|
|
2146
|
-
onChange: (
|
|
2147
|
-
placeholder:
|
|
2148
|
-
"aria-label":
|
|
2149
|
-
description: d ? `${
|
|
2160
|
+
onChange: (h) => t(h.currentTarget.value),
|
|
2161
|
+
placeholder: l ? `Filtrar ${l}…` : "Filtrar…",
|
|
2162
|
+
"aria-label": l ? `Filtrar ${l}` : "Filtrar",
|
|
2163
|
+
description: d ? `${n} de ${u}` : void 0,
|
|
2150
2164
|
rightSection: a ? /* @__PURE__ */ e(Ya, { size: "sm", onClick: () => t(""), "aria-label": "Limpar filtro" }) : null
|
|
2151
2165
|
}
|
|
2152
2166
|
);
|
|
2153
|
-
},
|
|
2154
|
-
const [
|
|
2155
|
-
const d =
|
|
2167
|
+
}, Kr = /[̀-ͯ]/g, ya = (a) => a.toLocaleLowerCase().normalize("NFD").replace(Kr, ""), He = (a, t) => {
|
|
2168
|
+
const [l, n] = S(""), u = ie(() => {
|
|
2169
|
+
const d = ya(l.trim());
|
|
2156
2170
|
return d ? a.filter(
|
|
2157
|
-
(
|
|
2171
|
+
(h) => t(h).some((A) => A ? ya(A).includes(d) : !1)
|
|
2158
2172
|
) : a;
|
|
2159
|
-
}, [a,
|
|
2160
|
-
return { filtro:
|
|
2161
|
-
},
|
|
2173
|
+
}, [a, l]);
|
|
2174
|
+
return { filtro: l, setFiltro: n, filtrados: u };
|
|
2175
|
+
}, Ta = {
|
|
2162
2176
|
EFFECTIVE: { label: "Efetiva", color: "green" },
|
|
2163
2177
|
INERT: { label: "Inerte", color: "orange" },
|
|
2164
2178
|
DENIED: { label: "Negada", color: "red" }
|
|
2165
|
-
},
|
|
2179
|
+
}, Jr = { GROUP: "grupo", PROFILE: "perfil", USER: "direto" }, Xr = [
|
|
2166
2180
|
{ value: "all", label: "Todas" },
|
|
2167
2181
|
{ value: "EFFECTIVE", label: "Só efetivas" },
|
|
2168
2182
|
{ value: "INERT", label: "Só inertes" },
|
|
2169
2183
|
{ value: "DENIED", label: "Negadas" },
|
|
2170
2184
|
{ value: "inherited", label: "Só herdadas" }
|
|
2171
|
-
],
|
|
2172
|
-
const
|
|
2185
|
+
], _r = ({ slots: a, onError: t, userId: l }) => {
|
|
2186
|
+
const n = J(
|
|
2173
2187
|
K.SecurityDiagnostics
|
|
2174
|
-
), [
|
|
2188
|
+
), [u, d] = S(""), [h, A] = S(void 0), [z, g] = S(!1), [T, R] = S(void 0), [x, D] = S("all"), b = !!l, w = ae(
|
|
2175
2189
|
async (i) => {
|
|
2176
2190
|
const N = i.trim();
|
|
2177
2191
|
if (N) {
|
|
2178
|
-
|
|
2192
|
+
g(!0), R(void 0);
|
|
2179
2193
|
try {
|
|
2180
|
-
const
|
|
2181
|
-
|
|
2182
|
-
} catch (
|
|
2183
|
-
const
|
|
2184
|
-
|
|
2194
|
+
const I = N.includes("@") ? await n.getEffectiveAccessByEmail(N) : await n.getEffectiveAccessByUserId(N);
|
|
2195
|
+
A(I);
|
|
2196
|
+
} catch (I) {
|
|
2197
|
+
const M = Te(I);
|
|
2198
|
+
R(M), t?.(M), A(void 0);
|
|
2185
2199
|
} finally {
|
|
2186
|
-
|
|
2200
|
+
g(!1);
|
|
2187
2201
|
}
|
|
2188
2202
|
}
|
|
2189
2203
|
},
|
|
2190
|
-
[
|
|
2191
|
-
), o = ie(() =>
|
|
2192
|
-
{ label: "Perfil", value:
|
|
2193
|
-
{ label: "Grupos", value:
|
|
2194
|
-
...a?.userAttributes?.(
|
|
2195
|
-
] : [], [
|
|
2204
|
+
[n, t]
|
|
2205
|
+
), o = ie(() => h ? [
|
|
2206
|
+
{ label: "Perfil", value: h.profileName || "—" },
|
|
2207
|
+
{ label: "Grupos", value: h.groupNames.length ? h.groupNames.join(", ") : "—" },
|
|
2208
|
+
...a?.userAttributes?.(h) ?? []
|
|
2209
|
+
] : [], [h, a]), s = ie(() => h ? x === "all" ? h.capabilities : x === "inherited" ? h.capabilities.filter((i) => i.grantedByType !== "USER") : h.capabilities.filter((i) => i.situation === x) : [], [h, x]), {
|
|
2196
2210
|
filtro: p,
|
|
2197
|
-
setFiltro:
|
|
2198
|
-
filtrados:
|
|
2199
|
-
} =
|
|
2211
|
+
setFiltro: v,
|
|
2212
|
+
filtrados: $
|
|
2213
|
+
} = He(s, (i) => [i.resource, i.action, i.grantedByName]);
|
|
2200
2214
|
ee(() => {
|
|
2201
|
-
|
|
2202
|
-
}, [
|
|
2203
|
-
const
|
|
2204
|
-
return /* @__PURE__ */ r(
|
|
2205
|
-
|
|
2215
|
+
l && (D("all"), w(l));
|
|
2216
|
+
}, [l, w]);
|
|
2217
|
+
const y = a?.additionalCapabilityColumns ?? [];
|
|
2218
|
+
return /* @__PURE__ */ r(U, { gap: "lg", children: [
|
|
2219
|
+
b ? null : /* @__PURE__ */ e(pe, { title: "Consultar", hint: "por e-mail ou id do usuário", children: a?.renderUserSearch ? a.renderUserSearch((i) => {
|
|
2206
2220
|
d(i), w(i);
|
|
2207
2221
|
}) : /* @__PURE__ */ r(O, { gap: "xs", align: "flex-end", children: [
|
|
2208
2222
|
/* @__PURE__ */ e(
|
|
2209
|
-
|
|
2223
|
+
he,
|
|
2210
2224
|
{
|
|
2211
2225
|
style: { flex: 1, minWidth: 240 },
|
|
2212
2226
|
label: "Usuário",
|
|
2213
2227
|
placeholder: "pessoa@empresa.com.br",
|
|
2214
|
-
value:
|
|
2228
|
+
value: u,
|
|
2215
2229
|
onChange: (i) => d(i.currentTarget.value),
|
|
2216
2230
|
onKeyDown: (i) => {
|
|
2217
|
-
i.key === "Enter" && w(
|
|
2231
|
+
i.key === "Enter" && w(u);
|
|
2218
2232
|
}
|
|
2219
2233
|
}
|
|
2220
2234
|
),
|
|
2221
|
-
/* @__PURE__ */ e(X, { onClick: () => void w(
|
|
2235
|
+
/* @__PURE__ */ e(X, { onClick: () => void w(u), loading: z, children: "Consultar" })
|
|
2222
2236
|
] }) }),
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
/* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ r(
|
|
2237
|
+
T ? /* @__PURE__ */ e(ce, { color: "red", title: "Não foi possível ler o efetivo", children: T }) : null,
|
|
2238
|
+
z && !h ? /* @__PURE__ */ e(se, { size: "sm" }) : null,
|
|
2239
|
+
h ? /* @__PURE__ */ r(xe, { children: [
|
|
2240
|
+
/* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ r(U, { gap: "sm", children: [
|
|
2227
2241
|
/* @__PURE__ */ r(O, { gap: 8, wrap: "wrap", align: "center", children: [
|
|
2228
|
-
/* @__PURE__ */ e(
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
a?.afterUserBadges?.(
|
|
2242
|
+
/* @__PURE__ */ e(c, { fw: 620, children: h.userLabel }),
|
|
2243
|
+
h.administrator ? /* @__PURE__ */ e(j, { color: "red", children: "administrador" }) : null,
|
|
2244
|
+
h.enabled ? null : /* @__PURE__ */ e(j, { color: "red", children: "conta desativada" }),
|
|
2245
|
+
a?.afterUserBadges?.(h)
|
|
2232
2246
|
] }),
|
|
2233
|
-
/* @__PURE__ */ e(
|
|
2247
|
+
/* @__PURE__ */ e(Hr, { attributes: o })
|
|
2234
2248
|
] }) }),
|
|
2235
|
-
|
|
2249
|
+
h.administrator ? /* @__PURE__ */ r(ce, { color: "orange", title: "Administrador passa direto", children: [
|
|
2236
2250
|
"O portão GRANT concede sem consultar o catálogo. A lista abaixo vir vazia não é falta de dado — é o atalho que a flag ",
|
|
2237
2251
|
/* @__PURE__ */ e("code", { children: "isAdministrator" }),
|
|
2238
2252
|
" representa."
|
|
2239
2253
|
] }) : null,
|
|
2240
|
-
/* @__PURE__ */ e(
|
|
2241
|
-
["concedidas",
|
|
2242
|
-
["efetivas",
|
|
2243
|
-
["inertes",
|
|
2244
|
-
["negadas",
|
|
2245
|
-
].map(([i, N,
|
|
2246
|
-
/* @__PURE__ */ e(
|
|
2247
|
-
/* @__PURE__ */ e(
|
|
2254
|
+
/* @__PURE__ */ e(We, { cols: { base: 2, sm: 4 }, spacing: "xs", children: [
|
|
2255
|
+
["concedidas", h.granted, "neutral"],
|
|
2256
|
+
["efetivas", h.effective, "ok"],
|
|
2257
|
+
["inertes", h.inert, "warning"],
|
|
2258
|
+
["negadas", h.denied, "critical"]
|
|
2259
|
+
].map(([i, N, I]) => /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "sm", children: /* @__PURE__ */ r(U, { gap: 2, children: [
|
|
2260
|
+
/* @__PURE__ */ e(c, { size: "1.3rem", fw: 620, c: Ge(I), children: N }),
|
|
2261
|
+
/* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: i })
|
|
2248
2262
|
] }) }, i)) }),
|
|
2249
|
-
a?.afterEffectiveTally?.(
|
|
2250
|
-
/* @__PURE__ */ r(
|
|
2251
|
-
/* @__PURE__ */ e(
|
|
2263
|
+
a?.afterEffectiveTally?.(h),
|
|
2264
|
+
/* @__PURE__ */ r(pe, { title: "Capacidades", hint: `${h.capabilities.length} no total`, children: [
|
|
2265
|
+
/* @__PURE__ */ e(ha.Group, { multiple: !1, value: x, onChange: (i) => D(i), children: /* @__PURE__ */ e(O, { gap: 6, children: Xr.map((i) => /* @__PURE__ */ e(ha, { value: i.value, size: "xs", variant: "outline", children: i.label }, i.value)) }) }),
|
|
2252
2266
|
/* @__PURE__ */ e(
|
|
2253
2267
|
Be,
|
|
2254
2268
|
{
|
|
2255
2269
|
value: p,
|
|
2256
|
-
onChange:
|
|
2270
|
+
onChange: v,
|
|
2257
2271
|
assunto: "capacidades",
|
|
2258
|
-
visiveis:
|
|
2259
|
-
total:
|
|
2272
|
+
visiveis: $.length,
|
|
2273
|
+
total: s.length
|
|
2260
2274
|
}
|
|
2261
2275
|
),
|
|
2262
|
-
/* @__PURE__ */ e(
|
|
2263
|
-
/* @__PURE__ */ e(
|
|
2264
|
-
/* @__PURE__ */ e(
|
|
2265
|
-
/* @__PURE__ */ e(
|
|
2266
|
-
/* @__PURE__ */ e(
|
|
2267
|
-
|
|
2276
|
+
/* @__PURE__ */ e(ke, { maxHeight: "calc(100vh - 460px)", children: /* @__PURE__ */ r(m, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
|
|
2277
|
+
/* @__PURE__ */ e(m.Thead, { children: /* @__PURE__ */ r(m.Tr, { children: [
|
|
2278
|
+
/* @__PURE__ */ e(m.Th, { children: "Capacidade" }),
|
|
2279
|
+
/* @__PURE__ */ e(m.Th, { children: "Origem" }),
|
|
2280
|
+
/* @__PURE__ */ e(m.Th, { children: "Situação" }),
|
|
2281
|
+
y.map((i) => /* @__PURE__ */ e(m.Th, { children: i.header }, i.header))
|
|
2268
2282
|
] }) }),
|
|
2269
|
-
/* @__PURE__ */ r(
|
|
2270
|
-
|
|
2271
|
-
/* @__PURE__ */ e(
|
|
2283
|
+
/* @__PURE__ */ r(m.Tbody, { children: [
|
|
2284
|
+
$.map((i, N) => /* @__PURE__ */ r(m.Tr, { children: [
|
|
2285
|
+
/* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ r(c, { size: "sm", ff: "monospace", children: [
|
|
2272
2286
|
i.resource,
|
|
2273
2287
|
":",
|
|
2274
2288
|
i.action
|
|
2275
2289
|
] }) }),
|
|
2276
|
-
/* @__PURE__ */ e(
|
|
2277
|
-
/* @__PURE__ */ r(
|
|
2278
|
-
|
|
2290
|
+
/* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ r(c, { size: "sm", children: [
|
|
2291
|
+
/* @__PURE__ */ r(c, { span: !0, c: "dimmed", children: [
|
|
2292
|
+
Jr[i.grantedByType] ?? i.grantedByType,
|
|
2279
2293
|
" "
|
|
2280
2294
|
] }),
|
|
2281
2295
|
i.grantedByName
|
|
2282
2296
|
] }) }),
|
|
2283
|
-
/* @__PURE__ */ e(
|
|
2284
|
-
|
|
2297
|
+
/* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(j, { color: Ta[i.situation].color, variant: "light", children: Ta[i.situation].label }) }),
|
|
2298
|
+
y.map((I) => /* @__PURE__ */ e(m.Td, { children: I.render(i, h) }, I.header))
|
|
2285
2299
|
] }, `${i.resource}:${i.action}:${N}`)),
|
|
2286
|
-
|
|
2300
|
+
s.length === 0 ? /* @__PURE__ */ e(m.Tr, { children: /* @__PURE__ */ e(m.Td, { colSpan: 3 + y.length, children: /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", ta: "center", py: "md", children: "Nenhuma capacidade neste filtro." }) }) }) : null
|
|
2287
2301
|
] })
|
|
2288
2302
|
] }) })
|
|
2289
2303
|
] })
|
|
2290
2304
|
] }) : null
|
|
2291
2305
|
] });
|
|
2292
|
-
}, wa = 40,
|
|
2306
|
+
}, wa = 40, Sa = ({
|
|
2293
2307
|
label: a,
|
|
2294
2308
|
valor: t,
|
|
2295
|
-
placeholder:
|
|
2296
|
-
branch:
|
|
2297
|
-
somenteFolhas:
|
|
2309
|
+
placeholder: l,
|
|
2310
|
+
branch: n,
|
|
2311
|
+
somenteFolhas: u,
|
|
2298
2312
|
branchDosFilhos: d,
|
|
2299
|
-
onSelecionar:
|
|
2313
|
+
onSelecionar: h
|
|
2300
2314
|
}) => {
|
|
2301
|
-
const
|
|
2315
|
+
const A = J(
|
|
2302
2316
|
K.SecurityDiagnostics
|
|
2303
|
-
), [
|
|
2317
|
+
), [z, g] = S(!1), [T, R] = S(""), [x, D] = S([]), [b, w] = S({}), [o, s] = S(), [p, v] = S(!1), [$, y] = S(), i = ae(
|
|
2304
2318
|
async (C) => {
|
|
2305
|
-
|
|
2319
|
+
v(!0), y(void 0);
|
|
2306
2320
|
try {
|
|
2307
|
-
const
|
|
2308
|
-
|
|
2309
|
-
} catch (
|
|
2310
|
-
|
|
2321
|
+
const k = await A.browse(n, { q: C || void 0, page: 0, size: wa });
|
|
2322
|
+
D(k.content ?? []);
|
|
2323
|
+
} catch (k) {
|
|
2324
|
+
y(k instanceof Error ? k.message : "Não foi possível carregar.");
|
|
2311
2325
|
} finally {
|
|
2312
|
-
|
|
2326
|
+
v(!1);
|
|
2313
2327
|
}
|
|
2314
2328
|
},
|
|
2315
|
-
[
|
|
2329
|
+
[A, n]
|
|
2316
2330
|
);
|
|
2317
2331
|
ee(() => {
|
|
2318
|
-
if (!
|
|
2332
|
+
if (!z)
|
|
2319
2333
|
return;
|
|
2320
|
-
const C = setTimeout(() => void i(
|
|
2334
|
+
const C = setTimeout(() => void i(T), T ? 300 : 0);
|
|
2321
2335
|
return () => clearTimeout(C);
|
|
2322
|
-
}, [
|
|
2336
|
+
}, [z, T, i]);
|
|
2323
2337
|
const N = ae(
|
|
2324
2338
|
async (C) => {
|
|
2325
2339
|
if (o === C.id) {
|
|
2326
|
-
|
|
2340
|
+
s(void 0);
|
|
2327
2341
|
return;
|
|
2328
2342
|
}
|
|
2329
|
-
if (
|
|
2343
|
+
if (s(C.id), !b[C.id])
|
|
2330
2344
|
try {
|
|
2331
|
-
const
|
|
2345
|
+
const k = await A.browse(d ?? n, {
|
|
2332
2346
|
parentId: C.id,
|
|
2333
2347
|
page: 0,
|
|
2334
2348
|
size: wa
|
|
2335
2349
|
});
|
|
2336
|
-
w((oe) => ({ ...oe, [C.id]:
|
|
2337
|
-
} catch (
|
|
2338
|
-
|
|
2350
|
+
w((oe) => ({ ...oe, [C.id]: k.content ?? [] }));
|
|
2351
|
+
} catch (k) {
|
|
2352
|
+
y(k instanceof Error ? k.message : "Não foi possível abrir.");
|
|
2339
2353
|
}
|
|
2340
2354
|
},
|
|
2341
|
-
[
|
|
2342
|
-
),
|
|
2343
|
-
|
|
2344
|
-
},
|
|
2355
|
+
[A, n, d, o, b]
|
|
2356
|
+
), I = (C, k) => {
|
|
2357
|
+
h(C, k), g(!1);
|
|
2358
|
+
}, M = (C, k) => {
|
|
2345
2359
|
const oe = C.hasChildren;
|
|
2346
2360
|
return /* @__PURE__ */ e(
|
|
2347
2361
|
ze,
|
|
2348
2362
|
{
|
|
2349
|
-
onClick: () => oe &&
|
|
2363
|
+
onClick: () => oe && u ? void N(C) : I(C, k),
|
|
2350
2364
|
style: {
|
|
2351
2365
|
display: "block",
|
|
2352
2366
|
width: "100%",
|
|
2353
2367
|
padding: "5px 8px",
|
|
2354
|
-
paddingLeft:
|
|
2368
|
+
paddingLeft: k ? 24 : 8,
|
|
2355
2369
|
borderRadius: 4
|
|
2356
2370
|
},
|
|
2357
2371
|
children: /* @__PURE__ */ r(O, { gap: 6, wrap: "nowrap", children: [
|
|
2358
|
-
/* @__PURE__ */ e(
|
|
2359
|
-
C.badge ? /* @__PURE__ */ e(
|
|
2372
|
+
/* @__PURE__ */ e(c, { size: "sm", fw: !u || !oe ? 500 : 600, truncate: !0, children: C.label }),
|
|
2373
|
+
C.badge ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: C.badge }) : null
|
|
2360
2374
|
] })
|
|
2361
2375
|
},
|
|
2362
|
-
`${
|
|
2376
|
+
`${k?.id ?? "raiz"}:${C.id}`
|
|
2363
2377
|
);
|
|
2364
|
-
},
|
|
2365
|
-
|
|
2366
|
-
o === C.id ? (
|
|
2378
|
+
}, F = (C) => /* @__PURE__ */ r(Y, { children: [
|
|
2379
|
+
M(C),
|
|
2380
|
+
o === C.id ? (b[C.id] ?? []).map((k) => M(k, C)) : null
|
|
2367
2381
|
] }, `ramo:${C.id}`);
|
|
2368
|
-
return /* @__PURE__ */ r(Je, { opened:
|
|
2382
|
+
return /* @__PURE__ */ r(Je, { opened: z, onChange: g, width: 340, position: "bottom-start", withinPortal: !0, shadow: "md", children: [
|
|
2369
2383
|
/* @__PURE__ */ e(Je.Target, { children: /* @__PURE__ */ e(
|
|
2370
|
-
|
|
2384
|
+
he,
|
|
2371
2385
|
{
|
|
2372
2386
|
label: a,
|
|
2373
|
-
placeholder:
|
|
2387
|
+
placeholder: l,
|
|
2374
2388
|
value: t ?? "",
|
|
2375
2389
|
readOnly: !0,
|
|
2376
|
-
onClick: () =>
|
|
2390
|
+
onClick: () => g((C) => !C),
|
|
2377
2391
|
styles: { input: { cursor: "pointer" } }
|
|
2378
2392
|
}
|
|
2379
2393
|
) }),
|
|
2380
2394
|
/* @__PURE__ */ r(Je.Dropdown, { p: 6, children: [
|
|
2381
2395
|
/* @__PURE__ */ e(
|
|
2382
|
-
|
|
2396
|
+
he,
|
|
2383
2397
|
{
|
|
2384
2398
|
size: "xs",
|
|
2385
2399
|
placeholder: "Buscar…",
|
|
2386
|
-
value:
|
|
2387
|
-
onChange: (C) =>
|
|
2400
|
+
value: T,
|
|
2401
|
+
onChange: (C) => R(C.currentTarget.value),
|
|
2388
2402
|
mb: 6,
|
|
2389
2403
|
autoFocus: !0
|
|
2390
2404
|
}
|
|
2391
2405
|
),
|
|
2392
2406
|
p ? /* @__PURE__ */ r(O, { gap: 6, p: 6, children: [
|
|
2393
|
-
/* @__PURE__ */ e(
|
|
2394
|
-
/* @__PURE__ */ e(
|
|
2407
|
+
/* @__PURE__ */ e(se, { size: "xs" }),
|
|
2408
|
+
/* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: "Carregando…" })
|
|
2395
2409
|
] }) : null,
|
|
2396
|
-
|
|
2397
|
-
!p &&
|
|
2398
|
-
/* @__PURE__ */ e(
|
|
2410
|
+
$ ? /* @__PURE__ */ e(c, { size: "xs", c: "red", p: 6, children: $ }) : null,
|
|
2411
|
+
!p && !$ && x.length === 0 ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", p: 6, children: "Nada encontrado." }) : null,
|
|
2412
|
+
/* @__PURE__ */ e(ue.Autosize, { mah: 280, type: "hover", children: x.map((C) => F(C)) })
|
|
2399
2413
|
] })
|
|
2400
2414
|
] });
|
|
2401
|
-
},
|
|
2415
|
+
}, Yr = [
|
|
2402
2416
|
{ gate: "IDENTITY", titulo: "Identidade", papel: "só nega", pergunta: "O principal é resolvível e a conta está ativa?" },
|
|
2403
2417
|
{ gate: "SCOPE", titulo: "Escopo", papel: "só nega", pergunta: "A concessão vale para o tenant, empresa e projeto pedidos?" },
|
|
2404
2418
|
{ gate: "RESTRICTION", titulo: "Restrições", papel: "só nega", pergunta: "Perfil, papel e persona exigidos pela anotação." },
|
|
2405
2419
|
{ gate: "LEVEL", titulo: "Nível", papel: "só nega", pergunta: "O nível da pessoa alcança o piso da capacidade?" },
|
|
2406
2420
|
{ gate: "GRANT", titulo: "Concessão", papel: "concede", pergunta: "Existe permissão, sem negação explícita?" }
|
|
2407
|
-
],
|
|
2408
|
-
const
|
|
2421
|
+
], et = ({ slots: a, onError: t, initial: l }) => {
|
|
2422
|
+
const n = J(
|
|
2409
2423
|
K.SecurityDiagnostics
|
|
2410
|
-
), [
|
|
2424
|
+
), [u, d] = S(""), [h, A] = S(""), [z, g] = S(""), [T, R] = S(""), [x, D] = S({}), [b, w] = S(void 0), [o, s] = S(!1), [p, v] = S(void 0);
|
|
2411
2425
|
ee(() => {
|
|
2412
|
-
|
|
2413
|
-
}, [
|
|
2414
|
-
const
|
|
2415
|
-
if (!(!
|
|
2416
|
-
|
|
2426
|
+
l && (l.userId && d(l.userId), l.userLabel && A(l.userLabel), l.resource && g(l.resource), l.action && R(l.action), w(void 0));
|
|
2427
|
+
}, [l?.userId, l?.userLabel, l?.resource, l?.action]);
|
|
2428
|
+
const $ = ae(async () => {
|
|
2429
|
+
if (!(!u.trim() || !z.trim() || !T.trim())) {
|
|
2430
|
+
s(!0), v(void 0);
|
|
2417
2431
|
try {
|
|
2418
|
-
const i =
|
|
2432
|
+
const i = u.trim(), N = await n.simulate({
|
|
2419
2433
|
...i.includes("@") ? { email: i } : { userId: i },
|
|
2420
|
-
resource:
|
|
2421
|
-
action:
|
|
2422
|
-
companyId:
|
|
2423
|
-
projectId:
|
|
2434
|
+
resource: z.trim(),
|
|
2435
|
+
action: T.trim(),
|
|
2436
|
+
companyId: x.companyId,
|
|
2437
|
+
projectId: x.projectId
|
|
2424
2438
|
});
|
|
2425
2439
|
w(N);
|
|
2426
2440
|
} catch (i) {
|
|
2427
|
-
const N =
|
|
2428
|
-
|
|
2441
|
+
const N = Te(i);
|
|
2442
|
+
v(N), t?.(N), w(void 0);
|
|
2429
2443
|
} finally {
|
|
2430
|
-
|
|
2444
|
+
s(!1);
|
|
2431
2445
|
}
|
|
2432
2446
|
}
|
|
2433
|
-
}, [
|
|
2434
|
-
const
|
|
2435
|
-
return
|
|
2447
|
+
}, [n, u, z, T, x, t]), y = (i, N) => {
|
|
2448
|
+
const I = N.chain?.find((M) => M.gate === i);
|
|
2449
|
+
return I ? I.passed ? "passou" : "negou" : "nao-avaliado";
|
|
2436
2450
|
};
|
|
2437
|
-
return /* @__PURE__ */ r(
|
|
2438
|
-
/* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ r(
|
|
2439
|
-
/* @__PURE__ */ r(
|
|
2451
|
+
return /* @__PURE__ */ r(U, { gap: "lg", children: [
|
|
2452
|
+
/* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ r(U, { gap: "sm", children: [
|
|
2453
|
+
/* @__PURE__ */ r(We, { cols: { base: 1, sm: 2, lg: 4 }, spacing: "xs", children: [
|
|
2440
2454
|
/* @__PURE__ */ e(
|
|
2441
|
-
|
|
2455
|
+
Sa,
|
|
2442
2456
|
{
|
|
2443
2457
|
label: "Usuário",
|
|
2444
2458
|
placeholder: "escolher pessoa",
|
|
2445
2459
|
branch: "USERS",
|
|
2446
|
-
valor:
|
|
2460
|
+
valor: h || u,
|
|
2447
2461
|
onSelecionar: (i) => {
|
|
2448
|
-
d(i.id),
|
|
2462
|
+
d(i.id), A(i.label);
|
|
2449
2463
|
}
|
|
2450
2464
|
}
|
|
2451
2465
|
),
|
|
2452
2466
|
/* @__PURE__ */ e(
|
|
2453
|
-
|
|
2467
|
+
Sa,
|
|
2454
2468
|
{
|
|
2455
2469
|
label: "Recurso e ação",
|
|
2456
2470
|
placeholder: "escolher capacidade",
|
|
2457
2471
|
branch: "RESOURCES",
|
|
2458
2472
|
branchDosFilhos: "ACTIONS_OF_RESOURCE",
|
|
2459
2473
|
somenteFolhas: !0,
|
|
2460
|
-
valor:
|
|
2474
|
+
valor: z && T ? `${z} · ${T}` : "",
|
|
2461
2475
|
onSelecionar: (i, N) => {
|
|
2462
|
-
|
|
2476
|
+
R(i.label), N && g(N.label);
|
|
2463
2477
|
}
|
|
2464
2478
|
}
|
|
2465
2479
|
),
|
|
2466
2480
|
/* @__PURE__ */ e(
|
|
2467
|
-
|
|
2481
|
+
he,
|
|
2468
2482
|
{
|
|
2469
2483
|
label: "Empresa (opcional)",
|
|
2470
2484
|
placeholder: "companyId",
|
|
2471
|
-
value:
|
|
2472
|
-
onChange: (i) =>
|
|
2485
|
+
value: x.companyId ?? "",
|
|
2486
|
+
onChange: (i) => D((N) => ({ ...N, companyId: i.currentTarget.value || void 0 }))
|
|
2473
2487
|
}
|
|
2474
2488
|
)
|
|
2475
2489
|
] }),
|
|
2476
|
-
a?.afterSimulationFields?.((i) =>
|
|
2490
|
+
a?.afterSimulationFields?.((i) => D((N) => ({ ...N, ...i }))),
|
|
2477
2491
|
/* @__PURE__ */ r(O, { gap: "xs", align: "center", children: [
|
|
2478
|
-
/* @__PURE__ */ e(X, { onClick: () => void
|
|
2479
|
-
/* @__PURE__ */ e(
|
|
2492
|
+
/* @__PURE__ */ e(X, { onClick: () => void $(), loading: o, children: "Simular" }),
|
|
2493
|
+
/* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: "Somente leitura — não altera permissão nenhuma." })
|
|
2480
2494
|
] })
|
|
2481
2495
|
] }) }),
|
|
2482
|
-
p ? /* @__PURE__ */ e(
|
|
2483
|
-
o && !
|
|
2484
|
-
|
|
2485
|
-
/* @__PURE__ */ e(
|
|
2486
|
-
const
|
|
2496
|
+
p ? /* @__PURE__ */ e(ce, { color: "red", title: "Não foi possível simular", children: p }) : null,
|
|
2497
|
+
o && !b ? /* @__PURE__ */ e(se, { size: "sm" }) : null,
|
|
2498
|
+
b ? /* @__PURE__ */ r(xe, { children: [
|
|
2499
|
+
/* @__PURE__ */ e(pe, { title: "Cadeia de decisão", hint: "os quatro primeiros só negam; só o quinto concede", children: /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ e(U, { gap: "sm", children: Yr.map((i, N) => {
|
|
2500
|
+
const I = y(i.gate, b), M = b.chain?.find((F) => F.gate === i.gate)?.detail;
|
|
2487
2501
|
return /* @__PURE__ */ r(O, { align: "flex-start", wrap: "nowrap", gap: "sm", children: [
|
|
2488
|
-
/* @__PURE__ */ e(
|
|
2489
|
-
/* @__PURE__ */ r(
|
|
2502
|
+
/* @__PURE__ */ e(c, { size: "xs", ff: "monospace", c: "dimmed", w: 16, children: N + 1 }),
|
|
2503
|
+
/* @__PURE__ */ r(U, { gap: 2, style: { flex: 1, minWidth: 0 }, children: [
|
|
2490
2504
|
/* @__PURE__ */ r(O, { gap: 8, align: "baseline", wrap: "wrap", children: [
|
|
2491
2505
|
/* @__PURE__ */ e(
|
|
2492
|
-
|
|
2506
|
+
c,
|
|
2493
2507
|
{
|
|
2494
2508
|
size: "sm",
|
|
2495
2509
|
fw: 600,
|
|
2496
|
-
c:
|
|
2497
|
-
opacity:
|
|
2510
|
+
c: I === "negou" ? "red" : void 0,
|
|
2511
|
+
opacity: I === "nao-avaliado" ? 0.5 : 1,
|
|
2498
2512
|
children: i.titulo
|
|
2499
2513
|
}
|
|
2500
2514
|
),
|
|
2501
|
-
/* @__PURE__ */ r(
|
|
2515
|
+
/* @__PURE__ */ r(c, { size: "xs", c: "dimmed", children: [
|
|
2502
2516
|
"· ",
|
|
2503
2517
|
i.papel
|
|
2504
2518
|
] })
|
|
2505
2519
|
] }),
|
|
2506
|
-
/* @__PURE__ */ e(
|
|
2507
|
-
|
|
2520
|
+
/* @__PURE__ */ e(c, { size: "xs", c: "dimmed", opacity: I === "nao-avaliado" ? 0.5 : 1, children: i.pergunta }),
|
|
2521
|
+
M ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: M }) : null
|
|
2508
2522
|
] }),
|
|
2509
2523
|
/* @__PURE__ */ e(
|
|
2510
|
-
|
|
2524
|
+
j,
|
|
2511
2525
|
{
|
|
2512
2526
|
variant: "light",
|
|
2513
|
-
color:
|
|
2514
|
-
children:
|
|
2527
|
+
color: I === "negou" ? "red" : I === "passou" ? "green" : "gray",
|
|
2528
|
+
children: I === "nao-avaliado" ? "não avaliado" : I
|
|
2515
2529
|
}
|
|
2516
2530
|
)
|
|
2517
2531
|
] }, i.gate);
|
|
2518
2532
|
}) }) }) }),
|
|
2519
|
-
/* @__PURE__ */ e(
|
|
2520
|
-
/* @__PURE__ */ e(
|
|
2521
|
-
/* @__PURE__ */ r(
|
|
2533
|
+
/* @__PURE__ */ e(ce, { color: b.allowed ? "green" : "red", title: b.allowed ? "Pode" : "Não pode", children: /* @__PURE__ */ r(U, { gap: 6, children: [
|
|
2534
|
+
/* @__PURE__ */ e(c, { size: "sm", children: b.message }),
|
|
2535
|
+
/* @__PURE__ */ r(c, { size: "xs", ff: "monospace", c: "dimmed", children: [
|
|
2522
2536
|
"reasonCode: ",
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2537
|
+
b.reasonCode,
|
|
2538
|
+
b.deniedAt ? ` · deniedAt: ${b.deniedAt}` : "",
|
|
2539
|
+
b.grantedByName ? ` · grantedBy: ${b.grantedByName}` : ""
|
|
2526
2540
|
] })
|
|
2527
2541
|
] }) }),
|
|
2528
|
-
a?.afterDecision?.(
|
|
2542
|
+
a?.afterDecision?.(b)
|
|
2529
2543
|
] }) : null
|
|
2530
2544
|
] });
|
|
2531
|
-
},
|
|
2545
|
+
}, Oa = (a) => {
|
|
2532
2546
|
switch (a) {
|
|
2533
2547
|
case "EFFECTIVE":
|
|
2534
|
-
return /* @__PURE__ */ e(
|
|
2548
|
+
return /* @__PURE__ */ e(j, { size: "sm", color: "green", variant: "light", children: "vale" });
|
|
2535
2549
|
case "INERT":
|
|
2536
|
-
return /* @__PURE__ */ e(
|
|
2550
|
+
return /* @__PURE__ */ e(j, { size: "sm", color: "yellow", variant: "light", children: "não vale" });
|
|
2537
2551
|
case "DENIED":
|
|
2538
|
-
return /* @__PURE__ */ e(
|
|
2552
|
+
return /* @__PURE__ */ e(j, { size: "sm", color: "red", variant: "light", children: "bloqueada" });
|
|
2539
2553
|
default:
|
|
2540
|
-
return /* @__PURE__ */ e(
|
|
2554
|
+
return /* @__PURE__ */ e(j, { size: "sm", color: "gray", variant: "light", children: "—" });
|
|
2541
2555
|
}
|
|
2542
|
-
},
|
|
2556
|
+
}, at = ({ id: a, label: t, slots: l, onSelectUser: n, onSimulate: u }) => {
|
|
2543
2557
|
const d = J(
|
|
2544
2558
|
K.SecurityDiagnostics
|
|
2545
|
-
), [
|
|
2546
|
-
filtro:
|
|
2547
|
-
setFiltro:
|
|
2548
|
-
filtrados:
|
|
2549
|
-
} =
|
|
2559
|
+
), [h, A] = S([]), {
|
|
2560
|
+
filtro: z,
|
|
2561
|
+
setFiltro: g,
|
|
2562
|
+
filtrados: T
|
|
2563
|
+
} = He(h, (o) => [o.userName, o.email, o.via]), [R, x] = S(!0), [D, b] = S();
|
|
2550
2564
|
ee(() => {
|
|
2551
2565
|
let o = !1;
|
|
2552
|
-
return
|
|
2553
|
-
o ||
|
|
2554
|
-
}).catch((
|
|
2555
|
-
o ||
|
|
2566
|
+
return x(!0), b(void 0), d.getReach(a).then((s) => {
|
|
2567
|
+
o || A(s ?? []);
|
|
2568
|
+
}).catch((s) => {
|
|
2569
|
+
o || b(s instanceof Error ? s.message : "Não foi possível carregar.");
|
|
2556
2570
|
}).finally(() => {
|
|
2557
|
-
o ||
|
|
2571
|
+
o || x(!1);
|
|
2558
2572
|
}), () => {
|
|
2559
2573
|
o = !0;
|
|
2560
2574
|
};
|
|
2561
2575
|
}, [d, a]);
|
|
2562
|
-
const w =
|
|
2563
|
-
return /* @__PURE__ */ r(
|
|
2564
|
-
/* @__PURE__ */ r(
|
|
2565
|
-
/* @__PURE__ */ e(
|
|
2566
|
-
/* @__PURE__ */ e(
|
|
2576
|
+
const w = h.filter((o) => o.kind === "ADMINISTRADOR").length;
|
|
2577
|
+
return /* @__PURE__ */ r(U, { gap: "lg", children: [
|
|
2578
|
+
/* @__PURE__ */ r(U, { gap: 4, children: [
|
|
2579
|
+
/* @__PURE__ */ e(c, { fw: 620, size: "xl", ff: "monospace", children: t }),
|
|
2580
|
+
/* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: "Quem alcança esta capacidade, e por qual via." })
|
|
2567
2581
|
] }),
|
|
2568
|
-
|
|
2582
|
+
D ? /* @__PURE__ */ e(ce, { color: "red", title: "Erro ao carregar", children: D }) : null,
|
|
2569
2583
|
/* @__PURE__ */ e(
|
|
2570
|
-
|
|
2584
|
+
pe,
|
|
2571
2585
|
{
|
|
2572
2586
|
title: "Quem alcança",
|
|
2573
|
-
hint:
|
|
2574
|
-
children:
|
|
2587
|
+
hint: R ? "carregando…" : `${h.length} ${h.length === 1 ? "pessoa" : "pessoas"}`,
|
|
2588
|
+
children: R ? /* @__PURE__ */ e(se, { size: "sm" }) : h.length === 0 ? /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: "Ninguém. A capacidade existe no catálogo e nunca foi concedida." }) : /* @__PURE__ */ r(xe, { children: [
|
|
2575
2589
|
/* @__PURE__ */ e(
|
|
2576
2590
|
Be,
|
|
2577
2591
|
{
|
|
2578
|
-
value:
|
|
2579
|
-
onChange:
|
|
2592
|
+
value: z,
|
|
2593
|
+
onChange: g,
|
|
2580
2594
|
assunto: "pessoas",
|
|
2581
|
-
visiveis:
|
|
2582
|
-
total:
|
|
2595
|
+
visiveis: T.length,
|
|
2596
|
+
total: h.length
|
|
2583
2597
|
}
|
|
2584
2598
|
),
|
|
2585
|
-
/* @__PURE__ */ e(
|
|
2586
|
-
/* @__PURE__ */ e(
|
|
2587
|
-
/* @__PURE__ */ e(
|
|
2588
|
-
/* @__PURE__ */ e(
|
|
2589
|
-
/* @__PURE__ */ e(
|
|
2599
|
+
/* @__PURE__ */ e(ke, { children: /* @__PURE__ */ r(m, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
|
|
2600
|
+
/* @__PURE__ */ e(m.Thead, { children: /* @__PURE__ */ r(m.Tr, { children: [
|
|
2601
|
+
/* @__PURE__ */ e(m.Th, { children: "Pessoa" }),
|
|
2602
|
+
/* @__PURE__ */ e(m.Th, { children: "Por qual via" }),
|
|
2603
|
+
/* @__PURE__ */ e(m.Th, { children: "Situação" })
|
|
2590
2604
|
] }) }),
|
|
2591
|
-
/* @__PURE__ */ e(
|
|
2592
|
-
|
|
2605
|
+
/* @__PURE__ */ e(m.Tbody, { children: T.map((o) => /* @__PURE__ */ r(
|
|
2606
|
+
m.Tr,
|
|
2593
2607
|
{
|
|
2594
|
-
style: { cursor:
|
|
2595
|
-
onClick: () =>
|
|
2608
|
+
style: { cursor: n ? "pointer" : void 0 },
|
|
2609
|
+
onClick: () => n?.(o.userId, o.userName),
|
|
2596
2610
|
children: [
|
|
2597
|
-
/* @__PURE__ */ e(
|
|
2598
|
-
/* @__PURE__ */ e(
|
|
2599
|
-
/* @__PURE__ */ e(
|
|
2611
|
+
/* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ r(U, { gap: 0, children: [
|
|
2612
|
+
/* @__PURE__ */ e(c, { size: "sm", fw: 550, children: o.userName }),
|
|
2613
|
+
/* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: o.email })
|
|
2600
2614
|
] }) }),
|
|
2601
|
-
/* @__PURE__ */ e(
|
|
2602
|
-
/* @__PURE__ */ e(
|
|
2603
|
-
o.kind === "ADMINISTRADOR" ? /* @__PURE__ */ e(
|
|
2615
|
+
/* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ r(O, { gap: 6, children: [
|
|
2616
|
+
/* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: o.via }),
|
|
2617
|
+
o.kind === "ADMINISTRADOR" ? /* @__PURE__ */ e(j, { size: "xs", color: "yellow", variant: "light", children: "atalho" }) : null
|
|
2604
2618
|
] }) }),
|
|
2605
|
-
/* @__PURE__ */ e(
|
|
2619
|
+
/* @__PURE__ */ e(m.Td, { children: Oa(o.situation) })
|
|
2606
2620
|
]
|
|
2607
2621
|
},
|
|
2608
2622
|
o.userId
|
|
2609
2623
|
)) })
|
|
2610
2624
|
] }) }),
|
|
2611
|
-
w > 0 ? /* @__PURE__ */ r(
|
|
2625
|
+
w > 0 ? /* @__PURE__ */ r(c, { size: "xs", c: "dimmed", lh: 1.5, children: [
|
|
2612
2626
|
w === 1 ? "Uma conta alcança" : `${w} contas alcançam`,
|
|
2613
2627
|
" pelo atalho de administrador — sem concessão nenhuma. Revisar permissões não muda o que elas podem."
|
|
2614
2628
|
] }) : null
|
|
2615
2629
|
] })
|
|
2616
2630
|
}
|
|
2617
2631
|
),
|
|
2618
|
-
|
|
2619
|
-
|
|
2632
|
+
l?.afterReachList?.(a, h),
|
|
2633
|
+
u ? /* @__PURE__ */ r(c, { size: "xs", c: "dimmed", children: [
|
|
2620
2634
|
"Para testar uma pessoa específica contra esta capacidade, use ",
|
|
2621
2635
|
/* @__PURE__ */ e("strong", { children: "Simular" }),
|
|
2622
2636
|
" na árvore — ela já vem escolhida."
|
|
2623
2637
|
] }) : null
|
|
2624
2638
|
] });
|
|
2625
|
-
},
|
|
2626
|
-
const
|
|
2639
|
+
}, xa = ({ id: a, kind: t, slots: l, onSelectUser: n }) => {
|
|
2640
|
+
const u = J(
|
|
2627
2641
|
K.SecurityDiagnostics
|
|
2628
|
-
), [d,
|
|
2629
|
-
filtro:
|
|
2630
|
-
setFiltro:
|
|
2631
|
-
filtrados:
|
|
2632
|
-
} =
|
|
2633
|
-
filtro:
|
|
2642
|
+
), [d, h] = S(), [A, z] = S(!0), [g, T] = S(), {
|
|
2643
|
+
filtro: R,
|
|
2644
|
+
setFiltro: x,
|
|
2645
|
+
filtrados: D
|
|
2646
|
+
} = He(d?.members ?? [], (v) => [v.name, v.email, v.profileName ?? void 0]), {
|
|
2647
|
+
filtro: b,
|
|
2634
2648
|
setFiltro: w,
|
|
2635
2649
|
filtrados: o
|
|
2636
|
-
} =
|
|
2650
|
+
} = He(d?.grants ?? [], (v) => [v.resource, v.action]);
|
|
2637
2651
|
if (ee(() => {
|
|
2638
|
-
let
|
|
2639
|
-
return
|
|
2640
|
-
|
|
2641
|
-
}).catch((
|
|
2642
|
-
|
|
2652
|
+
let v = !1;
|
|
2653
|
+
return z(!0), T(void 0), (t === "GROUP" ? u.getGroup(a) : u.getProfile(a)).then((y) => {
|
|
2654
|
+
v || h(y);
|
|
2655
|
+
}).catch((y) => {
|
|
2656
|
+
v || T(y instanceof Error ? y.message : "Não foi possível carregar.");
|
|
2643
2657
|
}).finally(() => {
|
|
2644
|
-
|
|
2658
|
+
v || z(!1);
|
|
2645
2659
|
}), () => {
|
|
2646
|
-
|
|
2660
|
+
v = !0;
|
|
2647
2661
|
};
|
|
2648
|
-
}, [
|
|
2662
|
+
}, [u, a, t]), A)
|
|
2649
2663
|
return /* @__PURE__ */ r(O, { gap: 8, children: [
|
|
2650
|
-
/* @__PURE__ */ e(
|
|
2651
|
-
/* @__PURE__ */ e(
|
|
2664
|
+
/* @__PURE__ */ e(se, { size: "sm" }),
|
|
2665
|
+
/* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: "Carregando…" })
|
|
2652
2666
|
] });
|
|
2653
|
-
if (
|
|
2654
|
-
return /* @__PURE__ */ e(
|
|
2667
|
+
if (g)
|
|
2668
|
+
return /* @__PURE__ */ e(ce, { color: "red", title: "Erro ao carregar", children: g });
|
|
2655
2669
|
if (!d)
|
|
2656
2670
|
return null;
|
|
2657
|
-
const
|
|
2658
|
-
return /* @__PURE__ */ r(
|
|
2659
|
-
/* @__PURE__ */ r(
|
|
2671
|
+
const s = t === "GROUP" ? "grupo" : "perfil", p = l?.additionalMemberColumns ?? [];
|
|
2672
|
+
return /* @__PURE__ */ r(U, { gap: "lg", children: [
|
|
2673
|
+
/* @__PURE__ */ r(U, { gap: 4, children: [
|
|
2660
2674
|
/* @__PURE__ */ r(O, { gap: 8, children: [
|
|
2661
|
-
/* @__PURE__ */ e(
|
|
2662
|
-
/* @__PURE__ */ e(
|
|
2675
|
+
/* @__PURE__ */ e(c, { fw: 620, size: "xl", children: d.groupName }),
|
|
2676
|
+
/* @__PURE__ */ e(j, { variant: "light", children: s })
|
|
2663
2677
|
] }),
|
|
2664
|
-
d.description ? /* @__PURE__ */ e(
|
|
2678
|
+
d.description ? /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: d.description }) : null
|
|
2665
2679
|
] }),
|
|
2666
2680
|
/* @__PURE__ */ r(
|
|
2667
|
-
|
|
2681
|
+
pe,
|
|
2668
2682
|
{
|
|
2669
2683
|
title: "Membros",
|
|
2670
2684
|
hint: `${d.members.length} — o total de cada um soma todas as origens`,
|
|
2671
2685
|
children: [
|
|
2672
|
-
d.members.length === 0 ? /* @__PURE__ */ r(
|
|
2686
|
+
d.members.length === 0 ? /* @__PURE__ */ r(c, { size: "sm", c: "dimmed", children: [
|
|
2673
2687
|
"Ninguém está ",
|
|
2674
2688
|
t === "GROUP" ? "neste grupo" : "com este perfil",
|
|
2675
2689
|
"."
|
|
@@ -2677,50 +2691,50 @@ const Ue = (a) => {
|
|
|
2677
2691
|
/* @__PURE__ */ e(
|
|
2678
2692
|
Be,
|
|
2679
2693
|
{
|
|
2680
|
-
value:
|
|
2681
|
-
onChange:
|
|
2694
|
+
value: R,
|
|
2695
|
+
onChange: x,
|
|
2682
2696
|
assunto: "pessoas",
|
|
2683
|
-
visiveis:
|
|
2697
|
+
visiveis: D.length,
|
|
2684
2698
|
total: d.members.length
|
|
2685
2699
|
}
|
|
2686
2700
|
),
|
|
2687
|
-
/* @__PURE__ */ e(
|
|
2688
|
-
/* @__PURE__ */ e(
|
|
2689
|
-
/* @__PURE__ */ e(
|
|
2690
|
-
/* @__PURE__ */ e(
|
|
2691
|
-
/* @__PURE__ */ e(
|
|
2692
|
-
/* @__PURE__ */ e(
|
|
2693
|
-
/* @__PURE__ */ e(
|
|
2694
|
-
/* @__PURE__ */ e(
|
|
2695
|
-
p.map((
|
|
2701
|
+
/* @__PURE__ */ e(ke, { children: /* @__PURE__ */ r(m, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
|
|
2702
|
+
/* @__PURE__ */ e(m.Thead, { children: /* @__PURE__ */ r(m.Tr, { children: [
|
|
2703
|
+
/* @__PURE__ */ e(m.Th, { children: "Pessoa" }),
|
|
2704
|
+
/* @__PURE__ */ e(m.Th, { children: "Perfil" }),
|
|
2705
|
+
/* @__PURE__ */ e(m.Th, { ta: "right", children: "Concedidas" }),
|
|
2706
|
+
/* @__PURE__ */ e(m.Th, { ta: "right", children: "Valem" }),
|
|
2707
|
+
/* @__PURE__ */ e(m.Th, { ta: "right", children: "Não valem" }),
|
|
2708
|
+
/* @__PURE__ */ e(m.Th, { ta: "right", children: "Bloqueadas" }),
|
|
2709
|
+
p.map((v) => /* @__PURE__ */ e(m.Th, { children: v.header }, v.header))
|
|
2696
2710
|
] }) }),
|
|
2697
|
-
/* @__PURE__ */ e(
|
|
2698
|
-
|
|
2711
|
+
/* @__PURE__ */ e(m.Tbody, { children: D.map((v) => /* @__PURE__ */ r(
|
|
2712
|
+
m.Tr,
|
|
2699
2713
|
{
|
|
2700
|
-
style: { cursor:
|
|
2701
|
-
onClick: () =>
|
|
2714
|
+
style: { cursor: n ? "pointer" : void 0 },
|
|
2715
|
+
onClick: () => n?.(v.userId, v.name),
|
|
2702
2716
|
children: [
|
|
2703
|
-
/* @__PURE__ */ e(
|
|
2717
|
+
/* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ r(U, { gap: 0, children: [
|
|
2704
2718
|
/* @__PURE__ */ r(O, { gap: 6, children: [
|
|
2705
|
-
/* @__PURE__ */ e(
|
|
2706
|
-
|
|
2707
|
-
|
|
2719
|
+
/* @__PURE__ */ e(c, { size: "sm", fw: 550, children: v.name }),
|
|
2720
|
+
v.administrator ? /* @__PURE__ */ e(j, { size: "xs", color: "yellow", variant: "light", children: "administrador" }) : null,
|
|
2721
|
+
v.enabled ? null : /* @__PURE__ */ e(j, { size: "xs", color: "red", variant: "light", children: "desativada" })
|
|
2708
2722
|
] }),
|
|
2709
|
-
/* @__PURE__ */ e(
|
|
2723
|
+
/* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: v.email })
|
|
2710
2724
|
] }) }),
|
|
2711
|
-
/* @__PURE__ */ e(
|
|
2712
|
-
/* @__PURE__ */ e(
|
|
2713
|
-
/* @__PURE__ */ e(
|
|
2714
|
-
/* @__PURE__ */ e(
|
|
2715
|
-
/* @__PURE__ */ e(
|
|
2716
|
-
p.map((
|
|
2725
|
+
/* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: v.profileName ?? "—" }) }),
|
|
2726
|
+
/* @__PURE__ */ e(m.Td, { ta: "right", children: v.total }),
|
|
2727
|
+
/* @__PURE__ */ e(m.Td, { ta: "right", c: "green", children: v.effective }),
|
|
2728
|
+
/* @__PURE__ */ e(m.Td, { ta: "right", c: "yellow.7", children: v.inert }),
|
|
2729
|
+
/* @__PURE__ */ e(m.Td, { ta: "right", c: "red", children: v.denied }),
|
|
2730
|
+
p.map(($) => /* @__PURE__ */ e(m.Td, { children: $.render(v, d) }, $.header))
|
|
2717
2731
|
]
|
|
2718
2732
|
},
|
|
2719
|
-
|
|
2733
|
+
v.userId
|
|
2720
2734
|
)) })
|
|
2721
2735
|
] }) })
|
|
2722
2736
|
] }),
|
|
2723
|
-
/* @__PURE__ */ r(
|
|
2737
|
+
/* @__PURE__ */ r(c, { size: "xs", c: "dimmed", lh: 1.5, children: [
|
|
2724
2738
|
"O total do membro não é o total ",
|
|
2725
2739
|
t === "GROUP" ? "do grupo" : "do perfil",
|
|
2726
2740
|
": ele soma o que vem de outras vias. Clique numa pessoa para ver a lista dela."
|
|
@@ -2728,41 +2742,41 @@ const Ue = (a) => {
|
|
|
2728
2742
|
]
|
|
2729
2743
|
}
|
|
2730
2744
|
),
|
|
2731
|
-
/* @__PURE__ */ e(
|
|
2745
|
+
/* @__PURE__ */ e(pe, { title: `O que este ${s} concede`, hint: "a parte que é responsabilidade dele", children: d.grants.length === 0 ? /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: "Nada concedido por esta via." }) : /* @__PURE__ */ r(xe, { children: [
|
|
2732
2746
|
/* @__PURE__ */ e(
|
|
2733
2747
|
Be,
|
|
2734
2748
|
{
|
|
2735
|
-
value:
|
|
2749
|
+
value: b,
|
|
2736
2750
|
onChange: w,
|
|
2737
2751
|
assunto: "capacidades",
|
|
2738
2752
|
visiveis: o.length,
|
|
2739
2753
|
total: d.grants.length
|
|
2740
2754
|
}
|
|
2741
2755
|
),
|
|
2742
|
-
/* @__PURE__ */ e(
|
|
2743
|
-
/* @__PURE__ */ e(
|
|
2744
|
-
/* @__PURE__ */ e(
|
|
2745
|
-
/* @__PURE__ */ e(
|
|
2756
|
+
/* @__PURE__ */ e(ke, { children: /* @__PURE__ */ r(m, { striped: !0, withTableBorder: !0, stickyHeader: !0, children: [
|
|
2757
|
+
/* @__PURE__ */ e(m.Thead, { children: /* @__PURE__ */ r(m.Tr, { children: [
|
|
2758
|
+
/* @__PURE__ */ e(m.Th, { children: "Capacidade" }),
|
|
2759
|
+
/* @__PURE__ */ e(m.Th, { children: "Situação" })
|
|
2746
2760
|
] }) }),
|
|
2747
|
-
/* @__PURE__ */ e(
|
|
2748
|
-
/* @__PURE__ */ e(
|
|
2749
|
-
|
|
2761
|
+
/* @__PURE__ */ e(m.Tbody, { children: o.map((v, $) => /* @__PURE__ */ r(m.Tr, { children: [
|
|
2762
|
+
/* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ r(c, { size: "sm", ff: "monospace", children: [
|
|
2763
|
+
v.resource,
|
|
2750
2764
|
" · ",
|
|
2751
|
-
|
|
2765
|
+
v.action
|
|
2752
2766
|
] }) }),
|
|
2753
|
-
/* @__PURE__ */ e(
|
|
2754
|
-
] }, `${
|
|
2767
|
+
/* @__PURE__ */ e(m.Td, { children: Oa(v.situation) })
|
|
2768
|
+
] }, `${v.resource}-${v.action}-${$}`)) })
|
|
2755
2769
|
] }) })
|
|
2756
2770
|
] }) }),
|
|
2757
|
-
|
|
2771
|
+
l?.afterGroupMembers?.(d)
|
|
2758
2772
|
] });
|
|
2759
|
-
},
|
|
2773
|
+
}, Ca = 50, aa = [
|
|
2760
2774
|
{ branch: "USERS", label: "Pessoas" },
|
|
2761
2775
|
{ branch: "GROUPS", label: "Grupos" },
|
|
2762
2776
|
{ branch: "PROFILES", label: "Perfis" },
|
|
2763
2777
|
{ branch: "RESOURCES", label: "Recursos" }
|
|
2764
|
-
], ra = { nodes: [], total: 0, carregando: !1, carregouTudo: !1 },
|
|
2765
|
-
|
|
2778
|
+
], ra = { nodes: [], total: 0, carregando: !1, carregouTudo: !1 }, rt = ({ aberta: a }) => /* @__PURE__ */ e(
|
|
2779
|
+
Y,
|
|
2766
2780
|
{
|
|
2767
2781
|
"aria-hidden": !0,
|
|
2768
2782
|
style: {
|
|
@@ -2774,7 +2788,7 @@ const Ue = (a) => {
|
|
|
2774
2788
|
justifyContent: "center"
|
|
2775
2789
|
},
|
|
2776
2790
|
children: /* @__PURE__ */ e(
|
|
2777
|
-
|
|
2791
|
+
Y,
|
|
2778
2792
|
{
|
|
2779
2793
|
style: {
|
|
2780
2794
|
width: 0,
|
|
@@ -2790,100 +2804,100 @@ const Ue = (a) => {
|
|
|
2790
2804
|
}
|
|
2791
2805
|
)
|
|
2792
2806
|
}
|
|
2793
|
-
),
|
|
2794
|
-
const
|
|
2807
|
+
), tt = ({ selected: a, onSelect: t }) => {
|
|
2808
|
+
const l = J(
|
|
2795
2809
|
K.SecurityDiagnostics
|
|
2796
|
-
), [
|
|
2797
|
-
async (o,
|
|
2798
|
-
const
|
|
2799
|
-
if (
|
|
2810
|
+
), [n, u] = S(""), [d] = oa(n, 300), [h, A] = S({}), [z, g] = S({}), T = (o, s) => s ? `${o}:${s}` : o, R = ae(
|
|
2811
|
+
async (o, s, p) => {
|
|
2812
|
+
const v = T(o, s), $ = z[v] ?? ra;
|
|
2813
|
+
if ($.carregando || p && $.carregouTudo)
|
|
2800
2814
|
return;
|
|
2801
|
-
const
|
|
2802
|
-
|
|
2815
|
+
const y = p ? Math.floor($.nodes.length / Ca) : 0;
|
|
2816
|
+
g((i) => ({ ...i, [v]: { ...i[v] ?? ra, carregando: !0, erro: void 0 } }));
|
|
2803
2817
|
try {
|
|
2804
|
-
const i = await
|
|
2805
|
-
parentId:
|
|
2818
|
+
const i = await l.browse(o, {
|
|
2819
|
+
parentId: s,
|
|
2806
2820
|
q: d || void 0,
|
|
2807
|
-
page:
|
|
2808
|
-
size:
|
|
2821
|
+
page: y,
|
|
2822
|
+
size: Ca
|
|
2809
2823
|
});
|
|
2810
|
-
|
|
2811
|
-
const
|
|
2824
|
+
g((N) => {
|
|
2825
|
+
const M = [...p ? N[v]?.nodes ?? [] : [], ...i.content ?? []];
|
|
2812
2826
|
return {
|
|
2813
2827
|
...N,
|
|
2814
|
-
[
|
|
2815
|
-
nodes:
|
|
2816
|
-
total: i.totalElements ??
|
|
2828
|
+
[v]: {
|
|
2829
|
+
nodes: M,
|
|
2830
|
+
total: i.totalElements ?? M.length,
|
|
2817
2831
|
carregando: !1,
|
|
2818
|
-
carregouTudo:
|
|
2832
|
+
carregouTudo: M.length >= (i.totalElements ?? 0)
|
|
2819
2833
|
}
|
|
2820
2834
|
};
|
|
2821
2835
|
});
|
|
2822
2836
|
} catch (i) {
|
|
2823
|
-
|
|
2837
|
+
g((N) => ({
|
|
2824
2838
|
...N,
|
|
2825
|
-
[
|
|
2826
|
-
...N[
|
|
2839
|
+
[v]: {
|
|
2840
|
+
...N[v] ?? ra,
|
|
2827
2841
|
carregando: !1,
|
|
2828
2842
|
erro: i instanceof Error ? i.message : "Não foi possível carregar."
|
|
2829
2843
|
}
|
|
2830
2844
|
}));
|
|
2831
2845
|
}
|
|
2832
2846
|
},
|
|
2833
|
-
[
|
|
2847
|
+
[l, d, z]
|
|
2834
2848
|
);
|
|
2835
2849
|
ee(() => {
|
|
2836
|
-
if (
|
|
2850
|
+
if (g({}), d) {
|
|
2837
2851
|
const o = {};
|
|
2838
|
-
aa.forEach((
|
|
2839
|
-
o[
|
|
2840
|
-
}),
|
|
2852
|
+
aa.forEach((s) => {
|
|
2853
|
+
o[s.branch] = !0;
|
|
2854
|
+
}), A((s) => ({ ...s, ...o }));
|
|
2841
2855
|
}
|
|
2842
2856
|
}, [d]), ee(() => {
|
|
2843
2857
|
aa.forEach((o) => {
|
|
2844
|
-
|
|
2858
|
+
h[o.branch] && !z[o.branch] && R(o.branch, void 0, !1);
|
|
2845
2859
|
});
|
|
2846
|
-
}, [
|
|
2847
|
-
const
|
|
2848
|
-
const
|
|
2849
|
-
return /* @__PURE__ */ r(
|
|
2860
|
+
}, [h, z, d]);
|
|
2861
|
+
const x = (o) => A((s) => ({ ...s, [o]: !s[o] })), D = (o) => o === "critical" ? "red" : o === "warning" ? "yellow" : void 0, b = (o, s, p) => {
|
|
2862
|
+
const v = T("ACTIONS_OF_RESOURCE", o.id), $ = !!h[v], y = z[v], i = a?.kind === o.kind && a?.id === o.id;
|
|
2863
|
+
return /* @__PURE__ */ r(Y, { children: [
|
|
2850
2864
|
/* @__PURE__ */ e(
|
|
2851
2865
|
ze,
|
|
2852
2866
|
{
|
|
2853
2867
|
onClick: () => {
|
|
2854
|
-
t({ kind: o.kind, id: o.id, label: o.label, parentLabel: p }), o.hasChildren && (
|
|
2868
|
+
t({ kind: o.kind, id: o.id, label: o.label, parentLabel: p }), o.hasChildren && (x(v), y || R("ACTIONS_OF_RESOURCE", o.id, !1));
|
|
2855
2869
|
},
|
|
2856
2870
|
"aria-current": i ? "true" : void 0,
|
|
2857
|
-
"aria-expanded": o.hasChildren ?
|
|
2871
|
+
"aria-expanded": o.hasChildren ? $ : void 0,
|
|
2858
2872
|
style: {
|
|
2859
2873
|
display: "block",
|
|
2860
2874
|
width: "100%",
|
|
2861
2875
|
padding: "5px 8px",
|
|
2862
|
-
paddingLeft: 8 +
|
|
2876
|
+
paddingLeft: 8 + s * 14,
|
|
2863
2877
|
borderRadius: 5,
|
|
2864
2878
|
background: i ? "var(--mantine-color-blue-light)" : void 0
|
|
2865
2879
|
},
|
|
2866
2880
|
children: /* @__PURE__ */ r(O, { gap: 7, wrap: "nowrap", children: [
|
|
2867
|
-
o.severity ? /* @__PURE__ */ e(
|
|
2868
|
-
/* @__PURE__ */ e(
|
|
2869
|
-
o.badge ? /* @__PURE__ */ e(
|
|
2881
|
+
o.severity ? /* @__PURE__ */ e(j, { size: "xs", circle: !0, color: D(o.severity) }) : /* @__PURE__ */ e(Y, { w: 8 }),
|
|
2882
|
+
/* @__PURE__ */ e(c, { size: "sm", fw: i ? 600 : 400, truncate: !0, style: { flex: 1 }, children: o.label }),
|
|
2883
|
+
o.badge ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", ff: "monospace", children: o.badge }) : null
|
|
2870
2884
|
] })
|
|
2871
2885
|
}
|
|
2872
2886
|
),
|
|
2873
|
-
o.hasChildren &&
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
/* @__PURE__ */ e(
|
|
2877
|
-
/* @__PURE__ */ e(
|
|
2887
|
+
o.hasChildren && $ ? /* @__PURE__ */ r(Y, { children: [
|
|
2888
|
+
y?.nodes.map((N) => b(N, s + 1, o.label)),
|
|
2889
|
+
y?.carregando ? /* @__PURE__ */ r(O, { gap: 6, pl: 8 + (s + 1) * 14, py: 4, children: [
|
|
2890
|
+
/* @__PURE__ */ e(se, { size: "xs" }),
|
|
2891
|
+
/* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: "carregando…" })
|
|
2878
2892
|
] }) : null,
|
|
2879
|
-
|
|
2893
|
+
y && !y.erro && !y.carregouTudo && !y.carregando && y.total > y.nodes.length ? /* @__PURE__ */ e(
|
|
2880
2894
|
ze,
|
|
2881
2895
|
{
|
|
2882
|
-
onClick: () => void
|
|
2883
|
-
style: { paddingLeft: 8 + (
|
|
2884
|
-
children: /* @__PURE__ */ r(
|
|
2896
|
+
onClick: () => void R("ACTIONS_OF_RESOURCE", o.id, !0),
|
|
2897
|
+
style: { paddingLeft: 8 + (s + 1) * 14, paddingTop: 3, paddingBottom: 3 },
|
|
2898
|
+
children: /* @__PURE__ */ r(c, { size: "xs", c: "blue", children: [
|
|
2885
2899
|
"mais ",
|
|
2886
|
-
|
|
2900
|
+
y.total - y.nodes.length,
|
|
2887
2901
|
" →"
|
|
2888
2902
|
] })
|
|
2889
2903
|
}
|
|
@@ -2891,63 +2905,174 @@ const Ue = (a) => {
|
|
|
2891
2905
|
] }) : null
|
|
2892
2906
|
] }, `${o.kind}-${o.id}`);
|
|
2893
2907
|
}, w = ie(() => aa, []);
|
|
2894
|
-
return /* @__PURE__ */ r(
|
|
2908
|
+
return /* @__PURE__ */ r(Y, { children: [
|
|
2895
2909
|
/* @__PURE__ */ e(
|
|
2896
|
-
|
|
2910
|
+
he,
|
|
2897
2911
|
{
|
|
2898
2912
|
size: "xs",
|
|
2899
2913
|
placeholder: "Buscar pessoa, grupo, capacidade…",
|
|
2900
|
-
value:
|
|
2901
|
-
onChange: (o) =>
|
|
2914
|
+
value: n,
|
|
2915
|
+
onChange: (o) => u(o.currentTarget.value),
|
|
2902
2916
|
"aria-label": "Buscar na árvore",
|
|
2903
2917
|
mb: "xs",
|
|
2904
|
-
rightSection:
|
|
2918
|
+
rightSection: n && n !== d ? /* @__PURE__ */ e(se, { size: "xs" }) : null
|
|
2905
2919
|
}
|
|
2906
2920
|
),
|
|
2907
2921
|
w.map((o) => {
|
|
2908
|
-
const
|
|
2909
|
-
return /* @__PURE__ */ r(
|
|
2922
|
+
const s = !!h[o.branch], p = z[o.branch];
|
|
2923
|
+
return /* @__PURE__ */ r(Y, { mb: 2, children: [
|
|
2910
2924
|
/* @__PURE__ */ e(
|
|
2911
2925
|
ze,
|
|
2912
2926
|
{
|
|
2913
2927
|
onClick: () => {
|
|
2914
|
-
|
|
2928
|
+
x(o.branch), p || R(o.branch, void 0, !1);
|
|
2915
2929
|
},
|
|
2916
|
-
"aria-expanded":
|
|
2930
|
+
"aria-expanded": s,
|
|
2917
2931
|
style: { display: "block", width: "100%", padding: "5px 8px", borderRadius: 5 },
|
|
2918
2932
|
children: /* @__PURE__ */ r(O, { gap: 7, wrap: "nowrap", children: [
|
|
2919
|
-
/* @__PURE__ */ e(
|
|
2920
|
-
/* @__PURE__ */ e(
|
|
2921
|
-
p ? /* @__PURE__ */ e(
|
|
2933
|
+
/* @__PURE__ */ e(rt, { aberta: s }),
|
|
2934
|
+
/* @__PURE__ */ e(c, { size: "sm", fw: 600, style: { flex: 1 }, children: o.label }),
|
|
2935
|
+
p ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", ff: "monospace", children: p.total }) : null
|
|
2922
2936
|
] })
|
|
2923
2937
|
}
|
|
2924
2938
|
),
|
|
2925
|
-
|
|
2926
|
-
p?.erro ? /* @__PURE__ */ e(
|
|
2927
|
-
p?.nodes.map((
|
|
2939
|
+
s ? /* @__PURE__ */ r(Y, { children: [
|
|
2940
|
+
p?.erro ? /* @__PURE__ */ e(c, { size: "xs", c: "red", pl: 22, py: 4, children: p.erro }) : null,
|
|
2941
|
+
p?.nodes.map((v) => b(v, 1)),
|
|
2928
2942
|
p?.carregando ? /* @__PURE__ */ r(O, { gap: 6, pl: 22, py: 4, children: [
|
|
2929
|
-
/* @__PURE__ */ e(
|
|
2930
|
-
/* @__PURE__ */ e(
|
|
2943
|
+
/* @__PURE__ */ e(se, { size: "xs" }),
|
|
2944
|
+
/* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: "carregando…" })
|
|
2931
2945
|
] }) : null,
|
|
2932
2946
|
p && !p.erro && !p.carregouTudo && !p.carregando && p.total > p.nodes.length ? /* @__PURE__ */ e(
|
|
2933
2947
|
ze,
|
|
2934
2948
|
{
|
|
2935
|
-
onClick: () => void
|
|
2949
|
+
onClick: () => void R(o.branch, void 0, !0),
|
|
2936
2950
|
style: { paddingLeft: 22, paddingTop: 3, paddingBottom: 3 },
|
|
2937
|
-
children: /* @__PURE__ */ r(
|
|
2951
|
+
children: /* @__PURE__ */ r(c, { size: "xs", c: "blue", children: [
|
|
2938
2952
|
"mais ",
|
|
2939
2953
|
p.total - p.nodes.length,
|
|
2940
2954
|
" →"
|
|
2941
2955
|
] })
|
|
2942
2956
|
}
|
|
2943
2957
|
) : null,
|
|
2944
|
-
p && !p.erro && p.nodes.length === 0 && !p.carregando ? /* @__PURE__ */ e(
|
|
2958
|
+
p && !p.erro && p.nodes.length === 0 && !p.carregando ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", pl: 22, py: 4, children: d ? "Nada encontrado." : "Vazio." }) : null
|
|
2945
2959
|
] }) : null
|
|
2946
2960
|
] }, o.branch);
|
|
2947
2961
|
})
|
|
2948
2962
|
] });
|
|
2949
|
-
},
|
|
2950
|
-
|
|
2963
|
+
}, it = 50, ta = {
|
|
2964
|
+
LOGIN: { label: "Entrou" },
|
|
2965
|
+
LOGIN_FALHOU: { label: "Falha ao entrar", cor: "red" },
|
|
2966
|
+
LOGOUT: { label: "Saiu" },
|
|
2967
|
+
ACESSO_NEGADO: { label: "Acesso negado", cor: "red" },
|
|
2968
|
+
SIMULACAO: { label: "Simulação", cor: "blue" }
|
|
2969
|
+
}, ot = ({ slots: a, onError: t }) => {
|
|
2970
|
+
const l = J(
|
|
2971
|
+
K.SecurityDiagnostics
|
|
2972
|
+
), [n, u] = S([]), [d, h] = S(1), [A, z] = S(1), [g, T] = S(0), [R, x] = S(""), [D, b] = S(null), [w, o] = S(!1), [s, p] = S(null), [v, $] = S(!1);
|
|
2973
|
+
return ee(() => {
|
|
2974
|
+
let y = !1;
|
|
2975
|
+
o(!0), p(null);
|
|
2976
|
+
const N = setTimeout(() => {
|
|
2977
|
+
l.getAuditEvents({
|
|
2978
|
+
usuario: R || void 0,
|
|
2979
|
+
tipo: D ?? void 0,
|
|
2980
|
+
page: d - 1,
|
|
2981
|
+
size: it
|
|
2982
|
+
}).then((I) => {
|
|
2983
|
+
y || (u(I.content ?? []), T(I.totalElements ?? 0), z(Math.max(I.totalPages ?? 1, 1)), $(!1));
|
|
2984
|
+
}).catch((I) => {
|
|
2985
|
+
if (y)
|
|
2986
|
+
return;
|
|
2987
|
+
const M = I instanceof Error ? I.message : "Não foi possível ler a trilha.";
|
|
2988
|
+
/404/.test(M) ? ($(!0), u([])) : (p(M), t?.(M));
|
|
2989
|
+
}).finally(() => {
|
|
2990
|
+
y || o(!1);
|
|
2991
|
+
});
|
|
2992
|
+
}, R ? 400 : 0);
|
|
2993
|
+
return () => {
|
|
2994
|
+
y = !0, clearTimeout(N);
|
|
2995
|
+
};
|
|
2996
|
+
}, [l, R, D, d, t]), v ? /* @__PURE__ */ r(ce, { color: "yellow", title: "Trilha desligada", children: [
|
|
2997
|
+
"O servidor está com ",
|
|
2998
|
+
/* @__PURE__ */ e("code", { children: "archbase.security.audit.enabled=false" }),
|
|
2999
|
+
'. Nada é registrado enquanto estiver assim — a lista vazia aqui significaria "nada aconteceu", e não é o caso.'
|
|
3000
|
+
] }) : /* @__PURE__ */ r(U, { gap: "md", style: { flex: 1, minHeight: 0 }, children: [
|
|
3001
|
+
/* @__PURE__ */ r(U, { gap: 4, children: [
|
|
3002
|
+
/* @__PURE__ */ e(c, { fw: 620, size: "xl", children: "Trilha de auditoria" }),
|
|
3003
|
+
/* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: "O que aconteceu — entradas, falhas, acessos negados e simulações. As outras telas mostram como a segurança está agora; esta mostra o que passou." })
|
|
3004
|
+
] }),
|
|
3005
|
+
/* @__PURE__ */ r(O, { gap: "xs", align: "flex-end", children: [
|
|
3006
|
+
/* @__PURE__ */ e(
|
|
3007
|
+
he,
|
|
3008
|
+
{
|
|
3009
|
+
size: "xs",
|
|
3010
|
+
label: "Pessoa",
|
|
3011
|
+
placeholder: "e-mail ou parte dele",
|
|
3012
|
+
value: R,
|
|
3013
|
+
onChange: (y) => {
|
|
3014
|
+
x(y.currentTarget.value), h(1);
|
|
3015
|
+
},
|
|
3016
|
+
style: { minWidth: 220 }
|
|
3017
|
+
}
|
|
3018
|
+
),
|
|
3019
|
+
/* @__PURE__ */ e(
|
|
3020
|
+
er,
|
|
3021
|
+
{
|
|
3022
|
+
size: "xs",
|
|
3023
|
+
label: "Tipo",
|
|
3024
|
+
placeholder: "todos",
|
|
3025
|
+
clearable: !0,
|
|
3026
|
+
value: D,
|
|
3027
|
+
onChange: (y) => {
|
|
3028
|
+
b(y ?? null), h(1);
|
|
3029
|
+
},
|
|
3030
|
+
data: Object.entries(ta).map(([y, { label: i }]) => ({ value: y, label: i })),
|
|
3031
|
+
style: { minWidth: 180 }
|
|
3032
|
+
}
|
|
3033
|
+
),
|
|
3034
|
+
/* @__PURE__ */ r(j, { variant: "light", children: [
|
|
3035
|
+
g,
|
|
3036
|
+
" ",
|
|
3037
|
+
g === 1 ? "evento" : "eventos"
|
|
3038
|
+
] }),
|
|
3039
|
+
w ? /* @__PURE__ */ e(se, { size: "xs" }) : null
|
|
3040
|
+
] }),
|
|
3041
|
+
s ? /* @__PURE__ */ e(ce, { color: "red", title: "Erro ao ler a trilha", children: s }) : null,
|
|
3042
|
+
!w && !s && n.length === 0 ? /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: "Nenhum evento no período." }) : null,
|
|
3043
|
+
n.length > 0 ? /* @__PURE__ */ e(pe, { title: "Eventos", hint: "do mais recente para o mais antigo", children: /* @__PURE__ */ e(ke, { maxHeight: "calc(100vh - 420px)", children: /* @__PURE__ */ r(m, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
|
|
3044
|
+
/* @__PURE__ */ e(m.Thead, { children: /* @__PURE__ */ r(m.Tr, { children: [
|
|
3045
|
+
/* @__PURE__ */ e(m.Th, { children: "Quando" }),
|
|
3046
|
+
/* @__PURE__ */ e(m.Th, { children: "O quê" }),
|
|
3047
|
+
/* @__PURE__ */ e(m.Th, { children: "Quem" }),
|
|
3048
|
+
/* @__PURE__ */ e(m.Th, { children: "Sobre" }),
|
|
3049
|
+
/* @__PURE__ */ e(m.Th, { children: "Por quê" }),
|
|
3050
|
+
/* @__PURE__ */ e(m.Th, { children: "Origem" })
|
|
3051
|
+
] }) }),
|
|
3052
|
+
/* @__PURE__ */ e(m.Tbody, { children: n.map((y) => /* @__PURE__ */ r(m.Tr, { children: [
|
|
3053
|
+
/* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(c, { size: "xs", children: nt(y.dataHora) }) }),
|
|
3054
|
+
/* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(j, { size: "sm", variant: "light", color: ta[y.tipo]?.cor, children: ta[y.tipo]?.label ?? y.tipo }) }),
|
|
3055
|
+
/* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(c, { size: "sm", children: y.usuario ?? "—" }) }),
|
|
3056
|
+
/* @__PURE__ */ e(m.Td, { children: y.recurso || y.acao ? /* @__PURE__ */ r(c, { size: "xs", ff: "monospace", children: [
|
|
3057
|
+
y.recurso,
|
|
3058
|
+
" · ",
|
|
3059
|
+
y.acao
|
|
3060
|
+
] }) : /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: "—" }) }),
|
|
3061
|
+
/* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: y.detalhe ?? "—" }) }),
|
|
3062
|
+
/* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: y.origem ?? "—" }) })
|
|
3063
|
+
] }, y.id)) })
|
|
3064
|
+
] }) }) }) : null,
|
|
3065
|
+
A > 1 ? /* @__PURE__ */ e(O, { justify: "center", children: /* @__PURE__ */ e(Ia, { value: d, onChange: h, total: A, size: "sm" }) }) : null,
|
|
3066
|
+
a?.afterAuditTrail?.(n)
|
|
3067
|
+
] });
|
|
3068
|
+
}, nt = (a) => {
|
|
3069
|
+
try {
|
|
3070
|
+
return new Date(a).toLocaleString();
|
|
3071
|
+
} catch {
|
|
3072
|
+
return a;
|
|
3073
|
+
}
|
|
3074
|
+
}, lt = () => /* @__PURE__ */ e(
|
|
3075
|
+
Y,
|
|
2951
3076
|
{
|
|
2952
3077
|
"aria-hidden": !0,
|
|
2953
3078
|
style: {
|
|
@@ -2958,67 +3083,69 @@ const Ue = (a) => {
|
|
|
2958
3083
|
borderBottom: "4px solid transparent"
|
|
2959
3084
|
}
|
|
2960
3085
|
}
|
|
2961
|
-
),
|
|
3086
|
+
), Aa = { kind: "OVERVIEW", id: "overview", label: "Panorama" }, Ra = { kind: "SIMULATE", id: "simulate", label: "Simular acesso" }, st = { kind: "AUDIT", id: "audit", label: "Trilha de auditoria" }, St = ({
|
|
2962
3087
|
height: a = "100%",
|
|
2963
3088
|
width: t = "100%",
|
|
2964
|
-
slots:
|
|
2965
|
-
onError:
|
|
3089
|
+
slots: l,
|
|
3090
|
+
onError: n
|
|
2966
3091
|
}) => {
|
|
2967
|
-
const [
|
|
2968
|
-
d((o) => o.kind === w.kind && o.id === w.id ? o : (
|
|
2969
|
-
}, []),
|
|
2970
|
-
|
|
3092
|
+
const [u, d] = S(Aa), [h, A] = S([]), [z, g] = S({}), T = ae((w) => {
|
|
3093
|
+
d((o) => o.kind === w.kind && o.id === w.id ? o : (A((s) => [...s, o]), w)), w.kind === "USER" && g((o) => ({ ...o, userId: w.id, userLabel: w.label })), w.kind === "ACTION" && g((o) => ({ ...o, action: w.label, resource: w.parentLabel }));
|
|
3094
|
+
}, []), R = ae(() => {
|
|
3095
|
+
A((w) => {
|
|
2971
3096
|
const o = w[w.length - 1];
|
|
2972
3097
|
return o ? (d(o), w.slice(0, -1)) : w;
|
|
2973
3098
|
});
|
|
2974
|
-
}, []),
|
|
2975
|
-
(w, o) =>
|
|
2976
|
-
[
|
|
2977
|
-
),
|
|
3099
|
+
}, []), x = ae(
|
|
3100
|
+
(w, o) => T({ kind: "USER", id: w, label: o }),
|
|
3101
|
+
[T]
|
|
3102
|
+
), D = (w) => /* @__PURE__ */ e(
|
|
2978
3103
|
ze,
|
|
2979
3104
|
{
|
|
2980
|
-
onClick: () =>
|
|
2981
|
-
"aria-current":
|
|
3105
|
+
onClick: () => T(w),
|
|
3106
|
+
"aria-current": u.kind === w.kind ? "true" : void 0,
|
|
2982
3107
|
style: {
|
|
2983
3108
|
display: "block",
|
|
2984
3109
|
width: "100%",
|
|
2985
3110
|
padding: "6px 8px",
|
|
2986
3111
|
borderRadius: 5,
|
|
2987
|
-
background:
|
|
3112
|
+
background: u.kind === w.kind ? "var(--mantine-color-blue-light)" : void 0
|
|
2988
3113
|
},
|
|
2989
|
-
children: /* @__PURE__ */ e(
|
|
3114
|
+
children: /* @__PURE__ */ e(c, { size: "sm", fw: u.kind === w.kind ? 600 : 500, children: w.label })
|
|
2990
3115
|
},
|
|
2991
3116
|
w.id
|
|
2992
|
-
),
|
|
2993
|
-
switch (
|
|
3117
|
+
), b = () => {
|
|
3118
|
+
switch (u.kind) {
|
|
2994
3119
|
case "OVERVIEW":
|
|
2995
|
-
return /* @__PURE__ */ e(
|
|
3120
|
+
return /* @__PURE__ */ e(va, { slots: l, onError: n });
|
|
2996
3121
|
case "SIMULATE":
|
|
2997
|
-
return /* @__PURE__ */ e(
|
|
3122
|
+
return /* @__PURE__ */ e(et, { slots: l, onError: n, initial: z });
|
|
3123
|
+
case "AUDIT":
|
|
3124
|
+
return /* @__PURE__ */ e(ot, { slots: l, onError: n });
|
|
2998
3125
|
case "USER":
|
|
2999
|
-
return /* @__PURE__ */ e(
|
|
3126
|
+
return /* @__PURE__ */ e(_r, { slots: l, onError: n, userId: u.id });
|
|
3000
3127
|
case "GROUP":
|
|
3001
|
-
return /* @__PURE__ */ e(
|
|
3128
|
+
return /* @__PURE__ */ e(xa, { id: u.id, kind: "GROUP", slots: l, onSelectUser: x });
|
|
3002
3129
|
case "PROFILE":
|
|
3003
|
-
return /* @__PURE__ */ e(
|
|
3130
|
+
return /* @__PURE__ */ e(xa, { id: u.id, kind: "PROFILE", slots: l, onSelectUser: x });
|
|
3004
3131
|
case "ACTION":
|
|
3005
3132
|
return /* @__PURE__ */ e(
|
|
3006
|
-
|
|
3133
|
+
at,
|
|
3007
3134
|
{
|
|
3008
|
-
id:
|
|
3009
|
-
label:
|
|
3010
|
-
slots:
|
|
3011
|
-
onSelectUser:
|
|
3012
|
-
onSimulate: () =>
|
|
3135
|
+
id: u.id,
|
|
3136
|
+
label: u.parentLabel ? `${u.parentLabel} · ${u.label}` : u.label,
|
|
3137
|
+
slots: l,
|
|
3138
|
+
onSelectUser: x,
|
|
3139
|
+
onSimulate: () => T(Ra)
|
|
3013
3140
|
}
|
|
3014
3141
|
);
|
|
3015
3142
|
case "RESOURCE":
|
|
3016
|
-
return /* @__PURE__ */ r(
|
|
3017
|
-
/* @__PURE__ */ e(
|
|
3018
|
-
/* @__PURE__ */ e(
|
|
3143
|
+
return /* @__PURE__ */ r(U, { gap: "xs", children: [
|
|
3144
|
+
/* @__PURE__ */ e(c, { fw: 620, size: "xl", ff: "monospace", children: u.label }),
|
|
3145
|
+
/* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: "Abra o recurso na árvore para ver as ações. Cada ação responde quem alcança." })
|
|
3019
3146
|
] });
|
|
3020
3147
|
default:
|
|
3021
|
-
return /* @__PURE__ */ e(
|
|
3148
|
+
return /* @__PURE__ */ e(va, { slots: l, onError: n });
|
|
3022
3149
|
}
|
|
3023
3150
|
};
|
|
3024
3151
|
return (
|
|
@@ -3026,7 +3153,7 @@ const Ue = (a) => {
|
|
|
3026
3153
|
// não uma fração de doze, e o `minmax(0, 1fr)` é o que impede uma tabela larga no painel de
|
|
3027
3154
|
// empurrar a árvore para fora da tela.
|
|
3028
3155
|
/* @__PURE__ */ r(
|
|
3029
|
-
|
|
3156
|
+
Y,
|
|
3030
3157
|
{
|
|
3031
3158
|
style: {
|
|
3032
3159
|
width: t,
|
|
@@ -3049,14 +3176,15 @@ const Ue = (a) => {
|
|
|
3049
3176
|
radius: "md",
|
|
3050
3177
|
p: "xs",
|
|
3051
3178
|
style: { display: "flex", flexDirection: "column", minHeight: 0, overflow: "hidden" },
|
|
3052
|
-
children: /* @__PURE__ */ r(
|
|
3053
|
-
|
|
3054
|
-
(w) =>
|
|
3179
|
+
children: /* @__PURE__ */ r(U, { gap: 2, style: { flex: 1, minHeight: 0 }, children: [
|
|
3180
|
+
l?.renderUserSearch ? /* @__PURE__ */ e(Y, { mb: 4, children: l.renderUserSearch(
|
|
3181
|
+
(w) => T({ kind: "USER", id: w, label: w })
|
|
3055
3182
|
) }) : null,
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
/* @__PURE__ */ e(
|
|
3183
|
+
D(Aa),
|
|
3184
|
+
D(Ra),
|
|
3185
|
+
D(st),
|
|
3186
|
+
/* @__PURE__ */ e(Y, { my: 6, style: { borderTop: "1px solid var(--mantine-color-default-border)" } }),
|
|
3187
|
+
/* @__PURE__ */ e(ue, { type: "hover", style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e(tt, { selected: u, onSelect: T }) })
|
|
3060
3188
|
] })
|
|
3061
3189
|
}
|
|
3062
3190
|
),
|
|
@@ -3068,24 +3196,24 @@ const Ue = (a) => {
|
|
|
3068
3196
|
p: "md",
|
|
3069
3197
|
style: { minWidth: 0, minHeight: 0, display: "flex", flexDirection: "column", overflow: "hidden" },
|
|
3070
3198
|
children: [
|
|
3071
|
-
|
|
3199
|
+
h.length > 0 ? /* @__PURE__ */ r(O, { gap: 6, mb: "xs", style: { flexShrink: 0 }, children: [
|
|
3072
3200
|
/* @__PURE__ */ e(
|
|
3073
3201
|
X,
|
|
3074
3202
|
{
|
|
3075
3203
|
size: "compact-sm",
|
|
3076
3204
|
variant: "subtle",
|
|
3077
|
-
onClick:
|
|
3078
|
-
leftSection: /* @__PURE__ */ e(
|
|
3205
|
+
onClick: R,
|
|
3206
|
+
leftSection: /* @__PURE__ */ e(lt, {}),
|
|
3079
3207
|
"aria-label": "Voltar para o item anterior",
|
|
3080
3208
|
children: "Voltar"
|
|
3081
3209
|
}
|
|
3082
3210
|
),
|
|
3083
|
-
/* @__PURE__ */ r(
|
|
3211
|
+
/* @__PURE__ */ r(c, { size: "xs", c: "dimmed", truncate: !0, children: [
|
|
3084
3212
|
"para ",
|
|
3085
|
-
|
|
3213
|
+
h[h.length - 1]?.label
|
|
3086
3214
|
] })
|
|
3087
3215
|
] }) : null,
|
|
3088
|
-
/* @__PURE__ */ e(
|
|
3216
|
+
/* @__PURE__ */ e(Y, { style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "column" }, children: b() })
|
|
3089
3217
|
]
|
|
3090
3218
|
}
|
|
3091
3219
|
)
|
|
@@ -3095,29 +3223,29 @@ const Ue = (a) => {
|
|
|
3095
3223
|
);
|
|
3096
3224
|
};
|
|
3097
3225
|
export {
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3226
|
+
at as ActionNodePanel,
|
|
3227
|
+
Dr as ApiTokenModal,
|
|
3228
|
+
wt as ArchbaseApiTokenView,
|
|
3229
|
+
Rr as ArchbaseDualListSelector,
|
|
3230
|
+
St as ArchbaseSecurityDiagnosticsView,
|
|
3231
|
+
Tt as ArchbaseSecurityView,
|
|
3232
|
+
Hr as AttributeList,
|
|
3233
|
+
_r as EffectiveAccessPanel,
|
|
3234
|
+
Br as FlagStrip,
|
|
3235
|
+
Er as GroupModal,
|
|
3236
|
+
xa as GroupNodePanel,
|
|
3237
|
+
Ur as MetricCard,
|
|
3238
|
+
Gr as MetricCards,
|
|
3111
3239
|
Wr as OverviewItemsDrawer,
|
|
3112
|
-
|
|
3240
|
+
va as OverviewPanel,
|
|
3113
3241
|
Xe as PermissionsSelectorModal,
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3242
|
+
Ar as ProfileModal,
|
|
3243
|
+
zr as RenderProfileUserItem,
|
|
3244
|
+
pe as Section,
|
|
3245
|
+
tt as SecurityTree,
|
|
3246
|
+
et as SimulationPanel,
|
|
3247
|
+
ke as TabelaRolavel,
|
|
3248
|
+
kr as UserModal,
|
|
3249
|
+
Ge as severityColor,
|
|
3250
|
+
Oa as situacaoBadge
|
|
3123
3251
|
};
|