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