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