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