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