@v1ct0rbr/minivault-web 0.3.1 → 0.4.1
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/minivault-web.js +166 -120
- package/package.json +1 -1
package/dist/minivault-web.js
CHANGED
|
@@ -927,8 +927,8 @@ function Y() {
|
|
|
927
927
|
let e = O(), t = w(), n = T(t.data?.configured), [r, a] = o(!1), [s, c] = o(() => ({
|
|
928
928
|
type: "LOCAL",
|
|
929
929
|
localPath: ""
|
|
930
|
-
})), [l, u] = o(!
|
|
931
|
-
format: "
|
|
930
|
+
})), [l, u] = o(!0), [d, h] = o({
|
|
931
|
+
format: "plain",
|
|
932
932
|
includeData: !0,
|
|
933
933
|
includeDropTable: !1,
|
|
934
934
|
includeCreateTable: !0,
|
|
@@ -938,12 +938,12 @@ function Y() {
|
|
|
938
938
|
}), [g, _] = o(() => /* @__PURE__ */ new Set()), [v, y] = o(null), [b, x] = o({}), [S, C] = o(""), D = E(v, t.data?.configured), k = i(() => new Set((t.data?.exportExcludedTables ?? []).map(te)), [t.data?.exportExcludedTables]), A = i(() => {
|
|
939
939
|
let e = n.data ?? [], t = S.trim().toLowerCase();
|
|
940
940
|
return t ? e.filter((e) => e.fullName.toLowerCase().includes(t)) : e;
|
|
941
|
-
}, [n.data, S]), j = (e) => {
|
|
941
|
+
}, [n.data, S]), j = i(() => Object.values(b).reduce((e, t) => e + t.length, 0), [b]), M = (e) => {
|
|
942
942
|
_((t) => {
|
|
943
943
|
let n = new Set(t);
|
|
944
944
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
945
945
|
});
|
|
946
|
-
},
|
|
946
|
+
}, N = (e, t) => {
|
|
947
947
|
x((n) => {
|
|
948
948
|
let r = n[e] ?? [], i = r.includes(t) ? r.filter((e) => e !== t) : [...r, t];
|
|
949
949
|
return {
|
|
@@ -951,7 +951,7 @@ function Y() {
|
|
|
951
951
|
[e]: i
|
|
952
952
|
};
|
|
953
953
|
});
|
|
954
|
-
},
|
|
954
|
+
}, P = () => {
|
|
955
955
|
let t;
|
|
956
956
|
if (l) {
|
|
957
957
|
t = { ...d }, g.size > 0 && (t.tables = [...g]);
|
|
@@ -964,7 +964,7 @@ function Y() {
|
|
|
964
964
|
originStorage: r ? s : void 0,
|
|
965
965
|
dumpOptions: t
|
|
966
966
|
});
|
|
967
|
-
},
|
|
967
|
+
}, F = e.isPending, I = t.data?.configured && !F;
|
|
968
968
|
return /* @__PURE__ */ m("div", { children: [
|
|
969
969
|
/* @__PURE__ */ m("div", {
|
|
970
970
|
className: "mb-3",
|
|
@@ -973,7 +973,7 @@ function Y() {
|
|
|
973
973
|
children: "Criar novo backup"
|
|
974
974
|
}), /* @__PURE__ */ p("p", {
|
|
975
975
|
className: "text-muted small mb-0",
|
|
976
|
-
children: "O minivault usa o banco configurado no servidor (via variáveis de ambiente). Selecione tabelas e colunas
|
|
976
|
+
children: "O minivault usa o banco configurado no servidor (via variáveis de ambiente). Selecione as tabelas no grid e expanda um card para marcar colunas cujo conteúdo será nulificado na exportação."
|
|
977
977
|
})]
|
|
978
978
|
}),
|
|
979
979
|
/* @__PURE__ */ p(U, {
|
|
@@ -1042,9 +1042,12 @@ function Y() {
|
|
|
1042
1042
|
children: "Nenhuma tabela encontrada."
|
|
1043
1043
|
}),
|
|
1044
1044
|
/* @__PURE__ */ p("div", {
|
|
1045
|
-
className: "
|
|
1045
|
+
className: "p-2",
|
|
1046
1046
|
style: {
|
|
1047
|
-
|
|
1047
|
+
display: "grid",
|
|
1048
|
+
gridTemplateColumns: "repeat(auto-fill, minmax(240px, 1fr))",
|
|
1049
|
+
gap: "0.5rem",
|
|
1050
|
+
maxHeight: 420,
|
|
1048
1051
|
overflow: "auto"
|
|
1049
1052
|
},
|
|
1050
1053
|
children: A.map((e) => /* @__PURE__ */ p(ee, {
|
|
@@ -1052,17 +1055,32 @@ function Y() {
|
|
|
1052
1055
|
disabled: k.has(e.fullName),
|
|
1053
1056
|
selected: g.has(e.fullName),
|
|
1054
1057
|
expanded: v === e.fullName,
|
|
1055
|
-
showColumnsToggle: d.format === "plain",
|
|
1056
1058
|
excluded: b[e.fullName] ?? [],
|
|
1057
|
-
onToggleTable: () =>
|
|
1059
|
+
onToggleTable: () => M(e.fullName),
|
|
1058
1060
|
onToggleExpand: () => y(v === e.fullName ? null : e.fullName),
|
|
1059
|
-
onToggleColumn: (t) =>
|
|
1061
|
+
onToggleColumn: (t) => N(e.fullName, t),
|
|
1060
1062
|
detail: v === e.fullName ? D : void 0
|
|
1061
1063
|
}, e.fullName))
|
|
1062
1064
|
}),
|
|
1063
|
-
/* @__PURE__ */
|
|
1064
|
-
className: "p-2 small
|
|
1065
|
-
children:
|
|
1065
|
+
/* @__PURE__ */ m("div", {
|
|
1066
|
+
className: "p-2 small border-top d-flex flex-wrap gap-2 align-items-center",
|
|
1067
|
+
children: [/* @__PURE__ */ m("span", {
|
|
1068
|
+
className: "text-muted",
|
|
1069
|
+
children: [/* @__PURE__ */ p("i", {
|
|
1070
|
+
className: "bi bi-info-circle me-1",
|
|
1071
|
+
"aria-hidden": !0
|
|
1072
|
+
}), "Deixe tudo desmarcado para incluir todas as tabelas (exceto as bloqueadas por segurança)."]
|
|
1073
|
+
}), j > 0 && d.format !== "plain" && /* @__PURE__ */ m("span", {
|
|
1074
|
+
className: "badge text-bg-warning ms-auto text-wrap text-start",
|
|
1075
|
+
children: [
|
|
1076
|
+
/* @__PURE__ */ p("i", {
|
|
1077
|
+
className: "bi bi-exclamation-triangle me-1",
|
|
1078
|
+
"aria-hidden": !0
|
|
1079
|
+
}),
|
|
1080
|
+
j,
|
|
1081
|
+
" coluna(s) marcada(s) serão nulificadas apenas com formato Plain SQL (texto)"
|
|
1082
|
+
]
|
|
1083
|
+
})]
|
|
1066
1084
|
})
|
|
1067
1085
|
]
|
|
1068
1086
|
})]
|
|
@@ -1079,7 +1097,7 @@ function Y() {
|
|
|
1079
1097
|
}), /* @__PURE__ */ p("label", {
|
|
1080
1098
|
className: "form-check-label",
|
|
1081
1099
|
htmlFor: "minivault-with-dump-options",
|
|
1082
|
-
children: "Configurar opcoes do dump (formato, dados, indices)"
|
|
1100
|
+
children: "Configurar opcoes do dump (formato, dados, indices) — desmarcar envia sem opcoes (formato padrão custom/binary no servidor)"
|
|
1083
1101
|
})]
|
|
1084
1102
|
}),
|
|
1085
1103
|
l && /* @__PURE__ */ m("div", {
|
|
@@ -1096,31 +1114,44 @@ function Y() {
|
|
|
1096
1114
|
className: "row g-3 mb-3",
|
|
1097
1115
|
children: /* @__PURE__ */ m("div", {
|
|
1098
1116
|
className: "col-md-4",
|
|
1099
|
-
children: [
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1117
|
+
children: [
|
|
1118
|
+
/* @__PURE__ */ p("label", {
|
|
1119
|
+
className: "form-label",
|
|
1120
|
+
children: "Formato"
|
|
1121
|
+
}),
|
|
1122
|
+
/* @__PURE__ */ m("select", {
|
|
1123
|
+
className: "form-select",
|
|
1124
|
+
value: d.format,
|
|
1125
|
+
onChange: (e) => h((t) => ({
|
|
1126
|
+
...t,
|
|
1127
|
+
format: e.target.value
|
|
1128
|
+
})),
|
|
1129
|
+
children: [
|
|
1130
|
+
/* @__PURE__ */ p("option", {
|
|
1131
|
+
value: "plain",
|
|
1132
|
+
children: "Plain SQL (texto, legível — padrão)"
|
|
1133
|
+
}),
|
|
1134
|
+
/* @__PURE__ */ p("option", {
|
|
1135
|
+
value: "custom",
|
|
1136
|
+
children: "Custom (-Fc, binário, mais compacto)"
|
|
1137
|
+
}),
|
|
1138
|
+
/* @__PURE__ */ p("option", {
|
|
1139
|
+
value: "tar",
|
|
1140
|
+
children: "Tar (-Ft, binário)"
|
|
1141
|
+
})
|
|
1142
|
+
]
|
|
1143
|
+
}),
|
|
1144
|
+
/* @__PURE__ */ m("div", {
|
|
1145
|
+
className: "form-text",
|
|
1146
|
+
children: [
|
|
1147
|
+
"Plain gera um arquivo SQL legível (",
|
|
1148
|
+
/* @__PURE__ */ p("code", { children: "database_dump.sql" }),
|
|
1149
|
+
") — necessário para nulificar colunas. Custom/Tar geram dump binário (",
|
|
1150
|
+
/* @__PURE__ */ p("code", { children: "database_dump.dump" }),
|
|
1151
|
+
"), não abrir como texto; usar com pg_restore."
|
|
1152
|
+
]
|
|
1153
|
+
})
|
|
1154
|
+
]
|
|
1124
1155
|
})
|
|
1125
1156
|
}), /* @__PURE__ */ p("div", {
|
|
1126
1157
|
className: "row g-3",
|
|
@@ -1363,10 +1394,10 @@ function Y() {
|
|
|
1363
1394
|
children: /* @__PURE__ */ m("button", {
|
|
1364
1395
|
type: "button",
|
|
1365
1396
|
className: "btn btn-primary",
|
|
1366
|
-
onClick:
|
|
1367
|
-
disabled: !
|
|
1397
|
+
onClick: P,
|
|
1398
|
+
disabled: !I,
|
|
1368
1399
|
children: [
|
|
1369
|
-
|
|
1400
|
+
F && /* @__PURE__ */ p("span", {
|
|
1370
1401
|
className: "spinner-border spinner-border-sm me-2",
|
|
1371
1402
|
"aria-hidden": !0
|
|
1372
1403
|
}),
|
|
@@ -1380,104 +1411,119 @@ function Y() {
|
|
|
1380
1411
|
})
|
|
1381
1412
|
] });
|
|
1382
1413
|
}
|
|
1383
|
-
function ee({ table: e, disabled: t, selected: n, expanded: r,
|
|
1384
|
-
return /* @__PURE__ */
|
|
1385
|
-
className:
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1414
|
+
function ee({ table: e, disabled: t, selected: n, expanded: r, excluded: i, detail: a, onToggleTable: o, onToggleExpand: s, onToggleColumn: c }) {
|
|
1415
|
+
return /* @__PURE__ */ p("div", {
|
|
1416
|
+
className: `card h-100 ${n ? "border-primary" : ""}`,
|
|
1417
|
+
style: { minWidth: 0 },
|
|
1418
|
+
children: /* @__PURE__ */ m("div", {
|
|
1419
|
+
className: "card-body p-2 d-flex flex-column gap-1",
|
|
1420
|
+
children: [/* @__PURE__ */ m("div", {
|
|
1421
|
+
className: "d-flex align-items-center gap-2",
|
|
1422
|
+
children: [/* @__PURE__ */ p("input", {
|
|
1423
|
+
className: "form-check-input mt-0",
|
|
1391
1424
|
type: "checkbox",
|
|
1392
1425
|
checked: n,
|
|
1393
1426
|
disabled: t,
|
|
1394
1427
|
title: t ? "Bloqueada por segurança (BACKUP_EXPORT_EXCLUDED_TABLES)" : void 0,
|
|
1395
|
-
onChange:
|
|
1396
|
-
}),
|
|
1397
|
-
|
|
1398
|
-
|
|
1428
|
+
onChange: o
|
|
1429
|
+
}), /* @__PURE__ */ m("span", {
|
|
1430
|
+
className: "font-monospace small text-truncate",
|
|
1431
|
+
style: { minWidth: 0 },
|
|
1432
|
+
title: e.fullName,
|
|
1399
1433
|
children: [e.fullName, e.type === "VIEW" && /* @__PURE__ */ p("span", {
|
|
1400
1434
|
className: "badge text-bg-light ms-1",
|
|
1401
1435
|
children: "view"
|
|
1402
1436
|
})]
|
|
1403
|
-
})
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1437
|
+
})]
|
|
1438
|
+
}), t ? /* @__PURE__ */ m("span", {
|
|
1439
|
+
className: "badge text-bg-secondary text-wrap text-start",
|
|
1440
|
+
title: "Exportação sempre ignora esta tabela",
|
|
1441
|
+
children: [/* @__PURE__ */ p("i", {
|
|
1442
|
+
className: "bi bi-shield-lock me-1",
|
|
1443
|
+
"aria-hidden": !0
|
|
1444
|
+
}), "excluída por segurança"]
|
|
1445
|
+
}) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ m("div", {
|
|
1446
|
+
className: "d-flex align-items-center justify-content-between gap-2",
|
|
1447
|
+
children: [/* @__PURE__ */ m("button", {
|
|
1413
1448
|
type: "button",
|
|
1414
|
-
className: "btn btn-sm btn-outline-secondary
|
|
1415
|
-
onClick:
|
|
1449
|
+
className: "btn btn-sm btn-outline-secondary",
|
|
1450
|
+
onClick: s,
|
|
1416
1451
|
"aria-expanded": r,
|
|
1417
1452
|
children: [/* @__PURE__ */ p("i", {
|
|
1418
1453
|
className: `bi ${r ? "bi-chevron-up" : "bi-chevron-down"} me-1`,
|
|
1419
1454
|
"aria-hidden": !0
|
|
1420
|
-
}), r ? "Ocultar" : "Colunas"]
|
|
1421
|
-
})
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
})
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1455
|
+
}), r ? "Ocultar colunas" : "Colunas"]
|
|
1456
|
+
}), i.length > 0 && /* @__PURE__ */ m("span", {
|
|
1457
|
+
className: "badge text-bg-warning",
|
|
1458
|
+
title: "Conteúdo desta(s) coluna(s) será nulificado na exportação",
|
|
1459
|
+
children: [
|
|
1460
|
+
i.length,
|
|
1461
|
+
" omitida",
|
|
1462
|
+
i.length > 1 ? "s" : ""
|
|
1463
|
+
]
|
|
1464
|
+
})]
|
|
1465
|
+
}), r && /* @__PURE__ */ m("div", {
|
|
1466
|
+
className: "mt-1 pt-2 border-top",
|
|
1467
|
+
style: {
|
|
1468
|
+
maxHeight: 210,
|
|
1469
|
+
overflowY: "auto"
|
|
1470
|
+
},
|
|
1471
|
+
children: [
|
|
1472
|
+
a?.isLoading && /* @__PURE__ */ p("small", {
|
|
1473
|
+
className: "text-muted",
|
|
1474
|
+
children: "Carregando colunas..."
|
|
1475
|
+
}),
|
|
1476
|
+
a?.isError && /* @__PURE__ */ m("small", {
|
|
1477
|
+
className: "text-danger",
|
|
1478
|
+
children: ["Erro: ", G(a.error)]
|
|
1479
|
+
}),
|
|
1480
|
+
a?.data && /* @__PURE__ */ m(f, { children: [a.data.columns.map((e) => /* @__PURE__ */ m("div", {
|
|
1481
|
+
className: "d-flex align-items-center gap-2 py-1",
|
|
1482
|
+
title: e.dataType,
|
|
1483
|
+
children: [
|
|
1484
|
+
/* @__PURE__ */ p("input", {
|
|
1485
|
+
className: "form-check-input mt-0",
|
|
1486
|
+
type: "checkbox",
|
|
1487
|
+
title: "Omitir esta coluna (conteúdo nulificado na exportação)",
|
|
1488
|
+
checked: i.includes(e.name),
|
|
1489
|
+
onChange: () => c(e.name)
|
|
1490
|
+
}),
|
|
1450
1491
|
/* @__PURE__ */ p("span", {
|
|
1451
|
-
className: "font-monospace",
|
|
1492
|
+
className: "font-monospace small text-truncate flex-grow-1",
|
|
1493
|
+
style: { minWidth: 0 },
|
|
1452
1494
|
children: e.name
|
|
1453
1495
|
}),
|
|
1454
1496
|
e.primaryKey && /* @__PURE__ */ p("span", {
|
|
1455
|
-
className: "badge text-bg-warning
|
|
1497
|
+
className: "badge text-bg-warning",
|
|
1498
|
+
style: { fontSize: "0.6rem" },
|
|
1456
1499
|
children: "PK"
|
|
1457
1500
|
}),
|
|
1458
1501
|
e.generated && /* @__PURE__ */ p("span", {
|
|
1459
|
-
className: "badge text-bg-info
|
|
1502
|
+
className: "badge text-bg-info",
|
|
1503
|
+
style: { fontSize: "0.6rem" },
|
|
1460
1504
|
children: "auto"
|
|
1505
|
+
}),
|
|
1506
|
+
/* @__PURE__ */ p("span", {
|
|
1507
|
+
className: "small text-body-secondary text-truncate",
|
|
1508
|
+
style: { maxWidth: 80 },
|
|
1509
|
+
children: e.dataType
|
|
1461
1510
|
})
|
|
1462
|
-
]
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
})
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
})] })
|
|
1479
|
-
]
|
|
1480
|
-
})]
|
|
1511
|
+
]
|
|
1512
|
+
}, e.name)), a.data.relationships.length > 0 && /* @__PURE__ */ m("div", {
|
|
1513
|
+
className: "small text-body-secondary mt-2 text-truncate",
|
|
1514
|
+
title: a.data.relationships.map((e) => e.summary).join(" • "),
|
|
1515
|
+
children: [
|
|
1516
|
+
/* @__PURE__ */ p("i", {
|
|
1517
|
+
className: "bi bi-diagram-3 me-1",
|
|
1518
|
+
"aria-hidden": !0
|
|
1519
|
+
}),
|
|
1520
|
+
a.data.relationships.length,
|
|
1521
|
+
" relação(ões)"
|
|
1522
|
+
]
|
|
1523
|
+
})] })
|
|
1524
|
+
]
|
|
1525
|
+
})] })]
|
|
1526
|
+
})
|
|
1481
1527
|
});
|
|
1482
1528
|
}
|
|
1483
1529
|
function te(e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v1ct0rbr/minivault-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Módulo independente de gerenciamento de backups (minivault). Consumível como pacote npm em qualquer app React. Cliente do minivault REST API (acesso tipicamente via proxy autenticado).",
|
|
5
5
|
"author": "Victor Queiroga (https://www.linkedin.com/in/victor-queiroga)",
|
|
6
6
|
"license": "MIT",
|