@plutonhq/core-frontend 0.1.13 → 0.1.14

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