@devtable/settings-form 10.37.3 → 10.38.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/index.d.ts +1 -17
- package/dist/{package-798d9388.mjs → package-2360dfd8.mjs} +1 -1
- package/dist/{account → settings-form/src/account}/index.d.ts +1 -0
- package/dist/settings-form/src/api-caller/request.d.ts +9 -0
- package/dist/settings-form/src/index.d.ts +19 -0
- package/dist/settings-form/src/shared/api-client/default-api-client.d.ts +17 -0
- package/dist/settings-form/src/shared/api-client/facade-api-client.d.ts +7 -0
- package/dist/settings-form/src/shared/api-client/index.d.ts +4 -0
- package/dist/settings-form/src/shared/api-client/types.d.ts +11 -0
- package/dist/settings-form/src/shared/api-client/utils.d.ts +3 -0
- package/dist/settings-form/src/shared/index.d.ts +1 -0
- package/dist/settings-form.es.js +577 -551
- package/dist/settings-form.umd.js +16 -16
- package/dist/stats.html +1 -1
- package/package.json +1 -1
- package/dist/api-caller/request.d.ts +0 -13
- /package/dist/{account → settings-form/src/account}/account-list.d.ts +0 -0
- /package/dist/{account → settings-form/src/account}/add-account.d.ts +0 -0
- /package/dist/{account → settings-form/src/account}/delete-account.d.ts +0 -0
- /package/dist/{account → settings-form/src/account}/edit-account.d.ts +0 -0
- /package/dist/{account → settings-form/src/account}/login/form.d.ts +0 -0
- /package/dist/{account → settings-form/src/account}/login/index.d.ts +0 -0
- /package/dist/{account → settings-form/src/account}/role-selector.d.ts +0 -0
- /package/dist/{account → settings-form/src/account}/styles.d.ts +0 -0
- /package/dist/{api-caller → settings-form/src/api-caller}/account.d.ts +0 -0
- /package/dist/{api-caller → settings-form/src/api-caller}/account.typed.d.ts +0 -0
- /package/dist/{api-caller → settings-form/src/api-caller}/api-key.d.ts +0 -0
- /package/dist/{api-caller → settings-form/src/api-caller}/api-key.typed.d.ts +0 -0
- /package/dist/{api-caller → settings-form/src/api-caller}/datasource.d.ts +0 -0
- /package/dist/{api-caller → settings-form/src/api-caller}/datasource.typed.d.ts +0 -0
- /package/dist/{api-caller → settings-form/src/api-caller}/index.d.ts +0 -0
- /package/dist/{api-caller → settings-form/src/api-caller}/role.d.ts +0 -0
- /package/dist/{api-caller → settings-form/src/api-caller}/role.typed.d.ts +0 -0
- /package/dist/{api-caller → settings-form/src/api-caller}/sql_snippet.d.ts +0 -0
- /package/dist/{api-caller → settings-form/src/api-caller}/sql_snippet.typed.d.ts +0 -0
- /package/dist/{api-caller → settings-form/src/api-caller}/types.d.ts +0 -0
- /package/dist/{api-key → settings-form/src/api-key}/add-api-key.d.ts +0 -0
- /package/dist/{api-key → settings-form/src/api-key}/api-key-list.d.ts +0 -0
- /package/dist/{api-key → settings-form/src/api-key}/delete-api-key.d.ts +0 -0
- /package/dist/{api-key → settings-form/src/api-key}/index.d.ts +0 -0
- /package/dist/{api-key → settings-form/src/api-key}/styles.d.ts +0 -0
- /package/dist/{components → settings-form/src/components}/minimal-mocaco-editor.d.ts +0 -0
- /package/dist/{datasource → settings-form/src/datasource}/add-data-source/db-permission-tips.d.ts +0 -0
- /package/dist/{datasource → settings-form/src/datasource}/add-data-source/forms/database.d.ts +0 -0
- /package/dist/{datasource → settings-form/src/datasource}/add-data-source/forms/http.d.ts +0 -0
- /package/dist/{datasource → settings-form/src/datasource}/add-data-source/index.d.ts +0 -0
- /package/dist/{datasource → settings-form/src/datasource}/add-data-source/types.d.ts +0 -0
- /package/dist/{datasource → settings-form/src/datasource}/components/data-source-icon.d.ts +0 -0
- /package/dist/{datasource → settings-form/src/datasource}/components/function-string-field/function-string-editor.d.ts +0 -0
- /package/dist/{datasource → settings-form/src/datasource}/components/function-string-field/index.d.ts +0 -0
- /package/dist/{datasource → settings-form/src/datasource}/data-source-list.d.ts +0 -0
- /package/dist/{datasource → settings-form/src/datasource}/delete-data-source.d.ts +0 -0
- /package/dist/{datasource → settings-form/src/datasource}/edit-data-source/forms/http.d.ts +0 -0
- /package/dist/{datasource → settings-form/src/datasource}/edit-data-source/index.d.ts +0 -0
- /package/dist/{datasource → settings-form/src/datasource}/edit-data-source/types.d.ts +0 -0
- /package/dist/{datasource → settings-form/src/datasource}/index.d.ts +0 -0
- /package/dist/{datasource → settings-form/src/datasource}/styles.d.ts +0 -0
- /package/dist/{global.d.ts → settings-form/src/global.d.ts} +0 -0
- /package/dist/{sql_snippet → settings-form/src/sql_snippet}/add-sql_snippet.d.ts +0 -0
- /package/dist/{sql_snippet → settings-form/src/sql_snippet}/delete-sql_snippet.d.ts +0 -0
- /package/dist/{sql_snippet → settings-form/src/sql_snippet}/index.d.ts +0 -0
- /package/dist/{sql_snippet → settings-form/src/sql_snippet}/sql_snippet-list.d.ts +0 -0
- /package/dist/{sql_snippet → settings-form/src/sql_snippet}/styles.d.ts +0 -0
- /package/dist/{sql_snippet → settings-form/src/sql_snippet}/update-sql_snippet.d.ts +0 -0
- /package/dist/{utils → settings-form/src/utils}/load-monaco-editor.d.ts +0 -0
- /package/dist/{vite-env.d.ts → settings-form/src/vite-env.d.ts} +0 -0
package/dist/settings-form.es.js
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import K, { useEffect as
|
|
2
|
-
import { Box as se, TextInput as ue, Divider as
|
|
3
|
-
import { showNotification as be, updateNotification as
|
|
4
|
-
import { Recycle as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import Pr from "lodash";
|
|
1
|
+
import K, { useEffect as yt, forwardRef as Je, useState as qt, Component as kr } from "react";
|
|
2
|
+
import { Box as se, TextInput as ue, Divider as et, Group as Q, NumberInput as Tr, PasswordInput as tt, Button as V, Modal as Ae, Stack as je, Alert as Rr, SegmentedControl as Or, Tooltip as Ke, Text as Re, ActionIcon as vt, LoadingOverlay as rt, Table as nt, Select as xr, Switch as Cr, createStyles as Ht, rem as Me, useComponentDefaultProps as Ir, useMantineTheme as Dr, ScrollArea as Yt, Tabs as at, HoverCard as gt } from "@mantine/core";
|
|
3
|
+
import { showNotification as be, updateNotification as J } from "@mantine/notifications";
|
|
4
|
+
import { Recycle as Lr, AlertCircle as Fr, PlaylistAdd as it, Trash as ot, Edit as Nr } from "tabler-icons-react";
|
|
5
|
+
import * as $r from "crypto-js";
|
|
6
|
+
import Pr from "axios";
|
|
8
7
|
import { useForm as Ee, Controller as H } from "react-hook-form";
|
|
9
8
|
import { useBoolean as zr, useRequest as Oe } from "ahooks";
|
|
10
|
-
import
|
|
11
|
-
import { useModals as
|
|
12
|
-
import { IconLock as
|
|
9
|
+
import Vt, { loader as ft } from "@monaco-editor/react";
|
|
10
|
+
import { useModals as Ue, closeAllModals as Mr } from "@mantine/modals";
|
|
11
|
+
import { IconLock as Wt, IconEdit as ht, IconNetwork as Br, IconBrandMysql as jr, IconDatabase as Ur, IconEye as Gr } from "@tabler/icons-react";
|
|
13
12
|
import { useClipboard as qr } from "@mantine/hooks";
|
|
14
|
-
var Hr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {},
|
|
13
|
+
var Hr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Be = {}, Yr = {
|
|
15
14
|
get exports() {
|
|
16
|
-
return
|
|
15
|
+
return Be;
|
|
17
16
|
},
|
|
18
17
|
set exports(e) {
|
|
19
|
-
|
|
18
|
+
Be = e;
|
|
20
19
|
}
|
|
21
20
|
}, Fe = {};
|
|
22
21
|
/**
|
|
@@ -28,11 +27,11 @@ var Hr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
28
27
|
* This source code is licensed under the MIT license found in the
|
|
29
28
|
* LICENSE file in the root directory of this source tree.
|
|
30
29
|
*/
|
|
31
|
-
var
|
|
30
|
+
var Nt;
|
|
32
31
|
function Vr() {
|
|
33
|
-
if (
|
|
32
|
+
if (Nt)
|
|
34
33
|
return Fe;
|
|
35
|
-
|
|
34
|
+
Nt = 1;
|
|
36
35
|
var e = K, t = Symbol.for("react.element"), r = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, s = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
37
36
|
function l(p, d, f) {
|
|
38
37
|
var b, u = {}, c = null, g = null;
|
|
@@ -56,9 +55,9 @@ var Ne = {};
|
|
|
56
55
|
* This source code is licensed under the MIT license found in the
|
|
57
56
|
* LICENSE file in the root directory of this source tree.
|
|
58
57
|
*/
|
|
59
|
-
var
|
|
58
|
+
var $t;
|
|
60
59
|
function Wr() {
|
|
61
|
-
return
|
|
60
|
+
return $t || ($t = 1, process.env.NODE_ENV !== "production" && function() {
|
|
62
61
|
var e = K, t = Symbol.for("react.element"), r = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), l = Symbol.for("react.provider"), p = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), f = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), u = Symbol.for("react.memo"), c = Symbol.for("react.lazy"), g = Symbol.for("react.offscreen"), y = Symbol.iterator, h = "@@iterator";
|
|
63
62
|
function _(i) {
|
|
64
63
|
if (i === null || typeof i != "object")
|
|
@@ -84,10 +83,10 @@ function Wr() {
|
|
|
84
83
|
W.unshift("Warning: " + v), Function.prototype.apply.call(console[i], console, W);
|
|
85
84
|
}
|
|
86
85
|
}
|
|
87
|
-
var M = !1,
|
|
86
|
+
var M = !1, te = !1, X = !1, Y = !1, Z = !1, F;
|
|
88
87
|
F = Symbol.for("react.module.reference");
|
|
89
88
|
function L(i) {
|
|
90
|
-
return !!(typeof i == "string" || typeof i == "function" || i === n || i === o || Z || i === s || i === f || i === b || Y || i === g || M ||
|
|
89
|
+
return !!(typeof i == "string" || typeof i == "function" || i === n || i === o || Z || i === s || i === f || i === b || Y || i === g || M || te || X || typeof i == "object" && i !== null && (i.$$typeof === c || i.$$typeof === u || i.$$typeof === l || i.$$typeof === p || i.$$typeof === d || // This needs to include all possible module reference object
|
|
91
90
|
// types supported by any Flight configuration anywhere since
|
|
92
91
|
// we don't know which Flight build this will end up being used
|
|
93
92
|
// with.
|
|
@@ -100,7 +99,7 @@ function Wr() {
|
|
|
100
99
|
var G = v.displayName || v.name || "";
|
|
101
100
|
return G !== "" ? T + "(" + G + ")" : T;
|
|
102
101
|
}
|
|
103
|
-
function
|
|
102
|
+
function ee(i) {
|
|
104
103
|
return i.displayName || "Context";
|
|
105
104
|
}
|
|
106
105
|
function R(i) {
|
|
@@ -128,10 +127,10 @@ function Wr() {
|
|
|
128
127
|
switch (i.$$typeof) {
|
|
129
128
|
case p:
|
|
130
129
|
var v = i;
|
|
131
|
-
return
|
|
130
|
+
return ee(v) + ".Consumer";
|
|
132
131
|
case l:
|
|
133
132
|
var T = i;
|
|
134
|
-
return
|
|
133
|
+
return ee(T._context) + ".Provider";
|
|
135
134
|
case d:
|
|
136
135
|
return B(i, i.render, "ForwardRef");
|
|
137
136
|
case u:
|
|
@@ -224,13 +223,13 @@ function Wr() {
|
|
|
224
223
|
` + ye + i;
|
|
225
224
|
}
|
|
226
225
|
}
|
|
227
|
-
var
|
|
226
|
+
var re = !1, de;
|
|
228
227
|
{
|
|
229
228
|
var ve = typeof WeakMap == "function" ? WeakMap : Map;
|
|
230
229
|
de = new ve();
|
|
231
230
|
}
|
|
232
231
|
function Te(i, v) {
|
|
233
|
-
if (!i ||
|
|
232
|
+
if (!i || re)
|
|
234
233
|
return "";
|
|
235
234
|
{
|
|
236
235
|
var T = de.get(i);
|
|
@@ -238,7 +237,7 @@ function Wr() {
|
|
|
238
237
|
return T;
|
|
239
238
|
}
|
|
240
239
|
var D;
|
|
241
|
-
|
|
240
|
+
re = !0;
|
|
242
241
|
var G = Error.prepareStackTrace;
|
|
243
242
|
Error.prepareStackTrace = void 0;
|
|
244
243
|
var W;
|
|
@@ -279,39 +278,39 @@ function Wr() {
|
|
|
279
278
|
if (we && D && typeof we.stack == "string") {
|
|
280
279
|
for (var P = we.stack.split(`
|
|
281
280
|
`), ge = D.stack.split(`
|
|
282
|
-
`),
|
|
281
|
+
`), ne = P.length - 1, ie = ge.length - 1; ne >= 1 && ie >= 0 && P[ne] !== ge[ie]; )
|
|
283
282
|
ie--;
|
|
284
|
-
for (;
|
|
285
|
-
if (P[
|
|
286
|
-
if (
|
|
283
|
+
for (; ne >= 1 && ie >= 0; ne--, ie--)
|
|
284
|
+
if (P[ne] !== ge[ie]) {
|
|
285
|
+
if (ne !== 1 || ie !== 1)
|
|
287
286
|
do
|
|
288
|
-
if (
|
|
287
|
+
if (ne--, ie--, ie < 0 || P[ne] !== ge[ie]) {
|
|
289
288
|
var me = `
|
|
290
|
-
` + P[
|
|
289
|
+
` + P[ne].replace(" at new ", " at ");
|
|
291
290
|
return i.displayName && me.includes("<anonymous>") && (me = me.replace("<anonymous>", i.displayName)), typeof i == "function" && de.set(i, me), me;
|
|
292
291
|
}
|
|
293
|
-
while (
|
|
292
|
+
while (ne >= 1 && ie >= 0);
|
|
294
293
|
break;
|
|
295
294
|
}
|
|
296
295
|
}
|
|
297
296
|
} finally {
|
|
298
|
-
|
|
297
|
+
re = !1, pe.current = W, ce(), Error.prepareStackTrace = G;
|
|
299
298
|
}
|
|
300
|
-
var Ce = i ? i.displayName || i.name : "",
|
|
301
|
-
return typeof i == "function" && de.set(i,
|
|
299
|
+
var Ce = i ? i.displayName || i.name : "", Ft = Ce ? fe(Ce) : "";
|
|
300
|
+
return typeof i == "function" && de.set(i, Ft), Ft;
|
|
302
301
|
}
|
|
303
|
-
function
|
|
302
|
+
function nr(i, v, T) {
|
|
304
303
|
return Te(i, !1);
|
|
305
304
|
}
|
|
306
|
-
function
|
|
305
|
+
function ar(i) {
|
|
307
306
|
var v = i.prototype;
|
|
308
307
|
return !!(v && v.isReactComponent);
|
|
309
308
|
}
|
|
310
|
-
function
|
|
309
|
+
function He(i, v, T) {
|
|
311
310
|
if (i == null)
|
|
312
311
|
return "";
|
|
313
312
|
if (typeof i == "function")
|
|
314
|
-
return Te(i,
|
|
313
|
+
return Te(i, ar(i));
|
|
315
314
|
if (typeof i == "string")
|
|
316
315
|
return fe(i);
|
|
317
316
|
switch (i) {
|
|
@@ -323,30 +322,30 @@ function Wr() {
|
|
|
323
322
|
if (typeof i == "object")
|
|
324
323
|
switch (i.$$typeof) {
|
|
325
324
|
case d:
|
|
326
|
-
return
|
|
325
|
+
return nr(i.render);
|
|
327
326
|
case u:
|
|
328
|
-
return
|
|
327
|
+
return He(i.type, v, T);
|
|
329
328
|
case c: {
|
|
330
329
|
var D = i, G = D._payload, W = D._init;
|
|
331
330
|
try {
|
|
332
|
-
return
|
|
331
|
+
return He(W(G), v, T);
|
|
333
332
|
} catch {
|
|
334
333
|
}
|
|
335
334
|
}
|
|
336
335
|
}
|
|
337
336
|
return "";
|
|
338
337
|
}
|
|
339
|
-
var
|
|
340
|
-
function
|
|
338
|
+
var Ye = Object.prototype.hasOwnProperty, Et = {}, _t = A.ReactDebugCurrentFrame;
|
|
339
|
+
function Ve(i) {
|
|
341
340
|
if (i) {
|
|
342
|
-
var v = i._owner, T =
|
|
343
|
-
|
|
341
|
+
var v = i._owner, T = He(i.type, i._source, v ? v.type : null);
|
|
342
|
+
_t.setExtraStackFrame(T);
|
|
344
343
|
} else
|
|
345
|
-
|
|
344
|
+
_t.setExtraStackFrame(null);
|
|
346
345
|
}
|
|
347
|
-
function
|
|
346
|
+
function ir(i, v, T, D, G) {
|
|
348
347
|
{
|
|
349
|
-
var W = Function.call.bind(
|
|
348
|
+
var W = Function.call.bind(Ye);
|
|
350
349
|
for (var z in i)
|
|
351
350
|
if (W(i, z)) {
|
|
352
351
|
var P = void 0;
|
|
@@ -356,70 +355,70 @@ function Wr() {
|
|
|
356
355
|
throw ge.name = "Invariant Violation", ge;
|
|
357
356
|
}
|
|
358
357
|
P = i[z](v, z, D, T, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
359
|
-
} catch (
|
|
360
|
-
P =
|
|
358
|
+
} catch (ne) {
|
|
359
|
+
P = ne;
|
|
361
360
|
}
|
|
362
|
-
P && !(P instanceof Error) && (
|
|
361
|
+
P && !(P instanceof Error) && (Ve(G), k("%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).", D || "React class", T, z, typeof P), Ve(null)), P instanceof Error && !(P.message in Et) && (Et[P.message] = !0, Ve(G), k("Failed %s type: %s", T, P.message), Ve(null));
|
|
363
362
|
}
|
|
364
363
|
}
|
|
365
364
|
}
|
|
366
|
-
var
|
|
367
|
-
function
|
|
368
|
-
return
|
|
365
|
+
var or = Array.isArray;
|
|
366
|
+
function lt(i) {
|
|
367
|
+
return or(i);
|
|
369
368
|
}
|
|
370
|
-
function
|
|
369
|
+
function sr(i) {
|
|
371
370
|
{
|
|
372
371
|
var v = typeof Symbol == "function" && Symbol.toStringTag, T = v && i[Symbol.toStringTag] || i.constructor.name || "Object";
|
|
373
372
|
return T;
|
|
374
373
|
}
|
|
375
374
|
}
|
|
376
|
-
function
|
|
375
|
+
function lr(i) {
|
|
377
376
|
try {
|
|
378
|
-
return
|
|
377
|
+
return At(i), !1;
|
|
379
378
|
} catch {
|
|
380
379
|
return !0;
|
|
381
380
|
}
|
|
382
381
|
}
|
|
383
|
-
function
|
|
382
|
+
function At(i) {
|
|
384
383
|
return "" + i;
|
|
385
384
|
}
|
|
386
|
-
function
|
|
387
|
-
if (
|
|
388
|
-
return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",
|
|
385
|
+
function kt(i) {
|
|
386
|
+
if (lr(i))
|
|
387
|
+
return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", sr(i)), At(i);
|
|
389
388
|
}
|
|
390
|
-
var Le = A.ReactCurrentOwner,
|
|
389
|
+
var Le = A.ReactCurrentOwner, ur = {
|
|
391
390
|
key: !0,
|
|
392
391
|
ref: !0,
|
|
393
392
|
__self: !0,
|
|
394
393
|
__source: !0
|
|
395
|
-
},
|
|
396
|
-
|
|
397
|
-
function
|
|
398
|
-
if (
|
|
394
|
+
}, Tt, Rt, ut;
|
|
395
|
+
ut = {};
|
|
396
|
+
function cr(i) {
|
|
397
|
+
if (Ye.call(i, "ref")) {
|
|
399
398
|
var v = Object.getOwnPropertyDescriptor(i, "ref").get;
|
|
400
399
|
if (v && v.isReactWarning)
|
|
401
400
|
return !1;
|
|
402
401
|
}
|
|
403
402
|
return i.ref !== void 0;
|
|
404
403
|
}
|
|
405
|
-
function
|
|
406
|
-
if (
|
|
404
|
+
function dr(i) {
|
|
405
|
+
if (Ye.call(i, "key")) {
|
|
407
406
|
var v = Object.getOwnPropertyDescriptor(i, "key").get;
|
|
408
407
|
if (v && v.isReactWarning)
|
|
409
408
|
return !1;
|
|
410
409
|
}
|
|
411
410
|
return i.key !== void 0;
|
|
412
411
|
}
|
|
413
|
-
function
|
|
412
|
+
function pr(i, v) {
|
|
414
413
|
if (typeof i.ref == "string" && Le.current && v && Le.current.stateNode !== v) {
|
|
415
414
|
var T = R(Le.current.type);
|
|
416
|
-
|
|
415
|
+
ut[T] || (k('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', R(Le.current.type), i.ref), ut[T] = !0);
|
|
417
416
|
}
|
|
418
417
|
}
|
|
419
|
-
function
|
|
418
|
+
function gr(i, v) {
|
|
420
419
|
{
|
|
421
420
|
var T = function() {
|
|
422
|
-
|
|
421
|
+
Tt || (Tt = !0, k("%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)", v));
|
|
423
422
|
};
|
|
424
423
|
T.isReactWarning = !0, Object.defineProperty(i, "key", {
|
|
425
424
|
get: T,
|
|
@@ -427,10 +426,10 @@ function Wr() {
|
|
|
427
426
|
});
|
|
428
427
|
}
|
|
429
428
|
}
|
|
430
|
-
function
|
|
429
|
+
function fr(i, v) {
|
|
431
430
|
{
|
|
432
431
|
var T = function() {
|
|
433
|
-
|
|
432
|
+
Rt || (Rt = !0, k("%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)", v));
|
|
434
433
|
};
|
|
435
434
|
T.isReactWarning = !0, Object.defineProperty(i, "ref", {
|
|
436
435
|
get: T,
|
|
@@ -438,7 +437,7 @@ function Wr() {
|
|
|
438
437
|
});
|
|
439
438
|
}
|
|
440
439
|
}
|
|
441
|
-
var
|
|
440
|
+
var hr = function(i, v, T, D, G, W, z) {
|
|
442
441
|
var P = {
|
|
443
442
|
// This tag allows us to uniquely identify this as a React Element
|
|
444
443
|
$$typeof: t,
|
|
@@ -467,41 +466,41 @@ function Wr() {
|
|
|
467
466
|
value: G
|
|
468
467
|
}), Object.freeze && (Object.freeze(P.props), Object.freeze(P)), P;
|
|
469
468
|
};
|
|
470
|
-
function
|
|
469
|
+
function mr(i, v, T, D, G) {
|
|
471
470
|
{
|
|
472
471
|
var W, z = {}, P = null, ge = null;
|
|
473
|
-
T !== void 0 && (
|
|
472
|
+
T !== void 0 && (kt(T), P = "" + T), dr(v) && (kt(v.key), P = "" + v.key), cr(v) && (ge = v.ref, pr(v, G));
|
|
474
473
|
for (W in v)
|
|
475
|
-
|
|
474
|
+
Ye.call(v, W) && !ur.hasOwnProperty(W) && (z[W] = v[W]);
|
|
476
475
|
if (i && i.defaultProps) {
|
|
477
|
-
var
|
|
478
|
-
for (W in
|
|
479
|
-
z[W] === void 0 && (z[W] =
|
|
476
|
+
var ne = i.defaultProps;
|
|
477
|
+
for (W in ne)
|
|
478
|
+
z[W] === void 0 && (z[W] = ne[W]);
|
|
480
479
|
}
|
|
481
480
|
if (P || ge) {
|
|
482
481
|
var ie = typeof i == "function" ? i.displayName || i.name || "Unknown" : i;
|
|
483
|
-
P &&
|
|
482
|
+
P && gr(z, ie), ge && fr(z, ie);
|
|
484
483
|
}
|
|
485
|
-
return
|
|
484
|
+
return hr(i, P, ge, G, D, Le.current, z);
|
|
486
485
|
}
|
|
487
486
|
}
|
|
488
|
-
var
|
|
487
|
+
var ct = A.ReactCurrentOwner, Ot = A.ReactDebugCurrentFrame;
|
|
489
488
|
function xe(i) {
|
|
490
489
|
if (i) {
|
|
491
|
-
var v = i._owner, T =
|
|
492
|
-
|
|
490
|
+
var v = i._owner, T = He(i.type, i._source, v ? v.type : null);
|
|
491
|
+
Ot.setExtraStackFrame(T);
|
|
493
492
|
} else
|
|
494
|
-
|
|
493
|
+
Ot.setExtraStackFrame(null);
|
|
495
494
|
}
|
|
496
|
-
var
|
|
497
|
-
|
|
498
|
-
function
|
|
495
|
+
var dt;
|
|
496
|
+
dt = !1;
|
|
497
|
+
function pt(i) {
|
|
499
498
|
return typeof i == "object" && i !== null && i.$$typeof === t;
|
|
500
499
|
}
|
|
501
|
-
function
|
|
500
|
+
function xt() {
|
|
502
501
|
{
|
|
503
|
-
if (
|
|
504
|
-
var i = R(
|
|
502
|
+
if (ct.current) {
|
|
503
|
+
var i = R(ct.current.type);
|
|
505
504
|
if (i)
|
|
506
505
|
return `
|
|
507
506
|
|
|
@@ -510,7 +509,7 @@ Check the render method of \`` + i + "`.";
|
|
|
510
509
|
return "";
|
|
511
510
|
}
|
|
512
511
|
}
|
|
513
|
-
function
|
|
512
|
+
function br(i) {
|
|
514
513
|
{
|
|
515
514
|
if (i !== void 0) {
|
|
516
515
|
var v = i.fileName.replace(/^.*[\\\/]/, ""), T = i.lineNumber;
|
|
@@ -521,10 +520,10 @@ Check your code at ` + v + ":" + T + ".";
|
|
|
521
520
|
return "";
|
|
522
521
|
}
|
|
523
522
|
}
|
|
524
|
-
var
|
|
525
|
-
function
|
|
523
|
+
var Ct = {};
|
|
524
|
+
function yr(i) {
|
|
526
525
|
{
|
|
527
|
-
var v =
|
|
526
|
+
var v = xt();
|
|
528
527
|
if (!v) {
|
|
529
528
|
var T = typeof i == "string" ? i : i.displayName || i.name;
|
|
530
529
|
T && (v = `
|
|
@@ -534,39 +533,39 @@ Check the top-level render call using <` + T + ">.");
|
|
|
534
533
|
return v;
|
|
535
534
|
}
|
|
536
535
|
}
|
|
537
|
-
function
|
|
536
|
+
function It(i, v) {
|
|
538
537
|
{
|
|
539
538
|
if (!i._store || i._store.validated || i.key != null)
|
|
540
539
|
return;
|
|
541
540
|
i._store.validated = !0;
|
|
542
|
-
var T =
|
|
543
|
-
if (
|
|
541
|
+
var T = yr(v);
|
|
542
|
+
if (Ct[T])
|
|
544
543
|
return;
|
|
545
|
-
|
|
544
|
+
Ct[T] = !0;
|
|
546
545
|
var D = "";
|
|
547
|
-
i && i._owner && i._owner !==
|
|
546
|
+
i && i._owner && i._owner !== ct.current && (D = " It was passed a child from " + R(i._owner.type) + "."), xe(i), k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', T, D), xe(null);
|
|
548
547
|
}
|
|
549
548
|
}
|
|
550
|
-
function
|
|
549
|
+
function Dt(i, v) {
|
|
551
550
|
{
|
|
552
551
|
if (typeof i != "object")
|
|
553
552
|
return;
|
|
554
|
-
if (
|
|
553
|
+
if (lt(i))
|
|
555
554
|
for (var T = 0; T < i.length; T++) {
|
|
556
555
|
var D = i[T];
|
|
557
|
-
|
|
556
|
+
pt(D) && It(D, v);
|
|
558
557
|
}
|
|
559
|
-
else if (
|
|
558
|
+
else if (pt(i))
|
|
560
559
|
i._store && (i._store.validated = !0);
|
|
561
560
|
else if (i) {
|
|
562
561
|
var G = _(i);
|
|
563
562
|
if (typeof G == "function" && G !== i.entries)
|
|
564
563
|
for (var W = G.call(i), z; !(z = W.next()).done; )
|
|
565
|
-
|
|
564
|
+
pt(z.value) && It(z.value, v);
|
|
566
565
|
}
|
|
567
566
|
}
|
|
568
567
|
}
|
|
569
|
-
function
|
|
568
|
+
function vr(i) {
|
|
570
569
|
{
|
|
571
570
|
var v = i.type;
|
|
572
571
|
if (v == null || typeof v == "string")
|
|
@@ -582,16 +581,16 @@ Check the top-level render call using <` + T + ">.");
|
|
|
582
581
|
return;
|
|
583
582
|
if (T) {
|
|
584
583
|
var D = R(v);
|
|
585
|
-
|
|
586
|
-
} else if (v.PropTypes !== void 0 && !
|
|
587
|
-
|
|
584
|
+
ir(T, i.props, "prop", D, i);
|
|
585
|
+
} else if (v.PropTypes !== void 0 && !dt) {
|
|
586
|
+
dt = !0;
|
|
588
587
|
var G = R(v);
|
|
589
588
|
k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", G || "Unknown");
|
|
590
589
|
}
|
|
591
590
|
typeof v.getDefaultProps == "function" && !v.getDefaultProps.isReactClassApproved && k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
592
591
|
}
|
|
593
592
|
}
|
|
594
|
-
function
|
|
593
|
+
function Sr(i) {
|
|
595
594
|
{
|
|
596
595
|
for (var v = Object.keys(i.props), T = 0; T < v.length; T++) {
|
|
597
596
|
var D = v[T];
|
|
@@ -603,50 +602,50 @@ Check the top-level render call using <` + T + ">.");
|
|
|
603
602
|
i.ref !== null && (xe(i), k("Invalid attribute `ref` supplied to `React.Fragment`."), xe(null));
|
|
604
603
|
}
|
|
605
604
|
}
|
|
606
|
-
function
|
|
605
|
+
function Lt(i, v, T, D, G, W) {
|
|
607
606
|
{
|
|
608
607
|
var z = L(i);
|
|
609
608
|
if (!z) {
|
|
610
609
|
var P = "";
|
|
611
610
|
(i === void 0 || typeof i == "object" && i !== null && Object.keys(i).length === 0) && (P += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
612
|
-
var ge =
|
|
613
|
-
ge ? P += ge : P +=
|
|
614
|
-
var
|
|
615
|
-
i === null ?
|
|
611
|
+
var ge = br(G);
|
|
612
|
+
ge ? P += ge : P += xt();
|
|
613
|
+
var ne;
|
|
614
|
+
i === null ? ne = "null" : lt(i) ? ne = "array" : i !== void 0 && i.$$typeof === t ? (ne = "<" + (R(i.type) || "Unknown") + " />", P = " Did you accidentally export a JSX literal instead of a component?") : ne = typeof i, k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", ne, P);
|
|
616
615
|
}
|
|
617
|
-
var ie =
|
|
616
|
+
var ie = mr(i, v, T, G, W);
|
|
618
617
|
if (ie == null)
|
|
619
618
|
return ie;
|
|
620
619
|
if (z) {
|
|
621
620
|
var me = v.children;
|
|
622
621
|
if (me !== void 0)
|
|
623
622
|
if (D)
|
|
624
|
-
if (
|
|
623
|
+
if (lt(me)) {
|
|
625
624
|
for (var Ce = 0; Ce < me.length; Ce++)
|
|
626
|
-
|
|
625
|
+
Dt(me[Ce], i);
|
|
627
626
|
Object.freeze && Object.freeze(me);
|
|
628
627
|
} else
|
|
629
628
|
k("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
630
629
|
else
|
|
631
|
-
|
|
630
|
+
Dt(me, i);
|
|
632
631
|
}
|
|
633
|
-
return i === n ?
|
|
632
|
+
return i === n ? Sr(ie) : vr(ie), ie;
|
|
634
633
|
}
|
|
635
634
|
}
|
|
636
|
-
function Sr(i, v, T) {
|
|
637
|
-
return Dt(i, v, T, !0);
|
|
638
|
-
}
|
|
639
635
|
function wr(i, v, T) {
|
|
640
|
-
return
|
|
636
|
+
return Lt(i, v, T, !0);
|
|
637
|
+
}
|
|
638
|
+
function Er(i, v, T) {
|
|
639
|
+
return Lt(i, v, T, !1);
|
|
641
640
|
}
|
|
642
|
-
var
|
|
643
|
-
Ne.Fragment = n, Ne.jsx =
|
|
641
|
+
var _r = Er, Ar = wr;
|
|
642
|
+
Ne.Fragment = n, Ne.jsx = _r, Ne.jsxs = Ar;
|
|
644
643
|
}()), Ne;
|
|
645
644
|
}
|
|
646
645
|
(function(e) {
|
|
647
646
|
process.env.NODE_ENV === "production" ? e.exports = Vr() : e.exports = Wr();
|
|
648
647
|
})(Yr);
|
|
649
|
-
const he =
|
|
648
|
+
const he = Be.Fragment, a = Be.jsx, C = Be.jsxs;
|
|
650
649
|
function Kr(e) {
|
|
651
650
|
e = e || {};
|
|
652
651
|
const t = Object.keys(e).sort(), r = [];
|
|
@@ -658,7 +657,9 @@ function Kr(e) {
|
|
|
658
657
|
const o = Object.keys(e[s]).sort();
|
|
659
658
|
for (let l = 0; l < o.length; l++) {
|
|
660
659
|
const p = o[l];
|
|
661
|
-
p != "sign" && e[s][p] && r.push(
|
|
660
|
+
p != "sign" && e[s][p] && r.push(
|
|
661
|
+
o[l] + "=" + (typeof e[s][p] == "object" ? JSON.stringify(e[s][p]) : e[s][p])
|
|
662
|
+
);
|
|
662
663
|
}
|
|
663
664
|
}
|
|
664
665
|
}
|
|
@@ -668,55 +669,75 @@ function Zr(e, t) {
|
|
|
668
669
|
let r = Kr(e);
|
|
669
670
|
return r += "&key=" + t, $r.MD5(r).toString().toUpperCase();
|
|
670
671
|
}
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
getAuthentication(
|
|
672
|
+
class Xr {
|
|
673
|
+
constructor() {
|
|
674
|
+
this.type = "default_api_client", this.baseURL = "http://localhost:31200", this.app_id = "", this.app_secret = "";
|
|
675
|
+
}
|
|
676
|
+
getAuthentication(t) {
|
|
676
677
|
if (!this.app_id || !this.app_secret)
|
|
677
678
|
return;
|
|
678
|
-
const
|
|
679
|
+
const r = (/* @__PURE__ */ new Date()).getTime().toString();
|
|
679
680
|
return {
|
|
680
681
|
app_id: this.app_id,
|
|
681
|
-
nonce_str:
|
|
682
|
-
sign: Zr(
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
682
|
+
nonce_str: r,
|
|
683
|
+
sign: Zr(
|
|
684
|
+
{
|
|
685
|
+
app_id: this.app_id,
|
|
686
|
+
nonce_str: r,
|
|
687
|
+
...t
|
|
688
|
+
},
|
|
689
|
+
this.app_secret
|
|
690
|
+
)
|
|
687
691
|
};
|
|
688
|
-
}
|
|
689
|
-
getRequest(
|
|
690
|
-
return (
|
|
691
|
-
const
|
|
692
|
-
|
|
693
|
-
"Content-Type": s.string ? "application/x-www-form-urlencoded" : "application/json",
|
|
694
|
-
authorization: o ? `bearer ${o}` : "",
|
|
695
|
-
...s.headers
|
|
696
|
-
}, p = {
|
|
697
|
-
baseURL: this.baseURL,
|
|
698
|
-
method: e,
|
|
699
|
-
url: r,
|
|
700
|
-
params: e === "GET" ? n : s.params,
|
|
701
|
-
headers: l,
|
|
702
|
-
signal: t
|
|
703
|
-
};
|
|
704
|
-
return ["POST", "PUT"].includes(e) && (p.data = s.string ? JSON.stringify(n) : n, p.data.authentication = this.getAuthentication(p.data)), Nr(p).then((d) => d.data).catch((d) => Pr.has(d, "response.data.detail.message") ? Promise.reject(new Error(d.response.data.detail.message)) : Promise.reject(d));
|
|
692
|
+
}
|
|
693
|
+
getRequest(t, r) {
|
|
694
|
+
return (n, s, o = {}) => {
|
|
695
|
+
const l = this.buildHeader(o), p = this.buildAxiosConfig(t, n, s, o, l, r);
|
|
696
|
+
return Pr(p).then((d) => d.data).catch((d) => Promise.reject(d));
|
|
705
697
|
};
|
|
706
698
|
}
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
699
|
+
buildAxiosConfig(t, r, n, s, o, l) {
|
|
700
|
+
const p = {
|
|
701
|
+
baseURL: this.baseURL,
|
|
702
|
+
method: t,
|
|
703
|
+
url: r,
|
|
704
|
+
params: t === "GET" ? n : s.params,
|
|
705
|
+
headers: o,
|
|
706
|
+
signal: l
|
|
707
|
+
};
|
|
708
|
+
return ["POST", "PUT"].includes(t) && (p.data = s.string ? JSON.stringify(n) : n, p.data.authentication = this.getAuthentication(p.data)), p;
|
|
709
|
+
}
|
|
710
|
+
buildHeader(t) {
|
|
711
|
+
const r = window.localStorage.getItem("token");
|
|
712
|
+
return {
|
|
713
|
+
"X-Requested-With": "XMLHttpRequest",
|
|
714
|
+
"Content-Type": t.string ? "application/x-www-form-urlencoded" : "application/json",
|
|
715
|
+
authorization: r ? `bearer ${r}` : "",
|
|
716
|
+
...t.headers
|
|
717
|
+
};
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
class Qr {
|
|
721
|
+
constructor(t) {
|
|
722
|
+
this.implementation = t;
|
|
723
|
+
}
|
|
724
|
+
getRequest(t, r) {
|
|
725
|
+
return this.implementation.getRequest(t, r);
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
const ze = new Xr(), Jr = new Qr(ze), ae = Jr;
|
|
729
|
+
function Ge(e) {
|
|
730
|
+
ze.baseURL !== e.apiBaseURL && (ze.baseURL = e.apiBaseURL), e.app_id && (ze.app_id = e.app_id), e.app_secret && (ze.app_secret = e.app_secret);
|
|
710
731
|
}
|
|
711
|
-
const
|
|
732
|
+
const en = {
|
|
712
733
|
login: async (e, t) => {
|
|
713
734
|
const r = {
|
|
714
735
|
name: e,
|
|
715
736
|
password: t
|
|
716
737
|
};
|
|
717
|
-
return await
|
|
738
|
+
return await ae.getRequest("POST")("/account/login", r);
|
|
718
739
|
},
|
|
719
|
-
list: async () => await
|
|
740
|
+
list: async () => await ae.getRequest("POST")("/account/list", {
|
|
720
741
|
filter: {},
|
|
721
742
|
sort: [{
|
|
722
743
|
field: "name",
|
|
@@ -730,7 +751,7 @@ const Xr = {
|
|
|
730
751
|
/**
|
|
731
752
|
* get current account
|
|
732
753
|
*/
|
|
733
|
-
get: async () => await
|
|
754
|
+
get: async () => await ae.getRequest("GET")("/account/get", {}),
|
|
734
755
|
/**
|
|
735
756
|
* update current account
|
|
736
757
|
*/
|
|
@@ -739,7 +760,7 @@ const Xr = {
|
|
|
739
760
|
name: e.trim(),
|
|
740
761
|
email: t.trim()
|
|
741
762
|
};
|
|
742
|
-
return await
|
|
763
|
+
return await ae.getRequest("PUT")("/account/update", r);
|
|
743
764
|
},
|
|
744
765
|
/**
|
|
745
766
|
* change current account's password
|
|
@@ -749,23 +770,23 @@ const Xr = {
|
|
|
749
770
|
old_password: e.trim(),
|
|
750
771
|
new_password: t.trim()
|
|
751
772
|
};
|
|
752
|
-
return await
|
|
773
|
+
return await ae.getRequest("POST")("/account/changepassword", r);
|
|
753
774
|
},
|
|
754
|
-
create: async (e, t, r, n) => await
|
|
775
|
+
create: async (e, t, r, n) => await ae.getRequest("POST")("/account/create", {
|
|
755
776
|
name: e.trim(),
|
|
756
777
|
email: t.trim(),
|
|
757
778
|
password: r.trim(),
|
|
758
779
|
role_id: n
|
|
759
780
|
}),
|
|
760
|
-
edit: async (e) => (e.reset_password || (e.new_password = void 0), await
|
|
781
|
+
edit: async (e) => (e.reset_password || (e.new_password = void 0), await ae.getRequest("PUT")("/account/edit", e)),
|
|
761
782
|
delete: async (e) => {
|
|
762
783
|
if (e)
|
|
763
|
-
return
|
|
784
|
+
return ae.getRequest("POST")("/account/delete", {
|
|
764
785
|
id: e
|
|
765
786
|
});
|
|
766
787
|
}
|
|
767
|
-
},
|
|
768
|
-
list: async () => await
|
|
788
|
+
}, tn = {
|
|
789
|
+
list: async () => await ae.getRequest("POST")("/api/key/list", {
|
|
769
790
|
filter: {
|
|
770
791
|
search: ""
|
|
771
792
|
},
|
|
@@ -778,18 +799,18 @@ const Xr = {
|
|
|
778
799
|
pagesize: 100
|
|
779
800
|
}
|
|
780
801
|
}),
|
|
781
|
-
create: async (e, t) =>
|
|
802
|
+
create: async (e, t) => ae.getRequest("POST")("/api/key/create", {
|
|
782
803
|
name: e,
|
|
783
804
|
role_id: t
|
|
784
805
|
}),
|
|
785
806
|
delete: async (e) => {
|
|
786
807
|
if (e)
|
|
787
|
-
return
|
|
808
|
+
return ae.getRequest("POST")("/api/key/delete", {
|
|
788
809
|
id: e
|
|
789
810
|
});
|
|
790
811
|
}
|
|
791
|
-
},
|
|
792
|
-
list: async () => await
|
|
812
|
+
}, rn = {
|
|
813
|
+
list: async () => await ae.getRequest("POST")("/datasource/list", {
|
|
793
814
|
filter: {},
|
|
794
815
|
sort: [{
|
|
795
816
|
field: "create_time",
|
|
@@ -800,29 +821,29 @@ const Xr = {
|
|
|
800
821
|
pagesize: 100
|
|
801
822
|
}
|
|
802
823
|
}),
|
|
803
|
-
create: async (e, t, r) => await
|
|
824
|
+
create: async (e, t, r) => await ae.getRequest("POST")("/datasource/create", {
|
|
804
825
|
type: e,
|
|
805
826
|
key: t,
|
|
806
827
|
config: r
|
|
807
828
|
}),
|
|
808
|
-
update: async (e, t) => await
|
|
829
|
+
update: async (e, t) => await ae.getRequest("PUT")("/datasource/update", {
|
|
809
830
|
id: e,
|
|
810
831
|
config: t
|
|
811
832
|
}),
|
|
812
833
|
delete: async (e) => {
|
|
813
|
-
await
|
|
834
|
+
await ae.getRequest("POST")("/datasource/delete", {
|
|
814
835
|
id: e
|
|
815
836
|
});
|
|
816
837
|
}
|
|
817
|
-
},
|
|
818
|
-
list: async () => await
|
|
838
|
+
}, nn = {
|
|
839
|
+
list: async () => await ae.getRequest("GET")("/role/list", {})
|
|
819
840
|
};
|
|
820
|
-
var
|
|
841
|
+
var mt = {}, an = {
|
|
821
842
|
get exports() {
|
|
822
|
-
return
|
|
843
|
+
return mt;
|
|
823
844
|
},
|
|
824
845
|
set exports(e) {
|
|
825
|
-
|
|
846
|
+
mt = e;
|
|
826
847
|
}
|
|
827
848
|
};
|
|
828
849
|
(function(e, t) {
|
|
@@ -849,25 +870,25 @@ var ht = {}, tn = {
|
|
|
849
870
|
return { M: u, y: g, w: b, d: f, D: y, h: d, m: p, s: l, ms: o, Q: c }[R] || String(R || "").toLowerCase().replace(/s$/, "");
|
|
850
871
|
}, u: function(R) {
|
|
851
872
|
return R === void 0;
|
|
852
|
-
} },
|
|
853
|
-
|
|
873
|
+
} }, te = "en", X = {};
|
|
874
|
+
X[te] = k;
|
|
854
875
|
var Y = function(R) {
|
|
855
876
|
return R instanceof B;
|
|
856
877
|
}, Z = function R(E, S, O) {
|
|
857
878
|
var w;
|
|
858
879
|
if (!E)
|
|
859
|
-
return
|
|
880
|
+
return te;
|
|
860
881
|
if (typeof E == "string") {
|
|
861
882
|
var x = E.toLowerCase();
|
|
862
|
-
|
|
883
|
+
X[x] && (w = x), S && (X[x] = S, w = x);
|
|
863
884
|
var I = E.split("-");
|
|
864
885
|
if (!w && I.length > 1)
|
|
865
886
|
return R(I[0]);
|
|
866
887
|
} else {
|
|
867
888
|
var N = E.name;
|
|
868
|
-
|
|
889
|
+
X[N] = E, w = N;
|
|
869
890
|
}
|
|
870
|
-
return !O && w && (
|
|
891
|
+
return !O && w && (te = w), w || !O && te;
|
|
871
892
|
}, F = function(R, E) {
|
|
872
893
|
if (Y(R))
|
|
873
894
|
return R.clone();
|
|
@@ -921,11 +942,11 @@ var ht = {}, tn = {
|
|
|
921
942
|
}, E.valueOf = function() {
|
|
922
943
|
return this.$d.getTime();
|
|
923
944
|
}, E.startOf = function(S, O) {
|
|
924
|
-
var w = this, x = !!L.u(O) || O, I = L.p(S), N = function(fe,
|
|
925
|
-
var de = L.w(w.$u ? Date.UTC(w.$y,
|
|
945
|
+
var w = this, x = !!L.u(O) || O, I = L.p(S), N = function(fe, re) {
|
|
946
|
+
var de = L.w(w.$u ? Date.UTC(w.$y, re, fe) : new Date(w.$y, re, fe), w);
|
|
926
947
|
return x ? de : de.endOf(f);
|
|
927
|
-
}, q = function(fe,
|
|
928
|
-
return L.w(w.toDate()[fe].apply(w.toDate("s"), (x ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(
|
|
948
|
+
}, q = function(fe, re) {
|
|
949
|
+
return L.w(w.toDate()[fe].apply(w.toDate("s"), (x ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(re)), w);
|
|
929
950
|
}, j = this.$W, U = this.$M, le = this.$D, ce = "set" + (this.$u ? "UTC" : "");
|
|
930
951
|
switch (I) {
|
|
931
952
|
case g:
|
|
@@ -984,16 +1005,16 @@ var ht = {}, tn = {
|
|
|
984
1005
|
var O = this, w = this.$locale();
|
|
985
1006
|
if (!this.isValid())
|
|
986
1007
|
return w.invalidDate || h;
|
|
987
|
-
var x = S || "YYYY-MM-DDTHH:mm:ssZ", I = L.z(this), N = this.$H, q = this.$m, j = this.$M, U = w.weekdays, le = w.months, ce = function(
|
|
988
|
-
return
|
|
989
|
-
}, pe = function(
|
|
990
|
-
return L.s(N % 12 || 12,
|
|
991
|
-
}, ye = w.meridiem || function(
|
|
992
|
-
var Te =
|
|
1008
|
+
var x = S || "YYYY-MM-DDTHH:mm:ssZ", I = L.z(this), N = this.$H, q = this.$m, j = this.$M, U = w.weekdays, le = w.months, ce = function(re, de, ve, Te) {
|
|
1009
|
+
return re && (re[de] || re(O, x)) || ve[de].slice(0, Te);
|
|
1010
|
+
}, pe = function(re) {
|
|
1011
|
+
return L.s(N % 12 || 12, re, "0");
|
|
1012
|
+
}, ye = w.meridiem || function(re, de, ve) {
|
|
1013
|
+
var Te = re < 12 ? "AM" : "PM";
|
|
993
1014
|
return ve ? Te.toLowerCase() : Te;
|
|
994
1015
|
}, fe = { YY: String(this.$y).slice(-2), YYYY: this.$y, M: j + 1, MM: L.s(j + 1, 2, "0"), MMM: ce(w.monthsShort, j, le, 3), MMMM: ce(le, j), D: this.$D, DD: L.s(this.$D, 2, "0"), d: String(this.$W), dd: ce(w.weekdaysMin, this.$W, U, 2), ddd: ce(w.weekdaysShort, this.$W, U, 3), dddd: U[this.$W], H: String(N), HH: L.s(N, 2, "0"), h: pe(1), hh: pe(2), a: ye(N, q, !0), A: ye(N, q, !1), m: String(q), mm: L.s(q, 2, "0"), s: String(this.$s), ss: L.s(this.$s, 2, "0"), SSS: L.s(this.$ms, 3, "0"), Z: I };
|
|
995
|
-
return x.replace(A, function(
|
|
996
|
-
return de || fe[
|
|
1016
|
+
return x.replace(A, function(re, de) {
|
|
1017
|
+
return de || fe[re] || I.replace(":", "");
|
|
997
1018
|
});
|
|
998
1019
|
}, E.utcOffset = function() {
|
|
999
1020
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
@@ -1003,7 +1024,7 @@ var ht = {}, tn = {
|
|
|
1003
1024
|
}, E.daysInMonth = function() {
|
|
1004
1025
|
return this.endOf(u).$D;
|
|
1005
1026
|
}, E.$locale = function() {
|
|
1006
|
-
return
|
|
1027
|
+
return X[this.$L];
|
|
1007
1028
|
}, E.locale = function(S, O) {
|
|
1008
1029
|
if (!S)
|
|
1009
1030
|
return this.$L;
|
|
@@ -1020,23 +1041,23 @@ var ht = {}, tn = {
|
|
|
1020
1041
|
}, E.toString = function() {
|
|
1021
1042
|
return this.$d.toUTCString();
|
|
1022
1043
|
}, R;
|
|
1023
|
-
}(),
|
|
1024
|
-
return F.prototype =
|
|
1025
|
-
|
|
1044
|
+
}(), ee = B.prototype;
|
|
1045
|
+
return F.prototype = ee, [["$ms", o], ["$s", l], ["$m", p], ["$H", d], ["$W", f], ["$M", u], ["$y", g], ["$D", y]].forEach(function(R) {
|
|
1046
|
+
ee[R[1]] = function(E) {
|
|
1026
1047
|
return this.$g(E, R[0], R[1]);
|
|
1027
1048
|
};
|
|
1028
1049
|
}), F.extend = function(R, E) {
|
|
1029
1050
|
return R.$i || (R(E, B, F), R.$i = !0), F;
|
|
1030
1051
|
}, F.locale = Z, F.isDayjs = Y, F.unix = function(R) {
|
|
1031
1052
|
return F(1e3 * R);
|
|
1032
|
-
}, F.en =
|
|
1053
|
+
}, F.en = X[te], F.Ls = X, F.p = {}, F;
|
|
1033
1054
|
});
|
|
1034
|
-
})(
|
|
1035
|
-
const
|
|
1055
|
+
})(an);
|
|
1056
|
+
const Pt = mt, on = {
|
|
1036
1057
|
list: async ({
|
|
1037
1058
|
pagination: e
|
|
1038
1059
|
}, t) => {
|
|
1039
|
-
const r = await
|
|
1060
|
+
const r = await ae.getRequest("POST", t)("/sql_snippet/list", {
|
|
1040
1061
|
sort: [{
|
|
1041
1062
|
field: "update_time",
|
|
1042
1063
|
order: "DESC"
|
|
@@ -1044,23 +1065,23 @@ const $t = ht, rn = {
|
|
|
1044
1065
|
pagination: e
|
|
1045
1066
|
});
|
|
1046
1067
|
return r.data.forEach((n) => {
|
|
1047
|
-
n.create_time =
|
|
1068
|
+
n.create_time = Pt(n.create_time).format("YYYY-MM-DD HH:mm:ss"), n.update_time = Pt(n.update_time).format("YYYY-MM-DD HH:mm:ss");
|
|
1048
1069
|
}), r;
|
|
1049
1070
|
},
|
|
1050
|
-
get: async (e, t) => await
|
|
1071
|
+
get: async (e, t) => await ae.getRequest("POST", t)("/sql_snippet/get", {
|
|
1051
1072
|
id: e
|
|
1052
1073
|
}),
|
|
1053
|
-
create: async (e, t) => await
|
|
1054
|
-
update: async (e, t) => await
|
|
1055
|
-
delete: async (e, t) =>
|
|
1074
|
+
create: async (e, t) => await ae.getRequest("POST", t)("/sql_snippet/create", e),
|
|
1075
|
+
update: async (e, t) => await ae.getRequest("PUT", t)("/sql_snippet/update", e),
|
|
1076
|
+
delete: async (e, t) => ae.getRequest("POST", t)("/sql_snippet/delete", {
|
|
1056
1077
|
id: e
|
|
1057
1078
|
})
|
|
1058
1079
|
}, oe = {
|
|
1059
|
-
datasource:
|
|
1060
|
-
account:
|
|
1061
|
-
role:
|
|
1062
|
-
api_key:
|
|
1063
|
-
sql_snippet:
|
|
1080
|
+
datasource: rn,
|
|
1081
|
+
account: en,
|
|
1082
|
+
role: nn,
|
|
1083
|
+
api_key: tn,
|
|
1084
|
+
sql_snippet: on
|
|
1064
1085
|
}, Se = {
|
|
1065
1086
|
size: "sm",
|
|
1066
1087
|
spacing: "md",
|
|
@@ -1068,7 +1089,7 @@ const $t = ht, rn = {
|
|
|
1068
1089
|
size: "xs"
|
|
1069
1090
|
}
|
|
1070
1091
|
};
|
|
1071
|
-
function
|
|
1092
|
+
function sn({
|
|
1072
1093
|
submit: e,
|
|
1073
1094
|
styles: t = Se,
|
|
1074
1095
|
type: r
|
|
@@ -1090,14 +1111,14 @@ function nn({
|
|
|
1090
1111
|
}
|
|
1091
1112
|
}
|
|
1092
1113
|
});
|
|
1093
|
-
return
|
|
1114
|
+
return yt(() => {
|
|
1094
1115
|
s("type", r);
|
|
1095
1116
|
}, [s, r]), /* @__PURE__ */ a(se, { mx: "auto", children: /* @__PURE__ */ C("form", { onSubmit: o(e), children: [
|
|
1096
1117
|
/* @__PURE__ */ a(H, { name: "key", control: n, render: ({
|
|
1097
1118
|
field: l
|
|
1098
1119
|
}) => /* @__PURE__ */ a(ue, { mb: t.spacing, size: t.size, required: !0, label: "Name", placeholder: "A unique name", ...l }) }),
|
|
1099
|
-
/* @__PURE__ */ a(
|
|
1100
|
-
/* @__PURE__ */ C(
|
|
1120
|
+
/* @__PURE__ */ a(et, { label: "Connection Info", labelPosition: "center" }),
|
|
1121
|
+
/* @__PURE__ */ C(Q, { grow: !0, children: [
|
|
1101
1122
|
/* @__PURE__ */ a(H, { name: "config.host", control: n, render: ({
|
|
1102
1123
|
field: l
|
|
1103
1124
|
}) => /* @__PURE__ */ a(ue, { mb: t.spacing, size: t.size, required: !0, label: "Host", sx: {
|
|
@@ -1107,7 +1128,7 @@ function nn({
|
|
|
1107
1128
|
field: l
|
|
1108
1129
|
}) => (
|
|
1109
1130
|
// @ts-expect-error type of onChange
|
|
1110
|
-
/* @__PURE__ */ a(
|
|
1131
|
+
/* @__PURE__ */ a(Tr, { mb: t.spacing, size: t.size, required: !0, label: "Port", hideControls: !0, sx: {
|
|
1111
1132
|
width: "8em"
|
|
1112
1133
|
}, ...l })
|
|
1113
1134
|
) })
|
|
@@ -1117,25 +1138,25 @@ function nn({
|
|
|
1117
1138
|
}) => /* @__PURE__ */ a(ue, { mb: t.spacing, size: t.size, required: !0, label: "Username", ...l }) }),
|
|
1118
1139
|
/* @__PURE__ */ a(H, { name: "config.password", control: n, render: ({
|
|
1119
1140
|
field: l
|
|
1120
|
-
}) => /* @__PURE__ */ a(
|
|
1141
|
+
}) => /* @__PURE__ */ a(tt, { mb: t.spacing, size: t.size, required: !0, label: "Password", ...l }) }),
|
|
1121
1142
|
/* @__PURE__ */ a(H, { name: "config.database", control: n, render: ({
|
|
1122
1143
|
field: l
|
|
1123
1144
|
}) => /* @__PURE__ */ a(ue, { mb: t.spacing, size: t.size, required: !0, label: "Database", ...l }) }),
|
|
1124
|
-
/* @__PURE__ */ a(
|
|
1145
|
+
/* @__PURE__ */ a(Q, { position: "right", mt: t.spacing, children: /* @__PURE__ */ a(V, { type: "submit", size: t.button.size, children: "Save" }) })
|
|
1125
1146
|
] }) });
|
|
1126
1147
|
}
|
|
1127
|
-
const
|
|
1148
|
+
const ln = ({
|
|
1128
1149
|
value: e,
|
|
1129
1150
|
onChange: t
|
|
1130
1151
|
}) => /* @__PURE__ */ a(se, { sx: {
|
|
1131
1152
|
position: "relative"
|
|
1132
|
-
}, children: /* @__PURE__ */ a(
|
|
1153
|
+
}, children: /* @__PURE__ */ a(Vt, { height: "500px", defaultLanguage: "javascript", value: e, onChange: (n) => {
|
|
1133
1154
|
n && t(n);
|
|
1134
1155
|
}, theme: "vs-dark", options: {
|
|
1135
1156
|
minimap: {
|
|
1136
1157
|
enabled: !1
|
|
1137
1158
|
}
|
|
1138
|
-
} }) }),
|
|
1159
|
+
} }) }), Ze = Je(({
|
|
1139
1160
|
value: e,
|
|
1140
1161
|
onChange: t,
|
|
1141
1162
|
label: r,
|
|
@@ -1146,37 +1167,37 @@ const an = ({
|
|
|
1146
1167
|
const [p, {
|
|
1147
1168
|
setTrue: d,
|
|
1148
1169
|
setFalse: f
|
|
1149
|
-
}] = zr(), [b, u] =
|
|
1170
|
+
}] = zr(), [b, u] = qt(e), c = () => {
|
|
1150
1171
|
f(), t(b);
|
|
1151
1172
|
}, g = () => {
|
|
1152
1173
|
f(), u(e);
|
|
1153
1174
|
}, y = () => {
|
|
1154
1175
|
u(s);
|
|
1155
1176
|
};
|
|
1156
|
-
return
|
|
1177
|
+
return yt(() => {
|
|
1157
1178
|
u(e);
|
|
1158
1179
|
}, [e]), /* @__PURE__ */ C(he, { children: [
|
|
1159
1180
|
/* @__PURE__ */ a(V, { variant: "filled", size: o.button.size, onClick: d, sx: {
|
|
1160
1181
|
flexGrow: 1
|
|
1161
1182
|
}, children: r }),
|
|
1162
|
-
/* @__PURE__ */ a(Ae, { size: 800, title: n, opened: p, onClose: f, closeOnClickOutside: !1, withCloseButton: !1, children: p && /* @__PURE__ */ C(
|
|
1163
|
-
/* @__PURE__ */ a(
|
|
1164
|
-
/* @__PURE__ */ C(
|
|
1165
|
-
/* @__PURE__ */ a(V, { onClick: y, color: "red", leftIcon: /* @__PURE__ */ a(
|
|
1166
|
-
/* @__PURE__ */ C(
|
|
1183
|
+
/* @__PURE__ */ a(Ae, { size: 800, title: n, opened: p, onClose: f, closeOnClickOutside: !1, withCloseButton: !1, children: p && /* @__PURE__ */ C(je, { children: [
|
|
1184
|
+
/* @__PURE__ */ a(ln, { value: b, onChange: u }),
|
|
1185
|
+
/* @__PURE__ */ C(Q, { position: "apart", children: [
|
|
1186
|
+
/* @__PURE__ */ a(V, { onClick: y, color: "red", leftIcon: /* @__PURE__ */ a(Lr, { size: 20 }), children: "Reset" }),
|
|
1187
|
+
/* @__PURE__ */ C(Q, { position: "right", children: [
|
|
1167
1188
|
/* @__PURE__ */ a(V, { onClick: g, variant: "subtle", children: "Cancel" }),
|
|
1168
1189
|
/* @__PURE__ */ a(V, { onClick: c, children: "OK" })
|
|
1169
1190
|
] })
|
|
1170
1191
|
] })
|
|
1171
1192
|
] }) })
|
|
1172
1193
|
] });
|
|
1173
|
-
}),
|
|
1194
|
+
}), We = {
|
|
1174
1195
|
pre: ["function pre_process({ method, url, params, headers, data }, utils) {", " // your code goes here", " return { method, url, params, headers, data }", "}"].join(`
|
|
1175
1196
|
`),
|
|
1176
1197
|
post: ["function post_process(res, utils) {", " // your code goes here", " return data", "}"].join(`
|
|
1177
1198
|
`)
|
|
1178
1199
|
};
|
|
1179
|
-
function
|
|
1200
|
+
function un({
|
|
1180
1201
|
submit: e,
|
|
1181
1202
|
styles: t = Se
|
|
1182
1203
|
}) {
|
|
@@ -1191,8 +1212,8 @@ function on({
|
|
|
1191
1212
|
config: {
|
|
1192
1213
|
host: "",
|
|
1193
1214
|
processing: {
|
|
1194
|
-
pre:
|
|
1195
|
-
post:
|
|
1215
|
+
pre: We.pre,
|
|
1216
|
+
post: We.post
|
|
1196
1217
|
}
|
|
1197
1218
|
}
|
|
1198
1219
|
}
|
|
@@ -1201,37 +1222,37 @@ function on({
|
|
|
1201
1222
|
/* @__PURE__ */ a(H, { name: "key", control: r, render: ({
|
|
1202
1223
|
field: o
|
|
1203
1224
|
}) => /* @__PURE__ */ a(ue, { mb: t.spacing, size: t.size, required: !0, label: "Name", placeholder: "A unique name", ...o }) }),
|
|
1204
|
-
/* @__PURE__ */ a(
|
|
1225
|
+
/* @__PURE__ */ a(et, { label: "Connection Info", labelPosition: "center" }),
|
|
1205
1226
|
/* @__PURE__ */ a(H, { name: "config.host", control: r, render: ({
|
|
1206
1227
|
field: o
|
|
1207
1228
|
}) => /* @__PURE__ */ a(ue, { mb: t.spacing, size: t.size, required: !0, label: "Base URL", sx: {
|
|
1208
1229
|
flexGrow: 1
|
|
1209
1230
|
}, ...o }) }),
|
|
1210
|
-
/* @__PURE__ */ C(
|
|
1231
|
+
/* @__PURE__ */ C(Q, { grow: !0, children: [
|
|
1211
1232
|
/* @__PURE__ */ a(H, { name: "config.processing.pre", control: r, render: ({
|
|
1212
1233
|
field: o
|
|
1213
|
-
}) => /* @__PURE__ */ a(
|
|
1234
|
+
}) => /* @__PURE__ */ a(Ze, { label: "Pre Processing", modalTitle: "This function will run before sending the request (for scenarios like encryption)", defaultValue: We.pre, ...o, styles: t }) }),
|
|
1214
1235
|
/* @__PURE__ */ a(H, { name: "config.processing.post", control: r, render: ({
|
|
1215
1236
|
field: o
|
|
1216
|
-
}) => /* @__PURE__ */ a(
|
|
1237
|
+
}) => /* @__PURE__ */ a(Ze, { label: "Post Processing", modalTitle: "This function will run after sending the request (for scenarios like decryption)", defaultValue: We.post, ...o, styles: t }) })
|
|
1217
1238
|
] }),
|
|
1218
|
-
/* @__PURE__ */ a(
|
|
1239
|
+
/* @__PURE__ */ a(Q, { position: "right", mt: t.spacing, children: /* @__PURE__ */ a(V, { type: "submit", size: t.button.size, children: "Save" }) })
|
|
1219
1240
|
] }) });
|
|
1220
1241
|
}
|
|
1221
|
-
function
|
|
1242
|
+
function cn({
|
|
1222
1243
|
styles: e = Se
|
|
1223
1244
|
}) {
|
|
1224
|
-
return /* @__PURE__ */ a(se, { mx: "auto", children: /* @__PURE__ */ C(
|
|
1245
|
+
return /* @__PURE__ */ a(se, { mx: "auto", children: /* @__PURE__ */ C(Rr, { mt: e.spacing, icon: /* @__PURE__ */ a(Fr, { size: 16 }), children: [
|
|
1225
1246
|
"Only ",
|
|
1226
1247
|
/* @__PURE__ */ a("b", { children: "SELECT" }),
|
|
1227
1248
|
" privilege is needed."
|
|
1228
1249
|
] }) });
|
|
1229
1250
|
}
|
|
1230
|
-
function
|
|
1251
|
+
function dn({
|
|
1231
1252
|
postSubmit: e,
|
|
1232
1253
|
styles: t = Se
|
|
1233
1254
|
}) {
|
|
1234
|
-
const [r, n] =
|
|
1255
|
+
const [r, n] = qt("postgresql"), s = async ({
|
|
1235
1256
|
type: p,
|
|
1236
1257
|
key: d,
|
|
1237
1258
|
config: f
|
|
@@ -1247,14 +1268,14 @@ function ln({
|
|
|
1247
1268
|
type: p,
|
|
1248
1269
|
key: d,
|
|
1249
1270
|
config: f
|
|
1250
|
-
}), await oe.datasource.create(p, d, f),
|
|
1271
|
+
}), await oe.datasource.create(p, d, f), J({
|
|
1251
1272
|
id: "for-creating",
|
|
1252
1273
|
title: "Successful",
|
|
1253
1274
|
message: "Data source is added",
|
|
1254
1275
|
color: "green"
|
|
1255
1276
|
}), e();
|
|
1256
1277
|
} catch (b) {
|
|
1257
|
-
|
|
1278
|
+
J({
|
|
1258
1279
|
id: "for-creating",
|
|
1259
1280
|
title: "Failed",
|
|
1260
1281
|
message: b.message,
|
|
@@ -1263,7 +1284,7 @@ function ln({
|
|
|
1263
1284
|
}
|
|
1264
1285
|
}, o = r === "postgresql" || r === "mysql", l = r === "http";
|
|
1265
1286
|
return /* @__PURE__ */ C(se, { mx: "auto", children: [
|
|
1266
|
-
/* @__PURE__ */ a(
|
|
1287
|
+
/* @__PURE__ */ a(Or, { fullWidth: !0, mb: t.spacing, size: t.size, data: [{
|
|
1267
1288
|
label: "PostgreSQL",
|
|
1268
1289
|
value: "postgresql"
|
|
1269
1290
|
}, {
|
|
@@ -1273,12 +1294,12 @@ function ln({
|
|
|
1273
1294
|
label: "HTTP",
|
|
1274
1295
|
value: "http"
|
|
1275
1296
|
}], value: r, onChange: (p) => n(p) }),
|
|
1276
|
-
o && /* @__PURE__ */ a(
|
|
1277
|
-
o && /* @__PURE__ */ a(
|
|
1278
|
-
l && /* @__PURE__ */ a(
|
|
1297
|
+
o && /* @__PURE__ */ a(cn, { styles: t }),
|
|
1298
|
+
o && /* @__PURE__ */ a(sn, { submit: s, styles: t, type: r }),
|
|
1299
|
+
l && /* @__PURE__ */ a(un, { submit: s, styles: t })
|
|
1279
1300
|
] });
|
|
1280
1301
|
}
|
|
1281
|
-
function
|
|
1302
|
+
function pn({
|
|
1282
1303
|
onSuccess: e,
|
|
1283
1304
|
styles: t = Se
|
|
1284
1305
|
}) {
|
|
@@ -1286,40 +1307,40 @@ function un({
|
|
|
1286
1307
|
return /* @__PURE__ */ C(he, { children: [
|
|
1287
1308
|
/* @__PURE__ */ a(Ae, { opened: r, onClose: () => n(!1), title: "Add a data source", trapFocus: !0, onDragStart: (p) => {
|
|
1288
1309
|
p.stopPropagation();
|
|
1289
|
-
}, children: /* @__PURE__ */ a(
|
|
1310
|
+
}, children: /* @__PURE__ */ a(dn, { postSubmit: () => {
|
|
1290
1311
|
e(), o();
|
|
1291
1312
|
}, styles: t }) }),
|
|
1292
|
-
/* @__PURE__ */ a(V, { size: t.button.size, onClick: s, leftIcon: /* @__PURE__ */ a(
|
|
1313
|
+
/* @__PURE__ */ a(V, { size: t.button.size, onClick: s, leftIcon: /* @__PURE__ */ a(it, { size: 20 }), children: "Add a Data Source" })
|
|
1293
1314
|
] });
|
|
1294
1315
|
}
|
|
1295
|
-
const
|
|
1296
|
-
function
|
|
1297
|
-
|
|
1298
|
-
if (
|
|
1316
|
+
const gn = (e) => e.replace(/([^:])(\/\/+)/g, "$1/");
|
|
1317
|
+
function fn(e) {
|
|
1318
|
+
yt(() => {
|
|
1319
|
+
if (ft.__getMonacoInstance())
|
|
1299
1320
|
return;
|
|
1300
1321
|
console.log("loading monaco for @devtable/settings-form");
|
|
1301
|
-
const r =
|
|
1302
|
-
|
|
1322
|
+
const r = gn(e);
|
|
1323
|
+
ft.config({
|
|
1303
1324
|
paths: {
|
|
1304
1325
|
vs: r
|
|
1305
1326
|
}
|
|
1306
|
-
}),
|
|
1327
|
+
}), ft.init().then((n) => console.log("monaco instance:", n));
|
|
1307
1328
|
}, []);
|
|
1308
1329
|
}
|
|
1309
|
-
function
|
|
1330
|
+
function hn({
|
|
1310
1331
|
id: e,
|
|
1311
1332
|
name: t,
|
|
1312
1333
|
isProtected: r,
|
|
1313
1334
|
onSuccess: n,
|
|
1314
1335
|
styles: s = Se
|
|
1315
1336
|
}) {
|
|
1316
|
-
const o =
|
|
1337
|
+
const o = Ue(), l = async () => {
|
|
1317
1338
|
e && (be({
|
|
1318
1339
|
id: "for-deleting",
|
|
1319
1340
|
title: "Pending",
|
|
1320
1341
|
message: "Deleting data source...",
|
|
1321
1342
|
loading: !0
|
|
1322
|
-
}), await oe.datasource.delete(e),
|
|
1343
|
+
}), await oe.datasource.delete(e), J({
|
|
1323
1344
|
id: "for-deleting",
|
|
1324
1345
|
title: "Successful",
|
|
1325
1346
|
message: `Data source [${t}] is deleted`,
|
|
@@ -1335,21 +1356,21 @@ function pn({
|
|
|
1335
1356
|
onCancel: () => console.log("Cancel"),
|
|
1336
1357
|
onConfirm: l
|
|
1337
1358
|
});
|
|
1338
|
-
return r ? /* @__PURE__ */ a(
|
|
1359
|
+
return r ? /* @__PURE__ */ a(Ke, { withArrow: !0, events: {
|
|
1339
1360
|
hover: !0,
|
|
1340
1361
|
touch: !1,
|
|
1341
1362
|
focus: !1
|
|
1342
|
-
}, label: "This is a preset datasource, it can not be deleted", children: /* @__PURE__ */ a(V, { size: s.button.size, color: "gray", variant: "light", leftIcon: /* @__PURE__ */ a(
|
|
1363
|
+
}, label: "This is a preset datasource, it can not be deleted", children: /* @__PURE__ */ a(V, { size: s.button.size, color: "gray", variant: "light", leftIcon: /* @__PURE__ */ a(Wt, { size: 16 }), sx: {
|
|
1343
1364
|
transform: "none !important"
|
|
1344
|
-
}, children: "Delete" }) }) : /* @__PURE__ */ a(V, { size: s.button.size, color: "red", onClick: p, leftIcon: /* @__PURE__ */ a(
|
|
1365
|
+
}, children: "Delete" }) }) : /* @__PURE__ */ a(V, { size: s.button.size, color: "red", onClick: p, leftIcon: /* @__PURE__ */ a(ot, { size: 16 }), children: "Delete" });
|
|
1345
1366
|
}
|
|
1346
|
-
const
|
|
1367
|
+
const zt = {
|
|
1347
1368
|
pre: ["function pre_process({ method, url, params, headers, data }, utils) {", " // your code goes here", " return { method, url, params, headers, data }", "}"].join(`
|
|
1348
1369
|
`),
|
|
1349
1370
|
post: ["function post_process(res, utils) {", " // your code goes here", " return data", "}"].join(`
|
|
1350
1371
|
`)
|
|
1351
1372
|
};
|
|
1352
|
-
function
|
|
1373
|
+
function mn({
|
|
1353
1374
|
name: e,
|
|
1354
1375
|
config: t,
|
|
1355
1376
|
submit: r,
|
|
@@ -1365,24 +1386,24 @@ function gn({
|
|
|
1365
1386
|
});
|
|
1366
1387
|
return /* @__PURE__ */ a(se, { mx: "auto", children: /* @__PURE__ */ C("form", { onSubmit: o(r), children: [
|
|
1367
1388
|
/* @__PURE__ */ a(ue, { mb: n.spacing, size: n.size, required: !0, label: "Name", value: e, readOnly: !0 }),
|
|
1368
|
-
/* @__PURE__ */ a(
|
|
1389
|
+
/* @__PURE__ */ a(et, { label: "Connection Info", labelPosition: "center" }),
|
|
1369
1390
|
/* @__PURE__ */ a(H, { name: "config.host", control: s, render: ({
|
|
1370
1391
|
field: l
|
|
1371
1392
|
}) => /* @__PURE__ */ a(ue, { mb: n.spacing, size: n.size, label: "Base URL", sx: {
|
|
1372
1393
|
flexGrow: 1
|
|
1373
1394
|
}, ...l }) }),
|
|
1374
|
-
/* @__PURE__ */ C(
|
|
1395
|
+
/* @__PURE__ */ C(Q, { grow: !0, children: [
|
|
1375
1396
|
/* @__PURE__ */ a(H, { name: "config.processing.pre", control: s, render: ({
|
|
1376
1397
|
field: l
|
|
1377
|
-
}) => /* @__PURE__ */ a(
|
|
1398
|
+
}) => /* @__PURE__ */ a(Ze, { label: "Pre Processing", modalTitle: "This function will run before sending the request (for scenarios like encryption)", defaultValue: zt.pre, ...l, styles: n }) }),
|
|
1378
1399
|
/* @__PURE__ */ a(H, { name: "config.processing.post", control: s, render: ({
|
|
1379
1400
|
field: l
|
|
1380
|
-
}) => /* @__PURE__ */ a(
|
|
1401
|
+
}) => /* @__PURE__ */ a(Ze, { label: "Post Processing", modalTitle: "This function will run after sending the request (for scenarios like decryption)", defaultValue: zt.post, ...l, styles: n }) })
|
|
1381
1402
|
] }),
|
|
1382
|
-
/* @__PURE__ */ a(
|
|
1403
|
+
/* @__PURE__ */ a(Q, { position: "right", mt: n.spacing, children: /* @__PURE__ */ a(V, { type: "submit", size: n.button.size, children: "Save" }) })
|
|
1383
1404
|
] }) });
|
|
1384
1405
|
}
|
|
1385
|
-
function
|
|
1406
|
+
function bn({
|
|
1386
1407
|
dataSource: e,
|
|
1387
1408
|
postSubmit: t,
|
|
1388
1409
|
styles: r = Se
|
|
@@ -1399,14 +1420,14 @@ function fn({
|
|
|
1399
1420
|
try {
|
|
1400
1421
|
console.log({
|
|
1401
1422
|
config: s
|
|
1402
|
-
}), await oe.datasource.update(e.id, s),
|
|
1423
|
+
}), await oe.datasource.update(e.id, s), J({
|
|
1403
1424
|
id: "for-updating",
|
|
1404
1425
|
title: "Successful",
|
|
1405
1426
|
message: "Data source is updated",
|
|
1406
1427
|
color: "green"
|
|
1407
1428
|
}), t();
|
|
1408
1429
|
} catch (o) {
|
|
1409
|
-
|
|
1430
|
+
J({
|
|
1410
1431
|
id: "for-updating",
|
|
1411
1432
|
title: "Failed",
|
|
1412
1433
|
message: o.message,
|
|
@@ -1414,9 +1435,9 @@ function fn({
|
|
|
1414
1435
|
});
|
|
1415
1436
|
}
|
|
1416
1437
|
};
|
|
1417
|
-
return e.config ? /* @__PURE__ */ a(se, { mx: "auto", children: /* @__PURE__ */ a(
|
|
1438
|
+
return e.config ? /* @__PURE__ */ a(se, { mx: "auto", children: /* @__PURE__ */ a(mn, { name: e.key, config: e.config, submit: n, styles: r }) }) : (console.error(new Error("unexpected empty config of a http datasource")), null);
|
|
1418
1439
|
}
|
|
1419
|
-
function
|
|
1440
|
+
function yn({
|
|
1420
1441
|
dataSource: e,
|
|
1421
1442
|
onSuccess: t,
|
|
1422
1443
|
styles: r = Se
|
|
@@ -1424,52 +1445,52 @@ function hn({
|
|
|
1424
1445
|
const [n, s] = K.useState(!1), o = () => s(!0), l = () => s(!1), p = () => {
|
|
1425
1446
|
t(), l();
|
|
1426
1447
|
};
|
|
1427
|
-
return e.is_preset ? /* @__PURE__ */ a(
|
|
1448
|
+
return e.is_preset ? /* @__PURE__ */ a(Ke, { withArrow: !0, events: {
|
|
1428
1449
|
hover: !0,
|
|
1429
1450
|
touch: !1,
|
|
1430
1451
|
focus: !1
|
|
1431
|
-
}, label: "This is a preset datasource, it can not be changed", children: /* @__PURE__ */ a(V, { size: r.button.size, color: "gray", variant: "light", leftIcon: /* @__PURE__ */ a(
|
|
1452
|
+
}, label: "This is a preset datasource, it can not be changed", children: /* @__PURE__ */ a(V, { size: r.button.size, color: "gray", variant: "light", leftIcon: /* @__PURE__ */ a(Wt, { size: 16 }), sx: {
|
|
1432
1453
|
transform: "none !important"
|
|
1433
|
-
}, children: "Edit" }) }) : e.type !== "http" ? /* @__PURE__ */ a(
|
|
1454
|
+
}, children: "Edit" }) }) : e.type !== "http" ? /* @__PURE__ */ a(Ke, { withArrow: !0, events: {
|
|
1434
1455
|
hover: !0,
|
|
1435
1456
|
touch: !1,
|
|
1436
1457
|
focus: !1
|
|
1437
|
-
}, label: "Only HTTP datasources can be edited", children: /* @__PURE__ */ a(V, { size: r.button.size, color: "gray", variant: "light", leftIcon: /* @__PURE__ */ a(
|
|
1458
|
+
}, label: "Only HTTP datasources can be edited", children: /* @__PURE__ */ a(V, { size: r.button.size, color: "gray", variant: "light", leftIcon: /* @__PURE__ */ a(ht, { size: 16 }), sx: {
|
|
1438
1459
|
transform: "none !important"
|
|
1439
1460
|
}, children: "Edit" }) }) : /* @__PURE__ */ C(he, { children: [
|
|
1440
1461
|
/* @__PURE__ */ a(Ae, { opened: n, onClose: () => s(!1), title: "Add a data source", trapFocus: !0, onDragStart: (d) => {
|
|
1441
1462
|
d.stopPropagation();
|
|
1442
|
-
}, children: /* @__PURE__ */ a(
|
|
1443
|
-
/* @__PURE__ */ a(V, { size: r.button.size, color: "blue", onClick: o, leftIcon: /* @__PURE__ */ a(
|
|
1463
|
+
}, children: /* @__PURE__ */ a(bn, { dataSource: e, postSubmit: p, styles: r }) }),
|
|
1464
|
+
/* @__PURE__ */ a(V, { size: r.button.size, color: "blue", onClick: o, leftIcon: /* @__PURE__ */ a(ht, { size: 16 }), children: "Edit" })
|
|
1444
1465
|
] });
|
|
1445
1466
|
}
|
|
1446
|
-
const
|
|
1467
|
+
const vn = {
|
|
1447
1468
|
http: "HTTP",
|
|
1448
1469
|
mysql: "MySQL",
|
|
1449
1470
|
postgresql: "PostgreSQL"
|
|
1450
|
-
},
|
|
1471
|
+
}, Sn = {
|
|
1451
1472
|
http: /* @__PURE__ */ a(Br, {}),
|
|
1452
1473
|
mysql: /* @__PURE__ */ a(jr, {}),
|
|
1453
1474
|
postgresql: /* @__PURE__ */ a(Ur, {})
|
|
1454
1475
|
};
|
|
1455
|
-
function
|
|
1476
|
+
function wn({
|
|
1456
1477
|
type: e
|
|
1457
1478
|
}) {
|
|
1458
|
-
return /* @__PURE__ */ C(
|
|
1459
|
-
/* @__PURE__ */ a(
|
|
1479
|
+
return /* @__PURE__ */ C(Q, { children: [
|
|
1480
|
+
/* @__PURE__ */ a(vt, { size: "xs", sx: {
|
|
1460
1481
|
transform: "none !important"
|
|
1461
|
-
}, children:
|
|
1482
|
+
}, children: Sn[e] }),
|
|
1462
1483
|
/* @__PURE__ */ a(Re, { sx: {
|
|
1463
1484
|
cusor: "default",
|
|
1464
1485
|
userSelect: "none"
|
|
1465
|
-
}, children:
|
|
1486
|
+
}, children: vn[e] })
|
|
1466
1487
|
] });
|
|
1467
1488
|
}
|
|
1468
|
-
function
|
|
1489
|
+
function Ea({
|
|
1469
1490
|
styles: e = Se,
|
|
1470
1491
|
config: t
|
|
1471
1492
|
}) {
|
|
1472
|
-
|
|
1493
|
+
fn(t.monacoPath), Ge(t);
|
|
1473
1494
|
const {
|
|
1474
1495
|
data: r = [],
|
|
1475
1496
|
loading: n,
|
|
@@ -1483,12 +1504,12 @@ function wa({
|
|
|
1483
1504
|
refreshDeps: []
|
|
1484
1505
|
});
|
|
1485
1506
|
return /* @__PURE__ */ C(he, { children: [
|
|
1486
|
-
/* @__PURE__ */ a(
|
|
1507
|
+
/* @__PURE__ */ a(Q, { pt: e.spacing, position: "right", children: /* @__PURE__ */ a(pn, { onSuccess: s }) }),
|
|
1487
1508
|
/* @__PURE__ */ C(se, { mt: e.spacing, sx: {
|
|
1488
1509
|
position: "relative"
|
|
1489
1510
|
}, children: [
|
|
1490
|
-
/* @__PURE__ */ a(
|
|
1491
|
-
/* @__PURE__ */ C(
|
|
1511
|
+
/* @__PURE__ */ a(rt, { visible: n }),
|
|
1512
|
+
/* @__PURE__ */ C(nt, { horizontalSpacing: e.spacing, verticalSpacing: e.spacing, fontSize: e.size, highlightOnHover: !0, children: [
|
|
1492
1513
|
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ C("tr", { children: [
|
|
1493
1514
|
/* @__PURE__ */ a("th", { children: "Type" }),
|
|
1494
1515
|
/* @__PURE__ */ a("th", { children: "Name" }),
|
|
@@ -1502,11 +1523,11 @@ function wa({
|
|
|
1502
1523
|
is_preset: f
|
|
1503
1524
|
} = o;
|
|
1504
1525
|
return /* @__PURE__ */ C("tr", { children: [
|
|
1505
|
-
/* @__PURE__ */ a("td", { width: 200, children: /* @__PURE__ */ a(
|
|
1526
|
+
/* @__PURE__ */ a("td", { width: 200, children: /* @__PURE__ */ a(wn, { type: d }) }),
|
|
1506
1527
|
/* @__PURE__ */ a("td", { children: p }),
|
|
1507
|
-
/* @__PURE__ */ a("td", { width: 400, children: /* @__PURE__ */ C(
|
|
1508
|
-
/* @__PURE__ */ a(
|
|
1509
|
-
/* @__PURE__ */ a(
|
|
1528
|
+
/* @__PURE__ */ a("td", { width: 400, children: /* @__PURE__ */ C(Q, { position: "left", children: [
|
|
1529
|
+
/* @__PURE__ */ a(yn, { dataSource: o, onSuccess: s, styles: e }),
|
|
1530
|
+
/* @__PURE__ */ a(hn, { isProtected: f, id: l, name: p, onSuccess: s, styles: e })
|
|
1510
1531
|
] }) })
|
|
1511
1532
|
] }, p);
|
|
1512
1533
|
}) })
|
|
@@ -1514,15 +1535,15 @@ function wa({
|
|
|
1514
1535
|
] })
|
|
1515
1536
|
] });
|
|
1516
1537
|
}
|
|
1517
|
-
const
|
|
1538
|
+
const En = Je(({
|
|
1518
1539
|
label: e,
|
|
1519
1540
|
value: t,
|
|
1520
1541
|
description: r,
|
|
1521
1542
|
...n
|
|
1522
|
-
}, s) => /* @__PURE__ */ C(
|
|
1543
|
+
}, s) => /* @__PURE__ */ C(je, { spacing: 2, ref: s, ...n, children: [
|
|
1523
1544
|
/* @__PURE__ */ a(Re, { size: "sm", children: e }),
|
|
1524
1545
|
/* @__PURE__ */ a(Re, { size: "xs", color: "dimmed", className: "role-description", children: r })
|
|
1525
|
-
] })),
|
|
1546
|
+
] })), St = Je(({
|
|
1526
1547
|
styles: e,
|
|
1527
1548
|
value: t,
|
|
1528
1549
|
onChange: r
|
|
@@ -1538,7 +1559,7 @@ const vn = Qe(({
|
|
|
1538
1559
|
})), {
|
|
1539
1560
|
refreshDeps: []
|
|
1540
1561
|
});
|
|
1541
|
-
return /* @__PURE__ */ a(
|
|
1562
|
+
return /* @__PURE__ */ a(xr, { ref: n, mb: e.spacing, size: e.size, required: !0, label: "Role", itemComponent: En, data: s, disabled: o, styles: () => ({
|
|
1542
1563
|
item: {
|
|
1543
1564
|
"&[data-selected]": {
|
|
1544
1565
|
"&, &:hover": {
|
|
@@ -1556,7 +1577,7 @@ const vn = Qe(({
|
|
|
1556
1577
|
size: "xs"
|
|
1557
1578
|
}
|
|
1558
1579
|
};
|
|
1559
|
-
function
|
|
1580
|
+
function _n({
|
|
1560
1581
|
postSubmit: e,
|
|
1561
1582
|
styles: t = ke,
|
|
1562
1583
|
initialRoleID: r
|
|
@@ -1584,14 +1605,14 @@ function Sn({
|
|
|
1584
1605
|
title: "Pending",
|
|
1585
1606
|
message: "Adding account...",
|
|
1586
1607
|
loading: !0
|
|
1587
|
-
}), await oe.account.create(l, p, d, f),
|
|
1608
|
+
}), await oe.account.create(l, p, d, f), J({
|
|
1588
1609
|
id: "for-creating",
|
|
1589
1610
|
title: "Successful",
|
|
1590
1611
|
message: "Account is added",
|
|
1591
1612
|
color: "green"
|
|
1592
1613
|
}), e();
|
|
1593
1614
|
} catch (b) {
|
|
1594
|
-
|
|
1615
|
+
J({
|
|
1595
1616
|
id: "for-creating",
|
|
1596
1617
|
title: "Failed",
|
|
1597
1618
|
message: b.message,
|
|
@@ -1607,14 +1628,14 @@ function Sn({
|
|
|
1607
1628
|
}) => /* @__PURE__ */ a(ue, { mb: t.spacing, size: t.size, required: !0, label: "Email", ...l }) }),
|
|
1608
1629
|
/* @__PURE__ */ a(H, { name: "password", control: n, render: ({
|
|
1609
1630
|
field: l
|
|
1610
|
-
}) => /* @__PURE__ */ a(
|
|
1631
|
+
}) => /* @__PURE__ */ a(tt, { mb: t.spacing, size: t.size, required: !0, label: "Password", description: "Password must be at least 8 characters long", ...l }) }),
|
|
1611
1632
|
/* @__PURE__ */ a(H, { name: "role_id", control: n, render: ({
|
|
1612
1633
|
field: l
|
|
1613
|
-
}) => /* @__PURE__ */ a(
|
|
1614
|
-
/* @__PURE__ */ a(
|
|
1634
|
+
}) => /* @__PURE__ */ a(St, { styles: t, ...l }) }),
|
|
1635
|
+
/* @__PURE__ */ a(Q, { position: "right", mt: t.spacing, children: /* @__PURE__ */ a(V, { type: "submit", size: t.button.size, children: "Save" }) })
|
|
1615
1636
|
] }) });
|
|
1616
1637
|
}
|
|
1617
|
-
function
|
|
1638
|
+
function An({
|
|
1618
1639
|
onSuccess: e,
|
|
1619
1640
|
styles: t = ke,
|
|
1620
1641
|
initialRoleID: r
|
|
@@ -1623,19 +1644,19 @@ function wn({
|
|
|
1623
1644
|
return /* @__PURE__ */ C(he, { children: [
|
|
1624
1645
|
/* @__PURE__ */ a(Ae, { opened: n, onClose: () => s(!1), title: "Add an Account", trapFocus: !0, onDragStart: (d) => {
|
|
1625
1646
|
d.stopPropagation();
|
|
1626
|
-
}, children: /* @__PURE__ */ a(
|
|
1647
|
+
}, children: /* @__PURE__ */ a(_n, { postSubmit: () => {
|
|
1627
1648
|
e(), l();
|
|
1628
1649
|
}, styles: t, initialRoleID: r }) }),
|
|
1629
|
-
/* @__PURE__ */ a(V, { size: t.button.size, onClick: o, leftIcon: /* @__PURE__ */ a(
|
|
1650
|
+
/* @__PURE__ */ a(V, { size: t.button.size, onClick: o, leftIcon: /* @__PURE__ */ a(it, { size: 20 }), children: "Add an Account" })
|
|
1630
1651
|
] });
|
|
1631
1652
|
}
|
|
1632
|
-
function
|
|
1653
|
+
function kn({
|
|
1633
1654
|
id: e,
|
|
1634
1655
|
name: t,
|
|
1635
1656
|
onSuccess: r,
|
|
1636
1657
|
styles: n = ke
|
|
1637
1658
|
}) {
|
|
1638
|
-
const s =
|
|
1659
|
+
const s = Ue(), o = async () => {
|
|
1639
1660
|
if (e) {
|
|
1640
1661
|
be({
|
|
1641
1662
|
id: "for-deleting",
|
|
@@ -1644,14 +1665,14 @@ function En({
|
|
|
1644
1665
|
loading: !0
|
|
1645
1666
|
});
|
|
1646
1667
|
try {
|
|
1647
|
-
await oe.account.delete(e),
|
|
1668
|
+
await oe.account.delete(e), J({
|
|
1648
1669
|
id: "for-deleting",
|
|
1649
1670
|
title: "Successful",
|
|
1650
1671
|
message: `Account [${t}] is deleted`,
|
|
1651
1672
|
color: "green"
|
|
1652
1673
|
}), r();
|
|
1653
1674
|
} catch (p) {
|
|
1654
|
-
|
|
1675
|
+
J({
|
|
1655
1676
|
id: "for-deleting",
|
|
1656
1677
|
title: "Failed",
|
|
1657
1678
|
message: p.message,
|
|
@@ -1668,9 +1689,9 @@ function En({
|
|
|
1668
1689
|
onCancel: () => console.log("Cancel"),
|
|
1669
1690
|
onConfirm: o
|
|
1670
1691
|
});
|
|
1671
|
-
return /* @__PURE__ */ a(V, { size: n.button.size, color: "red", onClick: l, leftIcon: /* @__PURE__ */ a(
|
|
1692
|
+
return /* @__PURE__ */ a(V, { size: n.button.size, color: "red", onClick: l, leftIcon: /* @__PURE__ */ a(ot, { size: 20 }), children: "Delete" });
|
|
1672
1693
|
}
|
|
1673
|
-
function
|
|
1694
|
+
function Tn({
|
|
1674
1695
|
id: e,
|
|
1675
1696
|
name: t,
|
|
1676
1697
|
email: r,
|
|
@@ -1710,14 +1731,14 @@ function _n({
|
|
|
1710
1731
|
role_id: y,
|
|
1711
1732
|
reset_password: h,
|
|
1712
1733
|
new_password: _.trim()
|
|
1713
|
-
}),
|
|
1734
|
+
}), J({
|
|
1714
1735
|
id: "for-updating",
|
|
1715
1736
|
title: "Successful",
|
|
1716
1737
|
message: "Account is updated",
|
|
1717
1738
|
color: "green"
|
|
1718
1739
|
}), s();
|
|
1719
1740
|
} catch (A) {
|
|
1720
|
-
|
|
1741
|
+
J({
|
|
1721
1742
|
id: "for-updating",
|
|
1722
1743
|
title: "Failed",
|
|
1723
1744
|
message: A.message,
|
|
@@ -1734,11 +1755,11 @@ function _n({
|
|
|
1734
1755
|
}) => /* @__PURE__ */ a(ue, { mb: o.spacing, size: o.size, required: !0, label: "Email", ...c }) }),
|
|
1735
1756
|
/* @__PURE__ */ a(H, { name: "role_id", control: l, render: ({
|
|
1736
1757
|
field: c
|
|
1737
|
-
}) => /* @__PURE__ */ a(
|
|
1738
|
-
/* @__PURE__ */ a(
|
|
1758
|
+
}) => /* @__PURE__ */ a(St, { styles: o, ...c }) }),
|
|
1759
|
+
/* @__PURE__ */ a(et, { my: 20, variant: "dashed", label: "", labelPosition: "center" }),
|
|
1739
1760
|
/* @__PURE__ */ a(H, { name: "reset_password", control: l, render: ({
|
|
1740
1761
|
field: c
|
|
1741
|
-
}) => /* @__PURE__ */ a(
|
|
1762
|
+
}) => /* @__PURE__ */ a(Cr, { mb: o.spacing, size: o.size, label: "Reset password", checked: c.value, onChange: (g) => c.onChange(g.currentTarget.checked), styles: {
|
|
1742
1763
|
label: {
|
|
1743
1764
|
verticalAlign: "middle"
|
|
1744
1765
|
}
|
|
@@ -1750,13 +1771,13 @@ function _n({
|
|
|
1750
1771
|
control: l,
|
|
1751
1772
|
render: ({
|
|
1752
1773
|
field: c
|
|
1753
|
-
}) => /* @__PURE__ */ a(
|
|
1774
|
+
}) => /* @__PURE__ */ a(tt, { autoComplete: "off", mb: o.spacing, size: o.size, required: !0, description: "Password must be at least 8 characters long", label: "New Password", ...c })
|
|
1754
1775
|
}
|
|
1755
1776
|
),
|
|
1756
|
-
/* @__PURE__ */ a(
|
|
1777
|
+
/* @__PURE__ */ a(Q, { position: "right", mt: o.spacing, children: /* @__PURE__ */ a(V, { type: "submit", size: o.button.size, children: "Submit" }) })
|
|
1757
1778
|
] }) });
|
|
1758
1779
|
}
|
|
1759
|
-
function
|
|
1780
|
+
function Rn({
|
|
1760
1781
|
account: e,
|
|
1761
1782
|
onSuccess: t,
|
|
1762
1783
|
styles: r = ke
|
|
@@ -1767,16 +1788,16 @@ function An({
|
|
|
1767
1788
|
return /* @__PURE__ */ C(he, { children: [
|
|
1768
1789
|
/* @__PURE__ */ a(Ae, { opened: n, onClose: () => s(!1), title: `Editing ${e.name}`, trapFocus: !0, onDragStart: (d) => {
|
|
1769
1790
|
d.stopPropagation();
|
|
1770
|
-
}, children: /* @__PURE__ */ a(
|
|
1771
|
-
/* @__PURE__ */ a(V, { size: r.button.size, onClick: o, leftIcon: /* @__PURE__ */ a(
|
|
1791
|
+
}, children: /* @__PURE__ */ a(Tn, { ...e, postSubmit: p, styles: r }) }),
|
|
1792
|
+
/* @__PURE__ */ a(V, { size: r.button.size, onClick: o, leftIcon: /* @__PURE__ */ a(Nr, { size: 20 }), children: "Edit" })
|
|
1772
1793
|
] });
|
|
1773
1794
|
}
|
|
1774
|
-
function
|
|
1795
|
+
function _a({
|
|
1775
1796
|
styles: e = ke,
|
|
1776
1797
|
config: t
|
|
1777
1798
|
}) {
|
|
1778
1799
|
var p;
|
|
1779
|
-
|
|
1800
|
+
Ge(t);
|
|
1780
1801
|
const {
|
|
1781
1802
|
data: r = [],
|
|
1782
1803
|
loading: n,
|
|
@@ -1800,12 +1821,12 @@ function Ea({
|
|
|
1800
1821
|
refreshDeps: []
|
|
1801
1822
|
});
|
|
1802
1823
|
return /* @__PURE__ */ C(he, { children: [
|
|
1803
|
-
/* @__PURE__ */ a(
|
|
1824
|
+
/* @__PURE__ */ a(Q, { pt: e.spacing, position: "right", children: /* @__PURE__ */ a(An, { onSuccess: s, initialRoleID: ((p = o == null ? void 0 : o[0]) == null ? void 0 : p.value) ?? "INACTIVE" }) }),
|
|
1804
1825
|
/* @__PURE__ */ C(se, { mt: e.spacing, sx: {
|
|
1805
1826
|
position: "relative"
|
|
1806
1827
|
}, children: [
|
|
1807
|
-
/* @__PURE__ */ a(
|
|
1808
|
-
/* @__PURE__ */ C(
|
|
1828
|
+
/* @__PURE__ */ a(rt, { visible: n || l }),
|
|
1829
|
+
/* @__PURE__ */ C(nt, { horizontalSpacing: e.spacing, verticalSpacing: e.spacing, fontSize: e.size, highlightOnHover: !0, children: [
|
|
1809
1830
|
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ C("tr", { children: [
|
|
1810
1831
|
/* @__PURE__ */ a("th", { children: "Username" }),
|
|
1811
1832
|
/* @__PURE__ */ a("th", { children: "Email" }),
|
|
@@ -1823,9 +1844,9 @@ function Ea({
|
|
|
1823
1844
|
/* @__PURE__ */ a("td", { width: 200, children: b }),
|
|
1824
1845
|
/* @__PURE__ */ a("td", { width: 200, children: u }),
|
|
1825
1846
|
/* @__PURE__ */ a("td", { width: 200, children: c }),
|
|
1826
|
-
/* @__PURE__ */ a("td", { width: 200, children: /* @__PURE__ */ C(
|
|
1827
|
-
/* @__PURE__ */ a(
|
|
1828
|
-
/* @__PURE__ */ a(
|
|
1847
|
+
/* @__PURE__ */ a("td", { width: 200, children: /* @__PURE__ */ C(Q, { position: "left", children: [
|
|
1848
|
+
/* @__PURE__ */ a(Rn, { account: d, onSuccess: s }),
|
|
1849
|
+
/* @__PURE__ */ a(kn, { id: f, name: b, onSuccess: s })
|
|
1829
1850
|
] }) })
|
|
1830
1851
|
] }, f);
|
|
1831
1852
|
}) })
|
|
@@ -1833,7 +1854,7 @@ function Ea({
|
|
|
1833
1854
|
] })
|
|
1834
1855
|
] });
|
|
1835
1856
|
}
|
|
1836
|
-
function
|
|
1857
|
+
function On({
|
|
1837
1858
|
postSubmit: e,
|
|
1838
1859
|
styles: t = ke
|
|
1839
1860
|
}) {
|
|
@@ -1858,14 +1879,14 @@ function kn({
|
|
|
1858
1879
|
loading: !0
|
|
1859
1880
|
});
|
|
1860
1881
|
const p = await oe.account.login(o.trim(), l.trim());
|
|
1861
|
-
window.localStorage.setItem("token", p.token),
|
|
1882
|
+
window.localStorage.setItem("token", p.token), J({
|
|
1862
1883
|
id: "for-login",
|
|
1863
1884
|
title: "Successful",
|
|
1864
1885
|
message: "Logged in",
|
|
1865
1886
|
color: "green"
|
|
1866
1887
|
}), e(p);
|
|
1867
1888
|
} catch (p) {
|
|
1868
|
-
|
|
1889
|
+
J({
|
|
1869
1890
|
id: "for-login",
|
|
1870
1891
|
title: "Login Failed",
|
|
1871
1892
|
message: p.message,
|
|
@@ -1878,29 +1899,29 @@ function kn({
|
|
|
1878
1899
|
}) => /* @__PURE__ */ a(ue, { mb: t.spacing, size: t.size, required: !0, label: "Username", ...o }) }),
|
|
1879
1900
|
/* @__PURE__ */ a(H, { name: "password", control: r, render: ({
|
|
1880
1901
|
field: o
|
|
1881
|
-
}) => /* @__PURE__ */ a(
|
|
1882
|
-
/* @__PURE__ */ a(
|
|
1902
|
+
}) => /* @__PURE__ */ a(tt, { mb: t.spacing, size: t.size, required: !0, label: "Password", ...o }) }),
|
|
1903
|
+
/* @__PURE__ */ a(Q, { position: "right", mt: t.spacing, children: /* @__PURE__ */ a(V, { type: "submit", size: t.button.size, children: "Submit" }) })
|
|
1883
1904
|
] }) });
|
|
1884
1905
|
}
|
|
1885
|
-
function
|
|
1906
|
+
function Aa({
|
|
1886
1907
|
styles: e = ke,
|
|
1887
1908
|
config: t,
|
|
1888
1909
|
onSuccess: r
|
|
1889
1910
|
}) {
|
|
1890
|
-
return
|
|
1911
|
+
return Ge(t), /* @__PURE__ */ a(he, { children: /* @__PURE__ */ a(se, { mt: e.spacing, sx: {
|
|
1891
1912
|
position: "relative"
|
|
1892
|
-
}, children: /* @__PURE__ */ a(
|
|
1913
|
+
}, children: /* @__PURE__ */ a(On, { styles: e, postSubmit: r }) }) });
|
|
1893
1914
|
}
|
|
1894
|
-
const
|
|
1915
|
+
const st = {
|
|
1895
1916
|
size: "sm",
|
|
1896
1917
|
spacing: "md",
|
|
1897
1918
|
button: {
|
|
1898
1919
|
size: "xs"
|
|
1899
1920
|
}
|
|
1900
1921
|
};
|
|
1901
|
-
function
|
|
1922
|
+
function xn({
|
|
1902
1923
|
postSubmit: e,
|
|
1903
|
-
styles: t =
|
|
1924
|
+
styles: t = st,
|
|
1904
1925
|
initialRoleID: r
|
|
1905
1926
|
}) {
|
|
1906
1927
|
const {
|
|
@@ -1927,14 +1948,14 @@ function Tn({
|
|
|
1927
1948
|
app_id: d,
|
|
1928
1949
|
app_secret: f
|
|
1929
1950
|
} = await oe.api_key.create(l, p);
|
|
1930
|
-
|
|
1951
|
+
J({
|
|
1931
1952
|
id: "for-creating",
|
|
1932
1953
|
title: "Successful",
|
|
1933
1954
|
message: "API Key is added",
|
|
1934
1955
|
color: "green"
|
|
1935
1956
|
}), e(d, f);
|
|
1936
1957
|
} catch (d) {
|
|
1937
|
-
|
|
1958
|
+
J({
|
|
1938
1959
|
id: "for-creating",
|
|
1939
1960
|
title: "Failed",
|
|
1940
1961
|
message: d.message,
|
|
@@ -1947,23 +1968,23 @@ function Tn({
|
|
|
1947
1968
|
}) => /* @__PURE__ */ a(ue, { mb: t.spacing, size: t.size, required: !0, label: "Name", ...l }) }),
|
|
1948
1969
|
/* @__PURE__ */ a(H, { name: "role_id", control: n, render: ({
|
|
1949
1970
|
field: l
|
|
1950
|
-
}) => /* @__PURE__ */ a(
|
|
1951
|
-
/* @__PURE__ */ a(
|
|
1971
|
+
}) => /* @__PURE__ */ a(St, { styles: t, ...l }) }),
|
|
1972
|
+
/* @__PURE__ */ a(Q, { position: "right", mt: t.spacing, children: /* @__PURE__ */ a(V, { type: "submit", size: t.button.size, children: "Save" }) })
|
|
1952
1973
|
] }) });
|
|
1953
1974
|
}
|
|
1954
|
-
function
|
|
1975
|
+
function Cn({
|
|
1955
1976
|
onSuccess: e,
|
|
1956
|
-
styles: t =
|
|
1977
|
+
styles: t = st,
|
|
1957
1978
|
initialRoleID: r
|
|
1958
1979
|
}) {
|
|
1959
|
-
const n =
|
|
1980
|
+
const n = Ue(), [s, o] = K.useState(!1), l = () => o(!0), p = () => o(!1);
|
|
1960
1981
|
return /* @__PURE__ */ C(he, { children: [
|
|
1961
1982
|
/* @__PURE__ */ a(Ae, { opened: s, onClose: () => o(!1), title: "Add an API Key", trapFocus: !0, onDragStart: (f) => {
|
|
1962
1983
|
f.stopPropagation();
|
|
1963
|
-
}, children: /* @__PURE__ */ a(
|
|
1984
|
+
}, children: /* @__PURE__ */ a(xn, { postSubmit: (f, b) => {
|
|
1964
1985
|
p(), n.openModal({
|
|
1965
1986
|
title: "API Key is generated",
|
|
1966
|
-
children: /* @__PURE__ */ C(
|
|
1987
|
+
children: /* @__PURE__ */ C(je, { children: [
|
|
1967
1988
|
/* @__PURE__ */ a(Re, { color: "dimmed", children: "Make sure you save it - you won't be able to access it again." }),
|
|
1968
1989
|
/* @__PURE__ */ a(ue, { defaultValue: f, disabled: !0, label: "APP ID", styles: {
|
|
1969
1990
|
input: {
|
|
@@ -1984,16 +2005,16 @@ function Rn({
|
|
|
1984
2005
|
}
|
|
1985
2006
|
});
|
|
1986
2007
|
}, styles: t, initialRoleID: r }) }),
|
|
1987
|
-
/* @__PURE__ */ a(V, { size: t.button.size, onClick: l, leftIcon: /* @__PURE__ */ a(
|
|
2008
|
+
/* @__PURE__ */ a(V, { size: t.button.size, onClick: l, leftIcon: /* @__PURE__ */ a(it, { size: 20 }), children: "Add an API Key" })
|
|
1988
2009
|
] });
|
|
1989
2010
|
}
|
|
1990
|
-
function
|
|
2011
|
+
function In({
|
|
1991
2012
|
id: e,
|
|
1992
2013
|
name: t,
|
|
1993
2014
|
onSuccess: r,
|
|
1994
|
-
styles: n =
|
|
2015
|
+
styles: n = st
|
|
1995
2016
|
}) {
|
|
1996
|
-
const s =
|
|
2017
|
+
const s = Ue(), o = async () => {
|
|
1997
2018
|
if (e) {
|
|
1998
2019
|
be({
|
|
1999
2020
|
id: "for-deleting",
|
|
@@ -2002,14 +2023,14 @@ function On({
|
|
|
2002
2023
|
loading: !0
|
|
2003
2024
|
});
|
|
2004
2025
|
try {
|
|
2005
|
-
await oe.api_key.delete(e),
|
|
2026
|
+
await oe.api_key.delete(e), J({
|
|
2006
2027
|
id: "for-deleting",
|
|
2007
2028
|
title: "Successful",
|
|
2008
2029
|
message: `API Key [${t}] is deleted`,
|
|
2009
2030
|
color: "green"
|
|
2010
2031
|
}), r();
|
|
2011
2032
|
} catch (p) {
|
|
2012
|
-
|
|
2033
|
+
J({
|
|
2013
2034
|
id: "for-deleting",
|
|
2014
2035
|
title: "Failed",
|
|
2015
2036
|
message: p.message,
|
|
@@ -2026,14 +2047,14 @@ function On({
|
|
|
2026
2047
|
onCancel: () => console.log("Cancel"),
|
|
2027
2048
|
onConfirm: o
|
|
2028
2049
|
});
|
|
2029
|
-
return /* @__PURE__ */ a(V, { size: n.button.size, color: "red", onClick: l, leftIcon: /* @__PURE__ */ a(
|
|
2050
|
+
return /* @__PURE__ */ a(V, { size: n.button.size, color: "red", onClick: l, leftIcon: /* @__PURE__ */ a(ot, { size: 20 }), children: "Delete" });
|
|
2030
2051
|
}
|
|
2031
|
-
function
|
|
2032
|
-
styles: e =
|
|
2052
|
+
function ka({
|
|
2053
|
+
styles: e = st,
|
|
2033
2054
|
config: t
|
|
2034
2055
|
}) {
|
|
2035
2056
|
var p;
|
|
2036
|
-
|
|
2057
|
+
Ge(t);
|
|
2037
2058
|
const {
|
|
2038
2059
|
data: r = [],
|
|
2039
2060
|
loading: n,
|
|
@@ -2057,12 +2078,12 @@ function Aa({
|
|
|
2057
2078
|
refreshDeps: []
|
|
2058
2079
|
});
|
|
2059
2080
|
return /* @__PURE__ */ C(he, { children: [
|
|
2060
|
-
/* @__PURE__ */ a(
|
|
2081
|
+
/* @__PURE__ */ a(Q, { pt: e.spacing, position: "right", children: /* @__PURE__ */ a(Cn, { onSuccess: s, initialRoleID: ((p = o == null ? void 0 : o[0]) == null ? void 0 : p.value) ?? "INACTIVE" }) }),
|
|
2061
2082
|
/* @__PURE__ */ C(se, { mt: e.spacing, sx: {
|
|
2062
2083
|
position: "relative"
|
|
2063
2084
|
}, children: [
|
|
2064
|
-
/* @__PURE__ */ a(
|
|
2065
|
-
/* @__PURE__ */ C(
|
|
2085
|
+
/* @__PURE__ */ a(rt, { visible: n || l }),
|
|
2086
|
+
/* @__PURE__ */ C(nt, { horizontalSpacing: e.spacing, verticalSpacing: e.spacing, fontSize: e.size, highlightOnHover: !0, children: [
|
|
2066
2087
|
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ C("tr", { children: [
|
|
2067
2088
|
/* @__PURE__ */ a("th", { children: "Name" }),
|
|
2068
2089
|
/* @__PURE__ */ a("th", { children: "APP ID" }),
|
|
@@ -2080,14 +2101,14 @@ function Aa({
|
|
|
2080
2101
|
/* @__PURE__ */ a("td", { width: 200, children: b }),
|
|
2081
2102
|
/* @__PURE__ */ a("td", { width: 200, children: u }),
|
|
2082
2103
|
/* @__PURE__ */ a("td", { width: 200, children: c }),
|
|
2083
|
-
/* @__PURE__ */ a("td", { width: 200, children: /* @__PURE__ */ a(
|
|
2104
|
+
/* @__PURE__ */ a("td", { width: 200, children: /* @__PURE__ */ a(Q, { position: "left", children: /* @__PURE__ */ a(In, { id: f, name: b, onSuccess: s }) }) })
|
|
2084
2105
|
] }, f);
|
|
2085
2106
|
}) })
|
|
2086
2107
|
] })
|
|
2087
2108
|
] })
|
|
2088
2109
|
] });
|
|
2089
2110
|
}
|
|
2090
|
-
const
|
|
2111
|
+
const Kt = ({
|
|
2091
2112
|
value: e,
|
|
2092
2113
|
onChange: t,
|
|
2093
2114
|
height: r = "200px",
|
|
@@ -2096,7 +2117,7 @@ const Wt = ({
|
|
|
2096
2117
|
const s = (l) => {
|
|
2097
2118
|
console.log("changing"), t == null || t(l ?? "");
|
|
2098
2119
|
}, o = !t;
|
|
2099
|
-
return /* @__PURE__ */ a(
|
|
2120
|
+
return /* @__PURE__ */ a(Vt, { className: "minimal-monaco-editor", height: r, defaultLanguage: n, value: e, onChange: o ? void 0 : s, theme: "vs-dark", options: {
|
|
2100
2121
|
lineNumbers: "off",
|
|
2101
2122
|
folding: !1,
|
|
2102
2123
|
lineDecorationsWidth: 20,
|
|
@@ -2114,7 +2135,7 @@ const Wt = ({
|
|
|
2114
2135
|
size: "xs"
|
|
2115
2136
|
}
|
|
2116
2137
|
};
|
|
2117
|
-
function
|
|
2138
|
+
function Dn({
|
|
2118
2139
|
postSubmit: e,
|
|
2119
2140
|
styles: t = De
|
|
2120
2141
|
}) {
|
|
@@ -2134,14 +2155,14 @@ function xn({
|
|
|
2134
2155
|
title: "Pending",
|
|
2135
2156
|
message: "Adding SQL Snippet...",
|
|
2136
2157
|
loading: !0
|
|
2137
|
-
}), await oe.sql_snippet.create(o),
|
|
2158
|
+
}), await oe.sql_snippet.create(o), J({
|
|
2138
2159
|
id: "for-creating",
|
|
2139
2160
|
title: "Successful",
|
|
2140
2161
|
message: "SQL Snippet is added",
|
|
2141
2162
|
color: "green"
|
|
2142
2163
|
}), e();
|
|
2143
2164
|
} catch (l) {
|
|
2144
|
-
|
|
2165
|
+
J({
|
|
2145
2166
|
id: "for-creating",
|
|
2146
2167
|
title: "Failed",
|
|
2147
2168
|
message: l.message,
|
|
@@ -2154,16 +2175,16 @@ function xn({
|
|
|
2154
2175
|
}) => /* @__PURE__ */ a(ue, { mb: t.spacing, size: t.size, required: !0, label: "Name", ...o }) }),
|
|
2155
2176
|
/* @__PURE__ */ a(H, { name: "content", control: r, render: ({
|
|
2156
2177
|
field: o
|
|
2157
|
-
}) => /* @__PURE__ */ C(
|
|
2178
|
+
}) => /* @__PURE__ */ C(je, { spacing: 4, children: [
|
|
2158
2179
|
/* @__PURE__ */ a(Re, { size: 14, fw: 500, color: "#212529", sx: {
|
|
2159
2180
|
cursor: "default"
|
|
2160
2181
|
}, children: "Content" }),
|
|
2161
|
-
/* @__PURE__ */ a(
|
|
2182
|
+
/* @__PURE__ */ a(Kt, { height: "600px", ...o })
|
|
2162
2183
|
] }) }),
|
|
2163
|
-
/* @__PURE__ */ a(
|
|
2184
|
+
/* @__PURE__ */ a(Q, { position: "right", mt: t.spacing, children: /* @__PURE__ */ a(V, { type: "submit", size: t.button.size, children: "Save" }) })
|
|
2164
2185
|
] }) });
|
|
2165
2186
|
}
|
|
2166
|
-
function
|
|
2187
|
+
function Ln({
|
|
2167
2188
|
onSuccess: e,
|
|
2168
2189
|
styles: t = De
|
|
2169
2190
|
}) {
|
|
@@ -2171,13 +2192,13 @@ function Cn({
|
|
|
2171
2192
|
return /* @__PURE__ */ C(he, { children: [
|
|
2172
2193
|
/* @__PURE__ */ a(Ae, { opened: r, onClose: () => n(!1), title: "Add a SQL Snippet", trapFocus: !0, onDragStart: (p) => {
|
|
2173
2194
|
p.stopPropagation();
|
|
2174
|
-
}, size: "80vw", children: /* @__PURE__ */ a(
|
|
2195
|
+
}, size: "80vw", children: /* @__PURE__ */ a(Dn, { postSubmit: () => {
|
|
2175
2196
|
o(), e();
|
|
2176
2197
|
}, styles: t }) }),
|
|
2177
|
-
/* @__PURE__ */ a(V, { size: t.button.size, onClick: s, leftIcon: /* @__PURE__ */ a(
|
|
2198
|
+
/* @__PURE__ */ a(V, { size: t.button.size, onClick: s, leftIcon: /* @__PURE__ */ a(it, { size: 18 }), children: "Add a SQL Snippet" })
|
|
2178
2199
|
] });
|
|
2179
2200
|
}
|
|
2180
|
-
function
|
|
2201
|
+
function Fn({
|
|
2181
2202
|
postSubmit: e,
|
|
2182
2203
|
styles: t = De,
|
|
2183
2204
|
id: r,
|
|
@@ -2199,14 +2220,14 @@ function In({
|
|
|
2199
2220
|
title: "Pending",
|
|
2200
2221
|
message: "Updating SQL Snippet...",
|
|
2201
2222
|
loading: !0
|
|
2202
|
-
}), await oe.sql_snippet.update(p),
|
|
2223
|
+
}), await oe.sql_snippet.update(p), J({
|
|
2203
2224
|
id: "for-updating",
|
|
2204
2225
|
title: "Successful",
|
|
2205
2226
|
message: "SQL Snippet is updated",
|
|
2206
2227
|
color: "green"
|
|
2207
2228
|
}), e();
|
|
2208
2229
|
} catch (d) {
|
|
2209
|
-
|
|
2230
|
+
J({
|
|
2210
2231
|
id: "for-updating",
|
|
2211
2232
|
title: "Failed",
|
|
2212
2233
|
message: d.message,
|
|
@@ -2219,16 +2240,16 @@ function In({
|
|
|
2219
2240
|
}) => /* @__PURE__ */ a(ue, { mb: t.spacing, size: t.size, required: !0, label: "Name", ...p }) }),
|
|
2220
2241
|
/* @__PURE__ */ a(H, { name: "content", control: s, render: ({
|
|
2221
2242
|
field: p
|
|
2222
|
-
}) => /* @__PURE__ */ C(
|
|
2243
|
+
}) => /* @__PURE__ */ C(je, { spacing: 4, children: [
|
|
2223
2244
|
/* @__PURE__ */ a(Re, { size: 14, fw: 500, color: "#212529", sx: {
|
|
2224
2245
|
cursor: "default"
|
|
2225
2246
|
}, children: "Content" }),
|
|
2226
|
-
/* @__PURE__ */ a(
|
|
2247
|
+
/* @__PURE__ */ a(Kt, { height: "600px", ...p })
|
|
2227
2248
|
] }) }),
|
|
2228
|
-
/* @__PURE__ */ a(
|
|
2249
|
+
/* @__PURE__ */ a(Q, { position: "right", mt: t.spacing, children: /* @__PURE__ */ a(V, { type: "submit", size: t.button.size, children: "Save" }) })
|
|
2229
2250
|
] }) });
|
|
2230
2251
|
}
|
|
2231
|
-
function
|
|
2252
|
+
function Nn({
|
|
2232
2253
|
onSuccess: e,
|
|
2233
2254
|
styles: t = De,
|
|
2234
2255
|
...r
|
|
@@ -2237,10 +2258,10 @@ function Dn({
|
|
|
2237
2258
|
return /* @__PURE__ */ C(he, { children: [
|
|
2238
2259
|
/* @__PURE__ */ a(Ae, { opened: n, onClose: () => s(!1), title: "Edit a SQL Snippet", trapFocus: !0, onDragStart: (d) => {
|
|
2239
2260
|
d.stopPropagation();
|
|
2240
|
-
}, size: "80vw", children: /* @__PURE__ */ a(
|
|
2261
|
+
}, size: "80vw", children: /* @__PURE__ */ a(Fn, { postSubmit: () => {
|
|
2241
2262
|
l(), e();
|
|
2242
2263
|
}, styles: t, ...r }) }),
|
|
2243
|
-
/* @__PURE__ */ a(V, { size: t.button.size, onClick: o, leftIcon: /* @__PURE__ */ a(
|
|
2264
|
+
/* @__PURE__ */ a(V, { size: t.button.size, onClick: o, leftIcon: /* @__PURE__ */ a(ht, { size: 18 }), children: "Edit" })
|
|
2244
2265
|
] });
|
|
2245
2266
|
}
|
|
2246
2267
|
/**
|
|
@@ -2251,7 +2272,7 @@ function Dn({
|
|
|
2251
2272
|
* @namespace
|
|
2252
2273
|
* @public
|
|
2253
2274
|
*/
|
|
2254
|
-
var
|
|
2275
|
+
var bt = function() {
|
|
2255
2276
|
var e = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, t = 0, r = {}, n = {
|
|
2256
2277
|
/**
|
|
2257
2278
|
* A namespace for utility methods.
|
|
@@ -2524,8 +2545,8 @@ var mt = function() {
|
|
|
2524
2545
|
g.hasOwnProperty(A) || (_[A] = h[A]);
|
|
2525
2546
|
}
|
|
2526
2547
|
var $ = y[u];
|
|
2527
|
-
return y[u] = _, n.languages.DFS(n.languages, function(M,
|
|
2528
|
-
|
|
2548
|
+
return y[u] = _, n.languages.DFS(n.languages, function(M, te) {
|
|
2549
|
+
te === $ && M != u && (this[M] = _);
|
|
2529
2550
|
}), _;
|
|
2530
2551
|
},
|
|
2531
2552
|
// Traverse a language definition with Depth First Search
|
|
@@ -2687,41 +2708,41 @@ var mt = function() {
|
|
|
2687
2708
|
for (var $ = 0; $ < k.length; ++$) {
|
|
2688
2709
|
if (_ && _.cause == A + "," + $)
|
|
2689
2710
|
return;
|
|
2690
|
-
var M = k[$],
|
|
2711
|
+
var M = k[$], te = M.inside, X = !!M.lookbehind, Y = !!M.greedy, Z = M.alias;
|
|
2691
2712
|
if (Y && !M.pattern.global) {
|
|
2692
2713
|
var F = M.pattern.toString().match(/[imsuy]*$/)[0];
|
|
2693
2714
|
M.pattern = RegExp(M.pattern.source, F + "g");
|
|
2694
2715
|
}
|
|
2695
|
-
for (var L = M.pattern || M, B = y.next,
|
|
2716
|
+
for (var L = M.pattern || M, B = y.next, ee = h; B !== c.tail && !(_ && ee >= _.reach); ee += B.value.length, B = B.next) {
|
|
2696
2717
|
var R = B.value;
|
|
2697
2718
|
if (c.length > u.length)
|
|
2698
2719
|
return;
|
|
2699
2720
|
if (!(R instanceof s)) {
|
|
2700
2721
|
var E = 1, S;
|
|
2701
2722
|
if (Y) {
|
|
2702
|
-
if (S = o(L,
|
|
2723
|
+
if (S = o(L, ee, u, X), !S || S.index >= u.length)
|
|
2703
2724
|
break;
|
|
2704
|
-
var I = S.index, O = S.index + S[0].length, w =
|
|
2725
|
+
var I = S.index, O = S.index + S[0].length, w = ee;
|
|
2705
2726
|
for (w += B.value.length; I >= w; )
|
|
2706
2727
|
B = B.next, w += B.value.length;
|
|
2707
|
-
if (w -= B.value.length,
|
|
2728
|
+
if (w -= B.value.length, ee = w, B.value instanceof s)
|
|
2708
2729
|
continue;
|
|
2709
2730
|
for (var x = B; x !== c.tail && (w < O || typeof x.value == "string"); x = x.next)
|
|
2710
2731
|
E++, w += x.value.length;
|
|
2711
|
-
E--, R = u.slice(
|
|
2712
|
-
} else if (S = o(L, 0, R,
|
|
2732
|
+
E--, R = u.slice(ee, w), S.index -= ee;
|
|
2733
|
+
} else if (S = o(L, 0, R, X), !S)
|
|
2713
2734
|
continue;
|
|
2714
|
-
var I = S.index, N = S[0], q = R.slice(0, I), j = R.slice(I + N.length), U =
|
|
2735
|
+
var I = S.index, N = S[0], q = R.slice(0, I), j = R.slice(I + N.length), U = ee + R.length;
|
|
2715
2736
|
_ && U > _.reach && (_.reach = U);
|
|
2716
2737
|
var le = B.prev;
|
|
2717
|
-
q && (le = d(c, le, q),
|
|
2718
|
-
var ce = new s(A,
|
|
2738
|
+
q && (le = d(c, le, q), ee += q.length), f(c, le, E);
|
|
2739
|
+
var ce = new s(A, te ? n.tokenize(N, te) : N, Z, N);
|
|
2719
2740
|
if (B = d(c, le, ce), j && d(c, B, j), E > 1) {
|
|
2720
2741
|
var pe = {
|
|
2721
2742
|
cause: A + "," + $,
|
|
2722
2743
|
reach: U
|
|
2723
2744
|
};
|
|
2724
|
-
l(u, c, g, B.prev,
|
|
2745
|
+
l(u, c, g, B.prev, ee, pe), _ && pe.reach > _.reach && (_.reach = pe.reach);
|
|
2725
2746
|
}
|
|
2726
2747
|
}
|
|
2727
2748
|
}
|
|
@@ -2747,8 +2768,8 @@ var mt = function() {
|
|
|
2747
2768
|
return c;
|
|
2748
2769
|
}
|
|
2749
2770
|
return n;
|
|
2750
|
-
}(), m =
|
|
2751
|
-
|
|
2771
|
+
}(), m = bt;
|
|
2772
|
+
bt.default = bt;
|
|
2752
2773
|
m.languages.markup = {
|
|
2753
2774
|
comment: {
|
|
2754
2775
|
pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
|
|
@@ -4205,34 +4226,34 @@ m.languages.sql = {
|
|
|
4205
4226
|
for (var Z = Y.content, F; g.indexOf(F = p(A++, h)) !== -1; )
|
|
4206
4227
|
;
|
|
4207
4228
|
return k[F] = Z, F;
|
|
4208
|
-
}).join(""), M = d($, y, h),
|
|
4229
|
+
}).join(""), M = d($, y, h), te = Object.keys(k);
|
|
4209
4230
|
A = 0;
|
|
4210
|
-
function
|
|
4231
|
+
function X(Y) {
|
|
4211
4232
|
for (var Z = 0; Z < Y.length; Z++) {
|
|
4212
|
-
if (A >=
|
|
4233
|
+
if (A >= te.length)
|
|
4213
4234
|
return;
|
|
4214
4235
|
var F = Y[Z];
|
|
4215
4236
|
if (typeof F == "string" || typeof F.content == "string") {
|
|
4216
|
-
var L =
|
|
4237
|
+
var L = te[A], B = typeof F == "string" ? F : (
|
|
4217
4238
|
/** @type {string} */
|
|
4218
4239
|
F.content
|
|
4219
|
-
),
|
|
4220
|
-
if (
|
|
4240
|
+
), ee = B.indexOf(L);
|
|
4241
|
+
if (ee !== -1) {
|
|
4221
4242
|
++A;
|
|
4222
|
-
var R = B.substring(0,
|
|
4243
|
+
var R = B.substring(0, ee), E = f(k[L]), S = B.substring(ee + L.length), O = [];
|
|
4223
4244
|
if (R && O.push(R), O.push(E), S) {
|
|
4224
4245
|
var w = [S];
|
|
4225
|
-
|
|
4246
|
+
X(w), O.push.apply(O, w);
|
|
4226
4247
|
}
|
|
4227
4248
|
typeof F == "string" ? (Y.splice.apply(Y, [Z, 1].concat(O)), Z += O.length - 1) : F.content = O;
|
|
4228
4249
|
}
|
|
4229
4250
|
} else {
|
|
4230
4251
|
var x = F.content;
|
|
4231
|
-
Array.isArray(x) ?
|
|
4252
|
+
Array.isArray(x) ? X(x) : X([x]);
|
|
4232
4253
|
}
|
|
4233
4254
|
}
|
|
4234
4255
|
}
|
|
4235
|
-
return
|
|
4256
|
+
return X(M), new e.Token(h, M, "language-" + h, g);
|
|
4236
4257
|
}
|
|
4237
4258
|
var u = {
|
|
4238
4259
|
javascript: !0,
|
|
@@ -4257,10 +4278,10 @@ m.languages.sql = {
|
|
|
4257
4278
|
if (k.type === "template-string") {
|
|
4258
4279
|
var M = $[1];
|
|
4259
4280
|
if ($.length === 3 && typeof M != "string" && M.type === "embedded-code") {
|
|
4260
|
-
var
|
|
4281
|
+
var te = c(M), X = M.alias, Y = Array.isArray(X) ? X[0] : X, Z = e.languages[Y];
|
|
4261
4282
|
if (!Z)
|
|
4262
4283
|
continue;
|
|
4263
|
-
$[1] = b(
|
|
4284
|
+
$[1] = b(te, Z, Y);
|
|
4264
4285
|
}
|
|
4265
4286
|
} else
|
|
4266
4287
|
y($);
|
|
@@ -5216,8 +5237,8 @@ m.languages.wasm = {
|
|
|
5216
5237
|
number: /[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/,
|
|
5217
5238
|
punctuation: /[()]/
|
|
5218
5239
|
};
|
|
5219
|
-
const
|
|
5220
|
-
var
|
|
5240
|
+
const $n = m;
|
|
5241
|
+
var Pn = {
|
|
5221
5242
|
plain: {
|
|
5222
5243
|
backgroundColor: "#2a2734",
|
|
5223
5244
|
color: "#9a86fd"
|
|
@@ -5284,11 +5305,11 @@ var Fn = {
|
|
|
5284
5305
|
}
|
|
5285
5306
|
}]
|
|
5286
5307
|
};
|
|
5287
|
-
const
|
|
5288
|
-
var
|
|
5308
|
+
const zn = Pn;
|
|
5309
|
+
var Mn = {
|
|
5289
5310
|
// $FlowFixMe
|
|
5290
|
-
Prism:
|
|
5291
|
-
theme:
|
|
5311
|
+
Prism: $n,
|
|
5312
|
+
theme: zn
|
|
5292
5313
|
};
|
|
5293
5314
|
function $e(e, t, r) {
|
|
5294
5315
|
return t in e ? Object.defineProperty(e, t, {
|
|
@@ -5308,7 +5329,7 @@ function _e() {
|
|
|
5308
5329
|
return e;
|
|
5309
5330
|
}, _e.apply(this, arguments);
|
|
5310
5331
|
}
|
|
5311
|
-
var
|
|
5332
|
+
var Bn = /\r\n|\r|\n/, Mt = function(e) {
|
|
5312
5333
|
e.length === 0 ? e.push({
|
|
5313
5334
|
types: ["plain"],
|
|
5314
5335
|
content: `
|
|
@@ -5316,32 +5337,32 @@ var Pn = /\r\n|\r|\n/, zt = function(e) {
|
|
|
5316
5337
|
empty: !0
|
|
5317
5338
|
}) : e.length === 1 && e[0].content === "" && (e[0].content = `
|
|
5318
5339
|
`, e[0].empty = !0);
|
|
5319
|
-
},
|
|
5340
|
+
}, Bt = function(e, t) {
|
|
5320
5341
|
var r = e.length;
|
|
5321
5342
|
return r > 0 && e[r - 1] === t ? e : e.concat(t);
|
|
5322
|
-
},
|
|
5343
|
+
}, jn = function(e) {
|
|
5323
5344
|
for (var t = [[]], r = [e], n = [0], s = [e.length], o = 0, l = 0, p = [], d = [p]; l > -1; ) {
|
|
5324
5345
|
for (; (o = n[l]++) < s[l]; ) {
|
|
5325
5346
|
var f = void 0, b = t[l], u = r[l], c = u[o];
|
|
5326
|
-
if (typeof c == "string" ? (b = l > 0 ? b : ["plain"], f = c) : (b =
|
|
5347
|
+
if (typeof c == "string" ? (b = l > 0 ? b : ["plain"], f = c) : (b = Bt(b, c.type), c.alias && (b = Bt(b, c.alias)), f = c.content), typeof f != "string") {
|
|
5327
5348
|
l++, t.push(b), r.push(f), n.push(0), s.push(f.length);
|
|
5328
5349
|
continue;
|
|
5329
5350
|
}
|
|
5330
|
-
var g = f.split(
|
|
5351
|
+
var g = f.split(Bn), y = g.length;
|
|
5331
5352
|
p.push({
|
|
5332
5353
|
types: b,
|
|
5333
5354
|
content: g[0]
|
|
5334
5355
|
});
|
|
5335
5356
|
for (var h = 1; h < y; h++)
|
|
5336
|
-
|
|
5357
|
+
Mt(p), d.push(p = []), p.push({
|
|
5337
5358
|
types: b,
|
|
5338
5359
|
content: g[h]
|
|
5339
5360
|
});
|
|
5340
5361
|
}
|
|
5341
5362
|
l--, t.pop(), r.pop(), n.pop(), s.pop();
|
|
5342
5363
|
}
|
|
5343
|
-
return
|
|
5344
|
-
},
|
|
5364
|
+
return Mt(p), d;
|
|
5365
|
+
}, Un = function(e, t) {
|
|
5345
5366
|
var r = e.plain, n = /* @__PURE__ */ Object.create(null), s = e.styles.reduce(function(o, l) {
|
|
5346
5367
|
var p = l.languages, d = l.style;
|
|
5347
5368
|
return p && !p.includes(t) || l.types.forEach(function(f) {
|
|
@@ -5353,13 +5374,13 @@ var Pn = /\r\n|\r|\n/, zt = function(e) {
|
|
|
5353
5374
|
backgroundColor: null
|
|
5354
5375
|
}), s;
|
|
5355
5376
|
};
|
|
5356
|
-
function
|
|
5377
|
+
function jt(e, t) {
|
|
5357
5378
|
var r = {};
|
|
5358
5379
|
for (var n in e)
|
|
5359
5380
|
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) === -1 && (r[n] = e[n]);
|
|
5360
5381
|
return r;
|
|
5361
5382
|
}
|
|
5362
|
-
var
|
|
5383
|
+
var Gn = /* @__PURE__ */ function(e) {
|
|
5363
5384
|
function t() {
|
|
5364
5385
|
for (var r = this, n = [], s = arguments.length; s--; )
|
|
5365
5386
|
n[s] = arguments[s];
|
|
@@ -5367,10 +5388,10 @@ var Bn = /* @__PURE__ */ function(e) {
|
|
|
5367
5388
|
if (r.themeDict !== void 0 && o.theme === r.prevTheme && o.language === r.prevLanguage)
|
|
5368
5389
|
return r.themeDict;
|
|
5369
5390
|
r.prevTheme = o.theme, r.prevLanguage = o.language;
|
|
5370
|
-
var l = o.theme ?
|
|
5391
|
+
var l = o.theme ? Un(o.theme, o.language) : void 0;
|
|
5371
5392
|
return r.themeDict = l;
|
|
5372
5393
|
}), $e(this, "getLineProps", function(o) {
|
|
5373
|
-
var l = o.key, p = o.className, d = o.style, f =
|
|
5394
|
+
var l = o.key, p = o.className, d = o.style, f = jt(o, ["key", "className", "style", "line"]), b = f, u = _e({}, b, {
|
|
5374
5395
|
className: "token-line",
|
|
5375
5396
|
style: void 0,
|
|
5376
5397
|
key: void 0
|
|
@@ -5395,7 +5416,7 @@ var Bn = /* @__PURE__ */ function(e) {
|
|
|
5395
5416
|
return Object.assign.apply(Object, [b].concat(u));
|
|
5396
5417
|
}
|
|
5397
5418
|
}), $e(this, "getTokenProps", function(o) {
|
|
5398
|
-
var l = o.key, p = o.className, d = o.style, f = o.token, b =
|
|
5419
|
+
var l = o.key, p = o.className, d = o.style, f = o.token, b = jt(o, ["key", "className", "style", "token"]), u = b, c = _e({}, u, {
|
|
5399
5420
|
className: "token " + f.types.join(" "),
|
|
5400
5421
|
children: f.content,
|
|
5401
5422
|
style: r.getStyleForToken(f),
|
|
@@ -5415,7 +5436,7 @@ var Bn = /* @__PURE__ */ function(e) {
|
|
|
5415
5436
|
});
|
|
5416
5437
|
}
|
|
5417
5438
|
return e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t, t.prototype.render = function() {
|
|
5418
|
-
var n = this.props, s = n.Prism, o = n.language, l = n.code, p = n.children, d = this.getThemeDict(this.props), f = s.languages[o], b = f !== void 0 ? this.tokenize(s, l, f, o) : [l], u =
|
|
5439
|
+
var n = this.props, s = n.Prism, o = n.language, l = n.code, p = n.children, d = this.getThemeDict(this.props), f = s.languages[o], b = f !== void 0 ? this.tokenize(s, l, f, o) : [l], u = jn(b);
|
|
5419
5440
|
return p({
|
|
5420
5441
|
tokens: u,
|
|
5421
5442
|
className: "prism-code language-" + o,
|
|
@@ -5424,9 +5445,9 @@ var Bn = /* @__PURE__ */ function(e) {
|
|
|
5424
5445
|
getTokenProps: this.getTokenProps
|
|
5425
5446
|
});
|
|
5426
5447
|
}, t;
|
|
5427
|
-
}(
|
|
5428
|
-
const
|
|
5429
|
-
function
|
|
5448
|
+
}(kr);
|
|
5449
|
+
const qn = Gn;
|
|
5450
|
+
function Zt({ copied: e }) {
|
|
5430
5451
|
return /* @__PURE__ */ K.createElement("svg", {
|
|
5431
5452
|
viewBox: "0 0 15 15",
|
|
5432
5453
|
fill: "none",
|
|
@@ -5444,8 +5465,8 @@ function Kt({ copied: e }) {
|
|
|
5444
5465
|
clipRule: "evenodd"
|
|
5445
5466
|
}));
|
|
5446
5467
|
}
|
|
5447
|
-
|
|
5448
|
-
const
|
|
5468
|
+
Zt.displayName = "@mantine/prism/CopyIcon";
|
|
5469
|
+
const Hn = (e) => ({
|
|
5449
5470
|
plain: {
|
|
5450
5471
|
color: e.colors.gray[4],
|
|
5451
5472
|
backgroundColor: e.colors.dark[8]
|
|
@@ -5530,7 +5551,7 @@ const Un = (e) => ({
|
|
|
5530
5551
|
}
|
|
5531
5552
|
}
|
|
5532
5553
|
]
|
|
5533
|
-
}),
|
|
5554
|
+
}), Yn = (e) => ({
|
|
5534
5555
|
plain: {
|
|
5535
5556
|
color: e.colors.gray[9],
|
|
5536
5557
|
backgroundColor: e.fn.rgba(e.colors.gray[0], 0.65)
|
|
@@ -5621,8 +5642,8 @@ const Un = (e) => ({
|
|
|
5621
5642
|
}
|
|
5622
5643
|
}
|
|
5623
5644
|
]
|
|
5624
|
-
}),
|
|
5625
|
-
var
|
|
5645
|
+
}), Vn = (e, t) => t === "dark" ? Hn(e) : Yn(e);
|
|
5646
|
+
var Wn = Ht((e, { colorScheme: t, native: r, maxLineSize: n, radius: s }) => ({
|
|
5626
5647
|
scrollArea: {},
|
|
5627
5648
|
root: {
|
|
5628
5649
|
position: "relative"
|
|
@@ -5632,7 +5653,7 @@ var Hn = qt((e, { colorScheme: t, native: r, maxLineSize: n, radius: s }) => ({
|
|
|
5632
5653
|
position: "relative",
|
|
5633
5654
|
fontFamily: e.fontFamilyMonospace,
|
|
5634
5655
|
lineHeight: 1.7,
|
|
5635
|
-
fontSize:
|
|
5656
|
+
fontSize: Me(13),
|
|
5636
5657
|
overflowX: r ? "auto" : void 0,
|
|
5637
5658
|
borderRadius: e.fn.radius(s),
|
|
5638
5659
|
padding: `${e.spacing.sm} 0`,
|
|
@@ -5659,7 +5680,7 @@ var Hn = qt((e, { colorScheme: t, native: r, maxLineSize: n, radius: s }) => ({
|
|
|
5659
5680
|
lineNumber: {
|
|
5660
5681
|
color: t === "dark" ? e.colors.dark[4] : e.colors.gray[4],
|
|
5661
5682
|
textAlign: "right",
|
|
5662
|
-
width: `calc(8 * ${
|
|
5683
|
+
width: `calc(8 * ${Me(n)})`,
|
|
5663
5684
|
marginRight: e.dir === "ltr" ? e.spacing.xs : void 0,
|
|
5664
5685
|
marginLeft: e.dir === "rtl" ? e.spacing.xs : void 0,
|
|
5665
5686
|
userSelect: "none"
|
|
@@ -5668,34 +5689,34 @@ var Hn = qt((e, { colorScheme: t, native: r, maxLineSize: n, radius: s }) => ({
|
|
|
5668
5689
|
width: "100%"
|
|
5669
5690
|
}
|
|
5670
5691
|
}));
|
|
5671
|
-
const
|
|
5672
|
-
var
|
|
5692
|
+
const Kn = Wn;
|
|
5693
|
+
var Zn = Object.defineProperty, Xn = Object.defineProperties, Qn = Object.getOwnPropertyDescriptors, Xe = Object.getOwnPropertySymbols, Xt = Object.prototype.hasOwnProperty, Qt = Object.prototype.propertyIsEnumerable, Ut = (e, t, r) => t in e ? Zn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Ie = (e, t) => {
|
|
5673
5694
|
for (var r in t || (t = {}))
|
|
5674
|
-
|
|
5675
|
-
if (
|
|
5676
|
-
for (var r of
|
|
5677
|
-
|
|
5695
|
+
Xt.call(t, r) && Ut(e, r, t[r]);
|
|
5696
|
+
if (Xe)
|
|
5697
|
+
for (var r of Xe(t))
|
|
5698
|
+
Qt.call(t, r) && Ut(e, r, t[r]);
|
|
5678
5699
|
return e;
|
|
5679
|
-
}, Pe = (e, t) =>
|
|
5700
|
+
}, Pe = (e, t) => Xn(e, Qn(t)), Jn = (e, t) => {
|
|
5680
5701
|
var r = {};
|
|
5681
5702
|
for (var n in e)
|
|
5682
|
-
|
|
5683
|
-
if (e != null &&
|
|
5684
|
-
for (var n of
|
|
5685
|
-
t.indexOf(n) < 0 &&
|
|
5703
|
+
Xt.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
|
|
5704
|
+
if (e != null && Xe)
|
|
5705
|
+
for (var n of Xe(e))
|
|
5706
|
+
t.indexOf(n) < 0 && Qt.call(e, n) && (r[n] = e[n]);
|
|
5686
5707
|
return r;
|
|
5687
5708
|
};
|
|
5688
|
-
const
|
|
5709
|
+
const ea = {
|
|
5689
5710
|
noCopy: !1,
|
|
5690
5711
|
copyLabel: "Copy code",
|
|
5691
5712
|
copiedLabel: "Copied",
|
|
5692
5713
|
withLineNumbers: !1,
|
|
5693
5714
|
trim: !0,
|
|
5694
5715
|
highlightLines: {},
|
|
5695
|
-
scrollAreaComponent:
|
|
5696
|
-
getPrismTheme:
|
|
5697
|
-
},
|
|
5698
|
-
const r =
|
|
5716
|
+
scrollAreaComponent: Yt,
|
|
5717
|
+
getPrismTheme: Vn
|
|
5718
|
+
}, wt = Je((e, t) => {
|
|
5719
|
+
const r = Ir("Prism", ea, e), {
|
|
5699
5720
|
className: n,
|
|
5700
5721
|
children: s,
|
|
5701
5722
|
language: o,
|
|
@@ -5713,7 +5734,7 @@ const Xn = {
|
|
|
5713
5734
|
radius: A,
|
|
5714
5735
|
getPrismTheme: k,
|
|
5715
5736
|
variant: $
|
|
5716
|
-
} = r, M =
|
|
5737
|
+
} = r, M = Jn(r, [
|
|
5717
5738
|
"className",
|
|
5718
5739
|
"children",
|
|
5719
5740
|
"language",
|
|
@@ -5731,11 +5752,11 @@ const Xn = {
|
|
|
5731
5752
|
"radius",
|
|
5732
5753
|
"getPrismTheme",
|
|
5733
5754
|
"variant"
|
|
5734
|
-
]),
|
|
5735
|
-
`).length.toString().length, Y =
|
|
5755
|
+
]), te = h && typeof s == "string" ? s.trim() : s, X = te.split(`
|
|
5756
|
+
`).length.toString().length, Y = Dr(), Z = qr(), F = y || Y.colorScheme, { classes: L, cx: B } = Kn({
|
|
5736
5757
|
colorScheme: F,
|
|
5737
|
-
native: g !==
|
|
5738
|
-
maxLineSize:
|
|
5758
|
+
native: g !== Yt,
|
|
5759
|
+
maxLineSize: X,
|
|
5739
5760
|
radius: A
|
|
5740
5761
|
}, { name: "Prism", classNames: p, styles: d, unstyled: _, variant: $ });
|
|
5741
5762
|
return /* @__PURE__ */ K.createElement(se, Pe(Ie({
|
|
@@ -5743,7 +5764,7 @@ const Xn = {
|
|
|
5743
5764
|
ref: t
|
|
5744
5765
|
}, M), {
|
|
5745
5766
|
translate: "no"
|
|
5746
|
-
}), !l && /* @__PURE__ */ K.createElement(
|
|
5767
|
+
}), !l && /* @__PURE__ */ K.createElement(Ke, {
|
|
5747
5768
|
label: Z.copied ? b : f,
|
|
5748
5769
|
position: "left",
|
|
5749
5770
|
withArrow: !0,
|
|
@@ -5751,19 +5772,19 @@ const Xn = {
|
|
|
5751
5772
|
offset: 6,
|
|
5752
5773
|
color: Z.copied ? "teal" : void 0,
|
|
5753
5774
|
unstyled: _
|
|
5754
|
-
}, /* @__PURE__ */ K.createElement(
|
|
5775
|
+
}, /* @__PURE__ */ K.createElement(vt, {
|
|
5755
5776
|
className: L.copy,
|
|
5756
5777
|
"aria-label": Z.copied ? b : f,
|
|
5757
|
-
onClick: () => Z.copy(
|
|
5778
|
+
onClick: () => Z.copy(te),
|
|
5758
5779
|
unstyled: _
|
|
5759
|
-
}, /* @__PURE__ */ K.createElement(
|
|
5780
|
+
}, /* @__PURE__ */ K.createElement(Zt, {
|
|
5760
5781
|
copied: Z.copied
|
|
5761
|
-
}))), /* @__PURE__ */ K.createElement(
|
|
5782
|
+
}))), /* @__PURE__ */ K.createElement(qn, Pe(Ie({}, Mn), {
|
|
5762
5783
|
theme: k(Y, F),
|
|
5763
|
-
code:
|
|
5784
|
+
code: te,
|
|
5764
5785
|
language: o
|
|
5765
5786
|
}), ({
|
|
5766
|
-
className:
|
|
5787
|
+
className: ee,
|
|
5767
5788
|
style: R,
|
|
5768
5789
|
tokens: E,
|
|
5769
5790
|
getLineProps: S,
|
|
@@ -5772,7 +5793,7 @@ const Xn = {
|
|
|
5772
5793
|
className: L.scrollArea,
|
|
5773
5794
|
dir: "ltr"
|
|
5774
5795
|
}, /* @__PURE__ */ K.createElement("pre", {
|
|
5775
|
-
className: B(L.code,
|
|
5796
|
+
className: B(L.code, ee),
|
|
5776
5797
|
style: R,
|
|
5777
5798
|
dir: "ltr"
|
|
5778
5799
|
}, E.map((w, x) => {
|
|
@@ -5792,23 +5813,23 @@ const Xn = {
|
|
|
5792
5813
|
}, ((j = c[U]) == null ? void 0 : j.label) || U), /* @__PURE__ */ K.createElement("div", {
|
|
5793
5814
|
className: L.lineContent
|
|
5794
5815
|
}, w.map((ye, fe) => {
|
|
5795
|
-
var
|
|
5816
|
+
var re, de;
|
|
5796
5817
|
const ve = O({ token: ye, key: fe });
|
|
5797
5818
|
return /* @__PURE__ */ K.createElement("span", Pe(Ie({}, ve), {
|
|
5798
5819
|
style: Pe(Ie({}, ve.style), {
|
|
5799
|
-
color: ce ? Y.fn.themeColor((
|
|
5820
|
+
color: ce ? Y.fn.themeColor((re = c[U]) == null ? void 0 : re.color, F === "dark" ? 5 : 8) : (de = ve == null ? void 0 : ve.style) == null ? void 0 : de.color
|
|
5800
5821
|
})
|
|
5801
5822
|
}));
|
|
5802
5823
|
})));
|
|
5803
5824
|
}).filter(Boolean)))));
|
|
5804
5825
|
});
|
|
5805
|
-
|
|
5806
|
-
var
|
|
5826
|
+
wt.displayName = "@mantine/prism/Prism";
|
|
5827
|
+
var ta = Ht((e, { radius: t }) => ({
|
|
5807
5828
|
tab: {
|
|
5808
5829
|
paddingLeft: e.spacing.sm,
|
|
5809
5830
|
paddingRight: e.spacing.sm,
|
|
5810
|
-
height:
|
|
5811
|
-
border: `${
|
|
5831
|
+
height: Me(34),
|
|
5832
|
+
border: `${Me(1)} solid ${e.colorScheme === "dark" ? e.colors.dark[5] : e.colors.gray[3]}`,
|
|
5812
5833
|
borderBottom: 0,
|
|
5813
5834
|
fontSize: e.fontSizes.sm,
|
|
5814
5835
|
color: e.colorScheme === "dark" ? e.colors.dark[1] : e.colors.gray[7],
|
|
@@ -5838,7 +5859,7 @@ var Qn = qt((e, { radius: t }) => ({
|
|
|
5838
5859
|
borderRadius: e.fn.radius(t),
|
|
5839
5860
|
borderTopRightRadius: 0,
|
|
5840
5861
|
borderTopLeftRadius: 0,
|
|
5841
|
-
border: `${
|
|
5862
|
+
border: `${Me(1)} solid ${e.colorScheme === "dark" ? e.colors.dark[4] : e.colors.gray[3]}`,
|
|
5842
5863
|
borderTop: 0,
|
|
5843
5864
|
overflow: "hidden"
|
|
5844
5865
|
},
|
|
@@ -5848,32 +5869,32 @@ var Qn = qt((e, { radius: t }) => ({
|
|
|
5848
5869
|
border: 0
|
|
5849
5870
|
}
|
|
5850
5871
|
}));
|
|
5851
|
-
const
|
|
5852
|
-
var
|
|
5872
|
+
const Jt = ta;
|
|
5873
|
+
var ra = Object.defineProperty, na = Object.defineProperties, aa = Object.getOwnPropertyDescriptors, Qe = Object.getOwnPropertySymbols, er = Object.prototype.hasOwnProperty, tr = Object.prototype.propertyIsEnumerable, Gt = (e, t, r) => t in e ? ra(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, rr = (e, t) => {
|
|
5853
5874
|
for (var r in t || (t = {}))
|
|
5854
|
-
|
|
5855
|
-
if (
|
|
5856
|
-
for (var r of
|
|
5857
|
-
|
|
5875
|
+
er.call(t, r) && Gt(e, r, t[r]);
|
|
5876
|
+
if (Qe)
|
|
5877
|
+
for (var r of Qe(t))
|
|
5878
|
+
tr.call(t, r) && Gt(e, r, t[r]);
|
|
5858
5879
|
return e;
|
|
5859
|
-
},
|
|
5880
|
+
}, ia = (e, t) => na(e, aa(t)), oa = (e, t) => {
|
|
5860
5881
|
var r = {};
|
|
5861
5882
|
for (var n in e)
|
|
5862
|
-
|
|
5863
|
-
if (e != null &&
|
|
5864
|
-
for (var n of
|
|
5865
|
-
t.indexOf(n) < 0 &&
|
|
5883
|
+
er.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
|
|
5884
|
+
if (e != null && Qe)
|
|
5885
|
+
for (var n of Qe(e))
|
|
5886
|
+
t.indexOf(n) < 0 && tr.call(e, n) && (r[n] = e[n]);
|
|
5866
5887
|
return r;
|
|
5867
5888
|
};
|
|
5868
|
-
function
|
|
5869
|
-
const { classes: t } =
|
|
5870
|
-
return /* @__PURE__ */ K.createElement(
|
|
5889
|
+
function sa(e) {
|
|
5890
|
+
const { classes: t } = Jt({ radius: e.radius });
|
|
5891
|
+
return /* @__PURE__ */ K.createElement(at, ia(rr({}, e), {
|
|
5871
5892
|
variant: "outline",
|
|
5872
5893
|
classNames: { tab: t.tab },
|
|
5873
5894
|
translate: "no"
|
|
5874
5895
|
}));
|
|
5875
5896
|
}
|
|
5876
|
-
function
|
|
5897
|
+
function la(e) {
|
|
5877
5898
|
var t = e, {
|
|
5878
5899
|
language: r,
|
|
5879
5900
|
children: n,
|
|
@@ -5888,7 +5909,7 @@ function ia(e) {
|
|
|
5888
5909
|
getPrismTheme: c,
|
|
5889
5910
|
colorScheme: g,
|
|
5890
5911
|
variant: y
|
|
5891
|
-
} = t, h =
|
|
5912
|
+
} = t, h = oa(t, [
|
|
5892
5913
|
"language",
|
|
5893
5914
|
"children",
|
|
5894
5915
|
"radius",
|
|
@@ -5903,8 +5924,8 @@ function ia(e) {
|
|
|
5903
5924
|
"colorScheme",
|
|
5904
5925
|
"variant"
|
|
5905
5926
|
]);
|
|
5906
|
-
const { classes: _ } =
|
|
5907
|
-
return /* @__PURE__ */ K.createElement(
|
|
5927
|
+
const { classes: _ } = Jt({ radius: s });
|
|
5928
|
+
return /* @__PURE__ */ K.createElement(at.Panel, rr({}, h), /* @__PURE__ */ K.createElement(wt, {
|
|
5908
5929
|
language: r,
|
|
5909
5930
|
classNames: { root: _.prism, code: _.code },
|
|
5910
5931
|
radius: s,
|
|
@@ -5920,17 +5941,17 @@ function ia(e) {
|
|
|
5920
5941
|
variant: y
|
|
5921
5942
|
}, n));
|
|
5922
5943
|
}
|
|
5923
|
-
const
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
function
|
|
5944
|
+
const qe = wt;
|
|
5945
|
+
qe.Tabs = sa;
|
|
5946
|
+
qe.Tab = at.Tab;
|
|
5947
|
+
qe.TabsList = at.List;
|
|
5948
|
+
qe.Panel = la;
|
|
5949
|
+
function ua({
|
|
5929
5950
|
id: e,
|
|
5930
5951
|
onSuccess: t,
|
|
5931
5952
|
styles: r = De
|
|
5932
5953
|
}) {
|
|
5933
|
-
const n =
|
|
5954
|
+
const n = Ue(), s = async () => {
|
|
5934
5955
|
if (e) {
|
|
5935
5956
|
be({
|
|
5936
5957
|
id: "for-deleting",
|
|
@@ -5939,14 +5960,14 @@ function oa({
|
|
|
5939
5960
|
loading: !0
|
|
5940
5961
|
});
|
|
5941
5962
|
try {
|
|
5942
|
-
await oe.sql_snippet.delete(e),
|
|
5963
|
+
await oe.sql_snippet.delete(e), J({
|
|
5943
5964
|
id: "for-deleting",
|
|
5944
5965
|
title: "Successful",
|
|
5945
5966
|
message: `SQL Snippet [${e}] is deleted`,
|
|
5946
5967
|
color: "green"
|
|
5947
5968
|
}), t();
|
|
5948
5969
|
} catch (l) {
|
|
5949
|
-
|
|
5970
|
+
J({
|
|
5950
5971
|
id: "for-deleting",
|
|
5951
5972
|
title: "Failed",
|
|
5952
5973
|
message: l.message,
|
|
@@ -5966,21 +5987,21 @@ function oa({
|
|
|
5966
5987
|
color: "red"
|
|
5967
5988
|
}
|
|
5968
5989
|
});
|
|
5969
|
-
return /* @__PURE__ */ a(V, { size: r.button.size, color: "red", onClick: o, leftIcon: /* @__PURE__ */ a(
|
|
5990
|
+
return /* @__PURE__ */ a(V, { size: r.button.size, color: "red", onClick: o, leftIcon: /* @__PURE__ */ a(ot, { size: 20 }), children: "Delete" });
|
|
5970
5991
|
}
|
|
5971
|
-
function
|
|
5992
|
+
function ca({
|
|
5972
5993
|
content: e
|
|
5973
5994
|
}) {
|
|
5974
|
-
return /* @__PURE__ */ C(
|
|
5975
|
-
/* @__PURE__ */ a(
|
|
5976
|
-
/* @__PURE__ */ a(
|
|
5995
|
+
return /* @__PURE__ */ C(gt, { width: "60vw", shadow: "md", children: [
|
|
5996
|
+
/* @__PURE__ */ a(gt.Target, { children: /* @__PURE__ */ a(vt, { size: 16, children: /* @__PURE__ */ a(Gr, {}) }) }),
|
|
5997
|
+
/* @__PURE__ */ a(gt.Dropdown, { children: /* @__PURE__ */ a(qe, { language: "sql", noCopy: !0, withLineNumbers: !0, children: e }) })
|
|
5977
5998
|
] });
|
|
5978
5999
|
}
|
|
5979
|
-
function
|
|
6000
|
+
function Ta({
|
|
5980
6001
|
styles: e = De,
|
|
5981
6002
|
config: t
|
|
5982
6003
|
}) {
|
|
5983
|
-
|
|
6004
|
+
Ge(t);
|
|
5984
6005
|
const {
|
|
5985
6006
|
data: r = [],
|
|
5986
6007
|
loading: n,
|
|
@@ -5999,12 +6020,12 @@ function ka({
|
|
|
5999
6020
|
refreshDeps: []
|
|
6000
6021
|
});
|
|
6001
6022
|
return /* @__PURE__ */ C(he, { children: [
|
|
6002
|
-
/* @__PURE__ */ a(
|
|
6023
|
+
/* @__PURE__ */ a(Q, { pt: e.spacing, position: "right", children: /* @__PURE__ */ a(Ln, { onSuccess: s }) }),
|
|
6003
6024
|
/* @__PURE__ */ C(se, { mt: e.spacing, sx: {
|
|
6004
6025
|
position: "relative"
|
|
6005
6026
|
}, children: [
|
|
6006
|
-
/* @__PURE__ */ a(
|
|
6007
|
-
/* @__PURE__ */ C(
|
|
6027
|
+
/* @__PURE__ */ a(rt, { visible: n }),
|
|
6028
|
+
/* @__PURE__ */ C(nt, { horizontalSpacing: e.spacing, verticalSpacing: e.spacing, fontSize: e.size, highlightOnHover: !0, children: [
|
|
6008
6029
|
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ C("tr", { children: [
|
|
6009
6030
|
/* @__PURE__ */ a("th", { children: "Name" }),
|
|
6010
6031
|
/* @__PURE__ */ a("th", {}),
|
|
@@ -6021,12 +6042,12 @@ function ka({
|
|
|
6021
6042
|
} = o;
|
|
6022
6043
|
return /* @__PURE__ */ C("tr", { children: [
|
|
6023
6044
|
/* @__PURE__ */ a("td", { children: l }),
|
|
6024
|
-
/* @__PURE__ */ a("td", { width: 50, children: /* @__PURE__ */ a(
|
|
6045
|
+
/* @__PURE__ */ a("td", { width: 50, children: /* @__PURE__ */ a(ca, { content: p }) }),
|
|
6025
6046
|
/* @__PURE__ */ a("td", { width: 200, children: d }),
|
|
6026
6047
|
/* @__PURE__ */ a("td", { width: 200, children: f }),
|
|
6027
|
-
/* @__PURE__ */ a("td", { width: 400, children: /* @__PURE__ */ C(
|
|
6028
|
-
/* @__PURE__ */ a(
|
|
6029
|
-
/* @__PURE__ */ a(
|
|
6048
|
+
/* @__PURE__ */ a("td", { width: 400, children: /* @__PURE__ */ C(Q, { position: "left", children: [
|
|
6049
|
+
/* @__PURE__ */ a(Nn, { ...o, onSuccess: s }),
|
|
6050
|
+
/* @__PURE__ */ a(ua, { id: l, onSuccess: s })
|
|
6030
6051
|
] }) })
|
|
6031
6052
|
] }, l);
|
|
6032
6053
|
}) })
|
|
@@ -6034,23 +6055,28 @@ function ka({
|
|
|
6034
6055
|
] })
|
|
6035
6056
|
] });
|
|
6036
6057
|
}
|
|
6037
|
-
const
|
|
6058
|
+
const Ra = () => import("./package-2360dfd8.mjs").then(({
|
|
6038
6059
|
version: e
|
|
6039
6060
|
}) => (console.log(`[@devtable/dashboard] version: ${e}`), e));
|
|
6040
6061
|
export {
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6062
|
+
ae as APIClient,
|
|
6063
|
+
ka as APIKeyList,
|
|
6064
|
+
_a as AccountList,
|
|
6065
|
+
Cn as AddAPIKey,
|
|
6066
|
+
An as AddAccount,
|
|
6067
|
+
pn as AddDataSource,
|
|
6068
|
+
Ln as AddSQLSnippet,
|
|
6069
|
+
Ea as DataSourceList,
|
|
6070
|
+
Xr as DefaultApiClient,
|
|
6071
|
+
In as DeleteAPIKey,
|
|
6072
|
+
kn as DeleteAccount,
|
|
6073
|
+
hn as DeleteDataSource,
|
|
6074
|
+
ua as DeleteSQLSnippet,
|
|
6075
|
+
Qr as FacadeApiClient,
|
|
6076
|
+
Aa as Login,
|
|
6077
|
+
Ta as SQLSnippetList,
|
|
6078
|
+
Nn as UpdateSQLSnippet,
|
|
6079
|
+
Ge as configureAPIClient,
|
|
6080
|
+
Jr as facadeApiClient,
|
|
6081
|
+
Ra as getVersion
|
|
6056
6082
|
};
|