@devtable/settings-form 5.5.0 → 5.6.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/api-caller/api-key.d.ts +4 -1
- package/dist/api-caller/api-key.typed.d.ts +2 -1
- package/dist/api-caller/index.d.ts +4 -1
- package/dist/api-caller/request.d.ts +7 -1
- package/dist/global.d.ts +2 -1
- package/dist/settings-form.es.js +575 -532
- package/dist/settings-form.umd.js +9 -9
- package/package.json +3 -1
package/dist/settings-form.es.js
CHANGED
|
@@ -1,41 +1,82 @@
|
|
|
1
|
-
import { Modal as
|
|
2
|
-
import { showNotification as M, updateNotification as
|
|
3
|
-
import
|
|
4
|
-
import { useForm as ee, Controller as
|
|
1
|
+
import { Modal as se, Button as x, Box as L, SegmentedControl as qr, TextInput as I, Divider as er, Group as j, NumberInput as Lr, PasswordInput as ce, Text as oe, LoadingOverlay as Re, Table as Pe, Stack as rr, Select as Nr, Switch as Ur } from "@mantine/core";
|
|
2
|
+
import { showNotification as M, updateNotification as z } from "@mantine/notifications";
|
|
3
|
+
import J, { forwardRef as tr, useMemo as nr } from "react";
|
|
4
|
+
import { useForm as ee, Controller as E } from "react-hook-form";
|
|
5
5
|
import { PlaylistAdd as Ee, Trash as Ce, Edit as Mr } from "tabler-icons-react";
|
|
6
6
|
import $r from "axios";
|
|
7
|
+
import Wr from "crypto-js";
|
|
7
8
|
import { useRequest as G } from "ahooks";
|
|
8
|
-
import { useModals as
|
|
9
|
+
import { useModals as le, closeAllModals as Vr } from "@mantine/modals";
|
|
10
|
+
function Yr(t) {
|
|
11
|
+
t = t || {};
|
|
12
|
+
const n = Object.keys(t).sort(), s = [];
|
|
13
|
+
for (let c = 0; c < n.length; c++) {
|
|
14
|
+
const u = n[c];
|
|
15
|
+
if (u != "authentication" && t[u])
|
|
16
|
+
s.push(n[c] + "=" + (typeof t[u] == "object" ? JSON.stringify(t[u]) : t[u]));
|
|
17
|
+
else {
|
|
18
|
+
const i = Object.keys(t[u]).sort();
|
|
19
|
+
for (let l = 0; l < i.length; l++) {
|
|
20
|
+
const d = i[l];
|
|
21
|
+
d != "sign" && t[u][d] && s.push(
|
|
22
|
+
i[l] + "=" + (typeof t[u][d] == "object" ? JSON.stringify(t[u][d]) : t[u][d])
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return s.sort().join("&");
|
|
28
|
+
}
|
|
29
|
+
function Kr(t, n) {
|
|
30
|
+
let s = Yr(t);
|
|
31
|
+
return s += "&key=" + n, Wr.MD5(s).toString().toUpperCase();
|
|
32
|
+
}
|
|
9
33
|
const C = {
|
|
10
34
|
baseURL: "http://localhost:31200",
|
|
11
|
-
|
|
35
|
+
app_id: "",
|
|
36
|
+
app_secret: "",
|
|
37
|
+
getAuthentication(t) {
|
|
38
|
+
if (!this.app_id || !this.app_secret)
|
|
39
|
+
return;
|
|
40
|
+
const n = new Date().getTime().toString();
|
|
41
|
+
return {
|
|
42
|
+
app_id: this.app_id,
|
|
43
|
+
nonce_str: n,
|
|
44
|
+
sign: Kr(
|
|
45
|
+
{
|
|
46
|
+
app_id: this.app_id,
|
|
47
|
+
nonce_str: n,
|
|
48
|
+
...t
|
|
49
|
+
},
|
|
50
|
+
this.app_secret
|
|
51
|
+
)
|
|
52
|
+
};
|
|
53
|
+
},
|
|
12
54
|
getRequest(t) {
|
|
13
|
-
return (
|
|
55
|
+
return (n, s, c = {}) => {
|
|
14
56
|
const u = window.localStorage.getItem("token"), i = {
|
|
15
57
|
"X-Requested-With": "XMLHttpRequest",
|
|
16
58
|
"Content-Type": c.string ? "application/x-www-form-urlencoded" : "application/json",
|
|
17
59
|
authorization: u ? `bearer ${u}` : "",
|
|
18
|
-
"x-api-key": this.apiKey,
|
|
19
60
|
...c.headers
|
|
20
61
|
}, l = {
|
|
21
62
|
baseURL: this.baseURL,
|
|
22
63
|
method: t,
|
|
23
|
-
url:
|
|
64
|
+
url: n,
|
|
24
65
|
params: t === "GET" ? s : c.params,
|
|
25
66
|
headers: i
|
|
26
67
|
};
|
|
27
|
-
return ["POST", "PUT"].includes(t) && (l.data = c.string ? JSON.stringify(s) : s), $r(l).then((
|
|
68
|
+
return ["POST", "PUT"].includes(t) && (l.data = c.string ? JSON.stringify(s) : s, l.data.authentication = this.getAuthentication(l.data)), $r(l).then((d) => d.data).catch((d) => Promise.reject(d));
|
|
28
69
|
};
|
|
29
70
|
}
|
|
30
71
|
};
|
|
31
|
-
function
|
|
32
|
-
C.baseURL !== t.apiBaseURL && (C.baseURL = t.apiBaseURL), t.
|
|
72
|
+
function ue(t) {
|
|
73
|
+
C.baseURL !== t.apiBaseURL && (C.baseURL = t.apiBaseURL), t.app_id && (C.app_id = t.app_id), t.app_secret && (C.app_secret = t.app_secret);
|
|
33
74
|
}
|
|
34
|
-
const
|
|
35
|
-
login: async (t,
|
|
75
|
+
const Br = {
|
|
76
|
+
login: async (t, n) => {
|
|
36
77
|
const s = {
|
|
37
78
|
name: t,
|
|
38
|
-
password:
|
|
79
|
+
password: n
|
|
39
80
|
};
|
|
40
81
|
return await C.getRequest("POST")("/account/login", s);
|
|
41
82
|
},
|
|
@@ -53,23 +94,23 @@ const Kr = {
|
|
|
53
94
|
}
|
|
54
95
|
}),
|
|
55
96
|
get: async () => await C.getRequest("GET")("/account/get", {}),
|
|
56
|
-
update: async (t,
|
|
97
|
+
update: async (t, n) => {
|
|
57
98
|
const s = {
|
|
58
99
|
name: t,
|
|
59
|
-
email:
|
|
100
|
+
email: n
|
|
60
101
|
};
|
|
61
102
|
return await C.getRequest("PUT")("/account/update", s);
|
|
62
103
|
},
|
|
63
|
-
changepassword: async (t,
|
|
104
|
+
changepassword: async (t, n) => {
|
|
64
105
|
const s = {
|
|
65
106
|
old_password: t,
|
|
66
|
-
new_password:
|
|
107
|
+
new_password: n
|
|
67
108
|
};
|
|
68
109
|
return await C.getRequest("POST")("/account/changepassword", s);
|
|
69
110
|
},
|
|
70
|
-
create: async (t,
|
|
111
|
+
create: async (t, n, s, c) => await C.getRequest("POST")("/account/create", {
|
|
71
112
|
name: t,
|
|
72
|
-
email:
|
|
113
|
+
email: n,
|
|
73
114
|
password: s,
|
|
74
115
|
role_id: c
|
|
75
116
|
}),
|
|
@@ -78,7 +119,7 @@ const Kr = {
|
|
|
78
119
|
if (!!t)
|
|
79
120
|
return C.getRequest("POST")("/account/delete", { id: t });
|
|
80
121
|
}
|
|
81
|
-
},
|
|
122
|
+
}, Gr = {
|
|
82
123
|
list: async () => await C.getRequest("POST")("/api/key/list", {
|
|
83
124
|
filter: {
|
|
84
125
|
search: ""
|
|
@@ -92,16 +133,15 @@ const Kr = {
|
|
|
92
133
|
pagesize: 100
|
|
93
134
|
}
|
|
94
135
|
}),
|
|
95
|
-
create: async (t,
|
|
136
|
+
create: async (t, n) => C.getRequest("POST")("/api/key/create", {
|
|
96
137
|
name: t,
|
|
97
|
-
role_id:
|
|
98
|
-
domain: s
|
|
138
|
+
role_id: n
|
|
99
139
|
}),
|
|
100
140
|
delete: async (t) => {
|
|
101
141
|
if (!!t)
|
|
102
142
|
return C.getRequest("POST")("/api/key/delete", { id: t });
|
|
103
143
|
}
|
|
104
|
-
},
|
|
144
|
+
}, Jr = {
|
|
105
145
|
list: async () => await C.getRequest("POST")("/datasource/list", {
|
|
106
146
|
filter: {},
|
|
107
147
|
sort: {
|
|
@@ -113,9 +153,9 @@ const Kr = {
|
|
|
113
153
|
pagesize: 100
|
|
114
154
|
}
|
|
115
155
|
}),
|
|
116
|
-
create: async (t,
|
|
156
|
+
create: async (t, n, s) => {
|
|
117
157
|
try {
|
|
118
|
-
return await C.getRequest("POST")("/datasource/create", { type: t, key:
|
|
158
|
+
return await C.getRequest("POST")("/datasource/create", { type: t, key: n, config: s });
|
|
119
159
|
} catch (c) {
|
|
120
160
|
return console.error(c), !1;
|
|
121
161
|
}
|
|
@@ -123,21 +163,21 @@ const Kr = {
|
|
|
123
163
|
delete: async (t) => {
|
|
124
164
|
await C.getRequest("POST")("/datasource/delete", { id: t });
|
|
125
165
|
}
|
|
126
|
-
},
|
|
166
|
+
}, Hr = {
|
|
127
167
|
list: async () => await C.getRequest("GET")("/role/list", {})
|
|
128
|
-
},
|
|
129
|
-
datasource:
|
|
130
|
-
account:
|
|
131
|
-
role:
|
|
132
|
-
api_key:
|
|
133
|
-
},
|
|
168
|
+
}, D = {
|
|
169
|
+
datasource: Jr,
|
|
170
|
+
account: Br,
|
|
171
|
+
role: Hr,
|
|
172
|
+
api_key: Gr
|
|
173
|
+
}, de = {
|
|
134
174
|
size: "sm",
|
|
135
175
|
spacing: "md",
|
|
136
176
|
button: {
|
|
137
177
|
size: "xs"
|
|
138
178
|
}
|
|
139
179
|
};
|
|
140
|
-
var
|
|
180
|
+
var fe = { exports: {} }, Q = {};
|
|
141
181
|
/**
|
|
142
182
|
* @license React
|
|
143
183
|
* react-jsx-runtime.production.min.js
|
|
@@ -148,20 +188,20 @@ var de = { exports: {} }, Q = {};
|
|
|
148
188
|
* LICENSE file in the root directory of this source tree.
|
|
149
189
|
*/
|
|
150
190
|
var Qe;
|
|
151
|
-
function
|
|
191
|
+
function Xr() {
|
|
152
192
|
if (Qe)
|
|
153
193
|
return Q;
|
|
154
194
|
Qe = 1;
|
|
155
|
-
var t =
|
|
156
|
-
function l(
|
|
157
|
-
var
|
|
158
|
-
|
|
159
|
-
for (
|
|
160
|
-
c.call(
|
|
161
|
-
if (
|
|
162
|
-
for (
|
|
163
|
-
|
|
164
|
-
return { $$typeof:
|
|
195
|
+
var t = J, n = Symbol.for("react.element"), s = Symbol.for("react.fragment"), c = Object.prototype.hasOwnProperty, u = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
196
|
+
function l(d, h, y) {
|
|
197
|
+
var _, v = {}, f = null, O = null;
|
|
198
|
+
y !== void 0 && (f = "" + y), h.key !== void 0 && (f = "" + h.key), h.ref !== void 0 && (O = h.ref);
|
|
199
|
+
for (_ in h)
|
|
200
|
+
c.call(h, _) && !i.hasOwnProperty(_) && (v[_] = h[_]);
|
|
201
|
+
if (d && d.defaultProps)
|
|
202
|
+
for (_ in h = d.defaultProps, h)
|
|
203
|
+
v[_] === void 0 && (v[_] = h[_]);
|
|
204
|
+
return { $$typeof: n, type: d, key: f, ref: O, props: v, _owner: u.current };
|
|
165
205
|
}
|
|
166
206
|
return Q.Fragment = s, Q.jsx = l, Q.jsxs = l, Q;
|
|
167
207
|
}
|
|
@@ -176,46 +216,46 @@ var Z = {};
|
|
|
176
216
|
* LICENSE file in the root directory of this source tree.
|
|
177
217
|
*/
|
|
178
218
|
var Ze;
|
|
179
|
-
function
|
|
219
|
+
function Qr() {
|
|
180
220
|
return Ze || (Ze = 1, process.env.NODE_ENV !== "production" && function() {
|
|
181
|
-
var t =
|
|
182
|
-
function
|
|
221
|
+
var t = J, n = Symbol.for("react.element"), s = Symbol.for("react.portal"), c = Symbol.for("react.fragment"), u = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), l = Symbol.for("react.provider"), d = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), _ = Symbol.for("react.suspense_list"), v = Symbol.for("react.memo"), f = Symbol.for("react.lazy"), O = Symbol.for("react.offscreen"), N = Symbol.iterator, V = "@@iterator";
|
|
222
|
+
function ge(e) {
|
|
183
223
|
if (e === null || typeof e != "object")
|
|
184
224
|
return null;
|
|
185
|
-
var
|
|
186
|
-
return typeof
|
|
225
|
+
var a = N && e[N] || e[V];
|
|
226
|
+
return typeof a == "function" ? a : null;
|
|
187
227
|
}
|
|
188
228
|
var U = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
189
229
|
function T(e) {
|
|
190
230
|
{
|
|
191
|
-
for (var
|
|
231
|
+
for (var a = arguments.length, o = new Array(a > 1 ? a - 1 : 0), p = 1; p < a; p++)
|
|
192
232
|
o[p - 1] = arguments[p];
|
|
193
233
|
ar("error", e, o);
|
|
194
234
|
}
|
|
195
235
|
}
|
|
196
|
-
function ar(e,
|
|
236
|
+
function ar(e, a, o) {
|
|
197
237
|
{
|
|
198
238
|
var p = U.ReactDebugCurrentFrame, b = p.getStackAddendum();
|
|
199
|
-
b !== "" && (
|
|
239
|
+
b !== "" && (a += "%s", o = o.concat([b]));
|
|
200
240
|
var S = o.map(function(m) {
|
|
201
241
|
return String(m);
|
|
202
242
|
});
|
|
203
|
-
S.unshift("Warning: " +
|
|
243
|
+
S.unshift("Warning: " + a), Function.prototype.apply.call(console[e], console, S);
|
|
204
244
|
}
|
|
205
245
|
}
|
|
206
|
-
var ir = !1, or = !1, sr = !1, cr = !1, lr = !1,
|
|
207
|
-
|
|
246
|
+
var ir = !1, or = !1, sr = !1, cr = !1, lr = !1, Ae;
|
|
247
|
+
Ae = Symbol.for("react.module.reference");
|
|
208
248
|
function ur(e) {
|
|
209
|
-
return !!(typeof e == "string" || typeof e == "function" || e === c || e === i || lr || e === u || e ===
|
|
249
|
+
return !!(typeof e == "string" || typeof e == "function" || e === c || e === i || lr || e === u || e === y || e === _ || cr || e === O || ir || or || sr || typeof e == "object" && e !== null && (e.$$typeof === f || e.$$typeof === v || e.$$typeof === l || e.$$typeof === d || e.$$typeof === h || e.$$typeof === Ae || e.getModuleId !== void 0));
|
|
210
250
|
}
|
|
211
|
-
function dr(e,
|
|
251
|
+
function dr(e, a, o) {
|
|
212
252
|
var p = e.displayName;
|
|
213
253
|
if (p)
|
|
214
254
|
return p;
|
|
215
|
-
var b =
|
|
255
|
+
var b = a.displayName || a.name || "";
|
|
216
256
|
return b !== "" ? o + "(" + b + ")" : o;
|
|
217
257
|
}
|
|
218
|
-
function
|
|
258
|
+
function ze(e) {
|
|
219
259
|
return e.displayName || "Context";
|
|
220
260
|
}
|
|
221
261
|
function F(e) {
|
|
@@ -234,25 +274,25 @@ function Hr() {
|
|
|
234
274
|
return "Profiler";
|
|
235
275
|
case u:
|
|
236
276
|
return "StrictMode";
|
|
237
|
-
case R:
|
|
238
|
-
return "Suspense";
|
|
239
277
|
case y:
|
|
278
|
+
return "Suspense";
|
|
279
|
+
case _:
|
|
240
280
|
return "SuspenseList";
|
|
241
281
|
}
|
|
242
282
|
if (typeof e == "object")
|
|
243
283
|
switch (e.$$typeof) {
|
|
244
|
-
case
|
|
245
|
-
var
|
|
246
|
-
return
|
|
284
|
+
case d:
|
|
285
|
+
var a = e;
|
|
286
|
+
return ze(a) + ".Consumer";
|
|
247
287
|
case l:
|
|
248
288
|
var o = e;
|
|
249
|
-
return
|
|
250
|
-
case v:
|
|
251
|
-
return dr(e, e.render, "ForwardRef");
|
|
289
|
+
return ze(o._context) + ".Provider";
|
|
252
290
|
case h:
|
|
291
|
+
return dr(e, e.render, "ForwardRef");
|
|
292
|
+
case v:
|
|
253
293
|
var p = e.displayName || null;
|
|
254
294
|
return p !== null ? p : F(e.type) || "Memo";
|
|
255
|
-
case
|
|
295
|
+
case f: {
|
|
256
296
|
var b = e, S = b._payload, m = b._init;
|
|
257
297
|
try {
|
|
258
298
|
return F(m(S));
|
|
@@ -263,14 +303,14 @@ function Hr() {
|
|
|
263
303
|
}
|
|
264
304
|
return null;
|
|
265
305
|
}
|
|
266
|
-
var
|
|
306
|
+
var Y = Object.assign, H = 0, Oe, De, xe, ke, Ie, je, Fe;
|
|
267
307
|
function qe() {
|
|
268
308
|
}
|
|
269
309
|
qe.__reactDisabledLog = !0;
|
|
270
310
|
function fr() {
|
|
271
311
|
{
|
|
272
|
-
if (
|
|
273
|
-
Oe = console.log,
|
|
312
|
+
if (H === 0) {
|
|
313
|
+
Oe = console.log, De = console.info, xe = console.warn, ke = console.error, Ie = console.group, je = console.groupCollapsed, Fe = console.groupEnd;
|
|
274
314
|
var e = {
|
|
275
315
|
configurable: !0,
|
|
276
316
|
enumerable: !0,
|
|
@@ -287,65 +327,65 @@ function Hr() {
|
|
|
287
327
|
groupEnd: e
|
|
288
328
|
});
|
|
289
329
|
}
|
|
290
|
-
|
|
330
|
+
H++;
|
|
291
331
|
}
|
|
292
332
|
}
|
|
293
333
|
function pr() {
|
|
294
334
|
{
|
|
295
|
-
if (
|
|
335
|
+
if (H--, H === 0) {
|
|
296
336
|
var e = {
|
|
297
337
|
configurable: !0,
|
|
298
338
|
enumerable: !0,
|
|
299
339
|
writable: !0
|
|
300
340
|
};
|
|
301
341
|
Object.defineProperties(console, {
|
|
302
|
-
log:
|
|
342
|
+
log: Y({}, e, {
|
|
303
343
|
value: Oe
|
|
304
344
|
}),
|
|
305
|
-
info:
|
|
306
|
-
value: xe
|
|
307
|
-
}),
|
|
308
|
-
warn: V({}, e, {
|
|
345
|
+
info: Y({}, e, {
|
|
309
346
|
value: De
|
|
310
347
|
}),
|
|
311
|
-
|
|
348
|
+
warn: Y({}, e, {
|
|
349
|
+
value: xe
|
|
350
|
+
}),
|
|
351
|
+
error: Y({}, e, {
|
|
312
352
|
value: ke
|
|
313
353
|
}),
|
|
314
|
-
group:
|
|
354
|
+
group: Y({}, e, {
|
|
315
355
|
value: Ie
|
|
316
356
|
}),
|
|
317
|
-
groupCollapsed:
|
|
357
|
+
groupCollapsed: Y({}, e, {
|
|
318
358
|
value: je
|
|
319
359
|
}),
|
|
320
|
-
groupEnd:
|
|
360
|
+
groupEnd: Y({}, e, {
|
|
321
361
|
value: Fe
|
|
322
362
|
})
|
|
323
363
|
});
|
|
324
364
|
}
|
|
325
|
-
|
|
365
|
+
H < 0 && T("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
326
366
|
}
|
|
327
367
|
}
|
|
328
|
-
var
|
|
329
|
-
function re(e,
|
|
368
|
+
var me = U.ReactCurrentDispatcher, he;
|
|
369
|
+
function re(e, a, o) {
|
|
330
370
|
{
|
|
331
|
-
if (
|
|
371
|
+
if (he === void 0)
|
|
332
372
|
try {
|
|
333
373
|
throw Error();
|
|
334
374
|
} catch (b) {
|
|
335
375
|
var p = b.stack.trim().match(/\n( *(at )?)/);
|
|
336
|
-
|
|
376
|
+
he = p && p[1] || "";
|
|
337
377
|
}
|
|
338
378
|
return `
|
|
339
|
-
` +
|
|
379
|
+
` + he + e;
|
|
340
380
|
}
|
|
341
381
|
}
|
|
342
|
-
var
|
|
382
|
+
var ve = !1, te;
|
|
343
383
|
{
|
|
344
384
|
var gr = typeof WeakMap == "function" ? WeakMap : Map;
|
|
345
385
|
te = new gr();
|
|
346
386
|
}
|
|
347
|
-
function Le(e,
|
|
348
|
-
if (!e ||
|
|
387
|
+
function Le(e, a) {
|
|
388
|
+
if (!e || ve)
|
|
349
389
|
return "";
|
|
350
390
|
{
|
|
351
391
|
var o = te.get(e);
|
|
@@ -353,13 +393,13 @@ function Hr() {
|
|
|
353
393
|
return o;
|
|
354
394
|
}
|
|
355
395
|
var p;
|
|
356
|
-
|
|
396
|
+
ve = !0;
|
|
357
397
|
var b = Error.prepareStackTrace;
|
|
358
398
|
Error.prepareStackTrace = void 0;
|
|
359
399
|
var S;
|
|
360
|
-
S =
|
|
400
|
+
S = me.current, me.current = null, fr();
|
|
361
401
|
try {
|
|
362
|
-
if (
|
|
402
|
+
if (a) {
|
|
363
403
|
var m = function() {
|
|
364
404
|
throw Error();
|
|
365
405
|
};
|
|
@@ -393,36 +433,36 @@ function Hr() {
|
|
|
393
433
|
} catch (q) {
|
|
394
434
|
if (q && p && typeof q.stack == "string") {
|
|
395
435
|
for (var g = q.stack.split(`
|
|
396
|
-
`),
|
|
397
|
-
`),
|
|
398
|
-
|
|
399
|
-
for (;
|
|
400
|
-
if (g[
|
|
401
|
-
if (
|
|
436
|
+
`), A = p.stack.split(`
|
|
437
|
+
`), R = g.length - 1, P = A.length - 1; R >= 1 && P >= 0 && g[R] !== A[P]; )
|
|
438
|
+
P--;
|
|
439
|
+
for (; R >= 1 && P >= 0; R--, P--)
|
|
440
|
+
if (g[R] !== A[P]) {
|
|
441
|
+
if (R !== 1 || P !== 1)
|
|
402
442
|
do
|
|
403
|
-
if (
|
|
443
|
+
if (R--, P--, P < 0 || g[R] !== A[P]) {
|
|
404
444
|
var k = `
|
|
405
|
-
` + g[
|
|
445
|
+
` + g[R].replace(" at new ", " at ");
|
|
406
446
|
return e.displayName && k.includes("<anonymous>") && (k = k.replace("<anonymous>", e.displayName)), typeof e == "function" && te.set(e, k), k;
|
|
407
447
|
}
|
|
408
|
-
while (
|
|
448
|
+
while (R >= 1 && P >= 0);
|
|
409
449
|
break;
|
|
410
450
|
}
|
|
411
451
|
}
|
|
412
452
|
} finally {
|
|
413
|
-
|
|
453
|
+
ve = !1, me.current = S, pr(), Error.prepareStackTrace = b;
|
|
414
454
|
}
|
|
415
455
|
var B = e ? e.displayName || e.name : "", Xe = B ? re(B) : "";
|
|
416
456
|
return typeof e == "function" && te.set(e, Xe), Xe;
|
|
417
457
|
}
|
|
418
|
-
function mr(e,
|
|
458
|
+
function mr(e, a, o) {
|
|
419
459
|
return Le(e, !1);
|
|
420
460
|
}
|
|
421
461
|
function hr(e) {
|
|
422
|
-
var
|
|
423
|
-
return !!(
|
|
462
|
+
var a = e.prototype;
|
|
463
|
+
return !!(a && a.isReactComponent);
|
|
424
464
|
}
|
|
425
|
-
function ne(e,
|
|
465
|
+
function ne(e, a, o) {
|
|
426
466
|
if (e == null)
|
|
427
467
|
return "";
|
|
428
468
|
if (typeof e == "function")
|
|
@@ -430,21 +470,21 @@ function Hr() {
|
|
|
430
470
|
if (typeof e == "string")
|
|
431
471
|
return re(e);
|
|
432
472
|
switch (e) {
|
|
433
|
-
case R:
|
|
434
|
-
return re("Suspense");
|
|
435
473
|
case y:
|
|
474
|
+
return re("Suspense");
|
|
475
|
+
case _:
|
|
436
476
|
return re("SuspenseList");
|
|
437
477
|
}
|
|
438
478
|
if (typeof e == "object")
|
|
439
479
|
switch (e.$$typeof) {
|
|
440
|
-
case v:
|
|
441
|
-
return mr(e.render);
|
|
442
480
|
case h:
|
|
443
|
-
return
|
|
444
|
-
case
|
|
481
|
+
return mr(e.render);
|
|
482
|
+
case v:
|
|
483
|
+
return ne(e.type, a, o);
|
|
484
|
+
case f: {
|
|
445
485
|
var p = e, b = p._payload, S = p._init;
|
|
446
486
|
try {
|
|
447
|
-
return ne(S(b),
|
|
487
|
+
return ne(S(b), a, o);
|
|
448
488
|
} catch {
|
|
449
489
|
}
|
|
450
490
|
}
|
|
@@ -454,12 +494,12 @@ function Hr() {
|
|
|
454
494
|
var ae = Object.prototype.hasOwnProperty, Ne = {}, Ue = U.ReactDebugCurrentFrame;
|
|
455
495
|
function ie(e) {
|
|
456
496
|
if (e) {
|
|
457
|
-
var
|
|
497
|
+
var a = e._owner, o = ne(e.type, e._source, a ? a.type : null);
|
|
458
498
|
Ue.setExtraStackFrame(o);
|
|
459
499
|
} else
|
|
460
500
|
Ue.setExtraStackFrame(null);
|
|
461
501
|
}
|
|
462
|
-
function vr(e,
|
|
502
|
+
function vr(e, a, o, p, b) {
|
|
463
503
|
{
|
|
464
504
|
var S = Function.call.bind(ae);
|
|
465
505
|
for (var m in e)
|
|
@@ -467,24 +507,24 @@ function Hr() {
|
|
|
467
507
|
var g = void 0;
|
|
468
508
|
try {
|
|
469
509
|
if (typeof e[m] != "function") {
|
|
470
|
-
var
|
|
471
|
-
throw
|
|
510
|
+
var A = Error((p || "React class") + ": " + o + " type `" + m + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[m] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
511
|
+
throw A.name = "Invariant Violation", A;
|
|
472
512
|
}
|
|
473
|
-
g = e[m](
|
|
474
|
-
} catch (
|
|
475
|
-
g =
|
|
513
|
+
g = e[m](a, m, p, o, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
514
|
+
} catch (R) {
|
|
515
|
+
g = R;
|
|
476
516
|
}
|
|
477
517
|
g && !(g instanceof Error) && (ie(b), T("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", p || "React class", o, m, typeof g), ie(null)), g instanceof Error && !(g.message in Ne) && (Ne[g.message] = !0, ie(b), T("Failed %s type: %s", o, g.message), ie(null));
|
|
478
518
|
}
|
|
479
519
|
}
|
|
480
520
|
}
|
|
481
521
|
var br = Array.isArray;
|
|
482
|
-
function
|
|
522
|
+
function be(e) {
|
|
483
523
|
return br(e);
|
|
484
524
|
}
|
|
485
525
|
function wr(e) {
|
|
486
526
|
{
|
|
487
|
-
var
|
|
527
|
+
var a = typeof Symbol == "function" && Symbol.toStringTag, o = a && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
488
528
|
return o;
|
|
489
529
|
}
|
|
490
530
|
}
|
|
@@ -502,39 +542,39 @@ function Hr() {
|
|
|
502
542
|
if (Sr(e))
|
|
503
543
|
return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", wr(e)), Me(e);
|
|
504
544
|
}
|
|
505
|
-
var X = U.ReactCurrentOwner,
|
|
545
|
+
var X = U.ReactCurrentOwner, _r = {
|
|
506
546
|
key: !0,
|
|
507
547
|
ref: !0,
|
|
508
548
|
__self: !0,
|
|
509
549
|
__source: !0
|
|
510
|
-
}, We,
|
|
511
|
-
|
|
550
|
+
}, We, Ve, we;
|
|
551
|
+
we = {};
|
|
512
552
|
function yr(e) {
|
|
513
553
|
if (ae.call(e, "ref")) {
|
|
514
|
-
var
|
|
515
|
-
if (
|
|
554
|
+
var a = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
555
|
+
if (a && a.isReactWarning)
|
|
516
556
|
return !1;
|
|
517
557
|
}
|
|
518
558
|
return e.ref !== void 0;
|
|
519
559
|
}
|
|
520
|
-
function
|
|
560
|
+
function Rr(e) {
|
|
521
561
|
if (ae.call(e, "key")) {
|
|
522
|
-
var
|
|
523
|
-
if (
|
|
562
|
+
var a = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
563
|
+
if (a && a.isReactWarning)
|
|
524
564
|
return !1;
|
|
525
565
|
}
|
|
526
566
|
return e.key !== void 0;
|
|
527
567
|
}
|
|
528
|
-
function Pr(e,
|
|
529
|
-
if (typeof e.ref == "string" && X.current &&
|
|
568
|
+
function Pr(e, a) {
|
|
569
|
+
if (typeof e.ref == "string" && X.current && a && X.current.stateNode !== a) {
|
|
530
570
|
var o = F(X.current.type);
|
|
531
|
-
|
|
571
|
+
we[o] || (T('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', F(X.current.type), e.ref), we[o] = !0);
|
|
532
572
|
}
|
|
533
573
|
}
|
|
534
|
-
function Er(e,
|
|
574
|
+
function Er(e, a) {
|
|
535
575
|
{
|
|
536
576
|
var o = function() {
|
|
537
|
-
We || (We = !0, T("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",
|
|
577
|
+
We || (We = !0, T("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", a));
|
|
538
578
|
};
|
|
539
579
|
o.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
540
580
|
get: o,
|
|
@@ -542,10 +582,10 @@ function Hr() {
|
|
|
542
582
|
});
|
|
543
583
|
}
|
|
544
584
|
}
|
|
545
|
-
function Cr(e,
|
|
585
|
+
function Cr(e, a) {
|
|
546
586
|
{
|
|
547
587
|
var o = function() {
|
|
548
|
-
|
|
588
|
+
Ve || (Ve = !0, T("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", a));
|
|
549
589
|
};
|
|
550
590
|
o.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
551
591
|
get: o,
|
|
@@ -553,11 +593,11 @@ function Hr() {
|
|
|
553
593
|
});
|
|
554
594
|
}
|
|
555
595
|
}
|
|
556
|
-
var Tr = function(e,
|
|
596
|
+
var Tr = function(e, a, o, p, b, S, m) {
|
|
557
597
|
var g = {
|
|
558
|
-
$$typeof:
|
|
598
|
+
$$typeof: n,
|
|
559
599
|
type: e,
|
|
560
|
-
key:
|
|
600
|
+
key: a,
|
|
561
601
|
ref: o,
|
|
562
602
|
props: m,
|
|
563
603
|
_owner: S
|
|
@@ -579,41 +619,41 @@ function Hr() {
|
|
|
579
619
|
value: b
|
|
580
620
|
}), Object.freeze && (Object.freeze(g.props), Object.freeze(g)), g;
|
|
581
621
|
};
|
|
582
|
-
function
|
|
622
|
+
function Ar(e, a, o, p, b) {
|
|
583
623
|
{
|
|
584
|
-
var S, m = {}, g = null,
|
|
585
|
-
o !== void 0 && ($e(o), g = "" + o),
|
|
586
|
-
for (S in
|
|
587
|
-
ae.call(
|
|
624
|
+
var S, m = {}, g = null, A = null;
|
|
625
|
+
o !== void 0 && ($e(o), g = "" + o), Rr(a) && ($e(a.key), g = "" + a.key), yr(a) && (A = a.ref, Pr(a, b));
|
|
626
|
+
for (S in a)
|
|
627
|
+
ae.call(a, S) && !_r.hasOwnProperty(S) && (m[S] = a[S]);
|
|
588
628
|
if (e && e.defaultProps) {
|
|
589
|
-
var
|
|
590
|
-
for (S in
|
|
591
|
-
m[S] === void 0 && (m[S] =
|
|
629
|
+
var R = e.defaultProps;
|
|
630
|
+
for (S in R)
|
|
631
|
+
m[S] === void 0 && (m[S] = R[S]);
|
|
592
632
|
}
|
|
593
|
-
if (g ||
|
|
594
|
-
var
|
|
595
|
-
g && Er(m,
|
|
633
|
+
if (g || A) {
|
|
634
|
+
var P = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
635
|
+
g && Er(m, P), A && Cr(m, P);
|
|
596
636
|
}
|
|
597
|
-
return Tr(e, g,
|
|
637
|
+
return Tr(e, g, A, b, p, X.current, m);
|
|
598
638
|
}
|
|
599
639
|
}
|
|
600
|
-
var
|
|
601
|
-
function
|
|
640
|
+
var Se = U.ReactCurrentOwner, Ye = U.ReactDebugCurrentFrame;
|
|
641
|
+
function K(e) {
|
|
602
642
|
if (e) {
|
|
603
|
-
var
|
|
604
|
-
|
|
643
|
+
var a = e._owner, o = ne(e.type, e._source, a ? a.type : null);
|
|
644
|
+
Ye.setExtraStackFrame(o);
|
|
605
645
|
} else
|
|
606
|
-
|
|
646
|
+
Ye.setExtraStackFrame(null);
|
|
607
647
|
}
|
|
608
|
-
var
|
|
609
|
-
|
|
610
|
-
function
|
|
611
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
648
|
+
var _e;
|
|
649
|
+
_e = !1;
|
|
650
|
+
function ye(e) {
|
|
651
|
+
return typeof e == "object" && e !== null && e.$$typeof === n;
|
|
612
652
|
}
|
|
613
|
-
function
|
|
653
|
+
function Ke() {
|
|
614
654
|
{
|
|
615
|
-
if (
|
|
616
|
-
var e = F(
|
|
655
|
+
if (Se.current) {
|
|
656
|
+
var e = F(Se.current.type);
|
|
617
657
|
if (e)
|
|
618
658
|
return `
|
|
619
659
|
|
|
@@ -622,13 +662,13 @@ Check the render method of \`` + e + "`.";
|
|
|
622
662
|
return "";
|
|
623
663
|
}
|
|
624
664
|
}
|
|
625
|
-
function
|
|
665
|
+
function zr(e) {
|
|
626
666
|
{
|
|
627
667
|
if (e !== void 0) {
|
|
628
|
-
var
|
|
668
|
+
var a = e.fileName.replace(/^.*[\\\/]/, ""), o = e.lineNumber;
|
|
629
669
|
return `
|
|
630
670
|
|
|
631
|
-
Check your code at ` +
|
|
671
|
+
Check your code at ` + a + ":" + o + ".";
|
|
632
672
|
}
|
|
633
673
|
return "";
|
|
634
674
|
}
|
|
@@ -636,130 +676,130 @@ Check your code at ` + n + ":" + o + ".";
|
|
|
636
676
|
var Be = {};
|
|
637
677
|
function Or(e) {
|
|
638
678
|
{
|
|
639
|
-
var
|
|
640
|
-
if (!
|
|
679
|
+
var a = Ke();
|
|
680
|
+
if (!a) {
|
|
641
681
|
var o = typeof e == "string" ? e : e.displayName || e.name;
|
|
642
|
-
o && (
|
|
682
|
+
o && (a = `
|
|
643
683
|
|
|
644
684
|
Check the top-level render call using <` + o + ">.");
|
|
645
685
|
}
|
|
646
|
-
return
|
|
686
|
+
return a;
|
|
647
687
|
}
|
|
648
688
|
}
|
|
649
|
-
function Ge(e,
|
|
689
|
+
function Ge(e, a) {
|
|
650
690
|
{
|
|
651
691
|
if (!e._store || e._store.validated || e.key != null)
|
|
652
692
|
return;
|
|
653
693
|
e._store.validated = !0;
|
|
654
|
-
var o = Or(
|
|
694
|
+
var o = Or(a);
|
|
655
695
|
if (Be[o])
|
|
656
696
|
return;
|
|
657
697
|
Be[o] = !0;
|
|
658
698
|
var p = "";
|
|
659
|
-
e && e._owner && e._owner !==
|
|
699
|
+
e && e._owner && e._owner !== Se.current && (p = " It was passed a child from " + F(e._owner.type) + "."), K(e), T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', o, p), K(null);
|
|
660
700
|
}
|
|
661
701
|
}
|
|
662
|
-
function
|
|
702
|
+
function Je(e, a) {
|
|
663
703
|
{
|
|
664
704
|
if (typeof e != "object")
|
|
665
705
|
return;
|
|
666
|
-
if (
|
|
706
|
+
if (be(e))
|
|
667
707
|
for (var o = 0; o < e.length; o++) {
|
|
668
708
|
var p = e[o];
|
|
669
|
-
|
|
709
|
+
ye(p) && Ge(p, a);
|
|
670
710
|
}
|
|
671
|
-
else if (
|
|
711
|
+
else if (ye(e))
|
|
672
712
|
e._store && (e._store.validated = !0);
|
|
673
713
|
else if (e) {
|
|
674
|
-
var b =
|
|
714
|
+
var b = ge(e);
|
|
675
715
|
if (typeof b == "function" && b !== e.entries)
|
|
676
716
|
for (var S = b.call(e), m; !(m = S.next()).done; )
|
|
677
|
-
|
|
717
|
+
ye(m.value) && Ge(m.value, a);
|
|
678
718
|
}
|
|
679
719
|
}
|
|
680
720
|
}
|
|
681
|
-
function
|
|
721
|
+
function Dr(e) {
|
|
682
722
|
{
|
|
683
|
-
var
|
|
684
|
-
if (
|
|
723
|
+
var a = e.type;
|
|
724
|
+
if (a == null || typeof a == "string")
|
|
685
725
|
return;
|
|
686
726
|
var o;
|
|
687
|
-
if (typeof
|
|
688
|
-
o =
|
|
689
|
-
else if (typeof
|
|
690
|
-
o =
|
|
727
|
+
if (typeof a == "function")
|
|
728
|
+
o = a.propTypes;
|
|
729
|
+
else if (typeof a == "object" && (a.$$typeof === h || a.$$typeof === v))
|
|
730
|
+
o = a.propTypes;
|
|
691
731
|
else
|
|
692
732
|
return;
|
|
693
733
|
if (o) {
|
|
694
|
-
var p = F(
|
|
734
|
+
var p = F(a);
|
|
695
735
|
vr(o, e.props, "prop", p, e);
|
|
696
|
-
} else if (
|
|
697
|
-
|
|
698
|
-
var b = F(
|
|
736
|
+
} else if (a.PropTypes !== void 0 && !_e) {
|
|
737
|
+
_e = !0;
|
|
738
|
+
var b = F(a);
|
|
699
739
|
T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", b || "Unknown");
|
|
700
740
|
}
|
|
701
|
-
typeof
|
|
741
|
+
typeof a.getDefaultProps == "function" && !a.getDefaultProps.isReactClassApproved && T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
702
742
|
}
|
|
703
743
|
}
|
|
704
|
-
function
|
|
744
|
+
function xr(e) {
|
|
705
745
|
{
|
|
706
|
-
for (var
|
|
707
|
-
var p =
|
|
746
|
+
for (var a = Object.keys(e.props), o = 0; o < a.length; o++) {
|
|
747
|
+
var p = a[o];
|
|
708
748
|
if (p !== "children" && p !== "key") {
|
|
709
|
-
|
|
749
|
+
K(e), T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", p), K(null);
|
|
710
750
|
break;
|
|
711
751
|
}
|
|
712
752
|
}
|
|
713
|
-
e.ref !== null && (
|
|
753
|
+
e.ref !== null && (K(e), T("Invalid attribute `ref` supplied to `React.Fragment`."), K(null));
|
|
714
754
|
}
|
|
715
755
|
}
|
|
716
|
-
function
|
|
756
|
+
function He(e, a, o, p, b, S) {
|
|
717
757
|
{
|
|
718
758
|
var m = ur(e);
|
|
719
759
|
if (!m) {
|
|
720
760
|
var g = "";
|
|
721
761
|
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (g += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
722
|
-
var
|
|
723
|
-
|
|
724
|
-
var
|
|
725
|
-
e === null ?
|
|
762
|
+
var A = zr(b);
|
|
763
|
+
A ? g += A : g += Ke();
|
|
764
|
+
var R;
|
|
765
|
+
e === null ? R = "null" : be(e) ? R = "array" : e !== void 0 && e.$$typeof === n ? (R = "<" + (F(e.type) || "Unknown") + " />", g = " Did you accidentally export a JSX literal instead of a component?") : R = typeof e, T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", R, g);
|
|
726
766
|
}
|
|
727
|
-
var
|
|
728
|
-
if (
|
|
729
|
-
return
|
|
767
|
+
var P = Ar(e, a, o, b, S);
|
|
768
|
+
if (P == null)
|
|
769
|
+
return P;
|
|
730
770
|
if (m) {
|
|
731
|
-
var k =
|
|
771
|
+
var k = a.children;
|
|
732
772
|
if (k !== void 0)
|
|
733
773
|
if (p)
|
|
734
|
-
if (
|
|
774
|
+
if (be(k)) {
|
|
735
775
|
for (var B = 0; B < k.length; B++)
|
|
736
|
-
|
|
776
|
+
Je(k[B], e);
|
|
737
777
|
Object.freeze && Object.freeze(k);
|
|
738
778
|
} else
|
|
739
779
|
T("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
740
780
|
else
|
|
741
|
-
|
|
781
|
+
Je(k, e);
|
|
742
782
|
}
|
|
743
|
-
return e === c ?
|
|
783
|
+
return e === c ? xr(P) : Dr(P), P;
|
|
744
784
|
}
|
|
745
785
|
}
|
|
746
|
-
function kr(e,
|
|
747
|
-
return
|
|
786
|
+
function kr(e, a, o) {
|
|
787
|
+
return He(e, a, o, !0);
|
|
748
788
|
}
|
|
749
|
-
function Ir(e,
|
|
750
|
-
return
|
|
789
|
+
function Ir(e, a, o) {
|
|
790
|
+
return He(e, a, o, !1);
|
|
751
791
|
}
|
|
752
792
|
var jr = Ir, Fr = kr;
|
|
753
793
|
Z.Fragment = c, Z.jsx = jr, Z.jsxs = Fr;
|
|
754
794
|
}()), Z;
|
|
755
795
|
}
|
|
756
796
|
(function(t) {
|
|
757
|
-
process.env.NODE_ENV === "production" ? t.exports =
|
|
758
|
-
})(
|
|
759
|
-
const $ =
|
|
760
|
-
function
|
|
797
|
+
process.env.NODE_ENV === "production" ? t.exports = Xr() : t.exports = Qr();
|
|
798
|
+
})(fe);
|
|
799
|
+
const $ = fe.exports.Fragment, r = fe.exports.jsx, w = fe.exports.jsxs;
|
|
800
|
+
function Zr({
|
|
761
801
|
postSubmit: t,
|
|
762
|
-
styles:
|
|
802
|
+
styles: n = de
|
|
763
803
|
}) {
|
|
764
804
|
const {
|
|
765
805
|
control: s,
|
|
@@ -783,15 +823,15 @@ function Jr({
|
|
|
783
823
|
onSubmit: c(async ({
|
|
784
824
|
type: i,
|
|
785
825
|
key: l,
|
|
786
|
-
config:
|
|
826
|
+
config: d
|
|
787
827
|
}) => {
|
|
788
828
|
if (M({
|
|
789
829
|
id: "for-creating",
|
|
790
830
|
title: "Pending",
|
|
791
831
|
message: "Adding data source...",
|
|
792
832
|
loading: !0
|
|
793
|
-
}), !await
|
|
794
|
-
|
|
833
|
+
}), !await D.datasource.create(i, l, d)) {
|
|
834
|
+
z({
|
|
795
835
|
id: "for-creating",
|
|
796
836
|
title: "Failed",
|
|
797
837
|
message: "Test connection failed with given info",
|
|
@@ -799,22 +839,22 @@ function Jr({
|
|
|
799
839
|
});
|
|
800
840
|
return;
|
|
801
841
|
}
|
|
802
|
-
|
|
842
|
+
z({
|
|
803
843
|
id: "for-creating",
|
|
804
844
|
title: "Successful",
|
|
805
845
|
message: "Data source is added",
|
|
806
846
|
color: "green"
|
|
807
847
|
}), t();
|
|
808
848
|
}),
|
|
809
|
-
children: [/* @__PURE__ */ r(
|
|
849
|
+
children: [/* @__PURE__ */ r(E, {
|
|
810
850
|
name: "type",
|
|
811
851
|
control: s,
|
|
812
852
|
render: ({
|
|
813
853
|
field: i
|
|
814
854
|
}) => /* @__PURE__ */ r(qr, {
|
|
815
855
|
fullWidth: !0,
|
|
816
|
-
mb:
|
|
817
|
-
size:
|
|
856
|
+
mb: n.spacing,
|
|
857
|
+
size: n.size,
|
|
818
858
|
data: [{
|
|
819
859
|
label: "PostgreSQL",
|
|
820
860
|
value: "postgresql"
|
|
@@ -828,14 +868,14 @@ function Jr({
|
|
|
828
868
|
}],
|
|
829
869
|
...i
|
|
830
870
|
})
|
|
831
|
-
}), /* @__PURE__ */ r(
|
|
871
|
+
}), /* @__PURE__ */ r(E, {
|
|
832
872
|
name: "key",
|
|
833
873
|
control: s,
|
|
834
874
|
render: ({
|
|
835
875
|
field: i
|
|
836
876
|
}) => /* @__PURE__ */ r(I, {
|
|
837
|
-
mb:
|
|
838
|
-
size:
|
|
877
|
+
mb: n.spacing,
|
|
878
|
+
size: n.size,
|
|
839
879
|
required: !0,
|
|
840
880
|
label: "Name",
|
|
841
881
|
placeholder: "A unique name",
|
|
@@ -846,14 +886,14 @@ function Jr({
|
|
|
846
886
|
labelPosition: "center"
|
|
847
887
|
}), /* @__PURE__ */ w(j, {
|
|
848
888
|
grow: !0,
|
|
849
|
-
children: [/* @__PURE__ */ r(
|
|
889
|
+
children: [/* @__PURE__ */ r(E, {
|
|
850
890
|
name: "config.host",
|
|
851
891
|
control: s,
|
|
852
892
|
render: ({
|
|
853
893
|
field: i
|
|
854
894
|
}) => /* @__PURE__ */ r(I, {
|
|
855
|
-
mb:
|
|
856
|
-
size:
|
|
895
|
+
mb: n.spacing,
|
|
896
|
+
size: n.size,
|
|
857
897
|
required: !0,
|
|
858
898
|
label: "Host",
|
|
859
899
|
sx: {
|
|
@@ -861,14 +901,14 @@ function Jr({
|
|
|
861
901
|
},
|
|
862
902
|
...i
|
|
863
903
|
})
|
|
864
|
-
}), /* @__PURE__ */ r(
|
|
904
|
+
}), /* @__PURE__ */ r(E, {
|
|
865
905
|
name: "config.port",
|
|
866
906
|
control: s,
|
|
867
907
|
render: ({
|
|
868
908
|
field: i
|
|
869
909
|
}) => /* @__PURE__ */ r(Lr, {
|
|
870
|
-
mb:
|
|
871
|
-
size:
|
|
910
|
+
mb: n.spacing,
|
|
911
|
+
size: n.size,
|
|
872
912
|
required: !0,
|
|
873
913
|
label: "Port",
|
|
874
914
|
hideControls: !0,
|
|
@@ -878,77 +918,77 @@ function Jr({
|
|
|
878
918
|
...i
|
|
879
919
|
})
|
|
880
920
|
})]
|
|
881
|
-
}), /* @__PURE__ */ r(
|
|
921
|
+
}), /* @__PURE__ */ r(E, {
|
|
882
922
|
name: "config.username",
|
|
883
923
|
control: s,
|
|
884
924
|
render: ({
|
|
885
925
|
field: i
|
|
886
926
|
}) => /* @__PURE__ */ r(I, {
|
|
887
|
-
mb:
|
|
888
|
-
size:
|
|
927
|
+
mb: n.spacing,
|
|
928
|
+
size: n.size,
|
|
889
929
|
required: !0,
|
|
890
930
|
label: "Username",
|
|
891
931
|
...i
|
|
892
932
|
})
|
|
893
|
-
}), /* @__PURE__ */ r(
|
|
933
|
+
}), /* @__PURE__ */ r(E, {
|
|
894
934
|
name: "config.password",
|
|
895
935
|
control: s,
|
|
896
936
|
render: ({
|
|
897
937
|
field: i
|
|
898
|
-
}) => /* @__PURE__ */ r(
|
|
899
|
-
mb:
|
|
900
|
-
size:
|
|
938
|
+
}) => /* @__PURE__ */ r(ce, {
|
|
939
|
+
mb: n.spacing,
|
|
940
|
+
size: n.size,
|
|
901
941
|
required: !0,
|
|
902
942
|
label: "Password",
|
|
903
943
|
...i
|
|
904
944
|
})
|
|
905
|
-
}), /* @__PURE__ */ r(
|
|
945
|
+
}), /* @__PURE__ */ r(E, {
|
|
906
946
|
name: "config.database",
|
|
907
947
|
control: s,
|
|
908
948
|
render: ({
|
|
909
949
|
field: i
|
|
910
950
|
}) => /* @__PURE__ */ r(I, {
|
|
911
|
-
mb:
|
|
912
|
-
size:
|
|
951
|
+
mb: n.spacing,
|
|
952
|
+
size: n.size,
|
|
913
953
|
required: !0,
|
|
914
954
|
label: "Database",
|
|
915
955
|
...i
|
|
916
956
|
})
|
|
917
957
|
}), /* @__PURE__ */ r(j, {
|
|
918
958
|
position: "right",
|
|
919
|
-
mt:
|
|
920
|
-
children: /* @__PURE__ */ r(
|
|
959
|
+
mt: n.spacing,
|
|
960
|
+
children: /* @__PURE__ */ r(x, {
|
|
921
961
|
type: "submit",
|
|
922
|
-
size:
|
|
962
|
+
size: n.button.size,
|
|
923
963
|
children: "Save"
|
|
924
964
|
})
|
|
925
965
|
})]
|
|
926
966
|
})
|
|
927
967
|
});
|
|
928
968
|
}
|
|
929
|
-
function
|
|
969
|
+
function et({
|
|
930
970
|
onSuccess: t,
|
|
931
|
-
styles:
|
|
971
|
+
styles: n = de
|
|
932
972
|
}) {
|
|
933
|
-
const [s, c] =
|
|
973
|
+
const [s, c] = J.useState(!1), u = () => c(!0), i = () => c(!1);
|
|
934
974
|
return /* @__PURE__ */ w($, {
|
|
935
|
-
children: [/* @__PURE__ */ r(
|
|
975
|
+
children: [/* @__PURE__ */ r(se, {
|
|
936
976
|
overflow: "inside",
|
|
937
977
|
opened: s,
|
|
938
978
|
onClose: () => c(!1),
|
|
939
979
|
title: "Add a data source",
|
|
940
980
|
trapFocus: !0,
|
|
941
|
-
onDragStart: (
|
|
942
|
-
|
|
981
|
+
onDragStart: (d) => {
|
|
982
|
+
d.stopPropagation();
|
|
943
983
|
},
|
|
944
|
-
children: /* @__PURE__ */ r(
|
|
984
|
+
children: /* @__PURE__ */ r(Zr, {
|
|
945
985
|
postSubmit: () => {
|
|
946
986
|
t(), i();
|
|
947
987
|
},
|
|
948
|
-
styles:
|
|
988
|
+
styles: n
|
|
949
989
|
})
|
|
950
|
-
}), /* @__PURE__ */ r(
|
|
951
|
-
size:
|
|
990
|
+
}), /* @__PURE__ */ r(x, {
|
|
991
|
+
size: n.button.size,
|
|
952
992
|
onClick: u,
|
|
953
993
|
leftIcon: /* @__PURE__ */ r(Ee, {
|
|
954
994
|
size: 20
|
|
@@ -957,27 +997,27 @@ function Xr({
|
|
|
957
997
|
})]
|
|
958
998
|
});
|
|
959
999
|
}
|
|
960
|
-
function
|
|
1000
|
+
function rt({
|
|
961
1001
|
id: t,
|
|
962
|
-
name:
|
|
1002
|
+
name: n,
|
|
963
1003
|
onSuccess: s,
|
|
964
|
-
styles: c =
|
|
1004
|
+
styles: c = de
|
|
965
1005
|
}) {
|
|
966
|
-
const u =
|
|
1006
|
+
const u = le(), i = async () => {
|
|
967
1007
|
!t || (M({
|
|
968
1008
|
id: "for-deleting",
|
|
969
1009
|
title: "Pending",
|
|
970
1010
|
message: "Deleting data source...",
|
|
971
1011
|
loading: !0
|
|
972
|
-
}), await
|
|
1012
|
+
}), await D.datasource.delete(t), z({
|
|
973
1013
|
id: "for-deleting",
|
|
974
1014
|
title: "Successful",
|
|
975
|
-
message: `Data source [${
|
|
1015
|
+
message: `Data source [${n}] is deleted`,
|
|
976
1016
|
color: "green"
|
|
977
1017
|
}), s());
|
|
978
1018
|
}, l = () => u.openConfirmModal({
|
|
979
1019
|
title: "Delete this data source?",
|
|
980
|
-
children: /* @__PURE__ */ r(
|
|
1020
|
+
children: /* @__PURE__ */ r(oe, {
|
|
981
1021
|
size: c.size,
|
|
982
1022
|
children: "This action won't affect your database."
|
|
983
1023
|
}),
|
|
@@ -988,7 +1028,7 @@ function Qr({
|
|
|
988
1028
|
onCancel: () => console.log("Cancel"),
|
|
989
1029
|
onConfirm: i
|
|
990
1030
|
});
|
|
991
|
-
return /* @__PURE__ */ r(
|
|
1031
|
+
return /* @__PURE__ */ r(x, {
|
|
992
1032
|
size: c.button.size,
|
|
993
1033
|
color: "red",
|
|
994
1034
|
onClick: l,
|
|
@@ -998,11 +1038,11 @@ function Qr({
|
|
|
998
1038
|
children: "Delete"
|
|
999
1039
|
});
|
|
1000
1040
|
}
|
|
1001
|
-
function
|
|
1002
|
-
styles: t =
|
|
1003
|
-
config:
|
|
1041
|
+
function _t({
|
|
1042
|
+
styles: t = de,
|
|
1043
|
+
config: n
|
|
1004
1044
|
}) {
|
|
1005
|
-
|
|
1045
|
+
ue(n);
|
|
1006
1046
|
const {
|
|
1007
1047
|
data: s = [],
|
|
1008
1048
|
loading: c,
|
|
@@ -1010,7 +1050,7 @@ function vt({
|
|
|
1010
1050
|
} = G(async () => {
|
|
1011
1051
|
const {
|
|
1012
1052
|
data: i
|
|
1013
|
-
} = await
|
|
1053
|
+
} = await D.datasource.list();
|
|
1014
1054
|
return i;
|
|
1015
1055
|
}, {
|
|
1016
1056
|
refreshDeps: []
|
|
@@ -1019,7 +1059,7 @@ function vt({
|
|
|
1019
1059
|
children: [/* @__PURE__ */ r(j, {
|
|
1020
1060
|
pt: t.spacing,
|
|
1021
1061
|
position: "right",
|
|
1022
|
-
children: /* @__PURE__ */ r(
|
|
1062
|
+
children: /* @__PURE__ */ r(et, {
|
|
1023
1063
|
onSuccess: u
|
|
1024
1064
|
})
|
|
1025
1065
|
}), /* @__PURE__ */ w(L, {
|
|
@@ -1027,7 +1067,7 @@ function vt({
|
|
|
1027
1067
|
sx: {
|
|
1028
1068
|
position: "relative"
|
|
1029
1069
|
},
|
|
1030
|
-
children: [/* @__PURE__ */ r(
|
|
1070
|
+
children: [/* @__PURE__ */ r(Re, {
|
|
1031
1071
|
visible: c
|
|
1032
1072
|
}), /* @__PURE__ */ w(Pe, {
|
|
1033
1073
|
horizontalSpacing: t.spacing,
|
|
@@ -1048,18 +1088,18 @@ function vt({
|
|
|
1048
1088
|
children: s.map(({
|
|
1049
1089
|
id: i,
|
|
1050
1090
|
key: l,
|
|
1051
|
-
type:
|
|
1091
|
+
type: d
|
|
1052
1092
|
}) => /* @__PURE__ */ w("tr", {
|
|
1053
1093
|
children: [/* @__PURE__ */ r("td", {
|
|
1054
1094
|
width: 200,
|
|
1055
|
-
children:
|
|
1095
|
+
children: d
|
|
1056
1096
|
}), /* @__PURE__ */ r("td", {
|
|
1057
1097
|
children: l
|
|
1058
1098
|
}), /* @__PURE__ */ r("td", {
|
|
1059
1099
|
width: 200,
|
|
1060
1100
|
children: /* @__PURE__ */ r(j, {
|
|
1061
1101
|
position: "left",
|
|
1062
|
-
children: /* @__PURE__ */ r(
|
|
1102
|
+
children: /* @__PURE__ */ r(rt, {
|
|
1063
1103
|
id: i,
|
|
1064
1104
|
name: l,
|
|
1065
1105
|
onSuccess: u
|
|
@@ -1072,19 +1112,19 @@ function vt({
|
|
|
1072
1112
|
})]
|
|
1073
1113
|
});
|
|
1074
1114
|
}
|
|
1075
|
-
const
|
|
1115
|
+
const tt = tr(({
|
|
1076
1116
|
label: t,
|
|
1077
|
-
value:
|
|
1117
|
+
value: n,
|
|
1078
1118
|
description: s,
|
|
1079
1119
|
...c
|
|
1080
1120
|
}, u) => /* @__PURE__ */ w(rr, {
|
|
1081
1121
|
spacing: 2,
|
|
1082
1122
|
ref: u,
|
|
1083
1123
|
...c,
|
|
1084
|
-
children: [/* @__PURE__ */ r(
|
|
1124
|
+
children: [/* @__PURE__ */ r(oe, {
|
|
1085
1125
|
size: "sm",
|
|
1086
1126
|
children: t
|
|
1087
|
-
}), /* @__PURE__ */ r(
|
|
1127
|
+
}), /* @__PURE__ */ r(oe, {
|
|
1088
1128
|
size: "xs",
|
|
1089
1129
|
color: "dimmed",
|
|
1090
1130
|
className: "role-description",
|
|
@@ -1092,17 +1132,17 @@ const Zr = tr(({
|
|
|
1092
1132
|
})]
|
|
1093
1133
|
})), Te = tr(({
|
|
1094
1134
|
styles: t,
|
|
1095
|
-
value:
|
|
1135
|
+
value: n,
|
|
1096
1136
|
onChange: s
|
|
1097
1137
|
}, c) => {
|
|
1098
1138
|
const {
|
|
1099
1139
|
data: u = [],
|
|
1100
1140
|
loading: i
|
|
1101
|
-
} = G(async () => (await
|
|
1102
|
-
label:
|
|
1103
|
-
value:
|
|
1104
|
-
description:
|
|
1105
|
-
disabled:
|
|
1141
|
+
} = G(async () => (await D.role.list()).map((d) => ({
|
|
1142
|
+
label: d.name,
|
|
1143
|
+
value: d.id,
|
|
1144
|
+
description: d.description,
|
|
1145
|
+
disabled: d.id === 50
|
|
1106
1146
|
})), {
|
|
1107
1147
|
refreshDeps: []
|
|
1108
1148
|
});
|
|
@@ -1112,7 +1152,7 @@ const Zr = tr(({
|
|
|
1112
1152
|
size: t.size,
|
|
1113
1153
|
required: !0,
|
|
1114
1154
|
label: "Role",
|
|
1115
|
-
itemComponent:
|
|
1155
|
+
itemComponent: tt,
|
|
1116
1156
|
data: u,
|
|
1117
1157
|
disabled: i,
|
|
1118
1158
|
styles: () => ({
|
|
@@ -1126,7 +1166,7 @@ const Zr = tr(({
|
|
|
1126
1166
|
}
|
|
1127
1167
|
}
|
|
1128
1168
|
}),
|
|
1129
|
-
value:
|
|
1169
|
+
value: n,
|
|
1130
1170
|
onChange: s
|
|
1131
1171
|
});
|
|
1132
1172
|
}), W = {
|
|
@@ -1136,9 +1176,9 @@ const Zr = tr(({
|
|
|
1136
1176
|
size: "xs"
|
|
1137
1177
|
}
|
|
1138
1178
|
};
|
|
1139
|
-
function
|
|
1179
|
+
function nt({
|
|
1140
1180
|
postSubmit: t,
|
|
1141
|
-
styles:
|
|
1181
|
+
styles: n = W,
|
|
1142
1182
|
initialRoleID: s
|
|
1143
1183
|
}) {
|
|
1144
1184
|
const {
|
|
@@ -1157,9 +1197,9 @@ function et({
|
|
|
1157
1197
|
children: /* @__PURE__ */ w("form", {
|
|
1158
1198
|
onSubmit: u(async ({
|
|
1159
1199
|
name: l,
|
|
1160
|
-
email:
|
|
1161
|
-
password:
|
|
1162
|
-
role_id:
|
|
1200
|
+
email: d,
|
|
1201
|
+
password: h,
|
|
1202
|
+
role_id: y
|
|
1163
1203
|
}) => {
|
|
1164
1204
|
try {
|
|
1165
1205
|
M({
|
|
@@ -1167,104 +1207,104 @@ function et({
|
|
|
1167
1207
|
title: "Pending",
|
|
1168
1208
|
message: "Adding account...",
|
|
1169
1209
|
loading: !0
|
|
1170
|
-
}), await
|
|
1210
|
+
}), await D.account.create(l, d, h, y), z({
|
|
1171
1211
|
id: "for-creating",
|
|
1172
1212
|
title: "Successful",
|
|
1173
1213
|
message: "Account is added",
|
|
1174
1214
|
color: "green"
|
|
1175
1215
|
}), t();
|
|
1176
|
-
} catch (
|
|
1177
|
-
|
|
1216
|
+
} catch (_) {
|
|
1217
|
+
z({
|
|
1178
1218
|
id: "for-creating",
|
|
1179
1219
|
title: "Failed",
|
|
1180
|
-
message:
|
|
1220
|
+
message: _.message,
|
|
1181
1221
|
color: "red"
|
|
1182
1222
|
});
|
|
1183
1223
|
}
|
|
1184
1224
|
}),
|
|
1185
|
-
children: [/* @__PURE__ */ r(
|
|
1225
|
+
children: [/* @__PURE__ */ r(E, {
|
|
1186
1226
|
name: "name",
|
|
1187
1227
|
control: c,
|
|
1188
1228
|
render: ({
|
|
1189
1229
|
field: l
|
|
1190
1230
|
}) => /* @__PURE__ */ r(I, {
|
|
1191
|
-
mb:
|
|
1192
|
-
size:
|
|
1231
|
+
mb: n.spacing,
|
|
1232
|
+
size: n.size,
|
|
1193
1233
|
required: !0,
|
|
1194
1234
|
label: "Username",
|
|
1195
1235
|
...l
|
|
1196
1236
|
})
|
|
1197
|
-
}), /* @__PURE__ */ r(
|
|
1237
|
+
}), /* @__PURE__ */ r(E, {
|
|
1198
1238
|
name: "email",
|
|
1199
1239
|
control: c,
|
|
1200
1240
|
render: ({
|
|
1201
1241
|
field: l
|
|
1202
1242
|
}) => /* @__PURE__ */ r(I, {
|
|
1203
|
-
mb:
|
|
1204
|
-
size:
|
|
1243
|
+
mb: n.spacing,
|
|
1244
|
+
size: n.size,
|
|
1205
1245
|
required: !0,
|
|
1206
1246
|
label: "Email",
|
|
1207
1247
|
...l
|
|
1208
1248
|
})
|
|
1209
|
-
}), /* @__PURE__ */ r(
|
|
1249
|
+
}), /* @__PURE__ */ r(E, {
|
|
1210
1250
|
name: "password",
|
|
1211
1251
|
control: c,
|
|
1212
1252
|
render: ({
|
|
1213
1253
|
field: l
|
|
1214
|
-
}) => /* @__PURE__ */ r(
|
|
1215
|
-
mb:
|
|
1216
|
-
size:
|
|
1254
|
+
}) => /* @__PURE__ */ r(ce, {
|
|
1255
|
+
mb: n.spacing,
|
|
1256
|
+
size: n.size,
|
|
1217
1257
|
required: !0,
|
|
1218
1258
|
label: "Password",
|
|
1219
1259
|
description: "Password must be at least 8 characters long",
|
|
1220
1260
|
...l
|
|
1221
1261
|
})
|
|
1222
|
-
}), /* @__PURE__ */ r(
|
|
1262
|
+
}), /* @__PURE__ */ r(E, {
|
|
1223
1263
|
name: "role_id",
|
|
1224
1264
|
control: c,
|
|
1225
1265
|
render: ({
|
|
1226
1266
|
field: l
|
|
1227
1267
|
}) => /* @__PURE__ */ r(Te, {
|
|
1228
|
-
styles:
|
|
1268
|
+
styles: n,
|
|
1229
1269
|
...l
|
|
1230
1270
|
})
|
|
1231
1271
|
}), /* @__PURE__ */ r(j, {
|
|
1232
1272
|
position: "right",
|
|
1233
|
-
mt:
|
|
1234
|
-
children: /* @__PURE__ */ r(
|
|
1273
|
+
mt: n.spacing,
|
|
1274
|
+
children: /* @__PURE__ */ r(x, {
|
|
1235
1275
|
type: "submit",
|
|
1236
|
-
size:
|
|
1276
|
+
size: n.button.size,
|
|
1237
1277
|
children: "Save"
|
|
1238
1278
|
})
|
|
1239
1279
|
})]
|
|
1240
1280
|
})
|
|
1241
1281
|
});
|
|
1242
1282
|
}
|
|
1243
|
-
function
|
|
1283
|
+
function at({
|
|
1244
1284
|
onSuccess: t,
|
|
1245
|
-
styles:
|
|
1285
|
+
styles: n = W,
|
|
1246
1286
|
initialRoleID: s
|
|
1247
1287
|
}) {
|
|
1248
|
-
const [c, u] =
|
|
1288
|
+
const [c, u] = J.useState(!1), i = () => u(!0), l = () => u(!1);
|
|
1249
1289
|
return /* @__PURE__ */ w($, {
|
|
1250
|
-
children: [/* @__PURE__ */ r(
|
|
1290
|
+
children: [/* @__PURE__ */ r(se, {
|
|
1251
1291
|
overflow: "inside",
|
|
1252
1292
|
opened: c,
|
|
1253
1293
|
onClose: () => u(!1),
|
|
1254
1294
|
title: "Add an Account",
|
|
1255
1295
|
trapFocus: !0,
|
|
1256
|
-
onDragStart: (
|
|
1257
|
-
|
|
1296
|
+
onDragStart: (h) => {
|
|
1297
|
+
h.stopPropagation();
|
|
1258
1298
|
},
|
|
1259
|
-
children: /* @__PURE__ */ r(
|
|
1299
|
+
children: /* @__PURE__ */ r(nt, {
|
|
1260
1300
|
postSubmit: () => {
|
|
1261
1301
|
t(), l();
|
|
1262
1302
|
},
|
|
1263
|
-
styles:
|
|
1303
|
+
styles: n,
|
|
1264
1304
|
initialRoleID: s
|
|
1265
1305
|
})
|
|
1266
|
-
}), /* @__PURE__ */ r(
|
|
1267
|
-
size:
|
|
1306
|
+
}), /* @__PURE__ */ r(x, {
|
|
1307
|
+
size: n.button.size,
|
|
1268
1308
|
onClick: i,
|
|
1269
1309
|
leftIcon: /* @__PURE__ */ r(Ee, {
|
|
1270
1310
|
size: 20
|
|
@@ -1273,13 +1313,13 @@ function rt({
|
|
|
1273
1313
|
})]
|
|
1274
1314
|
});
|
|
1275
1315
|
}
|
|
1276
|
-
function
|
|
1316
|
+
function it({
|
|
1277
1317
|
id: t,
|
|
1278
|
-
name:
|
|
1318
|
+
name: n,
|
|
1279
1319
|
onSuccess: s,
|
|
1280
1320
|
styles: c = W
|
|
1281
1321
|
}) {
|
|
1282
|
-
const u =
|
|
1322
|
+
const u = le(), i = async () => {
|
|
1283
1323
|
if (!!t) {
|
|
1284
1324
|
M({
|
|
1285
1325
|
id: "for-deleting",
|
|
@@ -1288,17 +1328,17 @@ function tt({
|
|
|
1288
1328
|
loading: !0
|
|
1289
1329
|
});
|
|
1290
1330
|
try {
|
|
1291
|
-
await
|
|
1331
|
+
await D.account.delete(t), z({
|
|
1292
1332
|
id: "for-deleting",
|
|
1293
1333
|
title: "Successful",
|
|
1294
|
-
message: `Account [${
|
|
1334
|
+
message: `Account [${n}] is deleted`,
|
|
1295
1335
|
color: "green"
|
|
1296
1336
|
}), s();
|
|
1297
|
-
} catch (
|
|
1298
|
-
|
|
1337
|
+
} catch (d) {
|
|
1338
|
+
z({
|
|
1299
1339
|
id: "for-deleting",
|
|
1300
1340
|
title: "Failed",
|
|
1301
|
-
message:
|
|
1341
|
+
message: d.message,
|
|
1302
1342
|
color: "red"
|
|
1303
1343
|
});
|
|
1304
1344
|
}
|
|
@@ -1312,7 +1352,7 @@ function tt({
|
|
|
1312
1352
|
onCancel: () => console.log("Cancel"),
|
|
1313
1353
|
onConfirm: i
|
|
1314
1354
|
});
|
|
1315
|
-
return /* @__PURE__ */ r(
|
|
1355
|
+
return /* @__PURE__ */ r(x, {
|
|
1316
1356
|
size: c.button.size,
|
|
1317
1357
|
color: "red",
|
|
1318
1358
|
onClick: l,
|
|
@@ -1322,9 +1362,9 @@ function tt({
|
|
|
1322
1362
|
children: "Delete"
|
|
1323
1363
|
});
|
|
1324
1364
|
}
|
|
1325
|
-
function
|
|
1365
|
+
function ot({
|
|
1326
1366
|
id: t,
|
|
1327
|
-
name:
|
|
1367
|
+
name: n,
|
|
1328
1368
|
email: s,
|
|
1329
1369
|
role_id: c,
|
|
1330
1370
|
postSubmit: u,
|
|
@@ -1332,22 +1372,22 @@ function nt({
|
|
|
1332
1372
|
}) {
|
|
1333
1373
|
const {
|
|
1334
1374
|
control: l,
|
|
1335
|
-
handleSubmit:
|
|
1336
|
-
watch:
|
|
1375
|
+
handleSubmit: d,
|
|
1376
|
+
watch: h
|
|
1337
1377
|
} = ee({
|
|
1338
1378
|
defaultValues: {
|
|
1339
|
-
name:
|
|
1379
|
+
name: n,
|
|
1340
1380
|
email: s,
|
|
1341
1381
|
role_id: c,
|
|
1342
1382
|
reset_password: !1,
|
|
1343
1383
|
new_password: ""
|
|
1344
1384
|
}
|
|
1345
|
-
}),
|
|
1346
|
-
name:
|
|
1385
|
+
}), y = async ({
|
|
1386
|
+
name: f,
|
|
1347
1387
|
email: O,
|
|
1348
1388
|
role_id: N,
|
|
1349
|
-
reset_password:
|
|
1350
|
-
new_password:
|
|
1389
|
+
reset_password: V,
|
|
1390
|
+
new_password: ge
|
|
1351
1391
|
}) => {
|
|
1352
1392
|
try {
|
|
1353
1393
|
M({
|
|
@@ -1355,105 +1395,105 @@ function nt({
|
|
|
1355
1395
|
title: "Pending",
|
|
1356
1396
|
message: "Updating account...",
|
|
1357
1397
|
loading: !0
|
|
1358
|
-
}), await
|
|
1398
|
+
}), await D.account.edit({
|
|
1359
1399
|
id: t,
|
|
1360
|
-
name:
|
|
1400
|
+
name: f,
|
|
1361
1401
|
email: O,
|
|
1362
1402
|
role_id: N,
|
|
1363
|
-
reset_password:
|
|
1364
|
-
new_password:
|
|
1365
|
-
}),
|
|
1403
|
+
reset_password: V,
|
|
1404
|
+
new_password: ge
|
|
1405
|
+
}), z({
|
|
1366
1406
|
id: "for-updating",
|
|
1367
1407
|
title: "Successful",
|
|
1368
1408
|
message: "Account is updated",
|
|
1369
1409
|
color: "green"
|
|
1370
1410
|
}), u();
|
|
1371
1411
|
} catch (U) {
|
|
1372
|
-
|
|
1412
|
+
z({
|
|
1373
1413
|
id: "for-updating",
|
|
1374
1414
|
title: "Failed",
|
|
1375
1415
|
message: U.message,
|
|
1376
1416
|
color: "red"
|
|
1377
1417
|
});
|
|
1378
1418
|
}
|
|
1379
|
-
}, [
|
|
1419
|
+
}, [_, v] = h(["reset_password", "new_password"]);
|
|
1380
1420
|
return /* @__PURE__ */ r(L, {
|
|
1381
1421
|
mx: "auto",
|
|
1382
1422
|
children: /* @__PURE__ */ w("form", {
|
|
1383
|
-
onSubmit:
|
|
1384
|
-
children: [/* @__PURE__ */ r(
|
|
1423
|
+
onSubmit: d(y),
|
|
1424
|
+
children: [/* @__PURE__ */ r(E, {
|
|
1385
1425
|
name: "name",
|
|
1386
1426
|
control: l,
|
|
1387
1427
|
render: ({
|
|
1388
|
-
field:
|
|
1428
|
+
field: f
|
|
1389
1429
|
}) => /* @__PURE__ */ r(I, {
|
|
1390
1430
|
mb: i.spacing,
|
|
1391
1431
|
size: i.size,
|
|
1392
1432
|
required: !0,
|
|
1393
1433
|
label: "Username",
|
|
1394
|
-
...
|
|
1434
|
+
...f
|
|
1395
1435
|
})
|
|
1396
|
-
}), /* @__PURE__ */ r(
|
|
1436
|
+
}), /* @__PURE__ */ r(E, {
|
|
1397
1437
|
name: "email",
|
|
1398
1438
|
control: l,
|
|
1399
1439
|
render: ({
|
|
1400
|
-
field:
|
|
1440
|
+
field: f
|
|
1401
1441
|
}) => /* @__PURE__ */ r(I, {
|
|
1402
1442
|
mb: i.spacing,
|
|
1403
1443
|
size: i.size,
|
|
1404
1444
|
required: !0,
|
|
1405
1445
|
label: "Email",
|
|
1406
|
-
...
|
|
1446
|
+
...f
|
|
1407
1447
|
})
|
|
1408
|
-
}), /* @__PURE__ */ r(
|
|
1448
|
+
}), /* @__PURE__ */ r(E, {
|
|
1409
1449
|
name: "role_id",
|
|
1410
1450
|
control: l,
|
|
1411
1451
|
render: ({
|
|
1412
|
-
field:
|
|
1452
|
+
field: f
|
|
1413
1453
|
}) => /* @__PURE__ */ r(Te, {
|
|
1414
1454
|
styles: i,
|
|
1415
|
-
...
|
|
1455
|
+
...f
|
|
1416
1456
|
})
|
|
1417
1457
|
}), /* @__PURE__ */ r(er, {
|
|
1418
1458
|
my: 20,
|
|
1419
1459
|
variant: "dashed",
|
|
1420
1460
|
label: "",
|
|
1421
1461
|
labelPosition: "center"
|
|
1422
|
-
}), /* @__PURE__ */ r(
|
|
1462
|
+
}), /* @__PURE__ */ r(E, {
|
|
1423
1463
|
name: "reset_password",
|
|
1424
1464
|
control: l,
|
|
1425
1465
|
render: ({
|
|
1426
|
-
field:
|
|
1466
|
+
field: f
|
|
1427
1467
|
}) => /* @__PURE__ */ r(Ur, {
|
|
1428
1468
|
mb: i.spacing,
|
|
1429
1469
|
size: i.size,
|
|
1430
1470
|
label: "Reset password",
|
|
1431
|
-
checked:
|
|
1432
|
-
onChange: (O) =>
|
|
1471
|
+
checked: f.value,
|
|
1472
|
+
onChange: (O) => f.onChange(O.currentTarget.checked),
|
|
1433
1473
|
styles: {
|
|
1434
1474
|
label: {
|
|
1435
1475
|
verticalAlign: "middle"
|
|
1436
1476
|
}
|
|
1437
1477
|
}
|
|
1438
1478
|
})
|
|
1439
|
-
}),
|
|
1479
|
+
}), _ && /* @__PURE__ */ r(E, {
|
|
1440
1480
|
name: "new_password",
|
|
1441
1481
|
control: l,
|
|
1442
1482
|
render: ({
|
|
1443
|
-
field:
|
|
1444
|
-
}) => /* @__PURE__ */ r(
|
|
1483
|
+
field: f
|
|
1484
|
+
}) => /* @__PURE__ */ r(ce, {
|
|
1445
1485
|
autoComplete: "off",
|
|
1446
1486
|
mb: i.spacing,
|
|
1447
1487
|
size: i.size,
|
|
1448
1488
|
required: !0,
|
|
1449
1489
|
description: "Password must be at least 8 characters long",
|
|
1450
1490
|
label: "New Password",
|
|
1451
|
-
...
|
|
1491
|
+
...f
|
|
1452
1492
|
})
|
|
1453
1493
|
}), /* @__PURE__ */ r(j, {
|
|
1454
1494
|
position: "right",
|
|
1455
1495
|
mt: i.spacing,
|
|
1456
|
-
children: /* @__PURE__ */ r(
|
|
1496
|
+
children: /* @__PURE__ */ r(x, {
|
|
1457
1497
|
type: "submit",
|
|
1458
1498
|
size: i.button.size,
|
|
1459
1499
|
children: "Submit"
|
|
@@ -1462,30 +1502,30 @@ function nt({
|
|
|
1462
1502
|
})
|
|
1463
1503
|
});
|
|
1464
1504
|
}
|
|
1465
|
-
function
|
|
1505
|
+
function st({
|
|
1466
1506
|
account: t,
|
|
1467
|
-
onSuccess:
|
|
1507
|
+
onSuccess: n,
|
|
1468
1508
|
styles: s = W
|
|
1469
1509
|
}) {
|
|
1470
|
-
const [c, u] =
|
|
1471
|
-
|
|
1510
|
+
const [c, u] = J.useState(!1), i = () => u(!0), l = () => u(!1), d = () => {
|
|
1511
|
+
n(), l();
|
|
1472
1512
|
};
|
|
1473
1513
|
return /* @__PURE__ */ w($, {
|
|
1474
|
-
children: [/* @__PURE__ */ r(
|
|
1514
|
+
children: [/* @__PURE__ */ r(se, {
|
|
1475
1515
|
overflow: "inside",
|
|
1476
1516
|
opened: c,
|
|
1477
1517
|
onClose: () => u(!1),
|
|
1478
1518
|
title: `Editing ${t.name}`,
|
|
1479
1519
|
trapFocus: !0,
|
|
1480
|
-
onDragStart: (
|
|
1481
|
-
|
|
1520
|
+
onDragStart: (h) => {
|
|
1521
|
+
h.stopPropagation();
|
|
1482
1522
|
},
|
|
1483
|
-
children: /* @__PURE__ */ r(
|
|
1523
|
+
children: /* @__PURE__ */ r(ot, {
|
|
1484
1524
|
...t,
|
|
1485
|
-
postSubmit:
|
|
1525
|
+
postSubmit: d,
|
|
1486
1526
|
styles: s
|
|
1487
1527
|
})
|
|
1488
|
-
}), /* @__PURE__ */ r(
|
|
1528
|
+
}), /* @__PURE__ */ r(x, {
|
|
1489
1529
|
size: s.button.size,
|
|
1490
1530
|
onClick: i,
|
|
1491
1531
|
leftIcon: /* @__PURE__ */ r(Mr, {
|
|
@@ -1495,51 +1535,51 @@ function at({
|
|
|
1495
1535
|
})]
|
|
1496
1536
|
});
|
|
1497
1537
|
}
|
|
1498
|
-
function
|
|
1538
|
+
function yt({
|
|
1499
1539
|
styles: t = W,
|
|
1500
|
-
config:
|
|
1540
|
+
config: n
|
|
1501
1541
|
}) {
|
|
1502
|
-
var
|
|
1503
|
-
|
|
1542
|
+
var y, _;
|
|
1543
|
+
ue(n);
|
|
1504
1544
|
const {
|
|
1505
1545
|
data: s = [],
|
|
1506
1546
|
loading: c,
|
|
1507
1547
|
refresh: u
|
|
1508
1548
|
} = G(async () => {
|
|
1509
1549
|
const {
|
|
1510
|
-
data:
|
|
1511
|
-
} = await
|
|
1512
|
-
return
|
|
1550
|
+
data: v
|
|
1551
|
+
} = await D.account.list();
|
|
1552
|
+
return v;
|
|
1513
1553
|
}, {
|
|
1514
1554
|
refreshDeps: []
|
|
1515
1555
|
}), {
|
|
1516
1556
|
data: i = [],
|
|
1517
1557
|
loading: l
|
|
1518
|
-
} = G(async () => (await
|
|
1519
|
-
label:
|
|
1520
|
-
value:
|
|
1521
|
-
description:
|
|
1522
|
-
disabled:
|
|
1558
|
+
} = G(async () => (await D.role.list()).map((f) => ({
|
|
1559
|
+
label: f.name,
|
|
1560
|
+
value: f.id,
|
|
1561
|
+
description: f.description,
|
|
1562
|
+
disabled: f.id === 50
|
|
1523
1563
|
})), {
|
|
1524
1564
|
refreshDeps: []
|
|
1525
|
-
}),
|
|
1526
|
-
var
|
|
1527
|
-
return (
|
|
1565
|
+
}), d = nr(() => i.reduce((v, f) => (v.set(f.value, f.label), v), /* @__PURE__ */ new Map()), [i]), h = (v) => {
|
|
1566
|
+
var f;
|
|
1567
|
+
return (f = d.get(v)) != null ? f : v;
|
|
1528
1568
|
};
|
|
1529
1569
|
return /* @__PURE__ */ w($, {
|
|
1530
1570
|
children: [/* @__PURE__ */ r(j, {
|
|
1531
1571
|
pt: t.spacing,
|
|
1532
1572
|
position: "right",
|
|
1533
|
-
children: /* @__PURE__ */ r(
|
|
1573
|
+
children: /* @__PURE__ */ r(at, {
|
|
1534
1574
|
onSuccess: u,
|
|
1535
|
-
initialRoleID: (
|
|
1575
|
+
initialRoleID: (_ = (y = i == null ? void 0 : i[0]) == null ? void 0 : y.value) != null ? _ : 0
|
|
1536
1576
|
})
|
|
1537
1577
|
}), /* @__PURE__ */ w(L, {
|
|
1538
1578
|
mt: t.spacing,
|
|
1539
1579
|
sx: {
|
|
1540
1580
|
position: "relative"
|
|
1541
1581
|
},
|
|
1542
|
-
children: [/* @__PURE__ */ r(
|
|
1582
|
+
children: [/* @__PURE__ */ r(Re, {
|
|
1543
1583
|
visible: c || l
|
|
1544
1584
|
}), /* @__PURE__ */ w(Pe, {
|
|
1545
1585
|
horizontalSpacing: t.spacing,
|
|
@@ -1559,13 +1599,13 @@ function bt({
|
|
|
1559
1599
|
})]
|
|
1560
1600
|
})
|
|
1561
1601
|
}), /* @__PURE__ */ r("tbody", {
|
|
1562
|
-
children: s.map((
|
|
1602
|
+
children: s.map((v) => {
|
|
1563
1603
|
const {
|
|
1564
|
-
id:
|
|
1604
|
+
id: f,
|
|
1565
1605
|
name: O,
|
|
1566
1606
|
email: N,
|
|
1567
|
-
role_id:
|
|
1568
|
-
} =
|
|
1607
|
+
role_id: V
|
|
1608
|
+
} = v;
|
|
1569
1609
|
return /* @__PURE__ */ w("tr", {
|
|
1570
1610
|
children: [/* @__PURE__ */ r("td", {
|
|
1571
1611
|
width: 200,
|
|
@@ -1575,31 +1615,31 @@ function bt({
|
|
|
1575
1615
|
children: N
|
|
1576
1616
|
}), /* @__PURE__ */ r("td", {
|
|
1577
1617
|
width: 200,
|
|
1578
|
-
children:
|
|
1618
|
+
children: h(V)
|
|
1579
1619
|
}), /* @__PURE__ */ r("td", {
|
|
1580
1620
|
width: 200,
|
|
1581
1621
|
children: /* @__PURE__ */ w(j, {
|
|
1582
1622
|
position: "left",
|
|
1583
|
-
children: [/* @__PURE__ */ r(
|
|
1584
|
-
account:
|
|
1623
|
+
children: [/* @__PURE__ */ r(st, {
|
|
1624
|
+
account: v,
|
|
1585
1625
|
onSuccess: u
|
|
1586
|
-
}), /* @__PURE__ */ r(
|
|
1587
|
-
id:
|
|
1626
|
+
}), /* @__PURE__ */ r(it, {
|
|
1627
|
+
id: f,
|
|
1588
1628
|
name: O,
|
|
1589
1629
|
onSuccess: u
|
|
1590
1630
|
})]
|
|
1591
1631
|
})
|
|
1592
1632
|
})]
|
|
1593
|
-
},
|
|
1633
|
+
}, f);
|
|
1594
1634
|
})
|
|
1595
1635
|
})]
|
|
1596
1636
|
})]
|
|
1597
1637
|
})]
|
|
1598
1638
|
});
|
|
1599
1639
|
}
|
|
1600
|
-
function
|
|
1640
|
+
function ct({
|
|
1601
1641
|
postSubmit: t,
|
|
1602
|
-
styles:
|
|
1642
|
+
styles: n = W
|
|
1603
1643
|
}) {
|
|
1604
1644
|
const {
|
|
1605
1645
|
control: s,
|
|
@@ -1624,86 +1664,86 @@ function it({
|
|
|
1624
1664
|
message: "Loggin in...",
|
|
1625
1665
|
loading: !0
|
|
1626
1666
|
});
|
|
1627
|
-
const
|
|
1628
|
-
window.localStorage.setItem("token",
|
|
1667
|
+
const d = await D.account.login(i, l);
|
|
1668
|
+
window.localStorage.setItem("token", d.token), z({
|
|
1629
1669
|
id: "for-login",
|
|
1630
1670
|
title: "Successful",
|
|
1631
1671
|
message: "Logged in",
|
|
1632
1672
|
color: "green"
|
|
1633
|
-
}), t(
|
|
1634
|
-
} catch (
|
|
1635
|
-
|
|
1673
|
+
}), t(d);
|
|
1674
|
+
} catch (d) {
|
|
1675
|
+
z({
|
|
1636
1676
|
id: "for-login",
|
|
1637
1677
|
title: "Login Failed",
|
|
1638
|
-
message:
|
|
1678
|
+
message: d.message,
|
|
1639
1679
|
color: "red"
|
|
1640
1680
|
});
|
|
1641
1681
|
}
|
|
1642
1682
|
}),
|
|
1643
|
-
children: [/* @__PURE__ */ r(
|
|
1683
|
+
children: [/* @__PURE__ */ r(E, {
|
|
1644
1684
|
name: "name",
|
|
1645
1685
|
control: s,
|
|
1646
1686
|
render: ({
|
|
1647
1687
|
field: i
|
|
1648
1688
|
}) => /* @__PURE__ */ r(I, {
|
|
1649
|
-
mb:
|
|
1650
|
-
size:
|
|
1689
|
+
mb: n.spacing,
|
|
1690
|
+
size: n.size,
|
|
1651
1691
|
required: !0,
|
|
1652
1692
|
label: "Username",
|
|
1653
1693
|
...i
|
|
1654
1694
|
})
|
|
1655
|
-
}), /* @__PURE__ */ r(
|
|
1695
|
+
}), /* @__PURE__ */ r(E, {
|
|
1656
1696
|
name: "password",
|
|
1657
1697
|
control: s,
|
|
1658
1698
|
render: ({
|
|
1659
1699
|
field: i
|
|
1660
|
-
}) => /* @__PURE__ */ r(
|
|
1661
|
-
mb:
|
|
1662
|
-
size:
|
|
1700
|
+
}) => /* @__PURE__ */ r(ce, {
|
|
1701
|
+
mb: n.spacing,
|
|
1702
|
+
size: n.size,
|
|
1663
1703
|
required: !0,
|
|
1664
1704
|
label: "Password",
|
|
1665
1705
|
...i
|
|
1666
1706
|
})
|
|
1667
1707
|
}), /* @__PURE__ */ r(j, {
|
|
1668
1708
|
position: "right",
|
|
1669
|
-
mt:
|
|
1670
|
-
children: /* @__PURE__ */ r(
|
|
1709
|
+
mt: n.spacing,
|
|
1710
|
+
children: /* @__PURE__ */ r(x, {
|
|
1671
1711
|
type: "submit",
|
|
1672
|
-
size:
|
|
1712
|
+
size: n.button.size,
|
|
1673
1713
|
children: "Submit"
|
|
1674
1714
|
})
|
|
1675
1715
|
})]
|
|
1676
1716
|
})
|
|
1677
1717
|
});
|
|
1678
1718
|
}
|
|
1679
|
-
function
|
|
1719
|
+
function Rt({
|
|
1680
1720
|
styles: t = W,
|
|
1681
|
-
config:
|
|
1721
|
+
config: n,
|
|
1682
1722
|
onSuccess: s
|
|
1683
1723
|
}) {
|
|
1684
|
-
return
|
|
1724
|
+
return ue(n), /* @__PURE__ */ r($, {
|
|
1685
1725
|
children: /* @__PURE__ */ r(L, {
|
|
1686
1726
|
mt: t.spacing,
|
|
1687
1727
|
sx: {
|
|
1688
1728
|
position: "relative"
|
|
1689
1729
|
},
|
|
1690
|
-
children: /* @__PURE__ */ r(
|
|
1730
|
+
children: /* @__PURE__ */ r(ct, {
|
|
1691
1731
|
styles: t,
|
|
1692
1732
|
postSubmit: s
|
|
1693
1733
|
})
|
|
1694
1734
|
})
|
|
1695
1735
|
});
|
|
1696
1736
|
}
|
|
1697
|
-
const
|
|
1737
|
+
const pe = {
|
|
1698
1738
|
size: "sm",
|
|
1699
1739
|
spacing: "md",
|
|
1700
1740
|
button: {
|
|
1701
1741
|
size: "xs"
|
|
1702
1742
|
}
|
|
1703
1743
|
};
|
|
1704
|
-
function
|
|
1744
|
+
function lt({
|
|
1705
1745
|
postSubmit: t,
|
|
1706
|
-
styles:
|
|
1746
|
+
styles: n = pe,
|
|
1707
1747
|
initialRoleID: s
|
|
1708
1748
|
}) {
|
|
1709
1749
|
const {
|
|
@@ -1712,8 +1752,7 @@ function ot({
|
|
|
1712
1752
|
} = ee({
|
|
1713
1753
|
defaultValues: {
|
|
1714
1754
|
name: "",
|
|
1715
|
-
role_id: s
|
|
1716
|
-
domain: ""
|
|
1755
|
+
role_id: s
|
|
1717
1756
|
}
|
|
1718
1757
|
});
|
|
1719
1758
|
return /* @__PURE__ */ r(L, {
|
|
@@ -1721,8 +1760,7 @@ function ot({
|
|
|
1721
1760
|
children: /* @__PURE__ */ w("form", {
|
|
1722
1761
|
onSubmit: u(async ({
|
|
1723
1762
|
name: l,
|
|
1724
|
-
role_id:
|
|
1725
|
-
domain: v
|
|
1763
|
+
role_id: d
|
|
1726
1764
|
}) => {
|
|
1727
1765
|
try {
|
|
1728
1766
|
M({
|
|
@@ -1731,113 +1769,118 @@ function ot({
|
|
|
1731
1769
|
message: "Adding API Key...",
|
|
1732
1770
|
loading: !0
|
|
1733
1771
|
});
|
|
1734
|
-
const
|
|
1735
|
-
|
|
1772
|
+
const {
|
|
1773
|
+
app_id: h,
|
|
1774
|
+
app_secret: y
|
|
1775
|
+
} = await D.api_key.create(l, d);
|
|
1776
|
+
z({
|
|
1736
1777
|
id: "for-creating",
|
|
1737
1778
|
title: "Successful",
|
|
1738
1779
|
message: "API Key is added",
|
|
1739
1780
|
color: "green"
|
|
1740
|
-
}), t(
|
|
1741
|
-
} catch (
|
|
1742
|
-
|
|
1781
|
+
}), t(h, y);
|
|
1782
|
+
} catch (h) {
|
|
1783
|
+
z({
|
|
1743
1784
|
id: "for-creating",
|
|
1744
1785
|
title: "Failed",
|
|
1745
|
-
message:
|
|
1786
|
+
message: h.message,
|
|
1746
1787
|
color: "red"
|
|
1747
1788
|
});
|
|
1748
1789
|
}
|
|
1749
1790
|
}),
|
|
1750
|
-
children: [/* @__PURE__ */ r(
|
|
1791
|
+
children: [/* @__PURE__ */ r(E, {
|
|
1751
1792
|
name: "name",
|
|
1752
1793
|
control: c,
|
|
1753
1794
|
render: ({
|
|
1754
1795
|
field: l
|
|
1755
1796
|
}) => /* @__PURE__ */ r(I, {
|
|
1756
|
-
mb:
|
|
1757
|
-
size:
|
|
1797
|
+
mb: n.spacing,
|
|
1798
|
+
size: n.size,
|
|
1758
1799
|
required: !0,
|
|
1759
1800
|
label: "Name",
|
|
1760
1801
|
...l
|
|
1761
1802
|
})
|
|
1762
|
-
}), /* @__PURE__ */ r(
|
|
1763
|
-
name: "domain",
|
|
1764
|
-
control: c,
|
|
1765
|
-
render: ({
|
|
1766
|
-
field: l
|
|
1767
|
-
}) => /* @__PURE__ */ r(I, {
|
|
1768
|
-
mb: a.spacing,
|
|
1769
|
-
size: a.size,
|
|
1770
|
-
required: !0,
|
|
1771
|
-
label: "Domain",
|
|
1772
|
-
...l
|
|
1773
|
-
})
|
|
1774
|
-
}), /* @__PURE__ */ r(P, {
|
|
1803
|
+
}), /* @__PURE__ */ r(E, {
|
|
1775
1804
|
name: "role_id",
|
|
1776
1805
|
control: c,
|
|
1777
1806
|
render: ({
|
|
1778
1807
|
field: l
|
|
1779
1808
|
}) => /* @__PURE__ */ r(Te, {
|
|
1780
|
-
styles:
|
|
1809
|
+
styles: n,
|
|
1781
1810
|
...l
|
|
1782
1811
|
})
|
|
1783
1812
|
}), /* @__PURE__ */ r(j, {
|
|
1784
1813
|
position: "right",
|
|
1785
|
-
mt:
|
|
1786
|
-
children: /* @__PURE__ */ r(
|
|
1814
|
+
mt: n.spacing,
|
|
1815
|
+
children: /* @__PURE__ */ r(x, {
|
|
1787
1816
|
type: "submit",
|
|
1788
|
-
size:
|
|
1817
|
+
size: n.button.size,
|
|
1789
1818
|
children: "Save"
|
|
1790
1819
|
})
|
|
1791
1820
|
})]
|
|
1792
1821
|
})
|
|
1793
1822
|
});
|
|
1794
1823
|
}
|
|
1795
|
-
function
|
|
1824
|
+
function ut({
|
|
1796
1825
|
onSuccess: t,
|
|
1797
|
-
styles:
|
|
1826
|
+
styles: n = pe,
|
|
1798
1827
|
initialRoleID: s
|
|
1799
1828
|
}) {
|
|
1800
|
-
const c =
|
|
1829
|
+
const c = le(), [u, i] = J.useState(!1), l = () => i(!0), d = () => i(!1);
|
|
1801
1830
|
return /* @__PURE__ */ w($, {
|
|
1802
|
-
children: [/* @__PURE__ */ r(
|
|
1831
|
+
children: [/* @__PURE__ */ r(se, {
|
|
1803
1832
|
overflow: "inside",
|
|
1804
1833
|
opened: u,
|
|
1805
1834
|
onClose: () => i(!1),
|
|
1806
1835
|
title: "Add an API Key",
|
|
1807
1836
|
trapFocus: !0,
|
|
1808
|
-
onDragStart: (
|
|
1809
|
-
|
|
1837
|
+
onDragStart: (y) => {
|
|
1838
|
+
y.stopPropagation();
|
|
1810
1839
|
},
|
|
1811
|
-
children: /* @__PURE__ */ r(
|
|
1812
|
-
postSubmit: (
|
|
1813
|
-
|
|
1840
|
+
children: /* @__PURE__ */ r(lt, {
|
|
1841
|
+
postSubmit: (y, _) => {
|
|
1842
|
+
d(), c.openModal({
|
|
1814
1843
|
title: "API Key is generated",
|
|
1815
1844
|
children: /* @__PURE__ */ w(rr, {
|
|
1816
|
-
children: [/* @__PURE__ */ r(
|
|
1817
|
-
|
|
1845
|
+
children: [/* @__PURE__ */ r(oe, {
|
|
1846
|
+
color: "dimmed",
|
|
1847
|
+
children: "Make sure you save it - you won't be able to access it again."
|
|
1848
|
+
}), /* @__PURE__ */ r(I, {
|
|
1849
|
+
defaultValue: y,
|
|
1818
1850
|
disabled: !0,
|
|
1819
|
-
label: "
|
|
1820
|
-
description: "Make sure you save it - you won't be able to access it again.",
|
|
1851
|
+
label: "APP ID",
|
|
1821
1852
|
styles: {
|
|
1822
1853
|
input: {
|
|
1823
1854
|
cursor: "text !important"
|
|
1824
1855
|
}
|
|
1825
1856
|
}
|
|
1826
|
-
}), /* @__PURE__ */ r(
|
|
1857
|
+
}), /* @__PURE__ */ r(I, {
|
|
1858
|
+
defaultValue: _,
|
|
1859
|
+
disabled: !0,
|
|
1860
|
+
label: "APP Secret",
|
|
1861
|
+
styles: {
|
|
1862
|
+
input: {
|
|
1863
|
+
cursor: "text !important"
|
|
1864
|
+
}
|
|
1865
|
+
}
|
|
1866
|
+
}), /* @__PURE__ */ r(x, {
|
|
1827
1867
|
size: "sm",
|
|
1828
1868
|
onClick: () => {
|
|
1829
|
-
|
|
1869
|
+
Vr();
|
|
1830
1870
|
},
|
|
1831
1871
|
children: "I've saved this API Key"
|
|
1832
1872
|
})]
|
|
1833
|
-
})
|
|
1873
|
+
}),
|
|
1874
|
+
onClose: () => {
|
|
1875
|
+
t();
|
|
1876
|
+
}
|
|
1834
1877
|
});
|
|
1835
1878
|
},
|
|
1836
|
-
styles:
|
|
1879
|
+
styles: n,
|
|
1837
1880
|
initialRoleID: s
|
|
1838
1881
|
})
|
|
1839
|
-
}), /* @__PURE__ */ r(
|
|
1840
|
-
size:
|
|
1882
|
+
}), /* @__PURE__ */ r(x, {
|
|
1883
|
+
size: n.button.size,
|
|
1841
1884
|
onClick: l,
|
|
1842
1885
|
leftIcon: /* @__PURE__ */ r(Ee, {
|
|
1843
1886
|
size: 20
|
|
@@ -1846,13 +1889,13 @@ function st({
|
|
|
1846
1889
|
})]
|
|
1847
1890
|
});
|
|
1848
1891
|
}
|
|
1849
|
-
function
|
|
1892
|
+
function dt({
|
|
1850
1893
|
id: t,
|
|
1851
|
-
name:
|
|
1894
|
+
name: n,
|
|
1852
1895
|
onSuccess: s,
|
|
1853
|
-
styles: c =
|
|
1896
|
+
styles: c = pe
|
|
1854
1897
|
}) {
|
|
1855
|
-
const u =
|
|
1898
|
+
const u = le(), i = async () => {
|
|
1856
1899
|
if (!!t) {
|
|
1857
1900
|
M({
|
|
1858
1901
|
id: "for-deleting",
|
|
@@ -1861,17 +1904,17 @@ function ct({
|
|
|
1861
1904
|
loading: !0
|
|
1862
1905
|
});
|
|
1863
1906
|
try {
|
|
1864
|
-
await
|
|
1907
|
+
await D.api_key.delete(t), z({
|
|
1865
1908
|
id: "for-deleting",
|
|
1866
1909
|
title: "Successful",
|
|
1867
|
-
message: `API Key [${
|
|
1910
|
+
message: `API Key [${n}] is deleted`,
|
|
1868
1911
|
color: "green"
|
|
1869
1912
|
}), s();
|
|
1870
|
-
} catch (
|
|
1871
|
-
|
|
1913
|
+
} catch (d) {
|
|
1914
|
+
z({
|
|
1872
1915
|
id: "for-deleting",
|
|
1873
1916
|
title: "Failed",
|
|
1874
|
-
message:
|
|
1917
|
+
message: d.message,
|
|
1875
1918
|
color: "red"
|
|
1876
1919
|
});
|
|
1877
1920
|
}
|
|
@@ -1885,7 +1928,7 @@ function ct({
|
|
|
1885
1928
|
onCancel: () => console.log("Cancel"),
|
|
1886
1929
|
onConfirm: i
|
|
1887
1930
|
});
|
|
1888
|
-
return /* @__PURE__ */ r(
|
|
1931
|
+
return /* @__PURE__ */ r(x, {
|
|
1889
1932
|
size: c.button.size,
|
|
1890
1933
|
color: "red",
|
|
1891
1934
|
onClick: l,
|
|
@@ -1895,51 +1938,51 @@ function ct({
|
|
|
1895
1938
|
children: "Delete"
|
|
1896
1939
|
});
|
|
1897
1940
|
}
|
|
1898
|
-
function
|
|
1899
|
-
styles: t =
|
|
1900
|
-
config:
|
|
1941
|
+
function Pt({
|
|
1942
|
+
styles: t = pe,
|
|
1943
|
+
config: n
|
|
1901
1944
|
}) {
|
|
1902
|
-
var
|
|
1903
|
-
|
|
1945
|
+
var y, _;
|
|
1946
|
+
ue(n);
|
|
1904
1947
|
const {
|
|
1905
1948
|
data: s = [],
|
|
1906
1949
|
loading: c,
|
|
1907
1950
|
refresh: u
|
|
1908
1951
|
} = G(async () => {
|
|
1909
1952
|
const {
|
|
1910
|
-
data:
|
|
1911
|
-
} = await
|
|
1912
|
-
return
|
|
1953
|
+
data: v
|
|
1954
|
+
} = await D.api_key.list();
|
|
1955
|
+
return v;
|
|
1913
1956
|
}, {
|
|
1914
1957
|
refreshDeps: []
|
|
1915
1958
|
}), {
|
|
1916
1959
|
data: i = [],
|
|
1917
1960
|
loading: l
|
|
1918
|
-
} = G(async () => (await
|
|
1919
|
-
label:
|
|
1920
|
-
value:
|
|
1921
|
-
description:
|
|
1922
|
-
disabled:
|
|
1961
|
+
} = G(async () => (await D.role.list()).map((f) => ({
|
|
1962
|
+
label: f.name,
|
|
1963
|
+
value: f.id,
|
|
1964
|
+
description: f.description,
|
|
1965
|
+
disabled: f.id === 50
|
|
1923
1966
|
})), {
|
|
1924
1967
|
refreshDeps: []
|
|
1925
|
-
}),
|
|
1926
|
-
var
|
|
1927
|
-
return (
|
|
1968
|
+
}), d = nr(() => i.reduce((v, f) => (v.set(f.value, f.label), v), /* @__PURE__ */ new Map()), [i]), h = (v) => {
|
|
1969
|
+
var f;
|
|
1970
|
+
return (f = d.get(v)) != null ? f : v;
|
|
1928
1971
|
};
|
|
1929
1972
|
return /* @__PURE__ */ w($, {
|
|
1930
1973
|
children: [/* @__PURE__ */ r(j, {
|
|
1931
1974
|
pt: t.spacing,
|
|
1932
1975
|
position: "right",
|
|
1933
|
-
children: /* @__PURE__ */ r(
|
|
1976
|
+
children: /* @__PURE__ */ r(ut, {
|
|
1934
1977
|
onSuccess: u,
|
|
1935
|
-
initialRoleID: (
|
|
1978
|
+
initialRoleID: (_ = (y = i == null ? void 0 : i[0]) == null ? void 0 : y.value) != null ? _ : 0
|
|
1936
1979
|
})
|
|
1937
1980
|
}), /* @__PURE__ */ w(L, {
|
|
1938
1981
|
mt: t.spacing,
|
|
1939
1982
|
sx: {
|
|
1940
1983
|
position: "relative"
|
|
1941
1984
|
},
|
|
1942
|
-
children: [/* @__PURE__ */ r(
|
|
1985
|
+
children: [/* @__PURE__ */ r(Re, {
|
|
1943
1986
|
visible: c || l
|
|
1944
1987
|
}), /* @__PURE__ */ w(Pe, {
|
|
1945
1988
|
horizontalSpacing: t.spacing,
|
|
@@ -1951,7 +1994,7 @@ function St({
|
|
|
1951
1994
|
children: [/* @__PURE__ */ r("th", {
|
|
1952
1995
|
children: "Name"
|
|
1953
1996
|
}), /* @__PURE__ */ r("th", {
|
|
1954
|
-
children: "
|
|
1997
|
+
children: "APP ID"
|
|
1955
1998
|
}), /* @__PURE__ */ r("th", {
|
|
1956
1999
|
children: "Role"
|
|
1957
2000
|
}), /* @__PURE__ */ r("th", {
|
|
@@ -1959,13 +2002,13 @@ function St({
|
|
|
1959
2002
|
})]
|
|
1960
2003
|
})
|
|
1961
2004
|
}), /* @__PURE__ */ r("tbody", {
|
|
1962
|
-
children: s.map((
|
|
2005
|
+
children: s.map((v) => {
|
|
1963
2006
|
const {
|
|
1964
|
-
id:
|
|
2007
|
+
id: f,
|
|
1965
2008
|
name: O,
|
|
1966
|
-
|
|
1967
|
-
role_id:
|
|
1968
|
-
} =
|
|
2009
|
+
app_id: N,
|
|
2010
|
+
role_id: V
|
|
2011
|
+
} = v;
|
|
1969
2012
|
return /* @__PURE__ */ w("tr", {
|
|
1970
2013
|
children: [/* @__PURE__ */ r("td", {
|
|
1971
2014
|
width: 200,
|
|
@@ -1975,19 +2018,19 @@ function St({
|
|
|
1975
2018
|
children: N
|
|
1976
2019
|
}), /* @__PURE__ */ r("td", {
|
|
1977
2020
|
width: 200,
|
|
1978
|
-
children:
|
|
2021
|
+
children: h(V)
|
|
1979
2022
|
}), /* @__PURE__ */ r("td", {
|
|
1980
2023
|
width: 200,
|
|
1981
2024
|
children: /* @__PURE__ */ r(j, {
|
|
1982
2025
|
position: "left",
|
|
1983
|
-
children: /* @__PURE__ */ r(
|
|
1984
|
-
id:
|
|
2026
|
+
children: /* @__PURE__ */ r(dt, {
|
|
2027
|
+
id: f,
|
|
1985
2028
|
name: O,
|
|
1986
2029
|
onSuccess: u
|
|
1987
2030
|
})
|
|
1988
2031
|
})
|
|
1989
2032
|
})]
|
|
1990
|
-
},
|
|
2033
|
+
}, f);
|
|
1991
2034
|
})
|
|
1992
2035
|
})]
|
|
1993
2036
|
})]
|
|
@@ -1995,14 +2038,14 @@ function St({
|
|
|
1995
2038
|
});
|
|
1996
2039
|
}
|
|
1997
2040
|
export {
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2041
|
+
Pt as APIKeyList,
|
|
2042
|
+
yt as AccountList,
|
|
2043
|
+
ut as AddAPIKey,
|
|
2044
|
+
at as AddAccount,
|
|
2045
|
+
et as AddDataSource,
|
|
2046
|
+
_t as DataSourceList,
|
|
2047
|
+
dt as DeleteAPIKey,
|
|
2048
|
+
it as DeleteAccount,
|
|
2049
|
+
rt as DeleteDataSource,
|
|
2050
|
+
Rt as Login
|
|
2008
2051
|
};
|