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