@v1ct0rbr/minivault-web 0.7.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/MinivaultApi.d.ts +6 -2
- package/dist/hooks/useBackups.d.ts +5 -0
- package/dist/minivault-web.js +487 -215
- package/dist/types/minivault.d.ts +27 -0
- package/package.json +1 -1
package/dist/minivault-web.js
CHANGED
|
@@ -56,11 +56,11 @@ var h = class extends Error {
|
|
|
56
56
|
getBackup(e) {
|
|
57
57
|
return this.request(`/api/backups/${e}`);
|
|
58
58
|
}
|
|
59
|
-
createBackup(e, t, n, r) {
|
|
60
|
-
let
|
|
61
|
-
return r && (
|
|
59
|
+
createBackup(e, t, n, r, i) {
|
|
60
|
+
let a = {};
|
|
61
|
+
return r && (a.backupType = r), i && (a.scheduled = !0), e && (a.database = e), t && (a.originStorage = t), n && (a.dumpOptions = n), this.request("/api/backups", {
|
|
62
62
|
method: "POST",
|
|
63
|
-
body: JSON.stringify(
|
|
63
|
+
body: JSON.stringify(a)
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
restoreBackup(e, t, n) {
|
|
@@ -73,6 +73,12 @@ var h = class extends Error {
|
|
|
73
73
|
deleteBackup(e) {
|
|
74
74
|
return this.request(`/api/backups/${e}`, { method: "DELETE" });
|
|
75
75
|
}
|
|
76
|
+
updateBackupScheduled(e, t) {
|
|
77
|
+
return this.request(`/api/backups/${e}/schedule`, {
|
|
78
|
+
method: "PATCH",
|
|
79
|
+
body: JSON.stringify({ scheduled: t })
|
|
80
|
+
});
|
|
81
|
+
}
|
|
76
82
|
verifyBackup(e) {
|
|
77
83
|
return this.request(`/api/backups/${e}/verify`, { method: "POST" });
|
|
78
84
|
}
|
|
@@ -171,6 +177,12 @@ var h = class extends Error {
|
|
|
171
177
|
let i = this.storageQuery(r, n);
|
|
172
178
|
i.set("key", e), i.set("type", t), await this.request(`/api/storage/files?${i.toString()}`, { method: "DELETE" });
|
|
173
179
|
}
|
|
180
|
+
restoreStorageItems(e) {
|
|
181
|
+
return this.request("/api/storage/restore", {
|
|
182
|
+
method: "POST",
|
|
183
|
+
body: JSON.stringify(e)
|
|
184
|
+
});
|
|
185
|
+
}
|
|
174
186
|
createStorageZip(e) {
|
|
175
187
|
return this.request("/api/storage/download/zip", {
|
|
176
188
|
method: "POST",
|
|
@@ -298,7 +310,7 @@ function A(e = !0) {
|
|
|
298
310
|
function j() {
|
|
299
311
|
let e = b(), t = d();
|
|
300
312
|
return l({
|
|
301
|
-
mutationFn: (t) => e.createBackup(t.database, t.originStorage, t.dumpOptions, t.backupType),
|
|
313
|
+
mutationFn: (t) => e.createBackup(t.database, t.originStorage, t.dumpOptions, t.backupType, t.scheduled),
|
|
302
314
|
onSuccess: () => t.invalidateQueries({ queryKey: S.all })
|
|
303
315
|
});
|
|
304
316
|
}
|
|
@@ -324,45 +336,52 @@ function P() {
|
|
|
324
336
|
});
|
|
325
337
|
}
|
|
326
338
|
function F() {
|
|
339
|
+
let e = b(), t = d();
|
|
340
|
+
return l({
|
|
341
|
+
mutationFn: (t) => e.updateBackupScheduled(t.id, t.scheduled),
|
|
342
|
+
onSuccess: () => t.invalidateQueries({ queryKey: S.all })
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
function I() {
|
|
327
346
|
let e = b();
|
|
328
347
|
return l({ mutationFn: (t) => e.downloadBackup(t.id) });
|
|
329
348
|
}
|
|
330
|
-
function
|
|
349
|
+
function L() {
|
|
331
350
|
let e = b();
|
|
332
351
|
return l({ mutationFn: (t) => e.importDump(t.file, t.database) });
|
|
333
352
|
}
|
|
334
|
-
function
|
|
353
|
+
function R() {
|
|
335
354
|
let e = b();
|
|
336
355
|
return l({ mutationFn: (t) => e.importFromStorage(t.storageType, t.storagePath, t.database, t.storageConfig) });
|
|
337
356
|
}
|
|
338
357
|
//#endregion
|
|
339
358
|
//#region src/utils/format.ts
|
|
340
|
-
var
|
|
359
|
+
var z = new Intl.DateTimeFormat("pt-BR", {
|
|
341
360
|
day: "2-digit",
|
|
342
361
|
month: "2-digit",
|
|
343
362
|
year: "numeric",
|
|
344
363
|
hour: "2-digit",
|
|
345
364
|
minute: "2-digit"
|
|
346
|
-
}),
|
|
365
|
+
}), B = [
|
|
347
366
|
"B",
|
|
348
367
|
"KB",
|
|
349
368
|
"MB",
|
|
350
369
|
"GB",
|
|
351
370
|
"TB"
|
|
352
371
|
];
|
|
353
|
-
function
|
|
372
|
+
function V(e) {
|
|
354
373
|
if (e == null || e < 0) return "—";
|
|
355
374
|
if (e < 1024) return `${e} B`;
|
|
356
375
|
let t = e, n = 0;
|
|
357
|
-
for (; t >= 1024 && n <
|
|
358
|
-
return `${Number.isInteger(t) ? t : Number(t.toFixed(1))} ${
|
|
376
|
+
for (; t >= 1024 && n < B.length - 1;) t /= 1024, n += 1;
|
|
377
|
+
return `${Number.isInteger(t) ? t : Number(t.toFixed(1))} ${B[n]}`;
|
|
359
378
|
}
|
|
360
|
-
function
|
|
379
|
+
function H(e) {
|
|
361
380
|
if (!e) return "—";
|
|
362
381
|
let t = new Date(e);
|
|
363
|
-
return Number.isNaN(t.getTime()) ? "—" :
|
|
382
|
+
return Number.isNaN(t.getTime()) ? "—" : z.format(t);
|
|
364
383
|
}
|
|
365
|
-
var
|
|
384
|
+
var U = {
|
|
366
385
|
PENDING: "Pendente",
|
|
367
386
|
IN_PROGRESS: "Em andamento",
|
|
368
387
|
COMPLETED: "Concluído",
|
|
@@ -370,7 +389,7 @@ var H = {
|
|
|
370
389
|
RESTORING: "Restaurando",
|
|
371
390
|
RESTORED: "Restaurado",
|
|
372
391
|
RESTORE_FAILED: "Falha na restauração"
|
|
373
|
-
},
|
|
392
|
+
}, ee = {
|
|
374
393
|
PENDING: "text-bg-secondary",
|
|
375
394
|
IN_PROGRESS: "text-bg-primary",
|
|
376
395
|
COMPLETED: "text-bg-success",
|
|
@@ -396,7 +415,7 @@ var H = {
|
|
|
396
415
|
//#endregion
|
|
397
416
|
//#region src/components/StatusBadge.tsx
|
|
398
417
|
function q({ status: e }) {
|
|
399
|
-
let t =
|
|
418
|
+
let t = ee[e] ?? "text-bg-secondary", n = U[e] ?? e;
|
|
400
419
|
return /* @__PURE__ */ p("span", {
|
|
401
420
|
className: `badge rounded-pill ${t}`,
|
|
402
421
|
children: n
|
|
@@ -423,7 +442,7 @@ function J({ dbInfo: e, isLoading: t, error: n, label: r, compact: i = !1 }) {
|
|
|
423
442
|
"aria-hidden": !0
|
|
424
443
|
}),
|
|
425
444
|
"Não foi possível consultar o banco configurado: ",
|
|
426
|
-
|
|
445
|
+
Y(n)
|
|
427
446
|
]
|
|
428
447
|
});
|
|
429
448
|
if (!e || !e.configured) return i ? /* @__PURE__ */ m("div", {
|
|
@@ -563,7 +582,7 @@ function J({ dbInfo: e, isLoading: t, error: n, label: r, compact: i = !1 }) {
|
|
|
563
582
|
}
|
|
564
583
|
//#endregion
|
|
565
584
|
//#region src/components/RestoreModal.tsx
|
|
566
|
-
function
|
|
585
|
+
function te({ backup: e, onClose: t }) {
|
|
567
586
|
let n = M(), r = D(), i = () => {
|
|
568
587
|
n.mutate({ id: e.id });
|
|
569
588
|
}, a = n.isPending, o = e.backupType === "STORAGE";
|
|
@@ -625,7 +644,7 @@ function Y({ backup: e, onClose: t }) {
|
|
|
625
644
|
children: [/* @__PURE__ */ p("i", {
|
|
626
645
|
className: "bi bi-x-circle me-2",
|
|
627
646
|
"aria-hidden": !0
|
|
628
|
-
}),
|
|
647
|
+
}), Y(n.error)]
|
|
629
648
|
}),
|
|
630
649
|
n.isSuccess && /* @__PURE__ */ m("div", {
|
|
631
650
|
className: "alert alert-success mt-3 mb-0",
|
|
@@ -660,19 +679,19 @@ function Y({ backup: e, onClose: t }) {
|
|
|
660
679
|
})
|
|
661
680
|
})] });
|
|
662
681
|
}
|
|
663
|
-
function
|
|
682
|
+
function Y(e) {
|
|
664
683
|
return e instanceof Error ? e.message : String(e);
|
|
665
684
|
}
|
|
666
685
|
//#endregion
|
|
667
686
|
//#region src/components/BackupsTab.tsx
|
|
668
|
-
function
|
|
669
|
-
let [e, t] = o(0), [n, a] = o(null), [s, c] = o(null), [l, u] = o({}), { data: d, isLoading: f, isError: h, error: g, refetch: _, isFetching: v } = E(e, 10, !0), y =
|
|
687
|
+
function X() {
|
|
688
|
+
let [e, t] = o(0), [n, a] = o(null), [s, c] = o(null), [l, u] = o({}), { data: d, isLoading: f, isError: h, error: g, refetch: _, isFetching: v } = E(e, 10, !0), y = I(), b = N(), x = P(), S = F();
|
|
670
689
|
r(() => {
|
|
671
690
|
if (!y.data || !y.variables) return;
|
|
672
691
|
let e = URL.createObjectURL(y.data), t = document.createElement("a");
|
|
673
692
|
t.href = e, t.download = y.variables.filename, document.body.appendChild(t), t.click(), t.remove(), setTimeout(() => URL.revokeObjectURL(e), 1e4);
|
|
674
693
|
}, [y.data, y.variables]);
|
|
675
|
-
let
|
|
694
|
+
let C = i(() => d?.content ?? [], [d]), w = d?.totalPages ?? 0;
|
|
676
695
|
return /* @__PURE__ */ m("div", { children: [
|
|
677
696
|
/* @__PURE__ */ m("div", {
|
|
678
697
|
className: "d-flex align-items-center justify-content-between flex-wrap gap-2 mb-3",
|
|
@@ -744,6 +763,17 @@ function Z() {
|
|
|
744
763
|
Q(x.error)
|
|
745
764
|
]
|
|
746
765
|
}),
|
|
766
|
+
S.isError && /* @__PURE__ */ m("div", {
|
|
767
|
+
className: "alert alert-danger",
|
|
768
|
+
children: [
|
|
769
|
+
/* @__PURE__ */ p("i", {
|
|
770
|
+
className: "bi bi-x-circle me-2",
|
|
771
|
+
"aria-hidden": !0
|
|
772
|
+
}),
|
|
773
|
+
"Falha ao atualizar o agendamento: ",
|
|
774
|
+
Q(S.error)
|
|
775
|
+
]
|
|
776
|
+
}),
|
|
747
777
|
Object.entries(l).map(([e, t]) => /* @__PURE__ */ m("div", {
|
|
748
778
|
className: `alert alert-${t.valid ? "success" : "warning"} d-flex align-items-center justify-content-between`,
|
|
749
779
|
children: [/* @__PURE__ */ m("span", { children: [
|
|
@@ -801,6 +831,10 @@ function Z() {
|
|
|
801
831
|
scope: "col",
|
|
802
832
|
children: "Status"
|
|
803
833
|
}),
|
|
834
|
+
/* @__PURE__ */ p("th", {
|
|
835
|
+
scope: "col",
|
|
836
|
+
children: "Agendado"
|
|
837
|
+
}),
|
|
804
838
|
/* @__PURE__ */ p("th", {
|
|
805
839
|
scope: "col",
|
|
806
840
|
children: "Checksum"
|
|
@@ -818,20 +852,31 @@ function Z() {
|
|
|
818
852
|
className: "text-end",
|
|
819
853
|
children: "Ações"
|
|
820
854
|
})
|
|
821
|
-
] }) }), /* @__PURE__ */ m("tbody", { children: [
|
|
822
|
-
colSpan:
|
|
855
|
+
] }) }), /* @__PURE__ */ m("tbody", { children: [C.length === 0 && /* @__PURE__ */ p("tr", { children: /* @__PURE__ */ p("td", {
|
|
856
|
+
colSpan: 11,
|
|
823
857
|
className: "text-center text-muted py-4",
|
|
824
858
|
children: "Nenhum backup cadastrado."
|
|
825
|
-
}) }),
|
|
859
|
+
}) }), C.map((e) => /* @__PURE__ */ m("tr", { children: [
|
|
826
860
|
/* @__PURE__ */ p("td", { children: e.id }),
|
|
827
861
|
/* @__PURE__ */ m("td", {
|
|
828
862
|
className: "text-truncate",
|
|
829
863
|
style: { maxWidth: 260 },
|
|
830
864
|
title: e.filename,
|
|
831
|
-
children: [
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
865
|
+
children: [
|
|
866
|
+
/* @__PURE__ */ p("i", {
|
|
867
|
+
className: "bi bi-archive me-1 text-primary",
|
|
868
|
+
"aria-hidden": !0
|
|
869
|
+
}),
|
|
870
|
+
e.filename,
|
|
871
|
+
e.scheduled && /* @__PURE__ */ m("span", {
|
|
872
|
+
className: "badge text-bg-info ms-2",
|
|
873
|
+
title: "O scheduler re-executa este backup automaticamente no horário configurado",
|
|
874
|
+
children: [/* @__PURE__ */ p("i", {
|
|
875
|
+
className: "bi bi-clock-history me-1",
|
|
876
|
+
"aria-hidden": !0
|
|
877
|
+
}), "agendado"]
|
|
878
|
+
})
|
|
879
|
+
]
|
|
835
880
|
}),
|
|
836
881
|
/* @__PURE__ */ p("td", { children: e.backupType ? /* @__PURE__ */ p("span", {
|
|
837
882
|
className: `badge ${K[e.backupType] ?? "text-bg-secondary"}`,
|
|
@@ -843,9 +888,24 @@ function Z() {
|
|
|
843
888
|
/* @__PURE__ */ p("td", { children: W[e.databaseType] ?? e.databaseType }),
|
|
844
889
|
/* @__PURE__ */ p("td", {
|
|
845
890
|
className: "text-end",
|
|
846
|
-
children:
|
|
891
|
+
children: V(e.fileSize)
|
|
847
892
|
}),
|
|
848
893
|
/* @__PURE__ */ p("td", { children: /* @__PURE__ */ p(q, { status: e.status }) }),
|
|
894
|
+
/* @__PURE__ */ p("td", { children: /* @__PURE__ */ p("div", {
|
|
895
|
+
className: "form-check form-switch d-inline-block mb-0",
|
|
896
|
+
title: e.scheduled ? "Desligar execução deste backup no agendamento noturno" : "Ligar execução deste backup no agendamento noturno",
|
|
897
|
+
children: /* @__PURE__ */ p("input", {
|
|
898
|
+
className: "form-check-input",
|
|
899
|
+
type: "checkbox",
|
|
900
|
+
role: "switch",
|
|
901
|
+
checked: !!e.scheduled,
|
|
902
|
+
disabled: S.isPending && S.variables?.id === e.id,
|
|
903
|
+
onChange: () => S.mutate({
|
|
904
|
+
id: e.id,
|
|
905
|
+
scheduled: !e.scheduled
|
|
906
|
+
})
|
|
907
|
+
})
|
|
908
|
+
}) }),
|
|
849
909
|
/* @__PURE__ */ p("td", { children: e.sha256 ? /* @__PURE__ */ m("code", {
|
|
850
910
|
title: e.sha256,
|
|
851
911
|
style: { fontSize: "0.8em" },
|
|
@@ -868,7 +928,7 @@ function Z() {
|
|
|
868
928
|
className: "text-muted",
|
|
869
929
|
children: "—"
|
|
870
930
|
}) }),
|
|
871
|
-
/* @__PURE__ */ p("td", { children:
|
|
931
|
+
/* @__PURE__ */ p("td", { children: H(e.createdAt) }),
|
|
872
932
|
/* @__PURE__ */ m("td", {
|
|
873
933
|
className: "text-end text-nowrap",
|
|
874
934
|
children: [
|
|
@@ -936,7 +996,7 @@ function Z() {
|
|
|
936
996
|
"Página ",
|
|
937
997
|
e + 1,
|
|
938
998
|
" de ",
|
|
939
|
-
Math.max(
|
|
999
|
+
Math.max(w, 1)
|
|
940
1000
|
]
|
|
941
1001
|
}), /* @__PURE__ */ m("div", {
|
|
942
1002
|
className: "btn-group",
|
|
@@ -952,7 +1012,7 @@ function Z() {
|
|
|
952
1012
|
}), /* @__PURE__ */ p("button", {
|
|
953
1013
|
type: "button",
|
|
954
1014
|
className: "btn btn-outline-secondary btn-sm",
|
|
955
|
-
disabled: e + 1 >=
|
|
1015
|
+
disabled: e + 1 >= w,
|
|
956
1016
|
onClick: () => t((e) => e + 1),
|
|
957
1017
|
children: /* @__PURE__ */ p("i", {
|
|
958
1018
|
className: "bi bi-chevron-right",
|
|
@@ -961,11 +1021,11 @@ function Z() {
|
|
|
961
1021
|
})]
|
|
962
1022
|
})]
|
|
963
1023
|
}),
|
|
964
|
-
n && /* @__PURE__ */ p(
|
|
1024
|
+
n && /* @__PURE__ */ p(te, {
|
|
965
1025
|
backup: n,
|
|
966
1026
|
onClose: () => a(null)
|
|
967
1027
|
}),
|
|
968
|
-
s && /* @__PURE__ */ p(
|
|
1028
|
+
s && /* @__PURE__ */ p(Z, {
|
|
969
1029
|
backup: s,
|
|
970
1030
|
busy: b.isPending,
|
|
971
1031
|
onCancel: () => c(null),
|
|
@@ -975,7 +1035,7 @@ function Z() {
|
|
|
975
1035
|
})
|
|
976
1036
|
] });
|
|
977
1037
|
}
|
|
978
|
-
function
|
|
1038
|
+
function Z(e) {
|
|
979
1039
|
let { backup: t, busy: n, onCancel: r, onConfirm: i } = e;
|
|
980
1040
|
return /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("div", { className: "modal-backdrop show" }), /* @__PURE__ */ p("div", {
|
|
981
1041
|
className: "modal show d-block",
|
|
@@ -1046,7 +1106,7 @@ function Q(e) {
|
|
|
1046
1106
|
}
|
|
1047
1107
|
//#endregion
|
|
1048
1108
|
//#region src/components/CreateBackupTab.tsx
|
|
1049
|
-
function
|
|
1109
|
+
function ne() {
|
|
1050
1110
|
let e = j(), t = D(), n = O(t.data?.configured), [r, a] = o(!0), [s, c] = o({
|
|
1051
1111
|
format: "plain",
|
|
1052
1112
|
includeData: !0,
|
|
@@ -1055,15 +1115,15 @@ function te() {
|
|
|
1055
1115
|
includeIndexes: !0,
|
|
1056
1116
|
includeConstraints: !0,
|
|
1057
1117
|
includeRelatedTables: !1
|
|
1058
|
-
}), [l, u] = o(() => /* @__PURE__ */ new Set()), [d, f] = o(null), [h, g] = o({}), [_, v] = o(""), y = k(d, t.data?.configured),
|
|
1118
|
+
}), [l, u] = o(() => /* @__PURE__ */ new Set()), [d, f] = o(null), [h, g] = o({}), [_, v] = o(""), [y, b] = o(!1), x = k(d, t.data?.configured), S = i(() => new Set((t.data?.exportExcludedTables ?? []).map(ie)), [t.data?.exportExcludedTables]), C = i(() => {
|
|
1059
1119
|
let e = n.data ?? [], t = _.trim().toLowerCase();
|
|
1060
1120
|
return t ? e.filter((e) => e.fullName.toLowerCase().includes(t)) : e;
|
|
1061
|
-
}, [n.data, _]),
|
|
1121
|
+
}, [n.data, _]), w = i(() => Object.values(h).reduce((e, t) => e + t.length, 0), [h]), T = (e) => {
|
|
1062
1122
|
u((t) => {
|
|
1063
1123
|
let n = new Set(t);
|
|
1064
1124
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
1065
1125
|
});
|
|
1066
|
-
},
|
|
1126
|
+
}, E = (e, t) => {
|
|
1067
1127
|
g((n) => {
|
|
1068
1128
|
let r = n[e] ?? [], i = r.includes(t) ? r.filter((e) => e !== t) : [...r, t];
|
|
1069
1129
|
return {
|
|
@@ -1071,7 +1131,7 @@ function te() {
|
|
|
1071
1131
|
[e]: i
|
|
1072
1132
|
};
|
|
1073
1133
|
});
|
|
1074
|
-
},
|
|
1134
|
+
}, A = () => {
|
|
1075
1135
|
let t;
|
|
1076
1136
|
if (r) {
|
|
1077
1137
|
t = { ...s }, l.size > 0 && (t.tables = [...l]);
|
|
@@ -1082,9 +1142,10 @@ function te() {
|
|
|
1082
1142
|
}
|
|
1083
1143
|
e.mutate({
|
|
1084
1144
|
backupType: "DATABASE",
|
|
1085
|
-
dumpOptions: t
|
|
1145
|
+
dumpOptions: t,
|
|
1146
|
+
scheduled: y
|
|
1086
1147
|
});
|
|
1087
|
-
},
|
|
1148
|
+
}, M = e.isPending, N = t.data?.configured && !M;
|
|
1088
1149
|
return /* @__PURE__ */ m("div", { children: [
|
|
1089
1150
|
/* @__PURE__ */ m("div", {
|
|
1090
1151
|
className: "mb-3",
|
|
@@ -1115,7 +1176,7 @@ function te() {
|
|
|
1115
1176
|
"aria-hidden": !0
|
|
1116
1177
|
}),
|
|
1117
1178
|
"Tabelas do banco (",
|
|
1118
|
-
n.data?.filter((e) => !
|
|
1179
|
+
n.data?.filter((e) => !S.has(e.fullName)).length ?? 0,
|
|
1119
1180
|
" disponíveis)"
|
|
1120
1181
|
]
|
|
1121
1182
|
}), /* @__PURE__ */ m("div", {
|
|
@@ -1155,10 +1216,10 @@ function te() {
|
|
|
1155
1216
|
"aria-hidden": !0
|
|
1156
1217
|
}),
|
|
1157
1218
|
"Falha ao listar tabelas: ",
|
|
1158
|
-
|
|
1219
|
+
Y(n.error)
|
|
1159
1220
|
]
|
|
1160
1221
|
}),
|
|
1161
|
-
|
|
1222
|
+
C.length === 0 && !n.isLoading && /* @__PURE__ */ p("div", {
|
|
1162
1223
|
className: "p-3 text-muted small",
|
|
1163
1224
|
children: "Nenhuma tabela encontrada."
|
|
1164
1225
|
}),
|
|
@@ -1171,16 +1232,16 @@ function te() {
|
|
|
1171
1232
|
maxHeight: 420,
|
|
1172
1233
|
overflow: "auto"
|
|
1173
1234
|
},
|
|
1174
|
-
children:
|
|
1235
|
+
children: C.map((e) => /* @__PURE__ */ p(re, {
|
|
1175
1236
|
table: e,
|
|
1176
|
-
disabled:
|
|
1237
|
+
disabled: S.has(e.fullName),
|
|
1177
1238
|
selected: l.has(e.fullName),
|
|
1178
1239
|
expanded: d === e.fullName,
|
|
1179
1240
|
excluded: h[e.fullName] ?? [],
|
|
1180
|
-
onToggleTable: () =>
|
|
1241
|
+
onToggleTable: () => T(e.fullName),
|
|
1181
1242
|
onToggleExpand: () => f(d === e.fullName ? null : e.fullName),
|
|
1182
|
-
onToggleColumn: (t) =>
|
|
1183
|
-
detail: d === e.fullName ?
|
|
1243
|
+
onToggleColumn: (t) => E(e.fullName, t),
|
|
1244
|
+
detail: d === e.fullName ? x : void 0
|
|
1184
1245
|
}, e.fullName))
|
|
1185
1246
|
}),
|
|
1186
1247
|
/* @__PURE__ */ m("div", {
|
|
@@ -1191,14 +1252,14 @@ function te() {
|
|
|
1191
1252
|
className: "bi bi-info-circle me-1",
|
|
1192
1253
|
"aria-hidden": !0
|
|
1193
1254
|
}), "Deixe tudo desmarcado para incluir todas as tabelas (exceto as bloqueadas por segurança)."]
|
|
1194
|
-
}),
|
|
1255
|
+
}), w > 0 && s.format !== "plain" && /* @__PURE__ */ m("span", {
|
|
1195
1256
|
className: "badge text-bg-warning ms-auto text-wrap text-start",
|
|
1196
1257
|
children: [
|
|
1197
1258
|
/* @__PURE__ */ p("i", {
|
|
1198
1259
|
className: "bi bi-exclamation-triangle me-1",
|
|
1199
1260
|
"aria-hidden": !0
|
|
1200
1261
|
}),
|
|
1201
|
-
|
|
1262
|
+
w,
|
|
1202
1263
|
" coluna(s) marcada(s) serão nulificadas apenas com formato Plain SQL (texto)"
|
|
1203
1264
|
]
|
|
1204
1265
|
})]
|
|
@@ -1332,7 +1393,7 @@ function te() {
|
|
|
1332
1393
|
"aria-hidden": !0
|
|
1333
1394
|
}),
|
|
1334
1395
|
"Falha ao criar backup: ",
|
|
1335
|
-
|
|
1396
|
+
Y(e.error)
|
|
1336
1397
|
]
|
|
1337
1398
|
}),
|
|
1338
1399
|
e.isSuccess && /* @__PURE__ */ m("div", {
|
|
@@ -1349,15 +1410,36 @@ function te() {
|
|
|
1349
1410
|
"). O progresso é exibido na aba Backups."
|
|
1350
1411
|
]
|
|
1351
1412
|
}),
|
|
1413
|
+
/* @__PURE__ */ m("div", {
|
|
1414
|
+
className: "form-check form-switch mb-3 d-flex align-items-center gap-2",
|
|
1415
|
+
children: [/* @__PURE__ */ p("input", {
|
|
1416
|
+
className: "form-check-input",
|
|
1417
|
+
type: "checkbox",
|
|
1418
|
+
role: "switch",
|
|
1419
|
+
id: "minivault-scheduled",
|
|
1420
|
+
checked: y,
|
|
1421
|
+
onChange: (e) => b(e.target.checked)
|
|
1422
|
+
}), /* @__PURE__ */ m("label", {
|
|
1423
|
+
className: "form-check-label",
|
|
1424
|
+
htmlFor: "minivault-scheduled",
|
|
1425
|
+
children: ["Executar em agendamento", /* @__PURE__ */ m("span", {
|
|
1426
|
+
className: "text-muted small ms-2",
|
|
1427
|
+
children: [/* @__PURE__ */ p("i", {
|
|
1428
|
+
className: "bi bi-clock-history me-1",
|
|
1429
|
+
"aria-hidden": !0
|
|
1430
|
+
}), "O scheduler re-executa este backup automaticamente no horário configurado."]
|
|
1431
|
+
})]
|
|
1432
|
+
})]
|
|
1433
|
+
}),
|
|
1352
1434
|
/* @__PURE__ */ p("div", {
|
|
1353
1435
|
className: "d-flex justify-content-end",
|
|
1354
1436
|
children: /* @__PURE__ */ m("button", {
|
|
1355
1437
|
type: "button",
|
|
1356
1438
|
className: "btn btn-primary",
|
|
1357
|
-
onClick:
|
|
1358
|
-
disabled: !
|
|
1439
|
+
onClick: A,
|
|
1440
|
+
disabled: !N,
|
|
1359
1441
|
children: [
|
|
1360
|
-
|
|
1442
|
+
M && /* @__PURE__ */ p("span", {
|
|
1361
1443
|
className: "spinner-border spinner-border-sm me-2",
|
|
1362
1444
|
"aria-hidden": !0
|
|
1363
1445
|
}),
|
|
@@ -1371,7 +1453,7 @@ function te() {
|
|
|
1371
1453
|
})
|
|
1372
1454
|
] });
|
|
1373
1455
|
}
|
|
1374
|
-
function
|
|
1456
|
+
function re({ table: e, disabled: t, selected: n, expanded: r, excluded: i, detail: a, onToggleTable: o, onToggleExpand: s, onToggleColumn: c }) {
|
|
1375
1457
|
return /* @__PURE__ */ p("div", {
|
|
1376
1458
|
className: `card h-100 ${n ? "border-primary" : ""}`,
|
|
1377
1459
|
style: { minWidth: 0 },
|
|
@@ -1435,7 +1517,7 @@ function ne({ table: e, disabled: t, selected: n, expanded: r, excluded: i, deta
|
|
|
1435
1517
|
}),
|
|
1436
1518
|
a?.isError && /* @__PURE__ */ m("small", {
|
|
1437
1519
|
className: "text-danger",
|
|
1438
|
-
children: ["Erro: ",
|
|
1520
|
+
children: ["Erro: ", Y(a.error)]
|
|
1439
1521
|
}),
|
|
1440
1522
|
a?.data && /* @__PURE__ */ m(f, { children: [a.data.columns.map((e) => /* @__PURE__ */ m("div", {
|
|
1441
1523
|
className: "d-flex align-items-center gap-2 py-1",
|
|
@@ -1486,13 +1568,13 @@ function ne({ table: e, disabled: t, selected: n, expanded: r, excluded: i, deta
|
|
|
1486
1568
|
})
|
|
1487
1569
|
});
|
|
1488
1570
|
}
|
|
1489
|
-
function
|
|
1571
|
+
function ie(e) {
|
|
1490
1572
|
let t = e.trim();
|
|
1491
1573
|
return t.includes(".") ? t : `public.${t}`;
|
|
1492
1574
|
}
|
|
1493
1575
|
//#endregion
|
|
1494
1576
|
//#region src/components/DiagnosticsTab.tsx
|
|
1495
|
-
function
|
|
1577
|
+
function ae() {
|
|
1496
1578
|
let { data: e, isLoading: t, isError: n, error: r, refetch: a, isFetching: o } = T(), s = i(() => e ? {
|
|
1497
1579
|
total: e.length,
|
|
1498
1580
|
okCount: e.filter((e) => e.ok).length,
|
|
@@ -1533,7 +1615,7 @@ function ie() {
|
|
|
1533
1615
|
"aria-hidden": !0
|
|
1534
1616
|
}),
|
|
1535
1617
|
"Não foi possível executar as checagens: ",
|
|
1536
|
-
|
|
1618
|
+
Y(r)
|
|
1537
1619
|
]
|
|
1538
1620
|
}),
|
|
1539
1621
|
s && /* @__PURE__ */ m("div", {
|
|
@@ -1570,7 +1652,7 @@ function ie() {
|
|
|
1570
1652
|
className: "card",
|
|
1571
1653
|
children: /* @__PURE__ */ m("ul", {
|
|
1572
1654
|
className: "list-group list-group-flush",
|
|
1573
|
-
children: [(e ?? []).map((e) => /* @__PURE__ */ p(
|
|
1655
|
+
children: [(e ?? []).map((e) => /* @__PURE__ */ p(oe, { check: e }, e.name)), e && e.length === 0 && /* @__PURE__ */ p("li", {
|
|
1574
1656
|
className: "list-group-item text-center text-muted py-4",
|
|
1575
1657
|
children: "Nenhuma checagem retornada."
|
|
1576
1658
|
})]
|
|
@@ -1578,7 +1660,7 @@ function ie() {
|
|
|
1578
1660
|
})
|
|
1579
1661
|
] });
|
|
1580
1662
|
}
|
|
1581
|
-
function
|
|
1663
|
+
function oe({ check: e }) {
|
|
1582
1664
|
let t = e.configured ? e.ok ? "bi-check-circle-fill text-success" : "bi-x-octagon-fill text-danger" : "bi-dash-circle text-secondary", n = e.configured ? e.ok ? "text-bg-success" : "text-bg-danger" : "text-bg-secondary", r = e.configured ? e.ok ? "OK" : "Falha" : "Não configurado";
|
|
1583
1665
|
return /* @__PURE__ */ m("li", {
|
|
1584
1666
|
className: "list-group-item d-flex align-items-start gap-3",
|
|
@@ -1614,80 +1696,92 @@ function ae({ check: e }) {
|
|
|
1614
1696
|
}
|
|
1615
1697
|
//#endregion
|
|
1616
1698
|
//#region src/components/StorageExplorerTab.tsx
|
|
1617
|
-
var
|
|
1699
|
+
var se = 1500;
|
|
1618
1700
|
function $({ target: e = "origin", title: n = "Explorador de Storage", storageType: a = "LOCAL", storageConfig: s }) {
|
|
1619
|
-
let c = b(), h = d(), [g, _] = o(""), [v, y] = o([]), [x, S] = o(/* @__PURE__ */ new Set()), [C, w] = o(null), [T, E] = o(
|
|
1701
|
+
let c = b(), h = d(), [g, _] = o(""), [v, y] = o([]), [x, S] = o(/* @__PURE__ */ new Set()), [C, w] = o(null), [T, E] = o(!1), [D, O] = o(null), [k, A] = o(null), [j, M] = o(null), [N, P] = o(!1), F = e === "destination" ? "Destino" : "Origem", { data: I, isPending: L } = u({
|
|
1620
1702
|
queryKey: ["storage-config"],
|
|
1621
1703
|
queryFn: () => c.getStorageConfig(),
|
|
1622
1704
|
retry: !1
|
|
1623
|
-
}),
|
|
1624
|
-
type:
|
|
1625
|
-
...
|
|
1626
|
-
...
|
|
1627
|
-
...
|
|
1628
|
-
...
|
|
1629
|
-
...
|
|
1630
|
-
} : s, [
|
|
1705
|
+
}), R = I?.[e], z = i(() => R?.configured ? {
|
|
1706
|
+
type: R.type,
|
|
1707
|
+
...R.localPath ? { localPath: R.localPath } : {},
|
|
1708
|
+
...R.endpoint ? { endpoint: R.endpoint } : {},
|
|
1709
|
+
...R.bucketName ? { bucketName: R.bucketName } : {},
|
|
1710
|
+
...R.region ? { region: R.region } : {},
|
|
1711
|
+
...R.pathStyleEnabled ? { pathStyleEnabled: !0 } : {}
|
|
1712
|
+
} : s, [R, s]), B = z?.type ?? a, { data: U, isLoading: ee } = u({
|
|
1631
1713
|
queryKey: [
|
|
1632
1714
|
"storage-files",
|
|
1633
1715
|
e,
|
|
1634
|
-
|
|
1716
|
+
B,
|
|
1635
1717
|
g,
|
|
1636
|
-
|
|
1718
|
+
z
|
|
1637
1719
|
],
|
|
1638
|
-
queryFn: () => c.listStorageFiles(
|
|
1639
|
-
enabled: !
|
|
1640
|
-
}),
|
|
1641
|
-
mutationFn: (t) => c.deleteStorageFile(t,
|
|
1720
|
+
queryFn: () => c.listStorageFiles(B, g || void 0, z, e),
|
|
1721
|
+
enabled: !L
|
|
1722
|
+
}), W = l({
|
|
1723
|
+
mutationFn: (t) => c.deleteStorageFile(t, B, z, e),
|
|
1642
1724
|
onSuccess: () => {
|
|
1643
1725
|
h.invalidateQueries({ queryKey: ["storage-files"] }), w(null);
|
|
1644
1726
|
}
|
|
1645
|
-
}),
|
|
1727
|
+
}), G = l({
|
|
1728
|
+
mutationFn: (t) => {
|
|
1729
|
+
let n = {
|
|
1730
|
+
keys: t,
|
|
1731
|
+
storage: e,
|
|
1732
|
+
type: B
|
|
1733
|
+
};
|
|
1734
|
+
return z?.localPath && (n.localPath = z.localPath), z?.endpoint && (n.endpoint = z.endpoint), z?.bucketName && (n.bucketName = z.bucketName), z?.accessKey && (n.accessKey = z.accessKey), z?.secretKey && (n.secretKey = z.secretKey), z?.region && (n.region = z.region), z?.pathStyleEnabled && (n.pathStyleEnabled = !0), c.restoreStorageItems(n);
|
|
1735
|
+
},
|
|
1736
|
+
onSuccess: (e) => {
|
|
1737
|
+
E(!1), O(e), h.invalidateQueries({ queryKey: ["storage-files"] });
|
|
1738
|
+
}
|
|
1739
|
+
}), K = t((e) => {
|
|
1646
1740
|
_(e), y(e ? e.split("/").filter(Boolean) : []), S(/* @__PURE__ */ new Set());
|
|
1647
|
-
}, []),
|
|
1741
|
+
}, []), q = t((e) => {
|
|
1648
1742
|
let t = v.slice(0, e + 1).join("/");
|
|
1649
|
-
|
|
1650
|
-
}, [v,
|
|
1743
|
+
K(t);
|
|
1744
|
+
}, [v, K]);
|
|
1651
1745
|
r(() => {
|
|
1652
1746
|
y(g ? g.split("/").filter(Boolean) : []);
|
|
1653
1747
|
}, [g]);
|
|
1654
|
-
let
|
|
1748
|
+
let J = (e) => {
|
|
1655
1749
|
S((t) => {
|
|
1656
1750
|
let n = new Set(t);
|
|
1657
1751
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
1658
1752
|
});
|
|
1659
|
-
},
|
|
1660
|
-
|
|
1661
|
-
},
|
|
1753
|
+
}, te = () => {
|
|
1754
|
+
U && S((e) => e.size === U.length ? /* @__PURE__ */ new Set() : new Set(U.map((e) => e.path)));
|
|
1755
|
+
}, Y = (e, t) => {
|
|
1662
1756
|
let n = window.URL.createObjectURL(e), r = document.createElement("a");
|
|
1663
1757
|
r.href = n, r.download = t, document.body.appendChild(r), r.click(), r.remove(), window.URL.revokeObjectURL(n);
|
|
1664
|
-
},
|
|
1758
|
+
}, X = async (t, n) => {
|
|
1665
1759
|
let r = {
|
|
1666
1760
|
storage: e,
|
|
1667
|
-
type:
|
|
1761
|
+
type: B,
|
|
1668
1762
|
mode: t,
|
|
1669
1763
|
keys: n
|
|
1670
1764
|
};
|
|
1671
|
-
|
|
1765
|
+
z?.localPath && (r.localPath = z.localPath), z?.endpoint && (r.endpoint = z.endpoint), z?.bucketName && (r.bucketName = z.bucketName), z?.accessKey && (r.accessKey = z.accessKey), z?.secretKey && (r.secretKey = z.secretKey), z?.region && (r.region = z.region), z?.pathStyleEnabled && (r.pathStyleEnabled = !0), M(null);
|
|
1672
1766
|
let i = await c.createStorageZip(r);
|
|
1673
|
-
|
|
1674
|
-
},
|
|
1675
|
-
await
|
|
1676
|
-
},
|
|
1677
|
-
await
|
|
1678
|
-
},
|
|
1767
|
+
A(i);
|
|
1768
|
+
}, Z = async (e) => {
|
|
1769
|
+
await X("file", [e]);
|
|
1770
|
+
}, Q = async () => {
|
|
1771
|
+
await X("zip", [...x]);
|
|
1772
|
+
}, ne = async (e) => {
|
|
1679
1773
|
try {
|
|
1680
|
-
|
|
1774
|
+
P(!0);
|
|
1681
1775
|
let t = await c.downloadStorageZip(e.jobId);
|
|
1682
|
-
|
|
1776
|
+
Y(t, e.fileName ?? `storage_${F.toLowerCase()}.zip`);
|
|
1683
1777
|
} catch (e) {
|
|
1684
|
-
|
|
1778
|
+
M(e instanceof Error ? e.message : String(e));
|
|
1685
1779
|
} finally {
|
|
1686
|
-
|
|
1780
|
+
P(!1), A(null);
|
|
1687
1781
|
}
|
|
1688
1782
|
};
|
|
1689
1783
|
r(() => {
|
|
1690
|
-
let e =
|
|
1784
|
+
let e = k?.jobId;
|
|
1691
1785
|
if (!e) return;
|
|
1692
1786
|
let t = !1, n;
|
|
1693
1787
|
return n = window.setInterval(async () => {
|
|
@@ -1696,17 +1790,17 @@ function $({ target: e = "origin", title: n = "Explorador de Storage", storageTy
|
|
|
1696
1790
|
r = await c.getStorageZipStatus(e);
|
|
1697
1791
|
} catch (e) {
|
|
1698
1792
|
if (window.clearInterval(n), t) return;
|
|
1699
|
-
|
|
1793
|
+
M(e instanceof Error ? e.message : String(e)), A(null);
|
|
1700
1794
|
return;
|
|
1701
1795
|
}
|
|
1702
|
-
t || (
|
|
1703
|
-
},
|
|
1796
|
+
t || (A(r), r.status === "DONE" ? (window.clearInterval(n), await ne(r)) : r.status === "FAILED" && (window.clearInterval(n), M(r.message)));
|
|
1797
|
+
}, se), () => {
|
|
1704
1798
|
t = !0, window.clearInterval(n);
|
|
1705
1799
|
};
|
|
1706
|
-
}, [
|
|
1707
|
-
let
|
|
1708
|
-
|
|
1709
|
-
},
|
|
1800
|
+
}, [k?.jobId]);
|
|
1801
|
+
let re = () => {
|
|
1802
|
+
A(null), M(null);
|
|
1803
|
+
}, ie = (e) => e ? H(e) : "-";
|
|
1710
1804
|
return /* @__PURE__ */ m("div", {
|
|
1711
1805
|
className: "space-y-3",
|
|
1712
1806
|
children: [
|
|
@@ -1719,37 +1813,51 @@ function $({ target: e = "origin", title: n = "Explorador de Storage", storageTy
|
|
|
1719
1813
|
n,
|
|
1720
1814
|
/* @__PURE__ */ p("span", {
|
|
1721
1815
|
className: "badge bg-secondary ms-2",
|
|
1722
|
-
children:
|
|
1816
|
+
children: F
|
|
1723
1817
|
}),
|
|
1724
1818
|
/* @__PURE__ */ p("span", {
|
|
1725
1819
|
className: "badge bg-light text-dark border ms-1",
|
|
1726
|
-
children:
|
|
1820
|
+
children: B
|
|
1727
1821
|
})
|
|
1728
1822
|
]
|
|
1729
1823
|
}), /* @__PURE__ */ p("div", {
|
|
1730
1824
|
className: "d-flex gap-2",
|
|
1731
|
-
children: x.size > 0 && /* @__PURE__ */ m(f, { children: [
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1825
|
+
children: x.size > 0 && /* @__PURE__ */ m(f, { children: [
|
|
1826
|
+
/* @__PURE__ */ m("button", {
|
|
1827
|
+
className: "btn btn-sm btn-outline-primary",
|
|
1828
|
+
onClick: Q,
|
|
1829
|
+
children: [
|
|
1830
|
+
/* @__PURE__ */ p("i", { className: "bi bi-download me-1" }),
|
|
1831
|
+
"Baixar seleção (",
|
|
1832
|
+
x.size,
|
|
1833
|
+
")"
|
|
1834
|
+
]
|
|
1835
|
+
}),
|
|
1836
|
+
e === "destination" && /* @__PURE__ */ m("button", {
|
|
1837
|
+
className: "btn btn-sm btn-outline-success",
|
|
1838
|
+
onClick: () => E(!0),
|
|
1839
|
+
disabled: G.isPending,
|
|
1840
|
+
children: [
|
|
1841
|
+
G.isPending ? /* @__PURE__ */ p("span", { className: "spinner-border spinner-border-sm me-1" }) : /* @__PURE__ */ p("i", { className: "bi bi-arrow-counterclockwise me-1" }),
|
|
1842
|
+
"Restaurar (",
|
|
1843
|
+
x.size,
|
|
1844
|
+
")"
|
|
1845
|
+
]
|
|
1846
|
+
}),
|
|
1847
|
+
/* @__PURE__ */ m("button", {
|
|
1848
|
+
className: "btn btn-sm btn-outline-danger",
|
|
1849
|
+
onClick: () => w("multiple"),
|
|
1850
|
+
children: [
|
|
1851
|
+
/* @__PURE__ */ p("i", { className: "bi bi-trash me-1" }),
|
|
1852
|
+
"Excluir (",
|
|
1853
|
+
x.size,
|
|
1854
|
+
")"
|
|
1855
|
+
]
|
|
1856
|
+
})
|
|
1857
|
+
] })
|
|
1750
1858
|
})]
|
|
1751
1859
|
}),
|
|
1752
|
-
!
|
|
1860
|
+
!L && !R?.configured && !s && /* @__PURE__ */ m("div", {
|
|
1753
1861
|
className: "alert alert-warning small py-1 mb-2",
|
|
1754
1862
|
children: [
|
|
1755
1863
|
/* @__PURE__ */ p("i", {
|
|
@@ -1770,17 +1878,17 @@ function $({ target: e = "origin", title: n = "Explorador de Storage", storageTy
|
|
|
1770
1878
|
children: [/* @__PURE__ */ p("li", {
|
|
1771
1879
|
className: `breadcrumb-item ${v.length === 0 ? "active" : ""}`,
|
|
1772
1880
|
style: { cursor: v.length > 0 ? "pointer" : "default" },
|
|
1773
|
-
onClick: () =>
|
|
1881
|
+
onClick: () => K(""),
|
|
1774
1882
|
children: /* @__PURE__ */ p("i", { className: "bi bi-house" })
|
|
1775
1883
|
}), v.map((e, t) => /* @__PURE__ */ p("li", {
|
|
1776
1884
|
className: `breadcrumb-item ${t === v.length - 1 ? "active" : ""}`,
|
|
1777
1885
|
style: { cursor: t < v.length - 1 ? "pointer" : "default" },
|
|
1778
|
-
onClick: () => t < v.length - 1 &&
|
|
1886
|
+
onClick: () => t < v.length - 1 && q(t),
|
|
1779
1887
|
children: e
|
|
1780
1888
|
}, t))]
|
|
1781
1889
|
})
|
|
1782
1890
|
}),
|
|
1783
|
-
|
|
1891
|
+
ee || L ? /* @__PURE__ */ m("div", {
|
|
1784
1892
|
className: "text-center py-5",
|
|
1785
1893
|
children: [/* @__PURE__ */ p("div", {
|
|
1786
1894
|
className: "spinner-border text-primary",
|
|
@@ -1789,14 +1897,14 @@ function $({ target: e = "origin", title: n = "Explorador de Storage", storageTy
|
|
|
1789
1897
|
className: "mt-2 small text-muted",
|
|
1790
1898
|
children: "Carregando arquivos..."
|
|
1791
1899
|
})]
|
|
1792
|
-
}) : !
|
|
1900
|
+
}) : !U || U.length === 0 ? /* @__PURE__ */ m("div", {
|
|
1793
1901
|
className: "text-center py-5 text-muted",
|
|
1794
1902
|
children: [
|
|
1795
1903
|
/* @__PURE__ */ p("i", { className: "bi bi-folder-x fs-1 d-block mb-2" }),
|
|
1796
1904
|
"Nenhum arquivo encontrado",
|
|
1797
1905
|
g && /* @__PURE__ */ p("button", {
|
|
1798
1906
|
className: "btn btn-sm btn-link mt-2",
|
|
1799
|
-
onClick: () =>
|
|
1907
|
+
onClick: () => K(""),
|
|
1800
1908
|
children: "Voltar ao inicio"
|
|
1801
1909
|
})
|
|
1802
1910
|
]
|
|
@@ -1804,11 +1912,11 @@ function $({ target: e = "origin", title: n = "Explorador de Storage", storageTy
|
|
|
1804
1912
|
className: "d-flex align-items-center gap-2 mb-2",
|
|
1805
1913
|
children: [/* @__PURE__ */ m("button", {
|
|
1806
1914
|
className: "btn btn-sm btn-outline-secondary",
|
|
1807
|
-
onClick:
|
|
1808
|
-
children: [x.size ===
|
|
1915
|
+
onClick: te,
|
|
1916
|
+
children: [x.size === U.length ? "Desmarcar" : "Selecionar", " Todos"]
|
|
1809
1917
|
}), /* @__PURE__ */ m("span", {
|
|
1810
1918
|
className: "small text-muted",
|
|
1811
|
-
children: [
|
|
1919
|
+
children: [U.length, " item(ns)"]
|
|
1812
1920
|
})]
|
|
1813
1921
|
}), /* @__PURE__ */ p("div", {
|
|
1814
1922
|
className: "table-responsive",
|
|
@@ -1832,53 +1940,73 @@ function $({ target: e = "origin", title: n = "Explorador de Storage", storageTy
|
|
|
1832
1940
|
children: "Acoes"
|
|
1833
1941
|
})
|
|
1834
1942
|
] })
|
|
1835
|
-
}), /* @__PURE__ */ p("tbody", { children:
|
|
1836
|
-
className: x.has(
|
|
1943
|
+
}), /* @__PURE__ */ p("tbody", { children: U.map((t) => /* @__PURE__ */ m("tr", {
|
|
1944
|
+
className: x.has(t.path) ? "table-active" : "",
|
|
1837
1945
|
children: [
|
|
1838
1946
|
/* @__PURE__ */ p("td", { children: /* @__PURE__ */ p("input", {
|
|
1839
1947
|
type: "checkbox",
|
|
1840
1948
|
className: "form-check-input",
|
|
1841
|
-
checked: x.has(
|
|
1842
|
-
onChange: () =>
|
|
1949
|
+
checked: x.has(t.path),
|
|
1950
|
+
onChange: () => J(t.path)
|
|
1843
1951
|
}) }),
|
|
1844
|
-
/* @__PURE__ */ p("td", { children:
|
|
1952
|
+
/* @__PURE__ */ p("td", { children: t.directory ? /* @__PURE__ */ m("button", {
|
|
1845
1953
|
className: "btn btn-sm btn-link text-decoration-none p-0 text-start",
|
|
1846
|
-
onClick: () =>
|
|
1954
|
+
onClick: () => K(t.path),
|
|
1847
1955
|
children: [/* @__PURE__ */ p("i", { className: "bi bi-folder-fill text-warning me-2" }), /* @__PURE__ */ p("span", {
|
|
1848
1956
|
className: "font-monospace",
|
|
1849
|
-
children:
|
|
1957
|
+
children: t.name
|
|
1850
1958
|
})]
|
|
1851
1959
|
}) : /* @__PURE__ */ m("span", {
|
|
1852
1960
|
className: "font-monospace small",
|
|
1853
|
-
children: [/* @__PURE__ */ p("i", { className: "bi bi-file-earmark me-2 text-primary" }),
|
|
1961
|
+
children: [/* @__PURE__ */ p("i", { className: "bi bi-file-earmark me-2 text-primary" }), t.name]
|
|
1854
1962
|
}) }),
|
|
1855
1963
|
/* @__PURE__ */ p("td", {
|
|
1856
1964
|
className: "text-muted small",
|
|
1857
|
-
children:
|
|
1965
|
+
children: t.directory ? "-" : V(t.size)
|
|
1858
1966
|
}),
|
|
1859
1967
|
/* @__PURE__ */ p("td", {
|
|
1860
1968
|
className: "text-muted small",
|
|
1861
|
-
children:
|
|
1969
|
+
children: ie(t.lastModified)
|
|
1862
1970
|
}),
|
|
1863
|
-
/* @__PURE__ */ p("td", { children:
|
|
1971
|
+
/* @__PURE__ */ p("td", { children: e === "destination" ? /* @__PURE__ */ m("div", {
|
|
1864
1972
|
className: "d-flex gap-1",
|
|
1865
1973
|
children: [/* @__PURE__ */ p("button", {
|
|
1974
|
+
className: "btn btn-sm btn-outline-success py-0",
|
|
1975
|
+
title: "Restaurar para a origem",
|
|
1976
|
+
onClick: () => {
|
|
1977
|
+
S(/* @__PURE__ */ new Set([t.path])), E(!0);
|
|
1978
|
+
},
|
|
1979
|
+
children: /* @__PURE__ */ p("i", { className: "bi bi-arrow-counterclockwise" })
|
|
1980
|
+
}), !t.directory && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("button", {
|
|
1866
1981
|
className: "btn btn-sm btn-outline-primary py-0",
|
|
1867
1982
|
title: "Baixar",
|
|
1868
|
-
onClick: () =>
|
|
1983
|
+
onClick: () => Z(t.path),
|
|
1869
1984
|
children: /* @__PURE__ */ p("i", { className: "bi bi-download" })
|
|
1870
1985
|
}), /* @__PURE__ */ p("button", {
|
|
1871
1986
|
className: "btn btn-sm btn-outline-danger py-0",
|
|
1872
1987
|
title: "Excluir",
|
|
1873
|
-
onClick: () => w(
|
|
1988
|
+
onClick: () => w(t.path),
|
|
1989
|
+
children: /* @__PURE__ */ p("i", { className: "bi bi-trash" })
|
|
1990
|
+
})] })]
|
|
1991
|
+
}) : t.directory ? null : /* @__PURE__ */ m("div", {
|
|
1992
|
+
className: "d-flex gap-1",
|
|
1993
|
+
children: [/* @__PURE__ */ p("button", {
|
|
1994
|
+
className: "btn btn-sm btn-outline-primary py-0",
|
|
1995
|
+
title: "Baixar",
|
|
1996
|
+
onClick: () => Z(t.path),
|
|
1997
|
+
children: /* @__PURE__ */ p("i", { className: "bi bi-download" })
|
|
1998
|
+
}), /* @__PURE__ */ p("button", {
|
|
1999
|
+
className: "btn btn-sm btn-outline-danger py-0",
|
|
2000
|
+
title: "Excluir",
|
|
2001
|
+
onClick: () => w(t.path),
|
|
1874
2002
|
children: /* @__PURE__ */ p("i", { className: "bi bi-trash" })
|
|
1875
2003
|
})]
|
|
1876
2004
|
}) })
|
|
1877
2005
|
]
|
|
1878
|
-
},
|
|
2006
|
+
}, t.path)) })]
|
|
1879
2007
|
})
|
|
1880
2008
|
})] }),
|
|
1881
|
-
|
|
2009
|
+
k && /* @__PURE__ */ p("div", {
|
|
1882
2010
|
className: "modal d-block",
|
|
1883
2011
|
tabIndex: -1,
|
|
1884
2012
|
style: { background: "rgba(0,0,0,.5)" },
|
|
@@ -1891,10 +2019,10 @@ function $({ target: e = "origin", title: n = "Explorador de Storage", storageTy
|
|
|
1891
2019
|
className: "modal-header",
|
|
1892
2020
|
children: [/* @__PURE__ */ m("h6", {
|
|
1893
2021
|
className: "modal-title",
|
|
1894
|
-
children: [/* @__PURE__ */ p("i", { className: "bi bi-box-arrow-down me-2" }),
|
|
2022
|
+
children: [/* @__PURE__ */ p("i", { className: "bi bi-box-arrow-down me-2" }), k.mode === "ZIP" ? "Compactando e baixando" : "Baixando arquivo"]
|
|
1895
2023
|
}), /* @__PURE__ */ p("button", {
|
|
1896
2024
|
className: "btn-close",
|
|
1897
|
-
onClick:
|
|
2025
|
+
onClick: re
|
|
1898
2026
|
})]
|
|
1899
2027
|
}),
|
|
1900
2028
|
/* @__PURE__ */ m("div", {
|
|
@@ -1913,9 +2041,9 @@ function $({ target: e = "origin", title: n = "Explorador de Storage", storageTy
|
|
|
1913
2041
|
className: "w-100",
|
|
1914
2042
|
children: [/* @__PURE__ */ m("div", {
|
|
1915
2043
|
className: "d-flex justify-content-between small mb-1",
|
|
1916
|
-
children: [/* @__PURE__ */ p("span", { children: ((e) => e.mode === "FILE" ? e.phase === "DOWNLOADING" ? e.totalBytes > 0 ? `Baixando arquivo... ${
|
|
2044
|
+
children: [/* @__PURE__ */ p("span", { children: ((e) => e.mode === "FILE" ? e.phase === "DOWNLOADING" ? e.totalBytes > 0 ? `Baixando arquivo... ${V(e.processedBytes)} / ${V(e.totalBytes)}` : "Baixando arquivo..." : e.message || "Preparando download..." : e.phase === "PREPARING" ? `Preparando ${e.processedItems}/${e.totalItems} arquivo(s)...` : e.phase === "COMPRESSING" ? `Compactando... ${e.percent}%` : e.message || "Processando...")(k) }), /* @__PURE__ */ m("span", {
|
|
1917
2045
|
className: "text-muted",
|
|
1918
|
-
children: [
|
|
2046
|
+
children: [k.percent, "%"]
|
|
1919
2047
|
})]
|
|
1920
2048
|
}), /* @__PURE__ */ p("div", {
|
|
1921
2049
|
className: "progress",
|
|
@@ -1923,39 +2051,39 @@ function $({ target: e = "origin", title: n = "Explorador de Storage", storageTy
|
|
|
1923
2051
|
children: /* @__PURE__ */ p("div", {
|
|
1924
2052
|
className: "progress-bar progress-bar-striped progress-bar-animated",
|
|
1925
2053
|
role: "progressbar",
|
|
1926
|
-
style: { width: `${Math.max(
|
|
2054
|
+
style: { width: `${Math.max(k.percent, 3)}%` }
|
|
1927
2055
|
})
|
|
1928
2056
|
})]
|
|
1929
2057
|
})]
|
|
1930
2058
|
}),
|
|
1931
|
-
|
|
2059
|
+
k.currentItem && /* @__PURE__ */ m("div", {
|
|
1932
2060
|
className: "small text-muted",
|
|
1933
|
-
title:
|
|
2061
|
+
title: k.currentItem,
|
|
1934
2062
|
children: [/* @__PURE__ */ p("i", {
|
|
1935
2063
|
className: "bi bi-file-earmark-text me-1",
|
|
1936
2064
|
"aria-hidden": !0
|
|
1937
2065
|
}), /* @__PURE__ */ p("span", {
|
|
1938
2066
|
className: "font-monospace",
|
|
1939
|
-
children:
|
|
2067
|
+
children: k.currentItem
|
|
1940
2068
|
})]
|
|
1941
2069
|
}),
|
|
1942
|
-
|
|
2070
|
+
k.mode === "FILE" && k.totalBytes > 0 || k.mode === "ZIP" ? /* @__PURE__ */ m("div", {
|
|
1943
2071
|
className: "small text-muted mt-1",
|
|
1944
2072
|
children: [
|
|
1945
2073
|
/* @__PURE__ */ p("i", {
|
|
1946
2074
|
className: "bi bi-hdd me-1",
|
|
1947
2075
|
"aria-hidden": !0
|
|
1948
2076
|
}),
|
|
1949
|
-
|
|
1950
|
-
|
|
2077
|
+
V(k.processedBytes),
|
|
2078
|
+
k.totalBytes > 0 ? ` / ${V(k.totalBytes)}` : ""
|
|
1951
2079
|
]
|
|
1952
2080
|
}) : null,
|
|
1953
|
-
|
|
2081
|
+
k.status === "FAILED" && /* @__PURE__ */ m("div", {
|
|
1954
2082
|
className: "alert alert-danger small mt-2 mb-0 py-1",
|
|
1955
2083
|
children: [/* @__PURE__ */ p("i", {
|
|
1956
2084
|
className: "bi bi-exclamation-triangle me-1",
|
|
1957
2085
|
"aria-hidden": !0
|
|
1958
|
-
}),
|
|
2086
|
+
}), k.message || "Falha ao preparar o download."]
|
|
1959
2087
|
})
|
|
1960
2088
|
]
|
|
1961
2089
|
}),
|
|
@@ -1963,16 +2091,16 @@ function $({ target: e = "origin", title: n = "Explorador de Storage", storageTy
|
|
|
1963
2091
|
className: "modal-footer",
|
|
1964
2092
|
children: /* @__PURE__ */ p("button", {
|
|
1965
2093
|
className: "btn btn-sm btn-secondary",
|
|
1966
|
-
onClick:
|
|
1967
|
-
disabled:
|
|
1968
|
-
children:
|
|
2094
|
+
onClick: re,
|
|
2095
|
+
disabled: N,
|
|
2096
|
+
children: N ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("span", { className: "spinner-border spinner-border-sm me-1" }), "Baixando..."] }) : k.status === "DONE" || k.status === "FAILED" ? "Fechar" : "Fechar (continua em 2º plano)"
|
|
1969
2097
|
})
|
|
1970
2098
|
})
|
|
1971
2099
|
]
|
|
1972
2100
|
})
|
|
1973
2101
|
})
|
|
1974
2102
|
}),
|
|
1975
|
-
|
|
2103
|
+
j && !k && /* @__PURE__ */ p("div", {
|
|
1976
2104
|
className: "modal d-block",
|
|
1977
2105
|
tabIndex: -1,
|
|
1978
2106
|
style: { background: "rgba(0,0,0,.5)" },
|
|
@@ -1988,21 +2116,21 @@ function $({ target: e = "origin", title: n = "Explorador de Storage", storageTy
|
|
|
1988
2116
|
children: [/* @__PURE__ */ p("i", { className: "bi bi-exclamation-triangle me-2 text-danger" }), "Falha no download"]
|
|
1989
2117
|
}), /* @__PURE__ */ p("button", {
|
|
1990
2118
|
className: "btn-close",
|
|
1991
|
-
onClick: () =>
|
|
2119
|
+
onClick: () => M(null)
|
|
1992
2120
|
})]
|
|
1993
2121
|
}),
|
|
1994
2122
|
/* @__PURE__ */ p("div", {
|
|
1995
2123
|
className: "modal-body",
|
|
1996
2124
|
children: /* @__PURE__ */ p("p", {
|
|
1997
2125
|
className: "mb-0 text-danger small",
|
|
1998
|
-
children:
|
|
2126
|
+
children: j
|
|
1999
2127
|
})
|
|
2000
2128
|
}),
|
|
2001
2129
|
/* @__PURE__ */ p("div", {
|
|
2002
2130
|
className: "modal-footer",
|
|
2003
2131
|
children: /* @__PURE__ */ p("button", {
|
|
2004
2132
|
className: "btn btn-sm btn-secondary",
|
|
2005
|
-
onClick: () =>
|
|
2133
|
+
onClick: () => M(null),
|
|
2006
2134
|
children: "Fechar"
|
|
2007
2135
|
})
|
|
2008
2136
|
})
|
|
@@ -2045,7 +2173,7 @@ function $({ target: e = "origin", title: n = "Explorador de Storage", storageTy
|
|
|
2045
2173
|
className: "text-danger small mb-0",
|
|
2046
2174
|
children: "Esta acao nao pode ser desfeita."
|
|
2047
2175
|
}),
|
|
2048
|
-
|
|
2176
|
+
W.isError && /* @__PURE__ */ m("div", {
|
|
2049
2177
|
className: "alert alert-danger small mt-2 mb-0 py-1",
|
|
2050
2178
|
children: [
|
|
2051
2179
|
/* @__PURE__ */ p("i", {
|
|
@@ -2054,7 +2182,7 @@ function $({ target: e = "origin", title: n = "Explorador de Storage", storageTy
|
|
|
2054
2182
|
}),
|
|
2055
2183
|
"Falha ao excluir:",
|
|
2056
2184
|
" ",
|
|
2057
|
-
|
|
2185
|
+
W.error instanceof Error ? W.error.message : String(W.error)
|
|
2058
2186
|
]
|
|
2059
2187
|
})
|
|
2060
2188
|
]
|
|
@@ -2067,25 +2195,145 @@ function $({ target: e = "origin", title: n = "Explorador de Storage", storageTy
|
|
|
2067
2195
|
children: "Cancelar"
|
|
2068
2196
|
}), /* @__PURE__ */ p("button", {
|
|
2069
2197
|
className: "btn btn-sm btn-danger",
|
|
2070
|
-
disabled:
|
|
2198
|
+
disabled: W.isPending,
|
|
2071
2199
|
onClick: async () => {
|
|
2072
|
-
if (C === "multiple") for (let e of x) await
|
|
2073
|
-
else await
|
|
2200
|
+
if (C === "multiple") for (let e of x) await W.mutateAsync(e);
|
|
2201
|
+
else await W.mutateAsync(C);
|
|
2074
2202
|
},
|
|
2075
|
-
children:
|
|
2203
|
+
children: W.isPending ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("span", { className: "spinner-border spinner-border-sm me-1" }), "Excluindo..."] }) : "Excluir"
|
|
2076
2204
|
})]
|
|
2077
2205
|
})
|
|
2078
2206
|
]
|
|
2079
2207
|
})
|
|
2080
2208
|
})
|
|
2209
|
+
}),
|
|
2210
|
+
T && /* @__PURE__ */ p("div", {
|
|
2211
|
+
className: "modal d-block",
|
|
2212
|
+
tabIndex: -1,
|
|
2213
|
+
style: { background: "rgba(0,0,0,.5)" },
|
|
2214
|
+
children: /* @__PURE__ */ p("div", {
|
|
2215
|
+
className: "modal-dialog modal-dialog-centered",
|
|
2216
|
+
children: /* @__PURE__ */ m("div", {
|
|
2217
|
+
className: "modal-content",
|
|
2218
|
+
children: [
|
|
2219
|
+
/* @__PURE__ */ m("div", {
|
|
2220
|
+
className: "modal-header",
|
|
2221
|
+
children: [/* @__PURE__ */ m("h6", {
|
|
2222
|
+
className: "modal-title",
|
|
2223
|
+
children: [/* @__PURE__ */ p("i", { className: "bi bi-arrow-counterclockwise me-2 text-success" }), "Restaurar para a origem"]
|
|
2224
|
+
}), /* @__PURE__ */ p("button", {
|
|
2225
|
+
className: "btn-close",
|
|
2226
|
+
onClick: () => E(!1)
|
|
2227
|
+
})]
|
|
2228
|
+
}),
|
|
2229
|
+
/* @__PURE__ */ m("div", {
|
|
2230
|
+
className: "modal-body",
|
|
2231
|
+
children: [
|
|
2232
|
+
/* @__PURE__ */ m("p", {
|
|
2233
|
+
className: "mb-2",
|
|
2234
|
+
children: [
|
|
2235
|
+
"Copiar ",
|
|
2236
|
+
/* @__PURE__ */ p("strong", { children: x.size }),
|
|
2237
|
+
" arquivo(s)/pasta(s) do storage",
|
|
2238
|
+
" ",
|
|
2239
|
+
/* @__PURE__ */ p("strong", { children: F }),
|
|
2240
|
+
" para o storage de origem?"
|
|
2241
|
+
]
|
|
2242
|
+
}),
|
|
2243
|
+
/* @__PURE__ */ m("p", {
|
|
2244
|
+
className: "small text-muted",
|
|
2245
|
+
children: [
|
|
2246
|
+
"Pastas são expandidas recursivamente e arquivos ",
|
|
2247
|
+
/* @__PURE__ */ p("code", { children: ".zip" }),
|
|
2248
|
+
" são extraídos na origem preservando a estrutura de pastas."
|
|
2249
|
+
]
|
|
2250
|
+
}),
|
|
2251
|
+
G.isError && /* @__PURE__ */ m("div", {
|
|
2252
|
+
className: "alert alert-danger small mt-2 mb-0 py-1",
|
|
2253
|
+
children: [
|
|
2254
|
+
/* @__PURE__ */ p("i", {
|
|
2255
|
+
className: "bi bi-exclamation-triangle me-1",
|
|
2256
|
+
"aria-hidden": !0
|
|
2257
|
+
}),
|
|
2258
|
+
"Falha ao restaurar:",
|
|
2259
|
+
" ",
|
|
2260
|
+
G.error instanceof Error ? G.error.message : String(G.error)
|
|
2261
|
+
]
|
|
2262
|
+
})
|
|
2263
|
+
]
|
|
2264
|
+
}),
|
|
2265
|
+
/* @__PURE__ */ m("div", {
|
|
2266
|
+
className: "modal-footer",
|
|
2267
|
+
children: [/* @__PURE__ */ p("button", {
|
|
2268
|
+
className: "btn btn-sm btn-secondary",
|
|
2269
|
+
onClick: () => E(!1),
|
|
2270
|
+
children: "Cancelar"
|
|
2271
|
+
}), /* @__PURE__ */ p("button", {
|
|
2272
|
+
className: "btn btn-sm btn-success",
|
|
2273
|
+
disabled: G.isPending,
|
|
2274
|
+
onClick: () => G.mutate([...x]),
|
|
2275
|
+
children: G.isPending ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("span", { className: "spinner-border spinner-border-sm me-1" }), "Restaurando..."] }) : "Restaurar"
|
|
2276
|
+
})]
|
|
2277
|
+
})
|
|
2278
|
+
]
|
|
2279
|
+
})
|
|
2280
|
+
})
|
|
2281
|
+
}),
|
|
2282
|
+
D && /* @__PURE__ */ p("div", {
|
|
2283
|
+
className: "modal d-block",
|
|
2284
|
+
tabIndex: -1,
|
|
2285
|
+
style: { background: "rgba(0,0,0,.5)" },
|
|
2286
|
+
children: /* @__PURE__ */ p("div", {
|
|
2287
|
+
className: "modal-dialog modal-dialog-centered",
|
|
2288
|
+
children: /* @__PURE__ */ m("div", {
|
|
2289
|
+
className: "modal-content",
|
|
2290
|
+
children: [
|
|
2291
|
+
/* @__PURE__ */ m("div", {
|
|
2292
|
+
className: "modal-header",
|
|
2293
|
+
children: [/* @__PURE__ */ m("h6", {
|
|
2294
|
+
className: "modal-title",
|
|
2295
|
+
children: [/* @__PURE__ */ p("i", { className: "bi bi-check-circle me-2 text-success" }), "Restauração concluída"]
|
|
2296
|
+
}), /* @__PURE__ */ p("button", {
|
|
2297
|
+
className: "btn-close",
|
|
2298
|
+
onClick: () => O(null)
|
|
2299
|
+
})]
|
|
2300
|
+
}),
|
|
2301
|
+
/* @__PURE__ */ m("div", {
|
|
2302
|
+
className: "modal-body",
|
|
2303
|
+
children: [/* @__PURE__ */ p("p", {
|
|
2304
|
+
className: "mb-2",
|
|
2305
|
+
children: D.message
|
|
2306
|
+
}), D.restoredItems.length > 0 && /* @__PURE__ */ m("ul", {
|
|
2307
|
+
className: "list-unstyled small mb-0",
|
|
2308
|
+
children: [D.restoredItems.slice(0, 10).map((e) => /* @__PURE__ */ p("li", { children: /* @__PURE__ */ p("code", { children: e }) }, e)), D.restoredItems.length > 10 && /* @__PURE__ */ m("li", {
|
|
2309
|
+
className: "text-muted",
|
|
2310
|
+
children: [
|
|
2311
|
+
"... e mais ",
|
|
2312
|
+
D.restoredItems.length - 10,
|
|
2313
|
+
" item(ns)"
|
|
2314
|
+
]
|
|
2315
|
+
})]
|
|
2316
|
+
})]
|
|
2317
|
+
}),
|
|
2318
|
+
/* @__PURE__ */ p("div", {
|
|
2319
|
+
className: "modal-footer",
|
|
2320
|
+
children: /* @__PURE__ */ p("button", {
|
|
2321
|
+
className: "btn btn-sm btn-secondary",
|
|
2322
|
+
onClick: () => O(null),
|
|
2323
|
+
children: "Fechar"
|
|
2324
|
+
})
|
|
2325
|
+
})
|
|
2326
|
+
]
|
|
2327
|
+
})
|
|
2328
|
+
})
|
|
2081
2329
|
})
|
|
2082
2330
|
]
|
|
2083
2331
|
});
|
|
2084
2332
|
}
|
|
2085
2333
|
//#endregion
|
|
2086
2334
|
//#region src/components/ImportDumpTab.tsx
|
|
2087
|
-
function
|
|
2088
|
-
let e =
|
|
2335
|
+
function ce() {
|
|
2336
|
+
let e = L(), t = R(), n = D(), r = a(null), [i, s] = o("upload"), [c, l] = o(null), [u, d] = o(""), [f, h] = o(!1), g = () => {
|
|
2089
2337
|
i === "upload" && c ? e.mutate({ file: c }) : i === "storage" && u && t.mutate({
|
|
2090
2338
|
storageType: "LOCAL",
|
|
2091
2339
|
storagePath: u
|
|
@@ -2246,7 +2494,7 @@ function se() {
|
|
|
2246
2494
|
"aria-hidden": !0
|
|
2247
2495
|
}),
|
|
2248
2496
|
"Falha na importacao: ",
|
|
2249
|
-
|
|
2497
|
+
Y(y)
|
|
2250
2498
|
]
|
|
2251
2499
|
}),
|
|
2252
2500
|
v && /* @__PURE__ */ m("div", {
|
|
@@ -2288,8 +2536,8 @@ function se() {
|
|
|
2288
2536
|
}
|
|
2289
2537
|
//#endregion
|
|
2290
2538
|
//#region src/components/StorageBackupTab.tsx
|
|
2291
|
-
function
|
|
2292
|
-
let e = j(), t = T(), n = t.data?.find((e) => e.name === "ORIGIN_STORAGE"), r = t.data?.find((e) => e.name === "OUTPUT_STORAGE"), i = e.isPending;
|
|
2539
|
+
function le() {
|
|
2540
|
+
let e = j(), t = T(), n = t.data?.find((e) => e.name === "ORIGIN_STORAGE"), r = t.data?.find((e) => e.name === "OUTPUT_STORAGE"), i = e.isPending, [a, s] = o(!1);
|
|
2293
2541
|
return /* @__PURE__ */ m("div", { children: [
|
|
2294
2542
|
/* @__PURE__ */ m("div", {
|
|
2295
2543
|
className: "mb-3",
|
|
@@ -2331,12 +2579,12 @@ function ce() {
|
|
|
2331
2579
|
}),
|
|
2332
2580
|
t.data && /* @__PURE__ */ m("div", {
|
|
2333
2581
|
className: "d-flex flex-column gap-2",
|
|
2334
|
-
children: [/* @__PURE__ */ p(
|
|
2582
|
+
children: [/* @__PURE__ */ p(ue, {
|
|
2335
2583
|
label: n?.label ?? "Storage de origem",
|
|
2336
2584
|
configured: n?.configured,
|
|
2337
2585
|
ok: n?.ok,
|
|
2338
2586
|
message: n?.message
|
|
2339
|
-
}), /* @__PURE__ */ p(
|
|
2587
|
+
}), /* @__PURE__ */ p(ue, {
|
|
2340
2588
|
label: r?.label ?? "Storage de destino",
|
|
2341
2589
|
configured: r?.configured,
|
|
2342
2590
|
ok: r?.ok,
|
|
@@ -2354,7 +2602,7 @@ function ce() {
|
|
|
2354
2602
|
"aria-hidden": !0
|
|
2355
2603
|
}),
|
|
2356
2604
|
"Falha ao criar backup de storage: ",
|
|
2357
|
-
|
|
2605
|
+
Y(e.error)
|
|
2358
2606
|
]
|
|
2359
2607
|
}),
|
|
2360
2608
|
e.isSuccess && /* @__PURE__ */ m("div", {
|
|
@@ -2371,13 +2619,37 @@ function ce() {
|
|
|
2371
2619
|
"). O progresso é exibido na aba Backups."
|
|
2372
2620
|
]
|
|
2373
2621
|
}),
|
|
2622
|
+
/* @__PURE__ */ m("div", {
|
|
2623
|
+
className: "form-check form-switch mb-3 d-flex align-items-center gap-2",
|
|
2624
|
+
children: [/* @__PURE__ */ p("input", {
|
|
2625
|
+
className: "form-check-input",
|
|
2626
|
+
type: "checkbox",
|
|
2627
|
+
role: "switch",
|
|
2628
|
+
id: "minivault-storage-scheduled",
|
|
2629
|
+
checked: a,
|
|
2630
|
+
onChange: (e) => s(e.target.checked)
|
|
2631
|
+
}), /* @__PURE__ */ m("label", {
|
|
2632
|
+
className: "form-check-label",
|
|
2633
|
+
htmlFor: "minivault-storage-scheduled",
|
|
2634
|
+
children: ["Executar em agendamento", /* @__PURE__ */ m("span", {
|
|
2635
|
+
className: "text-muted small ms-2",
|
|
2636
|
+
children: [/* @__PURE__ */ p("i", {
|
|
2637
|
+
className: "bi bi-clock-history me-1",
|
|
2638
|
+
"aria-hidden": !0
|
|
2639
|
+
}), "O scheduler re-executa este backup automaticamente no horário configurado."]
|
|
2640
|
+
})]
|
|
2641
|
+
})]
|
|
2642
|
+
}),
|
|
2374
2643
|
/* @__PURE__ */ p("div", {
|
|
2375
2644
|
className: "d-flex justify-content-end",
|
|
2376
2645
|
children: /* @__PURE__ */ m("button", {
|
|
2377
2646
|
type: "button",
|
|
2378
2647
|
className: "btn btn-primary",
|
|
2379
2648
|
onClick: () => {
|
|
2380
|
-
e.mutate({
|
|
2649
|
+
e.mutate({
|
|
2650
|
+
backupType: "STORAGE",
|
|
2651
|
+
scheduled: a
|
|
2652
|
+
});
|
|
2381
2653
|
},
|
|
2382
2654
|
disabled: i || t.data != null && n?.configured === !1,
|
|
2383
2655
|
children: [
|
|
@@ -2395,7 +2667,7 @@ function ce() {
|
|
|
2395
2667
|
})
|
|
2396
2668
|
] });
|
|
2397
2669
|
}
|
|
2398
|
-
function
|
|
2670
|
+
function ue({ label: e, configured: t, ok: n, message: r }) {
|
|
2399
2671
|
return t === !1 ? /* @__PURE__ */ m("div", {
|
|
2400
2672
|
className: "d-flex align-items-center gap-2 small text-muted",
|
|
2401
2673
|
children: [/* @__PURE__ */ p("i", {
|
|
@@ -2416,13 +2688,13 @@ function le({ label: e, configured: t, ok: n, message: r }) {
|
|
|
2416
2688
|
}
|
|
2417
2689
|
//#endregion
|
|
2418
2690
|
//#region src/hooks/useAutoTheme.ts
|
|
2419
|
-
function
|
|
2691
|
+
function de() {
|
|
2420
2692
|
return typeof document < "u" && document.documentElement.classList.contains("dark");
|
|
2421
2693
|
}
|
|
2422
|
-
function
|
|
2423
|
-
let [t, n] = o(
|
|
2694
|
+
function fe(e) {
|
|
2695
|
+
let [t, n] = o(de), [i, a] = o(() => typeof window < "u" && window.matchMedia?.("(prefers-color-scheme: dark)")?.matches === !0);
|
|
2424
2696
|
return r(() => {
|
|
2425
|
-
let e = document.documentElement, t = new MutationObserver(() => n(
|
|
2697
|
+
let e = document.documentElement, t = new MutationObserver(() => n(de()));
|
|
2426
2698
|
return t.observe(e, {
|
|
2427
2699
|
attributes: !0,
|
|
2428
2700
|
attributeFilter: ["class"]
|
|
@@ -2435,8 +2707,8 @@ function de(e) {
|
|
|
2435
2707
|
}
|
|
2436
2708
|
//#endregion
|
|
2437
2709
|
//#region src/components/MinivaultModule.tsx
|
|
2438
|
-
function
|
|
2439
|
-
let { companyAcronym: t = "Minivault", theme: n, refetchIntervalMs: r = 15e3, storageType: i = "LOCAL", ...a } = e, l =
|
|
2710
|
+
function pe(e) {
|
|
2711
|
+
let { companyAcronym: t = "Minivault", theme: n, refetchIntervalMs: r = 15e3, storageType: i = "LOCAL", ...a } = e, l = fe(n), [u] = o(() => new s({ defaultOptions: { queries: {
|
|
2440
2712
|
refetchInterval: r,
|
|
2441
2713
|
retry: 1
|
|
2442
2714
|
} } }));
|
|
@@ -2447,15 +2719,15 @@ function fe(e) {
|
|
|
2447
2719
|
children: /* @__PURE__ */ m("div", {
|
|
2448
2720
|
className: "minivault-module h-full w-full overflow-auto",
|
|
2449
2721
|
"data-minivault-theme": l,
|
|
2450
|
-
children: [/* @__PURE__ */ p(
|
|
2722
|
+
children: [/* @__PURE__ */ p(me, {
|
|
2451
2723
|
companyAcronym: t,
|
|
2452
2724
|
theme: l
|
|
2453
|
-
}), /* @__PURE__ */ p(
|
|
2725
|
+
}), /* @__PURE__ */ p(he, { storageType: i })]
|
|
2454
2726
|
})
|
|
2455
2727
|
})
|
|
2456
2728
|
});
|
|
2457
2729
|
}
|
|
2458
|
-
function
|
|
2730
|
+
function me({ companyAcronym: e, theme: t }) {
|
|
2459
2731
|
return /* @__PURE__ */ m("div", {
|
|
2460
2732
|
className: "d-flex align-items-center justify-content-between flex-wrap gap-2 px-3 py-2 border-bottom",
|
|
2461
2733
|
style: {
|
|
@@ -2484,7 +2756,7 @@ function pe({ companyAcronym: e, theme: t }) {
|
|
|
2484
2756
|
})]
|
|
2485
2757
|
});
|
|
2486
2758
|
}
|
|
2487
|
-
function
|
|
2759
|
+
function he({ storageType: e }) {
|
|
2488
2760
|
let [t, n] = o("backups");
|
|
2489
2761
|
return /* @__PURE__ */ m("div", {
|
|
2490
2762
|
className: "p-3",
|
|
@@ -2566,10 +2838,10 @@ function me({ storageType: e }) {
|
|
|
2566
2838
|
})
|
|
2567
2839
|
]
|
|
2568
2840
|
}),
|
|
2569
|
-
t === "backups" && /* @__PURE__ */ p(
|
|
2570
|
-
t === "create" && /* @__PURE__ */ p(
|
|
2571
|
-
t === "createStorage" && /* @__PURE__ */ p(
|
|
2572
|
-
t === "import" && /* @__PURE__ */ p(
|
|
2841
|
+
t === "backups" && /* @__PURE__ */ p(X, {}),
|
|
2842
|
+
t === "create" && /* @__PURE__ */ p(ne, {}),
|
|
2843
|
+
t === "createStorage" && /* @__PURE__ */ p(le, {}),
|
|
2844
|
+
t === "import" && /* @__PURE__ */ p(ce, {}),
|
|
2573
2845
|
t === "storage" && /* @__PURE__ */ m("div", {
|
|
2574
2846
|
className: "row g-3",
|
|
2575
2847
|
children: [/* @__PURE__ */ p("div", {
|
|
@@ -2588,18 +2860,18 @@ function me({ storageType: e }) {
|
|
|
2588
2860
|
})
|
|
2589
2861
|
})]
|
|
2590
2862
|
}),
|
|
2591
|
-
t === "diagnostics" && /* @__PURE__ */ p(
|
|
2863
|
+
t === "diagnostics" && /* @__PURE__ */ p(ae, {})
|
|
2592
2864
|
]
|
|
2593
2865
|
});
|
|
2594
2866
|
}
|
|
2595
2867
|
//#endregion
|
|
2596
2868
|
//#region src/components/CredentialsFields.tsx
|
|
2597
|
-
var
|
|
2869
|
+
var ge = [
|
|
2598
2870
|
"postgresql",
|
|
2599
2871
|
"mysql",
|
|
2600
2872
|
"sqlserver"
|
|
2601
2873
|
];
|
|
2602
|
-
function
|
|
2874
|
+
function _e() {
|
|
2603
2875
|
return {
|
|
2604
2876
|
host: "localhost",
|
|
2605
2877
|
port: 5432,
|
|
@@ -2609,19 +2881,19 @@ function ge() {
|
|
|
2609
2881
|
databaseType: "postgresql"
|
|
2610
2882
|
};
|
|
2611
2883
|
}
|
|
2612
|
-
function
|
|
2884
|
+
function ve(e) {
|
|
2613
2885
|
return e === "postgresql" || e === "postgres" ? 5432 : e === "mysql" ? 3306 : 1433;
|
|
2614
2886
|
}
|
|
2615
|
-
function
|
|
2887
|
+
function ye({ value: e, onChange: t, onValidatedChange: n }) {
|
|
2616
2888
|
let r = {
|
|
2617
|
-
...
|
|
2889
|
+
..._e(),
|
|
2618
2890
|
...e
|
|
2619
2891
|
}, i = (e) => {
|
|
2620
2892
|
let n = {
|
|
2621
2893
|
...r,
|
|
2622
2894
|
databaseType: e
|
|
2623
2895
|
};
|
|
2624
|
-
(r.port ===
|
|
2896
|
+
(r.port === ve(r.databaseType) || !r.port) && (n.port = ve(e)), t(n);
|
|
2625
2897
|
}, a = (e) => {
|
|
2626
2898
|
let i = {
|
|
2627
2899
|
...r,
|
|
@@ -2643,7 +2915,7 @@ function ve({ value: e, onChange: t, onValidatedChange: n }) {
|
|
|
2643
2915
|
className: "form-select",
|
|
2644
2916
|
value: r.databaseType,
|
|
2645
2917
|
onChange: (e) => i(e.target.value),
|
|
2646
|
-
children:
|
|
2918
|
+
children: ge.map((e) => /* @__PURE__ */ p("option", {
|
|
2647
2919
|
value: e,
|
|
2648
2920
|
children: W[e] ?? e
|
|
2649
2921
|
}, e))
|
|
@@ -2717,4 +2989,4 @@ function ve({ value: e, onChange: t, onValidatedChange: n }) {
|
|
|
2717
2989
|
});
|
|
2718
2990
|
}
|
|
2719
2991
|
//#endregion
|
|
2720
|
-
export {
|
|
2992
|
+
export { X as BackupsTab, ne as CreateBackupTab, ye as CredentialsFields, W as DATABASE_TYPE_LABELS, J as DatabaseBanner, ae as DiagnosticsTab, ce as ImportDumpTab, g as MinivaultApi, h as MinivaultApiError, y as MinivaultApiProvider, pe as MinivaultModule, te as RestoreModal, ee as STATUS_BADGE, U as STATUS_LABELS, q as StatusBadge, le as StorageBackupTab, $ as StorageExplorerTab, H as formatDate, V as formatFileSize, E as useBackups, j as useCreateBackup, D as useDbInfo, A as useDbRelationships, k as useDbTableDetail, O as useDbTables, N as useDeleteBackup, T as useDiagnostics, I as useDownloadBackup, L as useImportDump, R as useImportFromStorage, b as useMinivaultApi, M as useRestoreBackup };
|