@plutonhq/core-frontend 0.1.24 → 0.1.26
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-lib/@types/backups.d.ts +1 -1
- package/dist-lib/@types/backups.d.ts.map +1 -1
- package/dist-lib/components/Plan/BackupEvents/BackupEvents.d.ts.map +1 -1
- package/dist-lib/components/Plan/BackupEvents/BackupEvents.js +27 -27
- package/dist-lib/components/Plan/BackupEvents/BackupEvents.js.map +1 -1
- package/dist-lib/components/Plan/Backups/Backups.d.ts.map +1 -1
- package/dist-lib/components/Plan/Backups/Backups.js +189 -159
- package/dist-lib/components/Plan/Backups/Backups.js.map +1 -1
- package/dist-lib/components/Plan/PlanPruneModal/PlanPruneModal.d.ts.map +1 -1
- package/dist-lib/components/Plan/PlanPruneModal/PlanPruneModal.js +62 -26
- package/dist-lib/components/Plan/PlanPruneModal/PlanPruneModal.js.map +1 -1
- package/dist-lib/components/Plan/PlanSettings/PlanPruneSettings.d.ts.map +1 -1
- package/dist-lib/components/Plan/PlanSettings/PlanPruneSettings.js +138 -62
- package/dist-lib/components/Plan/PlanSettings/PlanPruneSettings.js.map +1 -1
- package/dist-lib/components/Plan/PlanSettings/PlanSettings.module.scss.js +42 -42
- package/dist-lib/components/Plan/SnapshotViewer/SnapshotViewer.d.ts +32 -0
- package/dist-lib/components/Plan/SnapshotViewer/SnapshotViewer.d.ts.map +1 -0
- package/dist-lib/components/Plan/SnapshotViewer/SnapshotViewer.js +252 -0
- package/dist-lib/components/Plan/SnapshotViewer/SnapshotViewer.js.map +1 -0
- package/dist-lib/components/Plan/SnapshotViewer/SnapshotViewerFile.d.ts +23 -0
- package/dist-lib/components/Plan/SnapshotViewer/SnapshotViewerFile.d.ts.map +1 -0
- package/dist-lib/components/Plan/SnapshotViewer/SnapshotViewerFile.js +72 -0
- package/dist-lib/components/Plan/SnapshotViewer/SnapshotViewerFile.js.map +1 -0
- package/dist-lib/components/Restore/RestoreFileSelector/RestoreFileSelector.d.ts.map +1 -1
- package/dist-lib/components/Restore/RestoreFileSelector/RestoreFileSelector.js +188 -198
- package/dist-lib/components/Restore/RestoreFileSelector/RestoreFileSelector.js.map +1 -1
- package/dist-lib/components/Restore/RestoreFileSelector/RestoreFileSelector.module.scss.js +20 -64
- package/dist-lib/components/Restore/RestoreFileSelector/RestoreFileSelector.module.scss.js.map +1 -1
- package/dist-lib/components/Restore/RestoredFileBrowser/RestoredFileBrowser.d.ts.map +1 -1
- package/dist-lib/components/Restore/RestoredFileBrowser/RestoredFileBrowser.js +125 -159
- package/dist-lib/components/Restore/RestoredFileBrowser/RestoredFileBrowser.js.map +1 -1
- package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowser.module.scss.js +74 -0
- package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowser.module.scss.js.map +1 -0
- package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserDirectories.d.ts +17 -0
- package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserDirectories.d.ts.map +1 -0
- package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserDirectories.js +57 -0
- package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserDirectories.js.map +1 -0
- package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserFileList.d.ts +18 -0
- package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserFileList.d.ts.map +1 -0
- package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserFileList.js +24 -0
- package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserFileList.js.map +1 -0
- package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserFileRow.d.ts +18 -0
- package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserFileRow.d.ts.map +1 -0
- package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserFileRow.js +37 -0
- package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserFileRow.js.map +1 -0
- package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserGoUpRow.d.ts +9 -0
- package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserGoUpRow.d.ts.map +1 -0
- package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserGoUpRow.js +15 -0
- package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserGoUpRow.js.map +1 -0
- package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserToolbar.d.ts +11 -0
- package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserToolbar.d.ts.map +1 -0
- package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserToolbar.js +18 -0
- package/dist-lib/components/common/SnapshotBrowser/SnapshotBrowserToolbar.js.map +1 -0
- package/dist-lib/components/common/SnapshotBrowser/hooks/useSnapshotDatabase.d.ts +12 -0
- package/dist-lib/components/common/SnapshotBrowser/hooks/useSnapshotDatabase.d.ts.map +1 -0
- package/dist-lib/components/common/SnapshotBrowser/hooks/useSnapshotDatabase.js +70 -0
- package/dist-lib/components/common/SnapshotBrowser/hooks/useSnapshotDatabase.js.map +1 -0
- package/dist-lib/components/common/SnapshotBrowser/hooks/useSnapshotNavigation.d.ts +22 -0
- package/dist-lib/components/common/SnapshotBrowser/hooks/useSnapshotNavigation.d.ts.map +1 -0
- package/dist-lib/components/common/SnapshotBrowser/hooks/useSnapshotNavigation.js +79 -0
- package/dist-lib/components/common/SnapshotBrowser/hooks/useSnapshotNavigation.js.map +1 -0
- package/dist-lib/components/common/SnapshotBrowser/hooks/useSnapshotSort.d.ts +6 -0
- package/dist-lib/components/common/SnapshotBrowser/hooks/useSnapshotSort.d.ts.map +1 -0
- package/dist-lib/components/common/SnapshotBrowser/hooks/useSnapshotSort.js +18 -0
- package/dist-lib/components/common/SnapshotBrowser/hooks/useSnapshotSort.js.map +1 -0
- package/dist-lib/components/common/SnapshotBrowser/index.d.ts +11 -0
- package/dist-lib/components/common/SnapshotBrowser/index.d.ts.map +1 -0
- package/dist-lib/components/common/StatusLabel/StatusLabel.d.ts +1 -1
- package/dist-lib/components/common/StatusLabel/StatusLabel.d.ts.map +1 -1
- package/dist-lib/components/common/StatusLabel/StatusLabel.js +17 -12
- package/dist-lib/components/common/StatusLabel/StatusLabel.js.map +1 -1
- package/dist-lib/components/common/form/NumberInput/NumberInput.module.scss.js +4 -4
- package/dist-lib/components/index.d.ts +10 -0
- package/dist-lib/components/index.d.ts.map +1 -1
- package/dist-lib/components.js +152 -132
- package/dist-lib/components.js.map +1 -1
- package/dist-lib/hooks/usePlanSingleActions.d.ts.map +1 -1
- package/dist-lib/hooks/usePlanSingleActions.js +21 -21
- package/dist-lib/hooks/usePlanSingleActions.js.map +1 -1
- package/dist-lib/services/backups.d.ts +4 -0
- package/dist-lib/services/backups.d.ts.map +1 -1
- package/dist-lib/services/backups.js +34 -25
- package/dist-lib/services/backups.js.map +1 -1
- package/dist-lib/services.js +113 -112
- package/dist-lib/styles/core-frontend.css +1 -1
- package/dist-lib/utils/index.d.ts +1 -0
- package/dist-lib/utils/index.d.ts.map +1 -1
- package/dist-lib/utils/snapshotDatabase.d.ts +16 -0
- package/dist-lib/utils/snapshotDatabase.d.ts.map +1 -0
- package/dist-lib/utils/snapshotDatabase.js +105 -0
- package/dist-lib/utils/snapshotDatabase.js.map +1 -0
- package/dist-lib/utils.js +24 -22
- package/dist-lib/utils.js.map +1 -1
- package/package.json +1 -1
- package/src/@types/backups.ts +1 -1
- package/src/components/Plan/BackupEvents/BackupEvents.tsx +5 -3
- package/src/components/Plan/Backups/Backups.tsx +40 -1
- package/src/components/Plan/PlanPruneModal/PlanPruneModal.tsx +54 -11
- package/src/components/Plan/PlanSettings/PlanPruneSettings.tsx +145 -61
- package/src/components/Plan/PlanSettings/PlanSettings.module.scss +5 -0
- package/src/components/Plan/SnapshotViewer/SnapshotViewer.tsx +344 -0
- package/src/components/Plan/SnapshotViewer/SnapshotViewerFile.tsx +89 -0
- package/src/components/Restore/RestoreFileSelector/RestoreFileSelector.tsx +82 -145
- package/src/components/Restore/RestoredFileBrowser/RestoredFileBrowser.tsx +71 -156
- package/src/components/common/SnapshotBrowser/SnapshotBrowser.module.scss +376 -0
- package/src/components/common/SnapshotBrowser/SnapshotBrowserDirectories.tsx +84 -0
- package/src/components/common/SnapshotBrowser/SnapshotBrowserFileList.tsx +52 -0
- package/src/components/common/SnapshotBrowser/SnapshotBrowserFileRow.tsx +44 -0
- package/src/components/common/SnapshotBrowser/SnapshotBrowserGoUpRow.tsx +22 -0
- package/src/components/common/SnapshotBrowser/SnapshotBrowserToolbar.tsx +29 -0
- package/src/components/common/SnapshotBrowser/hooks/useSnapshotDatabase.ts +130 -0
- package/src/components/common/SnapshotBrowser/hooks/useSnapshotNavigation.ts +154 -0
- package/src/components/common/SnapshotBrowser/hooks/useSnapshotSort.ts +24 -0
- package/src/components/common/SnapshotBrowser/index.ts +13 -0
- package/src/components/common/StatusLabel/StatusLabel.tsx +7 -1
- package/src/components/common/form/NumberInput/NumberInput.module.scss +1 -0
- package/src/components/index.ts +13 -0
- package/src/hooks/usePlanSingleActions.tsx +5 -3
- package/src/services/backups.ts +12 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/snapshotDatabase.ts +201 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SnapshotViewerFile.js","sources":["../../../../src/components/Plan/SnapshotViewer/SnapshotViewerFile.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\r\nimport Icon from '../../common/Icon/Icon';\r\nimport FileIcon from '../../common/FileIcon/FileIcon';\r\nimport { formatBytes, formatDateTime, timeAgo } from '../../../utils/helpers';\r\nimport { FileItem } from '../../../@types/system';\r\nimport classes from '../../common/SnapshotBrowser/SnapshotBrowser.module.scss';\r\n\r\ninterface SnapshotViewerFileProps {\r\n style: React.CSSProperties;\r\n file: FileItem | { isGoUp: true; path: string; name: string; isDirectory: true };\r\n isSync?: boolean;\r\n gridColumns: string;\r\n onGoUp: () => void;\r\n onDirectoryClick: (path: string) => void;\r\n onRestore: (file: FileItem) => void;\r\n renderFileActions?: (file: FileItem, meta: { fileExtension: string; isDirectory: boolean }) => ReactNode;\r\n}\r\n\r\nconst SnapshotViewerFile = ({\r\n style,\r\n file,\r\n isSync,\r\n gridColumns,\r\n onGoUp,\r\n onDirectoryClick,\r\n onRestore,\r\n renderFileActions,\r\n}: SnapshotViewerFileProps) => {\r\n if (!file) return null;\r\n\r\n if ('isGoUp' in file && file.isGoUp) {\r\n return (\r\n <div\r\n style={{ ...style, gridTemplateColumns: gridColumns }}\r\n className={`${classes.snapshotFile} ${classes.fileIsDir} ${classes.goUpButton}`}\r\n onClick={onGoUp}\r\n >\r\n <div className={classes.fileName}>...</div>\r\n <div></div>\r\n <div></div>\r\n {!isSync && <div></div>}\r\n </div>\r\n );\r\n }\r\n\r\n const typedFile = file as FileItem;\r\n const fileName = typedFile.name || typedFile.path.split('/').pop() || '';\r\n const isDirectory = typedFile.isDirectory;\r\n const fileExtension = fileName.split('.').pop() || '';\r\n\r\n return (\r\n <div\r\n style={{ ...style, gridTemplateColumns: gridColumns }}\r\n className={`${classes.snapshotFile} ${isDirectory ? classes.fileIsDir : ''}`}\r\n onClick={() => {\r\n if (isDirectory) {\r\n onDirectoryClick(typedFile.path);\r\n }\r\n }}\r\n >\r\n <div className={classes.fileName}>\r\n {isDirectory ? <Icon type={'fm-directory'} size={16} /> : <FileIcon filename={fileName} />} {fileName}\r\n </div>\r\n <div className={classes.fileModifiedAt} title={formatDateTime(typedFile.modifiedAt)}>\r\n <i>{timeAgo(new Date(typedFile.modifiedAt))}</i>\r\n </div>\r\n <div className={classes.fileSize}>{!isDirectory ? formatBytes(typedFile.size || 0) : ''}</div>\r\n {!isSync && (\r\n <div className={classes.fileActions}>\r\n {renderFileActions?.(typedFile, { fileExtension, isDirectory })}\r\n <button\r\n data-tooltip-id=\"htmlToolTip\"\r\n data-tooltip-place=\"top\"\r\n data-tooltip-delay-show={500}\r\n data-tooltip-html=\"Restore\"\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n onRestore(typedFile);\r\n }}\r\n >\r\n <Icon type={'restore'} size={16} />\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nexport default SnapshotViewerFile;\r\n"],"names":["SnapshotViewerFile","style","file","isSync","gridColumns","onGoUp","onDirectoryClick","onRestore","renderFileActions","jsxs","classes","jsx","typedFile","fileName","isDirectory","fileExtension","Icon","FileIcon","formatDateTime","formatBytes","e"],"mappings":";;;;;AAkBA,MAAMA,IAAqB,CAAC;AAAA,EACzB,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC;AAAA,EACA,QAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,mBAAAC;AACH,MAA+B;AAC5B,MAAI,CAACN,EAAM,QAAO;AAElB,MAAI,YAAYA,KAAQA,EAAK;AAC1B,WACG,gBAAAO;AAAA,MAAC;AAAA,MAAA;AAAA,QACE,OAAO,EAAE,GAAGR,GAAO,qBAAqBG,EAAA;AAAA,QACxC,WAAW,GAAGM,EAAQ,YAAY,IAAIA,EAAQ,SAAS,IAAIA,EAAQ,UAAU;AAAA,QAC7E,SAASL;AAAA,QAET,UAAA;AAAA,UAAA,gBAAAM,EAAC,OAAA,EAAI,WAAWD,EAAQ,UAAU,UAAA,OAAG;AAAA,4BACpC,OAAA,EAAI;AAAA,4BACJ,OAAA,EAAI;AAAA,UACJ,CAACP,KAAU,gBAAAQ,EAAC,OAAA,CAAA,CAAI;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAK1B,QAAMC,IAAYV,GACZW,IAAWD,EAAU,QAAQA,EAAU,KAAK,MAAM,GAAG,EAAE,IAAA,KAAS,IAChEE,IAAcF,EAAU,aACxBG,IAAgBF,EAAS,MAAM,GAAG,EAAE,SAAS;AAEnD,SACG,gBAAAJ;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,OAAO,EAAE,GAAGR,GAAO,qBAAqBG,EAAA;AAAA,MACxC,WAAW,GAAGM,EAAQ,YAAY,IAAII,IAAcJ,EAAQ,YAAY,EAAE;AAAA,MAC1E,SAAS,MAAM;AACZ,QAAII,KACDR,EAAiBM,EAAU,IAAI;AAAA,MAErC;AAAA,MAEA,UAAA;AAAA,QAAA,gBAAAH,EAAC,OAAA,EAAI,WAAWC,EAAQ,UACpB,UAAA;AAAA,UAAAI,IAAc,gBAAAH,EAACK,GAAA,EAAK,MAAM,gBAAgB,MAAM,IAAI,IAAK,gBAAAL,EAACM,GAAA,EAAS,UAAUJ,EAAA,CAAU;AAAA,UAAG;AAAA,UAAEA;AAAA,QAAA,GAChG;AAAA,0BACC,OAAA,EAAI,WAAWH,EAAQ,gBAAgB,OAAOQ,EAAeN,EAAU,UAAU,GAC/E,UAAA,gBAAAD,EAAC,KAAA,EAAG,YAAQ,IAAI,KAAKC,EAAU,UAAU,CAAC,GAAE,GAC/C;AAAA,QACA,gBAAAD,EAAC,OAAA,EAAI,WAAWD,EAAQ,UAAW,UAACI,IAAiD,KAAnCK,EAAYP,EAAU,QAAQ,CAAC,EAAI,CAAG;AAAA,QACvF,CAACT,KACC,gBAAAM,EAAC,OAAA,EAAI,WAAWC,EAAQ,aACpB,UAAA;AAAA,UAAAF,KAAA,gBAAAA,EAAoBI,GAAW,EAAE,eAAAG,GAAe,aAAAD,EAAA;AAAA,UACjD,gBAAAH;AAAA,YAAC;AAAA,YAAA;AAAA,cACE,mBAAgB;AAAA,cAChB,sBAAmB;AAAA,cACnB,2BAAyB;AAAA,cACzB,qBAAkB;AAAA,cAClB,SAAS,CAACS,MAAM;AACb,gBAAAA,EAAE,gBAAA,GACFb,EAAUK,CAAS;AAAA,cACtB;AAAA,cAEA,UAAA,gBAAAD,EAACK,GAAA,EAAK,MAAM,WAAW,MAAM,GAAA,CAAI;AAAA,YAAA;AAAA,UAAA;AAAA,QACpC,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIZ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RestoreFileSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/Restore/RestoreFileSelector/RestoreFileSelector.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RestoreFileSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/Restore/RestoreFileSelector/RestoreFileSelector.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAS3D,UAAU,wBAAwB;IAC/B,QAAQ,EAAE;QACP,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;QACtB,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;KACxB,CAAC;IACF,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,OAAO,CAAC;IACzD,QAAQ,EAAE,CAAC,QAAQ,EAAE,wBAAwB,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CACrE;AAMD,QAAA,MAAM,mBAAmB,GAAI,0FAA0F,wBAAwB,4CAua9I,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,268 +1,258 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsxs as n, jsx as l, Fragment as ne } from "react/jsx-runtime";
|
|
2
|
+
import { useState as P, useMemo as b, useEffect as le } from "react";
|
|
3
|
+
import I from "../../common/Icon/Icon.js";
|
|
4
|
+
import { calculateDirectorySizes as ae, formatNumberToK as T, formatBytes as A, sortFileItems as O, formatDateTime as de, isMobile as me } from "../../../utils/helpers.js";
|
|
5
|
+
import ue from "../../common/FileIcon/FileIcon.js";
|
|
6
|
+
import o from "./RestoreFileSelector.module.scss.js";
|
|
7
|
+
import { getPathSeparator as V, splitPath as v, getParentPath as M, normalizePath as g } from "../../../utils/restore.js";
|
|
8
|
+
import { useSnapshotNavigation as he } from "../../common/SnapshotBrowser/hooks/useSnapshotNavigation.js";
|
|
9
|
+
import S from "../../common/SnapshotBrowser/SnapshotBrowser.module.scss.js";
|
|
10
|
+
import fe from "../../common/SnapshotBrowser/SnapshotBrowserToolbar.js";
|
|
11
|
+
import pe from "../../common/SnapshotBrowser/SnapshotBrowserDirectories.js";
|
|
12
|
+
import Se from "../../common/SnapshotBrowser/SnapshotBrowserFileList.js";
|
|
13
|
+
import ye from "../../common/SnapshotBrowser/SnapshotBrowserGoUpRow.js";
|
|
14
|
+
const ge = me(), xe = ge ? 65 : 45, W = "1fr 180px minmax(80px, auto)", ke = ({ selected: L, files: a, isLoading: q, errorFetching: J, showChange: R, onSelect: Q, fileSelectCondition: D }) => {
|
|
15
|
+
const [B, X] = P(""), [m, Y] = P("name"), [p, G] = P("asc"), [d, Z] = P(() => ({
|
|
16
|
+
include: new Set(L.includes),
|
|
17
|
+
exclude: new Set(L.excludes)
|
|
13
18
|
}));
|
|
14
|
-
console.log("[RestoreFileSelector] files :",
|
|
15
|
-
const
|
|
19
|
+
console.log("[RestoreFileSelector] files :", a);
|
|
20
|
+
const ee = (e) => {
|
|
16
21
|
const r = [];
|
|
17
|
-
return
|
|
22
|
+
return a.forEach((t) => {
|
|
18
23
|
(t.path.startsWith(e + "/") || t.path.startsWith(e + "\\")) && r.push(t.path);
|
|
19
24
|
}), r;
|
|
20
|
-
},
|
|
25
|
+
}, N = (e) => d.exclude.has(e) || Array.from(d.exclude).some(
|
|
21
26
|
(s) => e.startsWith(s + "/") || e.startsWith(s + "\\")
|
|
22
|
-
) ? !1 :
|
|
27
|
+
) ? !1 : d.include.size === 0 || d.include.has(e) ? !0 : Array.from(d.include).some(
|
|
23
28
|
(s) => e.startsWith(s + "/") || e.startsWith(s + "\\")
|
|
24
|
-
),
|
|
29
|
+
), _ = (e) => Array.from(d.include).find((r) => e.startsWith(r + "/") || e.startsWith(r + "\\")) || null, [j, te] = P(() => {
|
|
25
30
|
const e = /* @__PURE__ */ new Set();
|
|
26
|
-
return
|
|
27
|
-
const t =
|
|
31
|
+
return a.forEach((r) => {
|
|
32
|
+
const t = V(r.path), s = v(r.path);
|
|
28
33
|
let i = "";
|
|
29
|
-
s.forEach((
|
|
30
|
-
i = i ? `${i}${t}${
|
|
34
|
+
s.forEach((c, h) => {
|
|
35
|
+
i = i ? `${i}${t}${c}` : c, h < 3 && e.add(i);
|
|
31
36
|
});
|
|
32
37
|
}), e;
|
|
33
|
-
}),
|
|
34
|
-
const e = {}, r =
|
|
35
|
-
return
|
|
38
|
+
}), x = b(() => {
|
|
39
|
+
const e = {}, r = ae(a);
|
|
40
|
+
return a.filter((t) => t.path.toLowerCase().includes(B.toLowerCase())).forEach((t) => {
|
|
36
41
|
let s = t;
|
|
37
|
-
const i = M(s.path),
|
|
38
|
-
s.isDirectory && (s.size = r[s.path] || 0), e[
|
|
42
|
+
const i = M(s.path), c = g(i) || "/";
|
|
43
|
+
s.isDirectory && (s.size = r[s.path] || 0), e[c] || (e[c] = []), e[c].push(s);
|
|
39
44
|
}), e;
|
|
40
|
-
}, [
|
|
41
|
-
console.log("fileSystem :",
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
45
|
+
}, [a, B]);
|
|
46
|
+
console.log("fileSystem :", x);
|
|
47
|
+
const y = b(() => a.filter((t) => t.isDirectory).map((t) => g(t.path)).sort((t, s) => {
|
|
48
|
+
const i = v(t), c = v(s), h = Math.min(i.length, c.length);
|
|
49
|
+
for (let f = 0; f < h; f++) {
|
|
50
|
+
const z = i[f].localeCompare(c[f]);
|
|
51
|
+
if (z !== 0)
|
|
52
|
+
return z;
|
|
53
|
+
}
|
|
54
|
+
return i.length - c.length;
|
|
55
|
+
}), [a]), { selectedFolder: u, setSelectedFolder: F, hasSubdirectories: se, isVisible: re, expandParentFolders: H, toggleFolder: ie } = he(
|
|
56
|
+
y,
|
|
57
|
+
j,
|
|
58
|
+
te,
|
|
59
|
+
{ splitPath: v, getPathSeparator: V, hasLeadingSeparator: !1 }
|
|
60
|
+
);
|
|
61
|
+
le(() => {
|
|
62
|
+
y.length > 0 && u === "" && F(y[0]);
|
|
63
|
+
}, [y, u, F]);
|
|
64
|
+
const C = b(() => {
|
|
54
65
|
let e = 0, r = 0;
|
|
55
|
-
const t =
|
|
66
|
+
const t = D ? a.filter((s) => D(s)) : a;
|
|
56
67
|
return t.forEach((s) => {
|
|
57
|
-
|
|
68
|
+
N(s.path) && (e++, s.isDirectory || (r += s.size));
|
|
58
69
|
}), {
|
|
59
70
|
selectedFiles: e,
|
|
60
71
|
totalFiles: t.length,
|
|
61
72
|
selectedBytes: r,
|
|
62
73
|
totalBytes: t.reduce((s, i) => s + (i.isDirectory ? 0 : i.size), 0)
|
|
63
74
|
};
|
|
64
|
-
}, [
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
u === e ? _(y === "asc" ? "desc" : "asc") : (X(e), _("asc"));
|
|
69
|
-
}, G = (e) => {
|
|
70
|
-
const r = new Set(z), t = I(e), s = g(e);
|
|
71
|
-
let i = "";
|
|
72
|
-
s.forEach((l) => {
|
|
73
|
-
i = i ? `${i}${t}${l}` : l, r.add(i);
|
|
74
|
-
}), j(r);
|
|
75
|
-
}, te = (e) => {
|
|
76
|
-
const r = new Set(z);
|
|
77
|
-
z.has(e) ? r.delete(e) : r.add(e), j(r);
|
|
78
|
-
}, se = (e) => {
|
|
79
|
-
const r = I(e), s = g(e).slice(0, -1);
|
|
80
|
-
let i = "";
|
|
81
|
-
return s.every((l) => (i = i ? `${i}${r}${l}` : l, z.has(i)));
|
|
82
|
-
}, K = (e, r) => {
|
|
83
|
-
const t = { ...m }, s = D(e);
|
|
75
|
+
}, [a, d]), $ = (e) => {
|
|
76
|
+
m === e ? G(p === "asc" ? "desc" : "asc") : (Y(e), G("asc"));
|
|
77
|
+
}, U = (e, r) => {
|
|
78
|
+
const t = { ...d }, s = N(e);
|
|
84
79
|
if (r) {
|
|
85
|
-
const i =
|
|
86
|
-
s ? (t.exclude.add(e), t.include.delete(e), i.forEach((
|
|
87
|
-
t.include.delete(
|
|
88
|
-
})) : (t.exclude.delete(e), t.include.size > 0 && (
|
|
89
|
-
t.include.delete(
|
|
80
|
+
const i = ee(e);
|
|
81
|
+
s ? (t.exclude.add(e), t.include.delete(e), i.forEach((c) => {
|
|
82
|
+
t.include.delete(c), t.exclude.delete(c);
|
|
83
|
+
})) : (t.exclude.delete(e), t.include.size > 0 && (_(e) || t.include.add(e)), i.forEach((c) => {
|
|
84
|
+
t.include.delete(c), t.exclude.delete(c);
|
|
90
85
|
}));
|
|
91
86
|
} else
|
|
92
|
-
s ? (t.exclude.add(e), t.include.delete(e)) : (t.exclude.delete(e), t.include.size > 0 ?
|
|
93
|
-
(
|
|
87
|
+
s ? (t.exclude.add(e), t.include.delete(e)) : (t.exclude.delete(e), t.include.size > 0 ? _(e) || t.include.add(e) : Array.from(t.exclude).some(
|
|
88
|
+
(c) => e.startsWith(c + "/") || e.startsWith(c + "\\")
|
|
94
89
|
) && t.include.add(e));
|
|
95
|
-
|
|
90
|
+
Z({
|
|
96
91
|
include: new Set(t.include),
|
|
97
92
|
exclude: new Set(t.exclude)
|
|
98
|
-
}),
|
|
93
|
+
}), Q({
|
|
99
94
|
includes: t.include,
|
|
100
95
|
excludes: t.exclude
|
|
101
96
|
});
|
|
102
|
-
},
|
|
97
|
+
}, ce = (e) => {
|
|
103
98
|
let r = [];
|
|
104
|
-
!e &&
|
|
99
|
+
!e && x[""] ? r = x[""] : r = x[e] || [];
|
|
105
100
|
const t = r.filter((i) => i.isDirectory), s = r.filter((i) => !i.isDirectory);
|
|
106
101
|
return [
|
|
107
|
-
...
|
|
108
|
-
...
|
|
102
|
+
...O(t, m, p),
|
|
103
|
+
...O(s, m, p)
|
|
109
104
|
];
|
|
110
|
-
},
|
|
111
|
-
if (!
|
|
112
|
-
const e =
|
|
113
|
-
return M(
|
|
114
|
-
}, [
|
|
115
|
-
const t =
|
|
105
|
+
}, K = b(() => {
|
|
106
|
+
if (!u) return [];
|
|
107
|
+
const e = ce(u);
|
|
108
|
+
return M(u) !== u ? [null, ...e] : e;
|
|
109
|
+
}, [u, x, m, p]), oe = ({ index: e, style: r }) => {
|
|
110
|
+
const t = K[e];
|
|
116
111
|
if (t === null)
|
|
117
|
-
return /* @__PURE__ */
|
|
118
|
-
|
|
112
|
+
return /* @__PURE__ */ l(
|
|
113
|
+
ye,
|
|
119
114
|
{
|
|
120
115
|
style: r,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
!S || S === "" || (G(S), b(S));
|
|
116
|
+
onGoUp: () => {
|
|
117
|
+
const k = M(u), E = g(k);
|
|
118
|
+
!E || E === "" || (H(E), F(E));
|
|
125
119
|
},
|
|
126
|
-
|
|
120
|
+
gridTemplateColumns: W
|
|
127
121
|
}
|
|
128
122
|
);
|
|
129
|
-
const s = t, i =
|
|
130
|
-
return /* @__PURE__ */
|
|
123
|
+
const s = t, i = v(s.path), c = i[i.length - 1], h = g(s.path), f = y.includes(h), z = N(s.path), w = D ? D(s) : !0;
|
|
124
|
+
return /* @__PURE__ */ n(
|
|
131
125
|
"div",
|
|
132
126
|
{
|
|
133
|
-
style: r,
|
|
134
|
-
className: `${
|
|
127
|
+
style: { ...r, gridTemplateColumns: W },
|
|
128
|
+
className: `${S.snapshotFile} ${f ? S.fileIsDir : ""} ${R && s.changeType === "modified" ? o.fileModified : ""} ${R && s.changeType === "removed" ? o.fileRemoved : ""}`,
|
|
135
129
|
onClick: () => {
|
|
136
|
-
|
|
130
|
+
f && (H(h), F(h));
|
|
137
131
|
},
|
|
138
132
|
children: [
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ n("div", { className: S.fileName, children: [
|
|
134
|
+
/* @__PURE__ */ l(
|
|
141
135
|
"button",
|
|
142
136
|
{
|
|
143
|
-
className: `${
|
|
144
|
-
onClick: (
|
|
145
|
-
|
|
137
|
+
className: `${o.selectButton} ${z ? o.selected : ""} ${w ? "" : o.notSelectable}`,
|
|
138
|
+
onClick: (k) => {
|
|
139
|
+
w && (k.stopPropagation(), U(s.path, !1));
|
|
146
140
|
},
|
|
147
|
-
disabled: !
|
|
148
|
-
children:
|
|
141
|
+
disabled: !w,
|
|
142
|
+
children: w ? /* @__PURE__ */ l(I, { type: z ? "check-circle-filled" : "check-circle", size: 13 }) : null
|
|
149
143
|
}
|
|
150
144
|
),
|
|
151
|
-
|
|
145
|
+
f ? /* @__PURE__ */ l(I, { type: f ? "fm-directory" : "fm-file", size: 16 }) : /* @__PURE__ */ l(ue, { filename: c || "" }),
|
|
152
146
|
" ",
|
|
153
|
-
|
|
147
|
+
c
|
|
154
148
|
] }),
|
|
155
|
-
/* @__PURE__ */
|
|
156
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ l("div", { className: o.fileModified, children: de(s.modifiedAt) }),
|
|
150
|
+
/* @__PURE__ */ l("div", { className: o.fileSize, children: A(s.size || 0) })
|
|
157
151
|
]
|
|
158
152
|
},
|
|
159
153
|
s.path
|
|
160
154
|
);
|
|
161
155
|
};
|
|
162
|
-
return /* @__PURE__ */
|
|
163
|
-
q && /* @__PURE__ */
|
|
164
|
-
/* @__PURE__ */
|
|
156
|
+
return /* @__PURE__ */ n("div", { className: o.restoreFileSelector, children: [
|
|
157
|
+
q && /* @__PURE__ */ n("div", { className: o.loader, children: [
|
|
158
|
+
/* @__PURE__ */ l(I, { type: "loading", size: 24 }),
|
|
165
159
|
" Loading Snapshot Content.."
|
|
166
160
|
] }),
|
|
167
|
-
/* @__PURE__ */
|
|
168
|
-
/* @__PURE__ */
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
m.exclude.size > 0 && /* @__PURE__ */ a("div", { className: c.excludedStat, children: [
|
|
161
|
+
/* @__PURE__ */ n("div", { className: S.snapshotBrowser, children: [
|
|
162
|
+
/* @__PURE__ */ l(
|
|
163
|
+
fe,
|
|
164
|
+
{
|
|
165
|
+
search: B,
|
|
166
|
+
onSearchChange: X,
|
|
167
|
+
leftContent: /* @__PURE__ */ n("div", { className: S.stats, children: [
|
|
168
|
+
/* @__PURE__ */ l("strong", { children: "Summary: " }),
|
|
169
|
+
T(C.selectedFiles),
|
|
170
|
+
"/",
|
|
171
|
+
T(C.totalFiles),
|
|
172
|
+
" Items ",
|
|
180
173
|
" • ",
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
174
|
+
A(C.selectedBytes),
|
|
175
|
+
"/",
|
|
176
|
+
A(C.totalBytes),
|
|
177
|
+
d.exclude.size > 0 && /* @__PURE__ */ n("div", { className: o.excludedStat, children: [
|
|
178
|
+
" • ",
|
|
179
|
+
/* @__PURE__ */ n("span", { children: [
|
|
180
|
+
"Excluded:",
|
|
181
|
+
" ",
|
|
182
|
+
/* @__PURE__ */ n("i", { title: Array.from(d.exclude).join(`
|
|
185
183
|
`), children: [
|
|
186
|
-
|
|
187
|
-
|
|
184
|
+
T(d.exclude.size),
|
|
185
|
+
" Items"
|
|
186
|
+
] })
|
|
188
187
|
] })
|
|
189
188
|
] })
|
|
190
189
|
] })
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
] }),
|
|
253
|
-
/* @__PURE__ */ a("div", { onClick: () => W("size"), className: u === "size" ? c.activeSort : "", children: [
|
|
254
|
-
"Size ",
|
|
255
|
-
u === "size" && (y === "asc" ? "↑" : "↓")
|
|
256
|
-
] })
|
|
257
|
-
] }),
|
|
258
|
-
p ? /* @__PURE__ */ n(ie, { height: window.innerHeight - 370, itemCount: U.length, itemSize: he, width: "100%", children: ce }) : /* @__PURE__ */ n("div", { className: c.fileListEmpty, children: "Select a folder from the left to browse it's content" }),
|
|
259
|
-
J && /* @__PURE__ */ n("div", { className: c.error, children: "Failed to load files. Please try again." })
|
|
260
|
-
] }) })
|
|
190
|
+
}
|
|
191
|
+
),
|
|
192
|
+
/* @__PURE__ */ n("div", { className: S.browserContent, children: [
|
|
193
|
+
/* @__PURE__ */ l(
|
|
194
|
+
pe,
|
|
195
|
+
{
|
|
196
|
+
directories: y,
|
|
197
|
+
selectedFolder: u,
|
|
198
|
+
expandedFolders: j,
|
|
199
|
+
onDirectoryClick: (e) => F(e),
|
|
200
|
+
onToggleFolder: ie,
|
|
201
|
+
isVisible: re,
|
|
202
|
+
hasSubdirectories: se,
|
|
203
|
+
renderDirectoryExtra: (e) => {
|
|
204
|
+
var t;
|
|
205
|
+
const r = N(((t = a.find((s) => s.isDirectory && g(s.path) === e)) == null ? void 0 : t.path) || e);
|
|
206
|
+
return /* @__PURE__ */ l(
|
|
207
|
+
"button",
|
|
208
|
+
{
|
|
209
|
+
className: `${o.selectButton} ${r ? o.selected : ""}`,
|
|
210
|
+
onClick: (s) => {
|
|
211
|
+
var c;
|
|
212
|
+
s.stopPropagation();
|
|
213
|
+
const i = ((c = a.find((h) => h.isDirectory && g(h.path) === e)) == null ? void 0 : c.path) || e;
|
|
214
|
+
U(i, !0);
|
|
215
|
+
},
|
|
216
|
+
children: /* @__PURE__ */ l(I, { type: r ? "check-circle-filled" : "check-circle", size: 13 })
|
|
217
|
+
}
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
),
|
|
222
|
+
/* @__PURE__ */ n("div", { className: `${S.content} styled__scrollbar`, children: [
|
|
223
|
+
/* @__PURE__ */ l(
|
|
224
|
+
Se,
|
|
225
|
+
{
|
|
226
|
+
files: K,
|
|
227
|
+
height: window.innerHeight - 370,
|
|
228
|
+
itemSize: xe,
|
|
229
|
+
headerContent: /* @__PURE__ */ n(ne, { children: [
|
|
230
|
+
/* @__PURE__ */ n("div", { onClick: () => $("name"), className: m === "name" ? o.activeSort : "", children: [
|
|
231
|
+
"Name ",
|
|
232
|
+
m === "name" && (p === "asc" ? "↑" : "↓")
|
|
233
|
+
] }),
|
|
234
|
+
/* @__PURE__ */ n("div", { onClick: () => $("modifiedAt"), className: m === "modifiedAt" ? o.activeSort : "", children: [
|
|
235
|
+
"Last Modified ",
|
|
236
|
+
m === "modifiedAt" && (p === "asc" ? "↑" : "↓")
|
|
237
|
+
] }),
|
|
238
|
+
/* @__PURE__ */ n("div", { onClick: () => $("size"), className: m === "size" ? o.activeSort : "", children: [
|
|
239
|
+
"Size ",
|
|
240
|
+
m === "size" && (p === "asc" ? "↑" : "↓")
|
|
241
|
+
] })
|
|
242
|
+
] }),
|
|
243
|
+
renderRow: oe,
|
|
244
|
+
selectedFolder: u || null,
|
|
245
|
+
gridTemplateColumns: W,
|
|
246
|
+
emptyMessage: "Select a folder from the left to browse it's content"
|
|
247
|
+
}
|
|
248
|
+
),
|
|
249
|
+
J && /* @__PURE__ */ l("div", { className: o.error, children: "Failed to load files. Please try again." })
|
|
250
|
+
] })
|
|
261
251
|
] })
|
|
262
252
|
] })
|
|
263
253
|
] });
|
|
264
254
|
};
|
|
265
255
|
export {
|
|
266
|
-
|
|
256
|
+
ke as default
|
|
267
257
|
};
|
|
268
258
|
//# sourceMappingURL=RestoreFileSelector.js.map
|