@plutonhq/core-frontend 0.1.23 → 0.1.25

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.
Files changed (143) hide show
  1. package/dist-lib/@types/index.js +4 -1
  2. package/dist-lib/@types/index.js.map +1 -1
  3. package/dist-lib/@types/settings.d.ts +14 -0
  4. package/dist-lib/@types/settings.d.ts.map +1 -1
  5. package/dist-lib/@types/settings.js +34 -0
  6. package/dist-lib/@types/settings.js.map +1 -0
  7. package/dist-lib/components/Plan/Backups/Backups.d.ts.map +1 -1
  8. package/dist-lib/components/Plan/Backups/Backups.js +189 -159
  9. package/dist-lib/components/Plan/Backups/Backups.js.map +1 -1
  10. package/dist-lib/components/Plan/PlanSettings/PlanNotificationSettings.d.ts.map +1 -1
  11. package/dist-lib/components/Plan/PlanSettings/PlanNotificationSettings.js +148 -90
  12. package/dist-lib/components/Plan/PlanSettings/PlanNotificationSettings.js.map +1 -1
  13. package/dist-lib/components/Plan/SnapshotViewer/SnapshotViewer.d.ts +32 -0
  14. package/dist-lib/components/Plan/SnapshotViewer/SnapshotViewer.d.ts.map +1 -0
  15. package/dist-lib/components/Plan/SnapshotViewer/SnapshotViewer.js +252 -0
  16. package/dist-lib/components/Plan/SnapshotViewer/SnapshotViewer.js.map +1 -0
  17. package/dist-lib/components/Plan/SnapshotViewer/SnapshotViewerFile.d.ts +23 -0
  18. package/dist-lib/components/Plan/SnapshotViewer/SnapshotViewerFile.d.ts.map +1 -0
  19. package/dist-lib/components/Plan/SnapshotViewer/SnapshotViewerFile.js +72 -0
  20. package/dist-lib/components/Plan/SnapshotViewer/SnapshotViewerFile.js.map +1 -0
  21. package/dist-lib/components/Restore/RestoreFileSelector/RestoreFileSelector.d.ts.map +1 -1
  22. package/dist-lib/components/Restore/RestoreFileSelector/RestoreFileSelector.js +188 -198
  23. package/dist-lib/components/Restore/RestoreFileSelector/RestoreFileSelector.js.map +1 -1
  24. package/dist-lib/components/Restore/RestoreFileSelector/RestoreFileSelector.module.scss.js +20 -64
  25. package/dist-lib/components/Restore/RestoreFileSelector/RestoreFileSelector.module.scss.js.map +1 -1
  26. package/dist-lib/components/Restore/RestoredFileBrowser/RestoredFileBrowser.d.ts.map +1 -1
  27. package/dist-lib/components/Restore/RestoredFileBrowser/RestoredFileBrowser.js +125 -159
  28. package/dist-lib/components/Restore/RestoredFileBrowser/RestoredFileBrowser.js.map +1 -1
  29. package/dist-lib/components/Settings/IntegrationSettings/IntegrationSettings.d.ts.map +1 -1
  30. package/dist-lib/components/Settings/IntegrationSettings/IntegrationSettings.js +52 -47
  31. package/dist-lib/components/Settings/IntegrationSettings/IntegrationSettings.js.map +1 -1
  32. package/dist-lib/components/Settings/IntegrationSettings/IntegrationSettings.module.scss.js +12 -6
  33. package/dist-lib/components/Settings/IntegrationSettings/IntegrationSettings.module.scss.js.map +1 -1
  34. package/dist-lib/components/Settings/IntegrationSettings/NtfySettings.d.ts +9 -0
  35. package/dist-lib/components/Settings/IntegrationSettings/NtfySettings.d.ts.map +1 -0
  36. package/dist-lib/components/Settings/IntegrationSettings/NtfySettings.js +79 -0
  37. package/dist-lib/components/Settings/IntegrationSettings/NtfySettings.js.map +1 -0
  38. package/dist-lib/components/Settings/IntegrationSettings/SMTPSettings.d.ts +4 -3
  39. package/dist-lib/components/Settings/IntegrationSettings/SMTPSettings.d.ts.map +1 -1
  40. package/dist-lib/components/Settings/IntegrationSettings/SMTPSettings.js +37 -35
  41. package/dist-lib/components/Settings/IntegrationSettings/SMTPSettings.js.map +1 -1
  42. package/dist-lib/components/Settings/IntegrationSettings/ValidateEmailIntegration.d.ts +10 -0
  43. package/dist-lib/components/Settings/IntegrationSettings/ValidateEmailIntegration.d.ts.map +1 -0
  44. package/dist-lib/components/Settings/IntegrationSettings/ValidateEmailIntegration.js +49 -0
  45. package/dist-lib/components/Settings/IntegrationSettings/ValidateEmailIntegration.js.map +1 -0
  46. package/dist-lib/components/Storage/EditStorage/EditStorage.js +10 -10
  47. package/dist-lib/components/Storage/EditStorage/EditStorage.js.map +1 -1
  48. package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowser.module.scss.js +74 -0
  49. package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowser.module.scss.js.map +1 -0
  50. package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserDirectories.d.ts +17 -0
  51. package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserDirectories.d.ts.map +1 -0
  52. package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserDirectories.js +57 -0
  53. package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserDirectories.js.map +1 -0
  54. package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserFileList.d.ts +18 -0
  55. package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserFileList.d.ts.map +1 -0
  56. package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserFileList.js +24 -0
  57. package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserFileList.js.map +1 -0
  58. package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserFileRow.d.ts +18 -0
  59. package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserFileRow.d.ts.map +1 -0
  60. package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserFileRow.js +37 -0
  61. package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserFileRow.js.map +1 -0
  62. package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserGoUpRow.d.ts +9 -0
  63. package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserGoUpRow.d.ts.map +1 -0
  64. package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserGoUpRow.js +15 -0
  65. package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserGoUpRow.js.map +1 -0
  66. package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserToolbar.d.ts +11 -0
  67. package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserToolbar.d.ts.map +1 -0
  68. package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserToolbar.js +18 -0
  69. package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserToolbar.js.map +1 -0
  70. package/dist-lib/components/common/SnapshotBrowser/hooks/useSnapshotDatabase.d.ts +12 -0
  71. package/dist-lib/components/common/SnapshotBrowser/hooks/useSnapshotDatabase.d.ts.map +1 -0
  72. package/dist-lib/components/common/SnapshotBrowser/hooks/useSnapshotDatabase.js +70 -0
  73. package/dist-lib/components/common/SnapshotBrowser/hooks/useSnapshotDatabase.js.map +1 -0
  74. package/dist-lib/components/common/SnapshotBrowser/hooks/useSnapshotNavigation.d.ts +22 -0
  75. package/dist-lib/components/common/SnapshotBrowser/hooks/useSnapshotNavigation.d.ts.map +1 -0
  76. package/dist-lib/components/common/SnapshotBrowser/hooks/useSnapshotNavigation.js +79 -0
  77. package/dist-lib/components/common/SnapshotBrowser/hooks/useSnapshotNavigation.js.map +1 -0
  78. package/dist-lib/components/common/SnapshotBrowser/hooks/useSnapshotSort.d.ts +6 -0
  79. package/dist-lib/components/common/SnapshotBrowser/hooks/useSnapshotSort.d.ts.map +1 -0
  80. package/dist-lib/components/common/SnapshotBrowser/hooks/useSnapshotSort.js +18 -0
  81. package/dist-lib/components/common/SnapshotBrowser/hooks/useSnapshotSort.js.map +1 -0
  82. package/dist-lib/components/common/SnapshotBrowser/index.d.ts +11 -0
  83. package/dist-lib/components/common/SnapshotBrowser/index.d.ts.map +1 -0
  84. package/dist-lib/components/index.d.ts +12 -0
  85. package/dist-lib/components/index.d.ts.map +1 -1
  86. package/dist-lib/components.js +152 -128
  87. package/dist-lib/components.js.map +1 -1
  88. package/dist-lib/hooks/usePlanSingleActions.d.ts.map +1 -1
  89. package/dist-lib/hooks/usePlanSingleActions.js +21 -21
  90. package/dist-lib/hooks/usePlanSingleActions.js.map +1 -1
  91. package/dist-lib/services/backups.d.ts +4 -0
  92. package/dist-lib/services/backups.d.ts.map +1 -1
  93. package/dist-lib/services/backups.js +34 -25
  94. package/dist-lib/services/backups.js.map +1 -1
  95. package/dist-lib/services/settings.d.ts +3 -2
  96. package/dist-lib/services/settings.d.ts.map +1 -1
  97. package/dist-lib/services/settings.js +0 -1
  98. package/dist-lib/services/settings.js.map +1 -1
  99. package/dist-lib/services.js +113 -112
  100. package/dist-lib/styles/core-frontend.css +1 -1
  101. package/dist-lib/utils/index.d.ts +1 -0
  102. package/dist-lib/utils/index.d.ts.map +1 -1
  103. package/dist-lib/utils/snapshotDatabase.d.ts +16 -0
  104. package/dist-lib/utils/snapshotDatabase.d.ts.map +1 -0
  105. package/dist-lib/utils/snapshotDatabase.js +105 -0
  106. package/dist-lib/utils/snapshotDatabase.js.map +1 -0
  107. package/dist-lib/utils.js +24 -22
  108. package/dist-lib/utils.js.map +1 -1
  109. package/package.json +1 -1
  110. package/src/@types/settings.ts +43 -0
  111. package/src/components/Plan/Backups/Backups.tsx +40 -1
  112. package/src/components/Plan/PlanSettings/PlanNotificationSettings.tsx +65 -0
  113. package/src/components/Plan/SnapshotViewer/SnapshotViewer.tsx +344 -0
  114. package/src/components/Plan/SnapshotViewer/SnapshotViewerFile.tsx +89 -0
  115. package/src/components/Restore/RestoreFileSelector/RestoreFileSelector.tsx +82 -145
  116. package/src/components/Restore/RestoredFileBrowser/RestoredFileBrowser.tsx +71 -156
  117. package/src/components/Settings/IntegrationSettings/IntegrationSettings.module.scss +16 -0
  118. package/src/components/Settings/IntegrationSettings/IntegrationSettings.tsx +45 -42
  119. package/src/components/Settings/IntegrationSettings/NtfySettings.tsx +106 -0
  120. package/src/components/Settings/IntegrationSettings/SMTPSettings.tsx +28 -19
  121. package/src/components/Settings/IntegrationSettings/ValidateEmailIntegration.tsx +58 -0
  122. package/src/components/Storage/EditStorage/EditStorage.tsx +1 -1
  123. package/src/components/common/SnapshotBrowser/SnapshotBrowser.module.scss +376 -0
  124. package/src/components/common/SnapshotBrowser/SnapshotBrowserDirectories.tsx +84 -0
  125. package/src/components/common/SnapshotBrowser/SnapshotBrowserFileList.tsx +52 -0
  126. package/src/components/common/SnapshotBrowser/SnapshotBrowserFileRow.tsx +44 -0
  127. package/src/components/common/SnapshotBrowser/SnapshotBrowserGoUpRow.tsx +22 -0
  128. package/src/components/common/SnapshotBrowser/SnapshotBrowserToolbar.tsx +29 -0
  129. package/src/components/common/SnapshotBrowser/hooks/useSnapshotDatabase.ts +130 -0
  130. package/src/components/common/SnapshotBrowser/hooks/useSnapshotNavigation.ts +154 -0
  131. package/src/components/common/SnapshotBrowser/hooks/useSnapshotSort.ts +24 -0
  132. package/src/components/common/SnapshotBrowser/index.ts +13 -0
  133. package/src/components/index.ts +15 -0
  134. package/src/hooks/usePlanSingleActions.tsx +5 -3
  135. package/src/services/backups.ts +12 -0
  136. package/src/services/settings.ts +2 -2
  137. package/src/utils/index.ts +1 -0
  138. package/src/utils/snapshotDatabase.ts +201 -0
  139. /package/dist-lib/providers/{azureBlob.png → azureblob.png} +0 -0
  140. /package/dist-lib/providers/{azureFiles.png → azurefiles.png} +0 -0
  141. /package/dist-lib/providers/{files.png → filescom.png} +0 -0
  142. /package/dist-lib/providers/{oracle.png → oracleobjectstorage.png} +0 -0
  143. /package/dist-lib/providers/{proton.png → protondrive.png} +0 -0
@@ -1,112 +1,115 @@
1
- import { jsxs as l, jsx as e, Fragment as ie } from "react/jsx-runtime";
2
- import { useState as h } from "react";
3
- import { toast as f } from "react-toastify";
4
- import { formatDuration as ae, formatBytes as le, formatNumberToK as se, timeAgo as V, formatDateTime as F } from "../../../utils/helpers.js";
5
- import s from "../../common/Icon/Icon.js";
6
- import o from "./Backups.module.scss.js";
7
- import j from "../../common/ActionModal/ActionModal.js";
8
- import { useDeleteBackup as de, useUpdateBackup as re, useDownloadBackup as ne, useCancelBackupDownload as ce, useGetBackupDownload as me } from "../../../services/backups.js";
9
- import { useQueryClient as pe } from "@tanstack/react-query";
10
- import ue from "../../Restore/RestoreWizard/RestoreWizard.js";
11
- import he from "../../common/StatusLabel/StatusLabel.js";
12
- import fe from "../BackupEvents/BackupEvents.js";
13
- import W from "../../common/form/Input/Input.js";
14
- import ve from "../Mirrors/MirrorStatusBadge.js";
15
- import ke from "../Mirrors/MirrorStorageSelectorModal.js";
16
- const we = ({ download: a, downloadBackup: B }) => {
1
+ import { jsxs as s, jsx as e, Fragment as de } from "react/jsx-runtime";
2
+ import { useState as m } from "react";
3
+ import { toast as p } from "react-toastify";
4
+ import { formatDuration as ne, formatBytes as ce, formatNumberToK as me, timeAgo as J, formatDateTime as V } from "../../../utils/helpers.js";
5
+ import r from "../../common/Icon/Icon.js";
6
+ import t from "./Backups.module.scss.js";
7
+ import X from "../../common/ActionModal/ActionModal.js";
8
+ import { useDeleteBackup as pe, useUpdateBackup as ue, useDownloadBackup as he, useCancelBackupDownload as fe, useGetBackupDownload as ve, useBrowseSnapshot as we } from "../../../services/backups.js";
9
+ import { useQueryClient as be } from "@tanstack/react-query";
10
+ import ke from "../../Restore/RestoreWizard/RestoreWizard.js";
11
+ import ye from "../../common/StatusLabel/StatusLabel.js";
12
+ import De from "../BackupEvents/BackupEvents.js";
13
+ import Z from "../../common/form/Input/Input.js";
14
+ import Te from "../Mirrors/MirrorStatusBadge.js";
15
+ import Be from "../Mirrors/MirrorStorageSelectorModal.js";
16
+ import Ne from "../../common/SidePanel/SidePanel.js";
17
+ import ge from "../SnapshotViewer/SnapshotViewer.js";
18
+ const $e = ({ download: a, downloadBackup: M }) => {
17
19
  if ((a == null ? void 0 : a.status) === "started")
18
20
  return /* @__PURE__ */ e(
19
21
  "span",
20
22
  {
21
- className: o.downloadLabel,
23
+ className: t.downloadLabel,
22
24
  "data-tooltip-id": "htmlToolTip",
23
25
  "data-tooltip-place": "top",
24
26
  "data-tooltip-html": "<div>Generating Download...</div>",
25
- children: /* @__PURE__ */ e(s, { type: "downloading", size: 14 })
27
+ children: /* @__PURE__ */ e(r, { type: "downloading", size: 14 })
26
28
  }
27
29
  );
28
30
  if ((a == null ? void 0 : a.status) === "failed")
29
31
  return /* @__PURE__ */ e(
30
32
  "span",
31
33
  {
32
- className: `${o.downloadLabelFailed} ${o.downloadLabel}`,
34
+ className: `${t.downloadLabelFailed} ${t.downloadLabel}`,
33
35
  "data-tooltip-id": "htmlToolTip",
34
36
  "data-tooltip-place": "top",
35
37
  "data-tooltip-html": `<div><div>Download Generation Failed!</div>${a.error ? `<div>${a.error}<div>` : ""}</div>`,
36
- children: /* @__PURE__ */ e(s, { type: "error", size: 12 })
38
+ children: /* @__PURE__ */ e(r, { type: "error", size: 12 })
37
39
  }
38
40
  );
39
41
  if ((a == null ? void 0 : a.status) === "complete") {
40
42
  let n;
41
43
  if (a != null && a.ended) {
42
- const N = a.ended * 1e3 + 1440 * 60 * 1e3, d = Date.now();
43
- n = Math.max(0, Math.floor((N - d) / (3600 * 1e3)));
44
+ const C = a.ended * 1e3 + 1440 * 60 * 1e3, l = Date.now();
45
+ n = Math.max(0, Math.floor((C - l) / (3600 * 1e3)));
44
46
  }
45
47
  return n ? /* @__PURE__ */ e(
46
48
  "span",
47
49
  {
48
- className: `${o.downloadLabelDone} ${o.downloadLabel}`,
49
- onClick: B,
50
+ className: `${t.downloadLabelDone} ${t.downloadLabel}`,
51
+ onClick: M,
50
52
  "data-tooltip-id": "htmlToolTip",
51
53
  "data-tooltip-place": "top",
52
54
  "data-tooltip-html": `<div><div>Download Generated. Click to Download. ${n ? `Valid for the next ${n} hours.` : "⚠ Download Expired!"} </div>`,
53
- children: /* @__PURE__ */ e(s, { type: "download", size: 12 })
55
+ children: /* @__PURE__ */ e(r, { type: "download", size: 12 })
54
56
  }
55
57
  ) : null;
56
58
  } else
57
59
  return;
58
- }, Pe = ({
60
+ }, Ke = ({
59
61
  planId: a,
60
- method: B,
62
+ method: M,
61
63
  backups: n = [],
62
- sourceId: U,
63
- sourceType: N,
64
- replicationSettings: d,
65
- storage: L,
66
- deviceId: Y
64
+ sourceId: q,
65
+ sourceType: C,
66
+ replicationSettings: l,
67
+ storage: z,
68
+ deviceId: _
67
69
  // snapLimit,
68
70
  }) => {
69
- const [v, D] = h(!1), [$, M] = h(!1), [k, G] = h(!1), [q, H] = h(!1), [c, w] = h(!1), [C, E] = h(!1), I = pe(), z = de(), S = re(), R = ne(), A = ce(), J = me(), m = B === "sync";
71
+ var j;
72
+ const [v, w] = m(!1), [S, E] = m(!1), [b, H] = m(!1), [I, K] = m(!1), [D, A] = m(!1), [u, k] = m(!1), [P, R] = m(!1), O = be(), F = pe(), x = ue(), U = he(), G = fe(), ee = ve(), L = we(), c = M === "sync", oe = (j = L.data) == null ? void 0 : j.result;
70
73
  console.log("backups :", n);
71
- const X = (t) => {
72
- console.log("remove :", t.id), z.mutate(t.id, {
74
+ const te = (o) => {
75
+ console.log("remove :", o.id), F.mutate(o.id, {
73
76
  onError: () => {
74
- f.error(`Failed to Remove "backup-${t.id}"`);
77
+ p.error(`Failed to Remove "backup-${o.id}"`);
75
78
  },
76
79
  onSuccess: () => {
77
- I.invalidateQueries({ queryKey: ["plan", a] }), f.success(`Backup "backup-${t.id}" Removed Successfully.`), M(!1);
80
+ O.invalidateQueries({ queryKey: ["plan", a] }), p.success(`Backup "backup-${o.id}" Removed Successfully.`), E(!1);
78
81
  }
79
82
  });
80
- }, Z = (t) => {
83
+ }, ie = (o) => {
81
84
  const i = {
82
- title: t.title,
83
- description: t.description
85
+ title: o.title,
86
+ description: o.description
84
87
  };
85
- console.log("update :", t.id, i), !(!i.title && !i.description) && S.mutate(
86
- { backupId: t.id, updatePayload: i },
88
+ console.log("update :", o.id, i), !(!i.title && !i.description) && x.mutate(
89
+ { backupId: o.id, updatePayload: i },
87
90
  {
88
91
  onError: () => {
89
- f.error(`Failed to Update "backup-${t.id}"`);
92
+ p.error(`Failed to Update "backup-${o.id}"`);
90
93
  },
91
94
  onSuccess: () => {
92
- I.invalidateQueries({ queryKey: ["plan", a] }), f.success(`Backup "backup-${t.id}" Updated Successfully.`), w(!1);
95
+ O.invalidateQueries({ queryKey: ["plan", a] }), p.success(`Backup "backup-${o.id}" Updated Successfully.`), k(!1);
93
96
  }
94
97
  }
95
98
  );
96
- }, _ = (t) => {
97
- d != null && d.enabled && t.mirrors && t.mirrors.some((i) => i.status === "completed") ? E(t) : K(t.id);
98
- }, K = (t, i) => {
99
- f.promise(R.mutateAsync({ backupId: t, planId: a, replicationId: i }), {
99
+ }, ae = (o) => {
100
+ l != null && l.enabled && o.mirrors && o.mirrors.some((i) => i.status === "completed") ? R(o) : Q(o.id);
101
+ }, Q = (o, i) => {
102
+ p.promise(U.mutateAsync({ backupId: o, planId: a, replicationId: i }), {
100
103
  pending: "Sending Download Request...",
101
104
  success: "Generating Download. This might take a while..",
102
105
  error: {
103
- render({ data: p }) {
104
- return `Failed to Generate Download. ${(p == null ? void 0 : p.message) || "Unknown Error."}`;
106
+ render({ data: h }) {
107
+ return `Failed to Generate Download. ${(h == null ? void 0 : h.message) || "Unknown Error."}`;
105
108
  }
106
109
  }
107
110
  });
108
- }, ee = (t) => {
109
- f.promise(A.mutateAsync({ backupId: t, planId: a }), {
111
+ }, se = (o) => {
112
+ p.promise(G.mutateAsync({ backupId: o, planId: a }), {
110
113
  pending: "Cancelling Download...",
111
114
  success: "Download Cancelled",
112
115
  error: {
@@ -116,10 +119,10 @@ const we = ({ download: a, downloadBackup: B }) => {
116
119
  }
117
120
  });
118
121
  };
119
- return /* @__PURE__ */ l("div", { className: o.backupsTable, children: [
120
- /* @__PURE__ */ l("div", { className: o.backupsTableHead, children: [
121
- /* @__PURE__ */ l("div", { children: [
122
- m ? "Sync" : "Backup",
122
+ return /* @__PURE__ */ s("div", { className: t.backupsTable, children: [
123
+ /* @__PURE__ */ s("div", { className: t.backupsTableHead, children: [
124
+ /* @__PURE__ */ s("div", { children: [
125
+ c ? "Sync" : "Backup",
123
126
  " ID"
124
127
  ] }),
125
128
  /* @__PURE__ */ e("div", { children: "Status" }),
@@ -129,132 +132,147 @@ const we = ({ download: a, downloadBackup: B }) => {
129
132
  /* @__PURE__ */ e("div", { children: "Date" }),
130
133
  /* @__PURE__ */ e("div", {})
131
134
  ] }),
132
- /* @__PURE__ */ l("div", { className: o.backupsTableContent, children: [
133
- n.filter((t) => !t.inProgress).map((t) => {
134
- const { id: i, title: p, description: O, started: y, ended: b, download: g, status: P, errorMsg: T, duration: Q, totalFiles: te, totalSize: oe, changes: u, active: x } = t, r = g && g.status === "started";
135
- return /* @__PURE__ */ l(
135
+ /* @__PURE__ */ s("div", { className: t.backupsTableContent, children: [
136
+ n.filter((o) => !o.inProgress).map((o) => {
137
+ const { id: i, title: h, description: W, started: T, ended: y, download: B, status: N, errorMsg: g, duration: Y, totalFiles: le, totalSize: re, changes: f, active: $ } = o, d = B && B.status === "started";
138
+ return /* @__PURE__ */ s(
136
139
  "div",
137
140
  {
138
- className: `${o.backupsTableRow} ${v && v === i ? o.backupsTableRowActive : ""}`,
141
+ className: `${t.backupsTableRow} ${v && v === i ? t.backupsTableRowActive : ""}`,
139
142
  children: [
140
- /* @__PURE__ */ l("div", { children: [
143
+ /* @__PURE__ */ s("div", { children: [
141
144
  /* @__PURE__ */ e(
142
145
  "span",
143
146
  {
144
- className: o.editIcon,
145
- onClick: () => w(t),
147
+ className: t.editIcon,
148
+ onClick: () => k(o),
146
149
  "data-tooltip-id": "htmlToolTip",
147
150
  "data-tooltip-html": "Edit Title & Description",
148
- children: /* @__PURE__ */ e(s, { type: "edit", size: 12 })
151
+ children: /* @__PURE__ */ e(r, { type: "edit", size: 12 })
149
152
  }
150
153
  ),
151
- /* @__PURE__ */ l("span", { className: o.backupTitle, onClick: () => !m && H(i), children: [
152
- /* @__PURE__ */ e(s, { type: m ? "sync" : "box", size: 14 }),
154
+ /* @__PURE__ */ s("span", { className: t.backupTitle, onClick: () => !c && K(i), children: [
155
+ /* @__PURE__ */ e(r, { type: c ? "sync" : "box", size: 14 }),
153
156
  " ",
154
- p || (m ? `sync-${i}` : `backup-${i}`),
157
+ h || (c ? `sync-${i}` : `backup-${i}`),
155
158
  " "
156
159
  ] }),
157
- O && /* @__PURE__ */ e("span", { className: o.backupDescription, "data-tooltip-id": "htmlToolTip", "data-tooltip-content": O, children: /* @__PURE__ */ e(s, { type: "note", size: 13 }) }),
158
- !m && x && /* @__PURE__ */ e("span", { className: o.activeBackup, "data-tooltip-id": "htmlToolTip", "data-tooltip-html": "Active Snapshot", children: /* @__PURE__ */ e(s, { type: "bolt", size: 14 }) }),
159
- (d == null ? void 0 : d.enabled) && t.mirrors && t.mirrors.length > 0 && /* @__PURE__ */ e(ve, { mirrors: t.mirrors, planId: a, backupId: i, replicationSettings: d }),
160
- g && /* @__PURE__ */ e(we, { download: g, downloadBackup: () => J.mutate(i) })
160
+ W && /* @__PURE__ */ e("span", { className: t.backupDescription, "data-tooltip-id": "htmlToolTip", "data-tooltip-content": W, children: /* @__PURE__ */ e(r, { type: "note", size: 13 }) }),
161
+ !c && $ && /* @__PURE__ */ e("span", { className: t.activeBackup, "data-tooltip-id": "htmlToolTip", "data-tooltip-html": "Active Snapshot", children: /* @__PURE__ */ e(r, { type: "bolt", size: 14 }) }),
162
+ (l == null ? void 0 : l.enabled) && o.mirrors && o.mirrors.length > 0 && /* @__PURE__ */ e(Te, { mirrors: o.mirrors, planId: a, backupId: i, replicationSettings: l }),
163
+ B && /* @__PURE__ */ e($e, { download: B, downloadBackup: () => ee.mutate(i) })
161
164
  ] }),
162
165
  /* @__PURE__ */ e(
163
166
  "div",
164
167
  {
165
- className: `${o.status} ${T ? o.statusHasError : ""}`,
168
+ className: `${t.status} ${g ? t.statusHasError : ""}`,
166
169
  "data-tooltip-id": "htmlToolTip",
167
- "data-tooltip-html": `<div><string>Error</string>: ${T}</div>`,
168
- "data-tooltip-hidden": !T,
169
- children: /* @__PURE__ */ e(he, { status: P, hasError: !!T })
170
+ "data-tooltip-html": `<div><string>Error</string>: ${g}</div>`,
171
+ "data-tooltip-hidden": !g,
172
+ children: /* @__PURE__ */ e(ye, { status: N, hasError: !!g })
170
173
  }
171
174
  ),
172
- /* @__PURE__ */ e("div", { title: Q + "s", children: ae(Q) }),
173
- /* @__PURE__ */ l(
175
+ /* @__PURE__ */ e("div", { title: Y + "s", children: ne(Y) }),
176
+ /* @__PURE__ */ s(
174
177
  "div",
175
178
  {
176
- className: o.changes,
179
+ className: t.changes,
177
180
  "data-tooltip-id": "htmlToolTip",
178
181
  "data-tooltip-html": `
179
- <div><b>New Items</b>: ${u.new}</div>
180
- <div><b>Modified Items</b>: ${u.modified}</div>
181
- <div><b>Deleted Items</b>: ${u.removed || 0}</div>
182
+ <div><b>New Items</b>: ${f.new}</div>
183
+ <div><b>Modified Items</b>: ${f.modified}</div>
184
+ <div><b>Deleted Items</b>: ${f.removed || 0}</div>
182
185
  `,
183
186
  children: [
184
- /* @__PURE__ */ l("span", { className: o.changesNew, children: [
185
- /* @__PURE__ */ e(s, { type: "file-new", size: 12 }),
187
+ /* @__PURE__ */ s("span", { className: t.changesNew, children: [
188
+ /* @__PURE__ */ e(r, { type: "file-new", size: 12 }),
186
189
  " ",
187
- u.new
190
+ f.new
188
191
  ] }),
189
192
  " ",
190
- /* @__PURE__ */ l("span", { className: o.changesModified, children: [
191
- /* @__PURE__ */ e(s, { type: "file-modified", size: 12 }),
193
+ /* @__PURE__ */ s("span", { className: t.changesModified, children: [
194
+ /* @__PURE__ */ e(r, { type: "file-modified", size: 12 }),
192
195
  " ",
193
- u.modified
196
+ f.modified
194
197
  ] }),
195
198
  " ",
196
- /* @__PURE__ */ l("span", { className: o.changesRemoved, children: [
197
- /* @__PURE__ */ e(s, { type: "file-removed", size: 12 }),
199
+ /* @__PURE__ */ s("span", { className: t.changesRemoved, children: [
200
+ /* @__PURE__ */ e(r, { type: "file-removed", size: 12 }),
198
201
  " ",
199
- u.removed || 0
202
+ f.removed || 0
200
203
  ] })
201
204
  ]
202
205
  }
203
206
  ),
204
- /* @__PURE__ */ e("div", { "data-tooltip-id": "htmlToolTip", "data-tooltip-html": `${se(te)} Files `, children: le(oe) }),
207
+ /* @__PURE__ */ e("div", { "data-tooltip-id": "htmlToolTip", "data-tooltip-html": `${me(le)} Files `, children: ce(re) }),
205
208
  /* @__PURE__ */ e(
206
209
  "div",
207
210
  {
208
211
  "data-tooltip-id": "htmlToolTip",
209
212
  "data-tooltip-html": `
210
- <div><b>Started</b>: ${F(y)}</div>
211
- <div><b>Ended</b>: ${b ? F(b) : ""}</div>
213
+ <div><b>Started</b>: ${V(T)}</div>
214
+ <div><b>Ended</b>: ${y ? V(y) : ""}</div>
212
215
  `,
213
- title: F(b || y),
214
- children: b ? V(new Date(b)) : V(y ? new Date(y) : /* @__PURE__ */ new Date())
216
+ title: V(y || T),
217
+ children: y ? J(new Date(y)) : J(T ? new Date(T) : /* @__PURE__ */ new Date())
215
218
  }
216
219
  ),
217
- /* @__PURE__ */ e("div", { className: o.snapOptsBtn, children: /* @__PURE__ */ e("button", { onClick: () => D(v && v === i ? !1 : i), children: /* @__PURE__ */ e(s, { type: "dots-vertical", size: 12 }) }) }),
218
- v === i && /* @__PURE__ */ l("div", { className: o.settings, children: [
219
- !m && P === "completed" && x && /* @__PURE__ */ l(
220
+ /* @__PURE__ */ e("div", { className: t.snapOptsBtn, children: /* @__PURE__ */ e("button", { onClick: () => w(v && v === i ? !1 : i), children: /* @__PURE__ */ e(r, { type: "dots-vertical", size: 12 }) }) }),
221
+ v === i && /* @__PURE__ */ s("div", { className: t.settings, children: [
222
+ !c && N === "completed" && $ && /* @__PURE__ */ s(
220
223
  "button",
221
224
  {
222
- className: R.isPending || A.isPending ? "notAllowed" : "",
223
- disabled: R.isPending || A.isPending,
225
+ className: U.isPending || G.isPending ? "notAllowed" : "",
226
+ disabled: U.isPending || G.isPending,
224
227
  onClick: () => {
225
- r ? ee(i) : _(t), D(!1);
228
+ d ? se(i) : ae(o), w(!1);
226
229
  },
227
230
  children: [
228
- /* @__PURE__ */ e(s, { type: r ? "close" : "download", size: 14 }),
231
+ /* @__PURE__ */ e(r, { type: d ? "close" : "download", size: 14 }),
229
232
  " ",
230
- r ? "Cancel Download" : "Download"
233
+ d ? "Cancel Download" : "Download"
231
234
  ]
232
235
  }
233
236
  ),
234
- P === "completed" && x && /* @__PURE__ */ l(
237
+ !c && N === "completed" && $ && /* @__PURE__ */ s(
235
238
  "button",
236
239
  {
237
- className: r ? "notAllowed" : "",
238
- disabled: r,
239
240
  onClick: () => {
240
- r || (G(t), D(!1));
241
+ p.promise(L.mutateAsync({ backupId: i }), {
242
+ pending: "Getting Snapshot Data...",
243
+ error: "Failed to Get Snapshot Data."
244
+ }), w(!1), A(o);
241
245
  },
242
246
  children: [
243
- /* @__PURE__ */ e(s, { type: "restore", size: 14 }),
247
+ /* @__PURE__ */ e(r, { type: "folders", size: 14 }),
248
+ " Browse"
249
+ ]
250
+ }
251
+ ),
252
+ N === "completed" && $ && /* @__PURE__ */ s(
253
+ "button",
254
+ {
255
+ className: d ? "notAllowed" : "",
256
+ disabled: d,
257
+ onClick: () => {
258
+ d || (H(o), w(!1));
259
+ },
260
+ children: [
261
+ /* @__PURE__ */ e(r, { type: "restore", size: 14 }),
244
262
  " Restore"
245
263
  ]
246
264
  }
247
265
  ),
248
- /* @__PURE__ */ l(
266
+ /* @__PURE__ */ s(
249
267
  "button",
250
268
  {
251
- className: r ? "notAllowed" : "",
252
- disabled: r,
269
+ className: d ? "notAllowed" : "",
270
+ disabled: d,
253
271
  onClick: () => {
254
- r || (M(t), D(!1));
272
+ d || (E(o), w(!1));
255
273
  },
256
274
  children: [
257
- /* @__PURE__ */ e(s, { type: "trash", size: 14 }),
275
+ /* @__PURE__ */ e(r, { type: "trash", size: 14 }),
258
276
  " Remove"
259
277
  ]
260
278
  }
@@ -265,105 +283,117 @@ const we = ({ download: a, downloadBackup: B }) => {
265
283
  i
266
284
  );
267
285
  }),
268
- n.length === 0 && /* @__PURE__ */ e("div", { className: o.noBackups, children: "Hasn't been backed up yet." })
286
+ n.length === 0 && /* @__PURE__ */ e("div", { className: t.noBackups, children: "Hasn't been backed up yet." })
269
287
  ] }),
270
- $ && /* @__PURE__ */ e(
271
- j,
288
+ S && /* @__PURE__ */ e(
289
+ X,
272
290
  {
273
291
  title: "Remove Backup",
274
- message: /* @__PURE__ */ l(ie, { children: [
292
+ message: /* @__PURE__ */ s(de, { children: [
275
293
  "Are you sure you want to remove the Backup ",
276
- /* @__PURE__ */ l("strong", { children: [
294
+ /* @__PURE__ */ s("strong", { children: [
277
295
  '"backup-',
278
- $.id,
296
+ S.id,
279
297
  '"'
280
298
  ] }),
281
299
  "?"
282
300
  ] }),
283
- closeModal: () => !z.isPending && M(!1),
301
+ closeModal: () => !F.isPending && E(!1),
284
302
  width: "400px",
285
303
  primaryAction: {
286
304
  title: "Yes, Remove Backup",
287
305
  type: "danger",
288
306
  icon: "trash",
289
- isPending: z.isPending,
290
- action: () => X($)
307
+ isPending: F.isPending,
308
+ action: () => te(S)
291
309
  }
292
310
  }
293
311
  ),
294
- k && /* @__PURE__ */ e(
295
- ue,
312
+ b && /* @__PURE__ */ e(
313
+ ke,
296
314
  {
297
- close: () => G(!1),
315
+ close: () => H(!1),
298
316
  planId: a,
299
- backupId: k.id,
300
- deviceId: Y,
301
- planStorage: L,
302
- mirrors: d != null && d.enabled && k.mirrors && k.mirrors.some((t) => t.status === "completed") ? k.mirrors : []
317
+ backupId: b.id,
318
+ deviceId: _,
319
+ planStorage: z,
320
+ mirrors: l != null && l.enabled && b.mirrors && b.mirrors.some((o) => o.status === "completed") ? b.mirrors : []
303
321
  }
304
322
  ),
305
- q && /* @__PURE__ */ e(
306
- fe,
323
+ I && /* @__PURE__ */ e(
324
+ De,
307
325
  {
308
- id: q,
326
+ id: I,
309
327
  planId: a,
310
- sourceId: U,
311
- sourceType: N,
312
- close: () => H(!1)
328
+ sourceId: q,
329
+ sourceType: C,
330
+ close: () => K(!1)
313
331
  }
314
332
  ),
315
- c && /* @__PURE__ */ e(
316
- j,
333
+ u && /* @__PURE__ */ e(
334
+ X,
317
335
  {
318
336
  title: "Edit Backup Title & Description",
319
- message: /* @__PURE__ */ l("div", { className: o.updateModalContent, children: [
320
- /* @__PURE__ */ e("div", { className: o.field, children: /* @__PURE__ */ e(
321
- W,
337
+ message: /* @__PURE__ */ s("div", { className: t.updateModalContent, children: [
338
+ /* @__PURE__ */ e("div", { className: t.field, children: /* @__PURE__ */ e(
339
+ Z,
322
340
  {
323
341
  label: "Title",
324
- fieldValue: c.title || "",
325
- onUpdate: (t) => w({ ...c, title: t }),
342
+ fieldValue: u.title || "",
343
+ onUpdate: (o) => k({ ...u, title: o }),
326
344
  placeholder: "Enter Backup Title",
327
345
  full: !0,
328
346
  inline: !1
329
347
  }
330
348
  ) }),
331
- /* @__PURE__ */ e("div", { className: o.field, children: /* @__PURE__ */ e(
332
- W,
349
+ /* @__PURE__ */ e("div", { className: t.field, children: /* @__PURE__ */ e(
350
+ Z,
333
351
  {
334
352
  label: "Description",
335
- fieldValue: c.description || "",
336
- onUpdate: (t) => w({ ...c, description: t }),
353
+ fieldValue: u.description || "",
354
+ onUpdate: (o) => k({ ...u, description: o }),
337
355
  placeholder: "Enter Backup Description",
338
356
  full: !0,
339
357
  inline: !1
340
358
  }
341
359
  ) })
342
360
  ] }),
343
- closeModal: () => !S.isPending && w(!1),
361
+ closeModal: () => !x.isPending && k(!1),
344
362
  width: "400px",
345
363
  primaryAction: {
346
364
  title: "Update Backup",
347
365
  type: "default",
348
- isPending: S.isPending,
349
- action: () => Z(c)
366
+ isPending: x.isPending,
367
+ action: () => ie(u)
350
368
  }
351
369
  }
352
370
  ),
353
- C && /* @__PURE__ */ e(
354
- ke,
371
+ P && /* @__PURE__ */ e(
372
+ Be,
355
373
  {
356
- mirrors: C.mirrors || [],
357
- primaryStorage: L,
358
- onSelect: (t) => {
359
- K(C.id, t), E(!1);
374
+ mirrors: P.mirrors || [],
375
+ primaryStorage: z,
376
+ onSelect: (o) => {
377
+ Q(P.id, o), R(!1);
360
378
  },
361
- onClose: () => E(!1)
379
+ onClose: () => R(!1)
380
+ }
381
+ ),
382
+ D && D.id && L.isSuccess && /* @__PURE__ */ e(Ne, { width: "100%", title: "Browse Snapshot", icon: /* @__PURE__ */ e(r, { type: "folders", size: 20 }), close: () => A(!1), children: /* @__PURE__ */ e(
383
+ ge,
384
+ {
385
+ files: oe || [],
386
+ backup: D,
387
+ planId: a,
388
+ isSync: c,
389
+ onClose: () => A(!1),
390
+ mirrors: l != null && l.enabled ? D.mirrors : void 0,
391
+ primaryStorage: l != null && l.enabled ? z : void 0
362
392
  }
363
- )
393
+ ) })
364
394
  ] });
365
395
  };
366
396
  export {
367
- Pe as default
397
+ Ke as default
368
398
  };
369
399
  //# sourceMappingURL=Backups.js.map