@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RestoreFileSelector.js","sources":["../../../../src/components/Restore/RestoreFileSelector/RestoreFileSelector.tsx"],"sourcesContent":["import { useState, useMemo } from 'react';\r\nimport { FixedSizeList as List } from 'react-window';\r\nimport Icon from '../../common/Icon/Icon';\r\nimport { RestoreFileItem } from '../../../@types/restores';\r\nimport { calculateDirectorySizes, formatBytes, formatDateTime, formatNumberToK, isMobile, sortFileItems } from '../../../utils/helpers';\r\nimport FileIcon from '../../common/FileIcon/FileIcon';\r\nimport classes from './RestoreFileSelector.module.scss';\r\nimport { getParentPath, getPathSeparator, normalizePath, splitPath } from '../../../utils/restore';\r\n\r\ninterface RestoreFileSelectorProps {\r\n selected: {\r\n includes: Set<string>;\r\n excludes: Set<string>;\r\n };\r\n backupId: string;\r\n files: RestoreFileItem[];\r\n isLoading: boolean;\r\n errorFetching: string | null;\r\n showChange?: boolean;\r\n fileSelectCondition?: (file: RestoreFileItem) => boolean;\r\n onSelect: (selected: RestoreFileSelectorProps['selected']) => void;\r\n}\r\n\r\nconst isMobileDevice = isMobile();\r\nconst ITEM_HEIGHT = isMobileDevice ? 65 : 45;\r\n\r\nconst RestoreFileSelector = ({ selected, files, isLoading, errorFetching, showChange, onSelect, fileSelectCondition }: RestoreFileSelectorProps) => {\r\n const [selectedFolder, setSelectedFolder] = useState<string>('');\r\n const [search, setSearch] = useState('');\r\n const [sortField, setSortField] = useState<'name' | 'modifiedAt' | 'size'>('name');\r\n const [sortDirection, setSortDirection] = useState<'asc' | 'desc'>('asc');\r\n const [selectedFiles, setSelectedFiles] = useState<{ include: Set<string>; exclude: Set<string> }>(() => ({\r\n include: new Set(selected.includes),\r\n exclude: new Set(selected.excludes),\r\n }));\r\n\r\n console.log('[RestoreFileSelector] files :', files);\r\n\r\n const getAllChildPaths = (dirPath: string): string[] => {\r\n const allPaths: string[] = [];\r\n\r\n files.forEach((file) => {\r\n // Use original paths, not normalized\r\n if (file.path.startsWith(dirPath + '/') || file.path.startsWith(dirPath + '\\\\')) {\r\n allPaths.push(file.path);\r\n }\r\n });\r\n\r\n return allPaths;\r\n };\r\n\r\n const isPathSelected = (path: string): boolean => {\r\n // If path is explicitly excluded, it's not selected\r\n if (selectedFiles.exclude.has(path)) {\r\n return false;\r\n }\r\n\r\n // Check if any parent directory is excluded\r\n const hasExcludedParent = Array.from(selectedFiles.exclude).some(\r\n (excludedPath) => path.startsWith(excludedPath + '/') || path.startsWith(excludedPath + '\\\\'),\r\n );\r\n\r\n if (hasExcludedParent) {\r\n return false;\r\n }\r\n\r\n // If nothing is in includes (default state), everything is selected\r\n if (selectedFiles.include.size === 0) {\r\n return true;\r\n }\r\n\r\n // If path is explicitly included, it's selected\r\n if (selectedFiles.include.has(path)) {\r\n return true;\r\n }\r\n\r\n // Check if any parent is included and this path is not excluded\r\n const hasIncludedParent = Array.from(selectedFiles.include).some(\r\n (includedPath) => path.startsWith(includedPath + '/') || path.startsWith(includedPath + '\\\\'),\r\n );\r\n\r\n return hasIncludedParent;\r\n };\r\n\r\n const getEffectiveParentInclude = (path: string): string | null => {\r\n return (\r\n Array.from(selectedFiles.include).find((includedPath) => path.startsWith(includedPath + '/') || path.startsWith(includedPath + '\\\\')) || null\r\n );\r\n };\r\n\r\n const [expandedFolders, setExpandedFolders] = useState<Set<string>>(() => {\r\n const allPaths = new Set<string>();\r\n files.forEach((file) => {\r\n const separator = getPathSeparator(file.path);\r\n const parts = splitPath(file.path);\r\n let currentPath = '';\r\n\r\n parts.forEach((part, index) => {\r\n currentPath = currentPath ? `${currentPath}${separator}${part}` : part;\r\n if (index < 3) {\r\n allPaths.add(currentPath);\r\n }\r\n });\r\n });\r\n return allPaths;\r\n });\r\n\r\n const fileSystem = useMemo(() => {\r\n const system: { [key: string]: RestoreFileItem[] } = {};\r\n const dirSizes = calculateDirectorySizes(files);\r\n files\r\n .filter((file) => {\r\n const matchesSearch = file.path.toLowerCase().includes(search.toLowerCase());\r\n return matchesSearch;\r\n })\r\n .forEach((file) => {\r\n let theFile = file;\r\n const dirPath = getParentPath(theFile.path);\r\n // Use the normalized path as key, but handle root directory\r\n const normalizedDirPath = normalizePath(dirPath) || '/'; // Use '/' for root\r\n\r\n if (theFile.isDirectory) {\r\n theFile.size = dirSizes[theFile.path] || 0;\r\n }\r\n\r\n if (!system[normalizedDirPath]) {\r\n system[normalizedDirPath] = [];\r\n }\r\n system[normalizedDirPath].push(theFile);\r\n });\r\n\r\n return system;\r\n }, [files, search]);\r\n\r\n console.log('fileSystem :', fileSystem);\r\n\r\n const directories = useMemo(() => {\r\n const dirs = files.filter((file) => file.isDirectory).map((file) => normalizePath(file.path));\r\n\r\n // Sort directories by their path to ensure proper hierarchical order\r\n const sortedDirs = dirs.sort((a, b) => {\r\n const aParts = splitPath(a);\r\n const bParts = splitPath(b);\r\n const minLength = Math.min(aParts.length, bParts.length);\r\n\r\n for (let i = 0; i < minLength; i++) {\r\n const comparison = aParts[i].localeCompare(bParts[i]);\r\n if (comparison !== 0) {\r\n return comparison;\r\n }\r\n }\r\n return aParts.length - bParts.length;\r\n });\r\n\r\n // Set the first directory as selected by default\r\n console.log('SelectedFolder :', sortedDirs[0]);\r\n setSelectedFolder(sortedDirs[0] || '');\r\n\r\n return sortedDirs;\r\n }, [files]);\r\n\r\n const summary = useMemo(() => {\r\n let selectedFilesCount = 0;\r\n let selectedBytes = 0;\r\n\r\n const restorableFiles = fileSelectCondition ? files.filter((file) => fileSelectCondition(file)) : files;\r\n\r\n restorableFiles.forEach((file) => {\r\n if (isPathSelected(file.path)) {\r\n selectedFilesCount++;\r\n if (!file.isDirectory) {\r\n selectedBytes += file.size;\r\n }\r\n }\r\n });\r\n\r\n return {\r\n selectedFiles: selectedFilesCount,\r\n totalFiles: restorableFiles.length,\r\n selectedBytes,\r\n totalBytes: restorableFiles.reduce((acc, file) => acc + (!file.isDirectory ? file.size : 0), 0),\r\n };\r\n }, [files, selectedFiles]);\r\n\r\n const hasSubdirectories = (dir: string) => {\r\n const separator = getPathSeparator(dir);\r\n return directories.some((d) => d !== dir && d.startsWith(dir + separator));\r\n };\r\n\r\n const handleSort = (field: 'name' | 'modifiedAt' | 'size') => {\r\n if (sortField === field) {\r\n // Toggle direction if clicking the same field\r\n setSortDirection(sortDirection === 'asc' ? 'desc' : 'asc');\r\n } else {\r\n // Set new field and default to ascending\r\n setSortField(field);\r\n setSortDirection('asc');\r\n }\r\n };\r\n\r\n const expandParentFolders = (dirPath: string) => {\r\n const newExpanded = new Set(expandedFolders);\r\n const separator = getPathSeparator(dirPath);\r\n const parts = splitPath(dirPath);\r\n let currentPath = '';\r\n\r\n // Expand all parent directories\r\n parts.forEach((part) => {\r\n currentPath = currentPath ? `${currentPath}${separator}${part}` : part;\r\n newExpanded.add(currentPath);\r\n });\r\n\r\n setExpandedFolders(newExpanded);\r\n };\r\n\r\n const toggleFolder = (dir: string) => {\r\n const newExpanded = new Set(expandedFolders);\r\n if (expandedFolders.has(dir)) {\r\n newExpanded.delete(dir);\r\n } else {\r\n newExpanded.add(dir);\r\n }\r\n setExpandedFolders(newExpanded);\r\n };\r\n\r\n const isVisible = (dir: string) => {\r\n const separator = getPathSeparator(dir);\r\n const parts = splitPath(dir);\r\n const parentParts = parts.slice(0, -1);\r\n let parentPath = '';\r\n\r\n // Check if all parent folders are expanded\r\n return parentParts.every((part) => {\r\n parentPath = parentPath ? `${parentPath}${separator}${part}` : part;\r\n return expandedFolders.has(parentPath);\r\n });\r\n };\r\n\r\n const onFileSelect = (path: string, isDirectory: boolean) => {\r\n const newSelected = { ...selectedFiles };\r\n const isCurrentlySelected = isPathSelected(path);\r\n\r\n if (isDirectory) {\r\n const childPaths = getAllChildPaths(path);\r\n\r\n if (isCurrentlySelected) {\r\n // Deselecting directory\r\n newSelected.exclude.add(path);\r\n newSelected.include.delete(path);\r\n\r\n // Remove any child paths from both include and exclude (they inherit exclusion from parent)\r\n childPaths.forEach((childPath) => {\r\n newSelected.include.delete(childPath);\r\n newSelected.exclude.delete(childPath);\r\n });\r\n } else {\r\n // Selecting directory\r\n newSelected.exclude.delete(path);\r\n\r\n // If we have explicit includes, we need to add this to include\r\n if (newSelected.include.size > 0) {\r\n // Check if parent is already included\r\n const parentInclude = getEffectiveParentInclude(path);\r\n if (!parentInclude) {\r\n newSelected.include.add(path);\r\n }\r\n }\r\n\r\n // Remove any child paths from both include and exclude (they inherit from parent)\r\n childPaths.forEach((childPath) => {\r\n newSelected.include.delete(childPath);\r\n newSelected.exclude.delete(childPath);\r\n });\r\n }\r\n } else {\r\n // File selection\r\n if (isCurrentlySelected) {\r\n // Deselecting file\r\n newSelected.exclude.add(path);\r\n newSelected.include.delete(path);\r\n } else {\r\n // Selecting file - always allow this\r\n newSelected.exclude.delete(path);\r\n\r\n // If we have explicit includes OR if parent is excluded, we need to add this to include\r\n if (newSelected.include.size > 0) {\r\n const parentInclude = getEffectiveParentInclude(path);\r\n if (!parentInclude) {\r\n newSelected.include.add(path);\r\n }\r\n } else {\r\n // Check if any parent is excluded - if so, we need to start using includes\r\n const hasExcludedParent = Array.from(newSelected.exclude).some(\r\n (excludedPath) => path.startsWith(excludedPath + '/') || path.startsWith(excludedPath + '\\\\'),\r\n );\r\n if (hasExcludedParent) {\r\n newSelected.include.add(path);\r\n }\r\n }\r\n }\r\n }\r\n\r\n setSelectedFiles({\r\n include: new Set(newSelected.include),\r\n exclude: new Set(newSelected.exclude),\r\n });\r\n\r\n onSelect({\r\n includes: newSelected.include,\r\n excludes: newSelected.exclude,\r\n });\r\n };\r\n\r\n const getDirectChildren = (parentPath: string) => {\r\n let children = [];\r\n\r\n if (!parentPath && fileSystem['']) {\r\n children = fileSystem[''];\r\n } else {\r\n children = fileSystem[parentPath] || [];\r\n }\r\n const directories = children.filter((item) => item.isDirectory);\r\n const files = children.filter((item) => !item.isDirectory);\r\n return [\r\n ...(sortFileItems(directories, sortField, sortDirection) as RestoreFileItem[]),\r\n ...(sortFileItems(files, sortField, sortDirection) as RestoreFileItem[]),\r\n ];\r\n };\r\n\r\n const directChildren = useMemo(() => {\r\n if (!selectedFolder) return [];\r\n\r\n const children = getDirectChildren(selectedFolder);\r\n const hasParent = getParentPath(selectedFolder) !== selectedFolder;\r\n\r\n // Add parent navigation item if needed\r\n return hasParent ? [null, ...children] : children;\r\n }, [selectedFolder, fileSystem, sortField, sortDirection]);\r\n\r\n const Row = ({ index, style }: { index: number; style: React.CSSProperties }) => {\r\n const item = directChildren[index];\r\n\r\n // Parent directory navigation\r\n if (item === null) {\r\n return (\r\n <div\r\n style={style}\r\n className={`${classes.file} ${classes.fileIsDir} ${classes.goUpButton}`}\r\n onClick={() => {\r\n const parentPath = getParentPath(selectedFolder);\r\n const normalizedParentPath = normalizePath(parentPath);\r\n if (!normalizedParentPath || normalizedParentPath === '') return;\r\n expandParentFolders(normalizedParentPath);\r\n setSelectedFolder(normalizedParentPath);\r\n }}\r\n >\r\n <div className={classes.fileName}>...</div>\r\n </div>\r\n );\r\n }\r\n\r\n const file = item;\r\n const parts = splitPath(file.path);\r\n const fileName = parts[parts.length - 1];\r\n const normalizedPath = normalizePath(file.path);\r\n const isDirectory = directories.includes(normalizedPath);\r\n const isSelected = isPathSelected(file.path);\r\n const canBeSelected = fileSelectCondition ? fileSelectCondition(file) : true;\r\n\r\n return (\r\n <div\r\n style={style}\r\n key={file.path}\r\n className={`${classes.file} ${isDirectory ? classes.fileIsDir : ''} ${showChange && file.changeType === 'modified' ? classes.fileModified : ''} ${showChange && file.changeType === 'removed' ? classes.fileRemoved : ''}`}\r\n onClick={() => {\r\n if (isDirectory) {\r\n expandParentFolders(normalizedPath);\r\n setSelectedFolder(normalizedPath);\r\n }\r\n }}\r\n >\r\n <div className={classes.fileName}>\r\n <button\r\n className={`${classes.selectButton} ${isSelected ? classes.selected : ''} ${!canBeSelected ? classes.notSelectable : ''}`}\r\n onClick={(e) => {\r\n if (!canBeSelected) return;\r\n e.stopPropagation();\r\n onFileSelect(file.path, false);\r\n }}\r\n disabled={!canBeSelected}\r\n >\r\n {canBeSelected ? <Icon type={isSelected ? 'check-circle-filled' : 'check-circle'} size={13} /> : null}\r\n </button>\r\n {isDirectory ? <Icon type={isDirectory ? 'fm-directory' : 'fm-file'} size={16} /> : <FileIcon filename={fileName || ''} />} {fileName}\r\n </div>\r\n <div className={classes.fileModified}>{formatDateTime(file.modifiedAt)}</div>\r\n <div className={classes.fileSize}>{formatBytes(file.size || 0)}</div>\r\n </div>\r\n );\r\n };\r\n\r\n return (\r\n <div className={classes.restoreFileSelector}>\r\n {isLoading && (\r\n <div className={classes.loader}>\r\n <Icon type=\"loading\" size={24} /> Loading Snapshot Content..\r\n </div>\r\n )}\r\n <div className={classes.restoredFileBrowser}>\r\n <div className={classes.toolbar}>\r\n <div className={classes.toolbarLeft}>\r\n <div className={classes.stats}>\r\n <strong>Summary: </strong>\r\n {formatNumberToK(summary.selectedFiles)}/{formatNumberToK(summary.totalFiles)} Items {' • '}\r\n {formatBytes(summary.selectedBytes)}/{formatBytes(summary.totalBytes)}\r\n {selectedFiles.exclude.size > 0 && (\r\n <div className={classes.excludedStat}>\r\n {' • '}\r\n <span>\r\n Excluded:{' '}\r\n <i title={Array.from(selectedFiles.exclude).join('\\n')}>{formatNumberToK(selectedFiles.exclude.size)} Items</i>\r\n </span>\r\n </div>\r\n )}\r\n </div>\r\n </div>\r\n <div className={classes.toolbarRight}>\r\n <div className={classes.search}>\r\n <Icon type=\"search\" size={16} />\r\n <input type=\"text\" placeholder=\"Search in current Directory...\" value={search} onChange={(e) => setSearch(e.target.value)} />\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div className={classes.browserContent}>\r\n <div className={`${classes.sidebar} styled__scrollbar`}>\r\n <div className={classes.sidebarHeader}>Directories</div>\r\n {directories.map((dir) => {\r\n const parts = splitPath(dir);\r\n const dirName = parts[parts.length - 1];\r\n const depth = parts.length - 1;\r\n const isExpanded = expandedFolders.has(dir);\r\n const hasChildren = hasSubdirectories(dir);\r\n const isSelected = isPathSelected(files.find((f) => f.isDirectory && normalizePath(f.path) === dir)?.path || dir);\r\n\r\n // Only render if parent folders are expanded or if it's a root folder\r\n if (depth === 0 || isVisible(dir)) {\r\n return (\r\n <div\r\n key={dir}\r\n className={`${classes.directory} ${selectedFolder === dir ? classes.selected : ''} ${hasChildren ? '' : classes.directoryEmpty}`}\r\n style={{ paddingLeft: `${depth * 20}px` }}\r\n onClick={() => setSelectedFolder(dir)}\r\n >\r\n {hasChildren ? (\r\n <button\r\n className={`${classes.toggleButton} ${isExpanded ? classes.active : ''}`}\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n toggleFolder(dir);\r\n }}\r\n >\r\n {isExpanded ? '-' : '+'}\r\n </button>\r\n ) : (\r\n <span className={`${classes.togglePlaceholder}`} />\r\n )}\r\n <div className={classes.dirName}>\r\n <Icon type={'fm-directory'} size={14} />\r\n <button\r\n className={`${classes.selectButton} ${isSelected ? classes.selected : ''}`}\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n const originalPath = files.find((f) => f.isDirectory && normalizePath(f.path) === dir)?.path || dir;\r\n onFileSelect(originalPath, true);\r\n }}\r\n >\r\n <Icon type={isSelected ? 'check-circle-filled' : 'check-circle'} size={13} />\r\n </button>\r\n {dirName}\r\n </div>\r\n </div>\r\n );\r\n }\r\n return null;\r\n })}\r\n </div>\r\n\r\n <div className={`${classes.content} styled__scrollbar`}>\r\n <div className={classes.fileList}>\r\n <div className={classes.header}>\r\n <div onClick={() => handleSort('name')} className={sortField === 'name' ? classes.activeSort : ''}>\r\n Name {sortField === 'name' && (sortDirection === 'asc' ? '↑' : '↓')}\r\n </div>\r\n <div onClick={() => handleSort('modifiedAt')} className={sortField === 'modifiedAt' ? classes.activeSort : ''}>\r\n Last Modified {sortField === 'modifiedAt' && (sortDirection === 'asc' ? '↑' : '↓')}\r\n </div>\r\n <div onClick={() => handleSort('size')} className={sortField === 'size' ? classes.activeSort : ''}>\r\n Size {sortField === 'size' && (sortDirection === 'asc' ? '↑' : '↓')}\r\n </div>\r\n </div>\r\n {selectedFolder ? (\r\n <List height={window.innerHeight - 370} itemCount={directChildren.length} itemSize={ITEM_HEIGHT} width=\"100%\">\r\n {Row}\r\n </List>\r\n ) : (\r\n <div className={classes.fileListEmpty}>Select a folder from the left to browse it's content</div>\r\n )}\r\n {errorFetching && <div className={classes.error}>Failed to load files. Please try again.</div>}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nexport default RestoreFileSelector;\r\n"],"names":["isMobileDevice","isMobile","ITEM_HEIGHT","RestoreFileSelector","selected","files","isLoading","errorFetching","showChange","onSelect","fileSelectCondition","selectedFolder","setSelectedFolder","useState","search","setSearch","sortField","setSortField","sortDirection","setSortDirection","selectedFiles","setSelectedFiles","getAllChildPaths","dirPath","allPaths","file","isPathSelected","path","excludedPath","includedPath","getEffectiveParentInclude","expandedFolders","setExpandedFolders","separator","getPathSeparator","parts","splitPath","currentPath","part","index","fileSystem","useMemo","system","dirSizes","calculateDirectorySizes","theFile","getParentPath","normalizedDirPath","normalizePath","directories","sortedDirs","a","b","aParts","bParts","minLength","i","comparison","summary","selectedFilesCount","selectedBytes","restorableFiles","acc","hasSubdirectories","dir","d","handleSort","field","expandParentFolders","newExpanded","toggleFolder","isVisible","parentParts","parentPath","onFileSelect","isDirectory","newSelected","isCurrentlySelected","childPaths","childPath","getDirectChildren","children","item","sortFileItems","directChildren","Row","style","jsx","classes","normalizedParentPath","fileName","normalizedPath","isSelected","canBeSelected","jsxs","e","Icon","FileIcon","formatDateTime","formatBytes","formatNumberToK","dirName","depth","isExpanded","hasChildren","_a","f","originalPath","List"],"mappings":";;;;;;;;AAuBA,MAAMA,KAAiBC,GAAA,GACjBC,KAAcF,KAAiB,KAAK,IAEpCG,KAAsB,CAAC,EAAE,UAAAC,GAAU,OAAAC,GAAO,WAAAC,GAAW,eAAAC,GAAe,YAAAC,GAAY,UAAAC,GAAU,qBAAAC,QAAoD;AACjJ,QAAM,CAACC,GAAgBC,CAAiB,IAAIC,EAAiB,EAAE,GACzD,CAACC,GAAQC,CAAS,IAAIF,EAAS,EAAE,GACjC,CAACG,GAAWC,CAAY,IAAIJ,EAAyC,MAAM,GAC3E,CAACK,GAAeC,CAAgB,IAAIN,EAAyB,KAAK,GAClE,CAACO,GAAeC,CAAgB,IAAIR,EAAyD,OAAO;AAAA,IACvG,SAAS,IAAI,IAAIT,EAAS,QAAQ;AAAA,IAClC,SAAS,IAAI,IAAIA,EAAS,QAAQ;AAAA,EAAA,EACnC;AAEF,UAAQ,IAAI,iCAAiCC,CAAK;AAElD,QAAMiB,IAAmB,CAACC,MAA8B;AACrD,UAAMC,IAAqB,CAAA;AAE3B,WAAAnB,EAAM,QAAQ,CAACoB,MAAS;AAErB,OAAIA,EAAK,KAAK,WAAWF,IAAU,GAAG,KAAKE,EAAK,KAAK,WAAWF,IAAU,IAAI,MAC3EC,EAAS,K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AAUlF,IAAa,OAAM,QACnG,UAAAmF,GAAA,CACJ,sBAEC,OAAA,EAAI,WAAWG,EAAQ,eAAe,UAAA,uDAAA,CAAoD;AAAA,UAE7FjF,KAAiB,gBAAAgF,EAAC,OAAA,EAAI,WAAWC,EAAQ,OAAO,UAAA,0CAAA,CAAuC;AAAA,QAAA,EAAA,CAC3F,EAAA,CACH;AAAA,MAAA,EAAA,CACH;AAAA,IAAA,EAAA,CACH;AAAA,EAAA,GACH;AAEN;"}
|
|
1
|
+
{"version":3,"file":"RestoreFileSelector.js","sources":["../../../../src/components/Restore/RestoreFileSelector/RestoreFileSelector.tsx"],"sourcesContent":["import { useState, useMemo, useEffect } from 'react';\r\nimport Icon from '../../common/Icon/Icon';\r\nimport { RestoreFileItem } from '../../../@types/restores';\r\nimport { calculateDirectorySizes, formatBytes, formatDateTime, formatNumberToK, isMobile, sortFileItems } from '../../../utils/helpers';\r\nimport FileIcon from '../../common/FileIcon/FileIcon';\r\nimport classes from './RestoreFileSelector.module.scss';\r\nimport { getParentPath, getPathSeparator, normalizePath, splitPath } from '../../../utils/restore';\r\nimport { SnapshotBrowserToolbar, SnapshotBrowserDirectories, SnapshotBrowserFileList, SnapshotBrowserGoUpRow } from '../../common/SnapshotBrowser';\r\nimport { useSnapshotNavigation } from '../../common/SnapshotBrowser/hooks/useSnapshotNavigation';\r\nimport sbClasses from '../../common/SnapshotBrowser/SnapshotBrowser.module.scss';\r\n\r\ninterface RestoreFileSelectorProps {\r\n selected: {\r\n includes: Set<string>;\r\n excludes: Set<string>;\r\n };\r\n backupId: string;\r\n files: RestoreFileItem[];\r\n isLoading: boolean;\r\n errorFetching: string | null;\r\n showChange?: boolean;\r\n fileSelectCondition?: (file: RestoreFileItem) => boolean;\r\n onSelect: (selected: RestoreFileSelectorProps['selected']) => void;\r\n}\r\n\r\nconst isMobileDevice = isMobile();\r\nconst ITEM_HEIGHT = isMobileDevice ? 65 : 45;\r\nconst GRID_COLUMNS = '1fr 180px minmax(80px, auto)';\r\n\r\nconst RestoreFileSelector = ({ selected, files, isLoading, errorFetching, showChange, onSelect, fileSelectCondition }: RestoreFileSelectorProps) => {\r\n const [search, setSearch] = useState('');\r\n const [sortField, setSortField] = useState<'name' | 'modifiedAt' | 'size'>('name');\r\n const [sortDirection, setSortDirection] = useState<'asc' | 'desc'>('asc');\r\n const [selectedFiles, setSelectedFiles] = useState<{ include: Set<string>; exclude: Set<string> }>(() => ({\r\n include: new Set(selected.includes),\r\n exclude: new Set(selected.excludes),\r\n }));\r\n\r\n console.log('[RestoreFileSelector] files :', files);\r\n\r\n const getAllChildPaths = (dirPath: string): string[] => {\r\n const allPaths: string[] = [];\r\n\r\n files.forEach((file) => {\r\n // Use original paths, not normalized\r\n if (file.path.startsWith(dirPath + '/') || file.path.startsWith(dirPath + '\\\\')) {\r\n allPaths.push(file.path);\r\n }\r\n });\r\n\r\n return allPaths;\r\n };\r\n\r\n const isPathSelected = (path: string): boolean => {\r\n // If path is explicitly excluded, it's not selected\r\n if (selectedFiles.exclude.has(path)) {\r\n return false;\r\n }\r\n\r\n // Check if any parent directory is excluded\r\n const hasExcludedParent = Array.from(selectedFiles.exclude).some(\r\n (excludedPath) => path.startsWith(excludedPath + '/') || path.startsWith(excludedPath + '\\\\'),\r\n );\r\n\r\n if (hasExcludedParent) {\r\n return false;\r\n }\r\n\r\n // If nothing is in includes (default state), everything is selected\r\n if (selectedFiles.include.size === 0) {\r\n return true;\r\n }\r\n\r\n // If path is explicitly included, it's selected\r\n if (selectedFiles.include.has(path)) {\r\n return true;\r\n }\r\n\r\n // Check if any parent is included and this path is not excluded\r\n const hasIncludedParent = Array.from(selectedFiles.include).some(\r\n (includedPath) => path.startsWith(includedPath + '/') || path.startsWith(includedPath + '\\\\'),\r\n );\r\n\r\n return hasIncludedParent;\r\n };\r\n\r\n const getEffectiveParentInclude = (path: string): string | null => {\r\n return (\r\n Array.from(selectedFiles.include).find((includedPath) => path.startsWith(includedPath + '/') || path.startsWith(includedPath + '\\\\')) || null\r\n );\r\n };\r\n\r\n const [expandedFolders, setExpandedFolders] = useState<Set<string>>(() => {\r\n const allPaths = new Set<string>();\r\n files.forEach((file) => {\r\n const separator = getPathSeparator(file.path);\r\n const parts = splitPath(file.path);\r\n let currentPath = '';\r\n\r\n parts.forEach((part, index) => {\r\n currentPath = currentPath ? `${currentPath}${separator}${part}` : part;\r\n if (index < 3) {\r\n allPaths.add(currentPath);\r\n }\r\n });\r\n });\r\n return allPaths;\r\n });\r\n\r\n const fileSystem = useMemo(() => {\r\n const system: { [key: string]: RestoreFileItem[] } = {};\r\n const dirSizes = calculateDirectorySizes(files);\r\n files\r\n .filter((file) => {\r\n const matchesSearch = file.path.toLowerCase().includes(search.toLowerCase());\r\n return matchesSearch;\r\n })\r\n .forEach((file) => {\r\n let theFile = file;\r\n const dirPath = getParentPath(theFile.path);\r\n // Use the normalized path as key, but handle root directory\r\n const normalizedDirPath = normalizePath(dirPath) || '/'; // Use '/' for root\r\n\r\n if (theFile.isDirectory) {\r\n theFile.size = dirSizes[theFile.path] || 0;\r\n }\r\n\r\n if (!system[normalizedDirPath]) {\r\n system[normalizedDirPath] = [];\r\n }\r\n system[normalizedDirPath].push(theFile);\r\n });\r\n\r\n return system;\r\n }, [files, search]);\r\n\r\n console.log('fileSystem :', fileSystem);\r\n\r\n const directories = useMemo(() => {\r\n const dirs = files.filter((file) => file.isDirectory).map((file) => normalizePath(file.path));\r\n\r\n // Sort directories by their path to ensure proper hierarchical order\r\n const sortedDirs = dirs.sort((a, b) => {\r\n const aParts = splitPath(a);\r\n const bParts = splitPath(b);\r\n const minLength = Math.min(aParts.length, bParts.length);\r\n\r\n for (let i = 0; i < minLength; i++) {\r\n const comparison = aParts[i].localeCompare(bParts[i]);\r\n if (comparison !== 0) {\r\n return comparison;\r\n }\r\n }\r\n return aParts.length - bParts.length;\r\n });\r\n\r\n return sortedDirs;\r\n }, [files]);\r\n\r\n const { selectedFolder, setSelectedFolder, hasSubdirectories, isVisible, expandParentFolders, toggleFolder } = useSnapshotNavigation(\r\n directories,\r\n expandedFolders,\r\n setExpandedFolders,\r\n { splitPath, getPathSeparator, hasLeadingSeparator: false },\r\n );\r\n\r\n // Set the first directory as selected by default\r\n useEffect(() => {\r\n if (directories.length > 0 && selectedFolder === '') {\r\n setSelectedFolder(directories[0]);\r\n }\r\n }, [directories, selectedFolder, setSelectedFolder]);\r\n\r\n const summary = useMemo(() => {\r\n let selectedFilesCount = 0;\r\n let selectedBytes = 0;\r\n\r\n const restorableFiles = fileSelectCondition ? files.filter((file) => fileSelectCondition(file)) : files;\r\n\r\n restorableFiles.forEach((file) => {\r\n if (isPathSelected(file.path)) {\r\n selectedFilesCount++;\r\n if (!file.isDirectory) {\r\n selectedBytes += file.size;\r\n }\r\n }\r\n });\r\n\r\n return {\r\n selectedFiles: selectedFilesCount,\r\n totalFiles: restorableFiles.length,\r\n selectedBytes,\r\n totalBytes: restorableFiles.reduce((acc, file) => acc + (!file.isDirectory ? file.size : 0), 0),\r\n };\r\n }, [files, selectedFiles]);\r\n\r\n const handleSort = (field: 'name' | 'modifiedAt' | 'size') => {\r\n if (sortField === field) {\r\n // Toggle direction if clicking the same field\r\n setSortDirection(sortDirection === 'asc' ? 'desc' : 'asc');\r\n } else {\r\n // Set new field and default to ascending\r\n setSortField(field);\r\n setSortDirection('asc');\r\n }\r\n };\r\n\r\n const onFileSelect = (path: string, isDirectory: boolean) => {\r\n const newSelected = { ...selectedFiles };\r\n const isCurrentlySelected = isPathSelected(path);\r\n\r\n if (isDirectory) {\r\n const childPaths = getAllChildPaths(path);\r\n\r\n if (isCurrentlySelected) {\r\n // Deselecting directory\r\n newSelected.exclude.add(path);\r\n newSelected.include.delete(path);\r\n\r\n // Remove any child paths from both include and exclude (they inherit exclusion from parent)\r\n childPaths.forEach((childPath) => {\r\n newSelected.include.delete(childPath);\r\n newSelected.exclude.delete(childPath);\r\n });\r\n } else {\r\n // Selecting directory\r\n newSelected.exclude.delete(path);\r\n\r\n // If we have explicit includes, we need to add this to include\r\n if (newSelected.include.size > 0) {\r\n // Check if parent is already included\r\n const parentInclude = getEffectiveParentInclude(path);\r\n if (!parentInclude) {\r\n newSelected.include.add(path);\r\n }\r\n }\r\n\r\n // Remove any child paths from both include and exclude (they inherit from parent)\r\n childPaths.forEach((childPath) => {\r\n newSelected.include.delete(childPath);\r\n newSelected.exclude.delete(childPath);\r\n });\r\n }\r\n } else {\r\n // File selection\r\n if (isCurrentlySelected) {\r\n // Deselecting file\r\n newSelected.exclude.add(path);\r\n newSelected.include.delete(path);\r\n } else {\r\n // Selecting file - always allow this\r\n newSelected.exclude.delete(path);\r\n\r\n // If we have explicit includes OR if parent is excluded, we need to add this to include\r\n if (newSelected.include.size > 0) {\r\n const parentInclude = getEffectiveParentInclude(path);\r\n if (!parentInclude) {\r\n newSelected.include.add(path);\r\n }\r\n } else {\r\n // Check if any parent is excluded - if so, we need to start using includes\r\n const hasExcludedParent = Array.from(newSelected.exclude).some(\r\n (excludedPath) => path.startsWith(excludedPath + '/') || path.startsWith(excludedPath + '\\\\'),\r\n );\r\n if (hasExcludedParent) {\r\n newSelected.include.add(path);\r\n }\r\n }\r\n }\r\n }\r\n\r\n setSelectedFiles({\r\n include: new Set(newSelected.include),\r\n exclude: new Set(newSelected.exclude),\r\n });\r\n\r\n onSelect({\r\n includes: newSelected.include,\r\n excludes: newSelected.exclude,\r\n });\r\n };\r\n\r\n const getDirectChildren = (parentPath: string) => {\r\n let children = [];\r\n\r\n if (!parentPath && fileSystem['']) {\r\n children = fileSystem[''];\r\n } else {\r\n children = fileSystem[parentPath] || [];\r\n }\r\n const directories = children.filter((item) => item.isDirectory);\r\n const files = children.filter((item) => !item.isDirectory);\r\n return [\r\n ...(sortFileItems(directories, sortField, sortDirection) as RestoreFileItem[]),\r\n ...(sortFileItems(files, sortField, sortDirection) as RestoreFileItem[]),\r\n ];\r\n };\r\n\r\n const directChildren = useMemo(() => {\r\n if (!selectedFolder) return [];\r\n\r\n const children = getDirectChildren(selectedFolder);\r\n const hasParent = getParentPath(selectedFolder) !== selectedFolder;\r\n\r\n // Add parent navigation item if needed\r\n return hasParent ? [null, ...children] : children;\r\n }, [selectedFolder, fileSystem, sortField, sortDirection]);\r\n\r\n const Row = ({ index, style }: { index: number; style: React.CSSProperties }) => {\r\n const item = directChildren[index];\r\n\r\n // Parent directory navigation\r\n if (item === null) {\r\n return (\r\n <SnapshotBrowserGoUpRow\r\n style={style}\r\n onGoUp={() => {\r\n const parentPath = getParentPath(selectedFolder);\r\n const normalizedParentPath = normalizePath(parentPath);\r\n if (!normalizedParentPath || normalizedParentPath === '') return;\r\n expandParentFolders(normalizedParentPath);\r\n setSelectedFolder(normalizedParentPath);\r\n }}\r\n gridTemplateColumns={GRID_COLUMNS}\r\n />\r\n );\r\n }\r\n\r\n const file = item;\r\n const parts = splitPath(file.path);\r\n const fileName = parts[parts.length - 1];\r\n const normalizedPath = normalizePath(file.path);\r\n const isDirectory = directories.includes(normalizedPath);\r\n const isSelected = isPathSelected(file.path);\r\n const canBeSelected = fileSelectCondition ? fileSelectCondition(file) : true;\r\n\r\n return (\r\n <div\r\n style={{ ...style, gridTemplateColumns: GRID_COLUMNS }}\r\n key={file.path}\r\n className={`${sbClasses.snapshotFile} ${isDirectory ? sbClasses.fileIsDir : ''} ${showChange && file.changeType === 'modified' ? classes.fileModified : ''} ${showChange && file.changeType === 'removed' ? classes.fileRemoved : ''}`}\r\n onClick={() => {\r\n if (isDirectory) {\r\n expandParentFolders(normalizedPath);\r\n setSelectedFolder(normalizedPath);\r\n }\r\n }}\r\n >\r\n <div className={sbClasses.fileName}>\r\n <button\r\n className={`${classes.selectButton} ${isSelected ? classes.selected : ''} ${!canBeSelected ? classes.notSelectable : ''}`}\r\n onClick={(e) => {\r\n if (!canBeSelected) return;\r\n e.stopPropagation();\r\n onFileSelect(file.path, false);\r\n }}\r\n disabled={!canBeSelected}\r\n >\r\n {canBeSelected ? <Icon type={isSelected ? 'check-circle-filled' : 'check-circle'} size={13} /> : null}\r\n </button>\r\n {isDirectory ? <Icon type={isDirectory ? 'fm-directory' : 'fm-file'} size={16} /> : <FileIcon filename={fileName || ''} />} {fileName}\r\n </div>\r\n <div className={classes.fileModified}>{formatDateTime(file.modifiedAt)}</div>\r\n <div className={classes.fileSize}>{formatBytes(file.size || 0)}</div>\r\n </div>\r\n );\r\n };\r\n\r\n return (\r\n <div className={classes.restoreFileSelector}>\r\n {isLoading && (\r\n <div className={classes.loader}>\r\n <Icon type=\"loading\" size={24} /> Loading Snapshot Content..\r\n </div>\r\n )}\r\n <div className={sbClasses.snapshotBrowser}>\r\n <SnapshotBrowserToolbar\r\n search={search}\r\n onSearchChange={setSearch}\r\n leftContent={\r\n <div className={sbClasses.stats}>\r\n <strong>Summary: </strong>\r\n {formatNumberToK(summary.selectedFiles)}/{formatNumberToK(summary.totalFiles)} Items {' • '}\r\n {formatBytes(summary.selectedBytes)}/{formatBytes(summary.totalBytes)}\r\n {selectedFiles.exclude.size > 0 && (\r\n <div className={classes.excludedStat}>\r\n {' • '}\r\n <span>\r\n Excluded:{' '}\r\n <i title={Array.from(selectedFiles.exclude).join('\\n')}>{formatNumberToK(selectedFiles.exclude.size)} Items</i>\r\n </span>\r\n </div>\r\n )}\r\n </div>\r\n }\r\n />\r\n\r\n <div className={sbClasses.browserContent}>\r\n <SnapshotBrowserDirectories\r\n directories={directories}\r\n selectedFolder={selectedFolder}\r\n expandedFolders={expandedFolders}\r\n onDirectoryClick={(dir) => setSelectedFolder(dir)}\r\n onToggleFolder={toggleFolder}\r\n isVisible={isVisible}\r\n hasSubdirectories={hasSubdirectories}\r\n renderDirectoryExtra={(dir) => {\r\n const isSelected = isPathSelected(files.find((f) => f.isDirectory && normalizePath(f.path) === dir)?.path || dir);\r\n return (\r\n <button\r\n className={`${classes.selectButton} ${isSelected ? classes.selected : ''}`}\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n const originalPath = files.find((f) => f.isDirectory && normalizePath(f.path) === dir)?.path || dir;\r\n onFileSelect(originalPath, true);\r\n }}\r\n >\r\n <Icon type={isSelected ? 'check-circle-filled' : 'check-circle'} size={13} />\r\n </button>\r\n );\r\n }}\r\n />\r\n\r\n <div className={`${sbClasses.content} styled__scrollbar`}>\r\n <SnapshotBrowserFileList\r\n files={directChildren}\r\n height={window.innerHeight - 370}\r\n itemSize={ITEM_HEIGHT}\r\n headerContent={\r\n <>\r\n <div onClick={() => handleSort('name')} className={sortField === 'name' ? classes.activeSort : ''}>\r\n Name {sortField === 'name' && (sortDirection === 'asc' ? '↑' : '↓')}\r\n </div>\r\n <div onClick={() => handleSort('modifiedAt')} className={sortField === 'modifiedAt' ? classes.activeSort : ''}>\r\n Last Modified {sortField === 'modifiedAt' && (sortDirection === 'asc' ? '↑' : '↓')}\r\n </div>\r\n <div onClick={() => handleSort('size')} className={sortField === 'size' ? classes.activeSort : ''}>\r\n Size {sortField === 'size' && (sortDirection === 'asc' ? '↑' : '↓')}\r\n </div>\r\n </>\r\n }\r\n renderRow={Row}\r\n selectedFolder={selectedFolder || null}\r\n gridTemplateColumns={GRID_COLUMNS}\r\n emptyMessage=\"Select a folder from the left to browse it's content\"\r\n />\r\n {errorFetching && <div className={classes.error}>Failed to load files. Please try again.</div>}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nexport default RestoreFileSelector;\r\n"],"names":["isMobileDevice","isMobile","ITEM_HEIGHT","GRID_COLUMNS","RestoreFileSelector","selected","files","isLoading","errorFetching","showChange","onSelect","fileSelectCondition","search","setSearch","useState","sortField","setSortField","sortDirection","setSortDirection","selectedFiles","setSelectedFiles","getAllChildPaths","dirPath","allPaths","file","isPathSelected","path","excludedPath","includedPath","getEffectiveParentInclude","expandedFolders","setExpandedFolders","separator","getPathSeparator","parts","splitPath","currentPath","part","index","fileSystem","useMemo","system","dirSizes","calculateDirectorySizes","theFile","getParentPath","normalizedDirPath","normalizePath","directories","a","b","aParts","bParts","minLength","i","comparison","selectedFolder","setSelectedFolder","hasSubdirectories","isVisible","expandParentFolders","toggleFolder","useSnapshotNavigation","useEffect","summary","selectedFilesCount","selectedBytes","restorableFiles","acc","handleSort","field","onFileSelect","isDirectory","newSelected","isCurrentlySelected","childPaths","childPath","getDirectChildren","parentPath","children","item","sortFileItems","directChildren","Row","style","jsx","SnapshotBrowserGoUpRow","normalizedParentPath","fileName","normalizedPath","isSelected","canBeSelected","jsxs","sbClasses","classes","e","Icon","FileIcon","formatDateTime","formatBytes","SnapshotBrowserToolbar","formatNumberToK","SnapshotBrowserDirectories","dir","_a","f","originalPath","SnapshotBrowserFileList","Fragment"],"mappings":";;;;;;;;;;;;;AAyBA,MAAMA,KAAiBC,GAAA,GACjBC,KAAcF,KAAiB,KAAK,IACpCG,IAAe,gCAEfC,KAAsB,CAAC,EAAE,UAAAC,GAAU,OAAAC,GAAO,WAAAC,GAAW,eAAAC,GAAe,YAAAC,GAAY,UAAAC,GAAU,qBAAAC,QAAoD;AACjJ,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAS,EAAE,GACjC,CAACC,GAAWC,CAAY,IAAIF,EAAyC,MAAM,GAC3E,CAACG,GAAeC,CAAgB,IAAIJ,EAAyB,KAAK,GAClE,CAACK,GAAeC,CAAgB,IAAIN,EAAyD,OAAO;AAAA,IACvG,SAAS,IAAI,IAAIT,EAAS,QAAQ;AAAA,IAClC,SAAS,IAAI,IAAIA,EAAS,QAAQ;AAAA,EAAA,EACnC;AAEF,UAAQ,IAAI,iCAAiCC,CAAK;AAElD,QAAMe,KAAmB,CAACC,MAA8B;AACrD,UAAMC,IAAqB,CAAA;AAE3B,WAAAjB,EAAM,QAAQ,CAACkB,MAAS;AAErB,OAAIA,EAAK,KAAK,WAAWF,IAAU,GAAG,KAAKE,EAAK,KAAK,WAAWF,IAAU,IAAI,MAC3EC,EAAS,KAAKC,EAAK,IAAI;AAAA,IAE7B,CAAC,GAEMD;AAAA,EACV,GAEME,IAAiB,CAACC,MAEjBP,EAAc,QAAQ,IAAIO,CAAI,KAKR,M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A,kBAC1F/E,MAAc,WAAWE,MAAkB,QAAQ,MAAM;AAAA,gBAAA,EAAA,CAClE;AAAA,cAAA,GACH;AAAA,cAEH,WAAWkE;AAAA,cACX,gBAAgB3B,KAAkB;AAAA,cAClC,qBAAqBrD;AAAA,cACrB,cAAa;AAAA,YAAA;AAAA,UAAA;AAAA,UAEfK,KAAiB,gBAAA6E,EAAC,OAAA,EAAI,WAAWS,EAAQ,OAAO,UAAA,0CAAA,CAAuC;AAAA,QAAA,EAAA,CAC3F;AAAA,MAAA,EAAA,CACH;AAAA,IAAA,EAAA,CACH;AAAA,EAAA,GACH;AAEN;"}
|
|
@@ -1,70 +1,26 @@
|
|
|
1
|
-
const e = "_restoreFileSelector_2yMzU", t = "
|
|
1
|
+
const e = "_restoreFileSelector_2yMzU", t = "_loader_LRDCX", o = "_excludedStat_Sg5Ma", l = "_selected_uDfXp", c = "_notSelectable_2i7O4", i = "_activeSort_oGaou", s = "_fileModified_yQxKz", d = "_fileRemoved_uYDMH", _ = "_selectButton_veFdV", a = "_fileSize_fm1U9", n = {
|
|
2
2
|
restoreFileSelector: e,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
sidebar: a,
|
|
13
|
-
sidebarHeader: d,
|
|
14
|
-
directory: f,
|
|
15
|
-
toggleButton: b,
|
|
16
|
-
togglePlaceholder: g,
|
|
17
|
-
dirName: m,
|
|
18
|
-
directoryEmpty: u,
|
|
19
|
-
selected: S,
|
|
20
|
-
notSelectable: h,
|
|
21
|
-
content: y,
|
|
22
|
-
fileList: p,
|
|
23
|
-
header: B,
|
|
24
|
-
activeSort: L,
|
|
25
|
-
fileListEmpty: x,
|
|
26
|
-
file: F,
|
|
27
|
-
fileIsDir: R,
|
|
28
|
-
fileName: v,
|
|
29
|
-
fileModified: D,
|
|
30
|
-
fileRemoved: E,
|
|
31
|
-
selectButton: N,
|
|
32
|
-
goUpButton: w,
|
|
33
|
-
fileSize: M
|
|
3
|
+
loader: t,
|
|
4
|
+
excludedStat: o,
|
|
5
|
+
selected: l,
|
|
6
|
+
notSelectable: c,
|
|
7
|
+
activeSort: i,
|
|
8
|
+
fileModified: s,
|
|
9
|
+
fileRemoved: d,
|
|
10
|
+
selectButton: _,
|
|
11
|
+
fileSize: a
|
|
34
12
|
};
|
|
35
13
|
export {
|
|
36
|
-
|
|
37
|
-
n as
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
F as file,
|
|
45
|
-
R as fileIsDir,
|
|
46
|
-
p as fileList,
|
|
47
|
-
x as fileListEmpty,
|
|
48
|
-
D as fileModified,
|
|
49
|
-
v as fileName,
|
|
50
|
-
E as fileRemoved,
|
|
51
|
-
M as fileSize,
|
|
52
|
-
w as goUpButton,
|
|
53
|
-
B as header,
|
|
54
|
-
o as loader,
|
|
55
|
-
h as notSelectable,
|
|
14
|
+
i as activeSort,
|
|
15
|
+
n as default,
|
|
16
|
+
o as excludedStat,
|
|
17
|
+
s as fileModified,
|
|
18
|
+
d as fileRemoved,
|
|
19
|
+
a as fileSize,
|
|
20
|
+
t as loader,
|
|
21
|
+
c as notSelectable,
|
|
56
22
|
e as restoreFileSelector,
|
|
57
|
-
|
|
58
|
-
l as
|
|
59
|
-
N as selectButton,
|
|
60
|
-
S as selected,
|
|
61
|
-
a as sidebar,
|
|
62
|
-
d as sidebarHeader,
|
|
63
|
-
c as stats,
|
|
64
|
-
b as toggleButton,
|
|
65
|
-
g as togglePlaceholder,
|
|
66
|
-
r as toolbar,
|
|
67
|
-
i as toolbarLeft,
|
|
68
|
-
s as toolbarRight
|
|
23
|
+
_ as selectButton,
|
|
24
|
+
l as selected
|
|
69
25
|
};
|
|
70
26
|
//# sourceMappingURL=RestoreFileSelector.module.scss.js.map
|
package/dist-lib/components/Restore/RestoreFileSelector/RestoreFileSelector.module.scss.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RestoreFileSelector.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RestoreFileSelector.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RestoredFileBrowser.d.ts","sourceRoot":"","sources":["../../../../src/components/Restore/RestoredFileBrowser/RestoredFileBrowser.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"RestoredFileBrowser.d.ts","sourceRoot":"","sources":["../../../../src/components/Restore/RestoredFileBrowser/RestoredFileBrowser.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAOhF,UAAU,wBAAwB;IAC/B,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;CACtB;AAMD,QAAA,MAAM,mBAAmB,GAAI,6BAAqC,wBAAwB,4CAgOzF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,194 +1,160 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import C from "../../common/Icon/Icon.js";
|
|
5
|
-
import s from "./RestoredFileBrowser.module.scss.js";
|
|
6
|
-
import { formatNumberToK as J, formatBytes as D, isMobile as Q } from "../../../utils/helpers.js";
|
|
7
|
-
import { getPathSeparator as g, splitPath as p, getParentPath as S, normalizePath as y } from "../../../utils/restore.js";
|
|
1
|
+
import { jsxs as d, jsx as o, Fragment as q } from "react/jsx-runtime";
|
|
2
|
+
import { useState as z, useMemo as x, useEffect as J } from "react";
|
|
3
|
+
import Q from "../../common/Icon/Icon.js";
|
|
8
4
|
import X from "../../common/FileIcon/FileIcon.js";
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
import m from "./RestoredFileBrowser.module.scss.js";
|
|
6
|
+
import { formatNumberToK as Y, formatBytes as B, isMobile as Z } from "../../../utils/helpers.js";
|
|
7
|
+
import { getPathSeparator as D, splitPath as F, getParentPath as P, normalizePath as g } from "../../../utils/restore.js";
|
|
8
|
+
import { useSnapshotNavigation as ee } from "../../common/SnapshotBrowser/hooks/useSnapshotNavigation.js";
|
|
9
|
+
import h from "../../common/SnapshotBrowser/SnapshotBrowser.module.scss.js";
|
|
10
|
+
import te from "../../common/SnapshotBrowser/SnapshotBrowserToolbar.js";
|
|
11
|
+
import re from "../../common/SnapshotBrowser/SnapshotBrowserDirectories.js";
|
|
12
|
+
import oe from "../../common/SnapshotBrowser/SnapshotBrowserFileList.js";
|
|
13
|
+
import se from "../../common/SnapshotBrowser/SnapshotBrowserGoUpRow.js";
|
|
14
|
+
const ne = Z(), ae = ne ? 65 : 45, E = "1fr 100px minmax(80px, auto)", ye = ({ files: p, stats: S, isPreview: k = !1 }) => {
|
|
15
|
+
const [C, A] = z(""), [u, L] = z({
|
|
11
16
|
unchanged: !0,
|
|
12
17
|
restored: !0,
|
|
13
18
|
updated: !0
|
|
14
|
-
}), [
|
|
19
|
+
}), [I, R] = z(() => {
|
|
15
20
|
const e = /* @__PURE__ */ new Set();
|
|
16
|
-
return
|
|
17
|
-
const
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
return p.forEach((r) => {
|
|
22
|
+
const n = D(r.path), t = F(r.path);
|
|
23
|
+
let i = "";
|
|
24
|
+
t.forEach((a, c) => {
|
|
25
|
+
i = i ? `${i}${n}${a}` : a, c < 3 && e.add(i);
|
|
21
26
|
});
|
|
22
27
|
}), e;
|
|
23
|
-
}),
|
|
28
|
+
}), w = x(() => {
|
|
24
29
|
const e = {};
|
|
25
|
-
return
|
|
26
|
-
const
|
|
27
|
-
return
|
|
28
|
-
}).forEach((
|
|
29
|
-
const
|
|
30
|
-
|
|
30
|
+
return p.filter((r) => {
|
|
31
|
+
const n = r.path.toLowerCase().includes(C.toLowerCase()), t = u[r.action];
|
|
32
|
+
return n && t;
|
|
33
|
+
}).forEach((r) => {
|
|
34
|
+
const n = P(r.path), t = g(n);
|
|
35
|
+
t && (e[t] || (e[t] = []), e[t].push(r));
|
|
31
36
|
}), e;
|
|
32
|
-
}, [
|
|
37
|
+
}, [p, C, u]), l = x(() => {
|
|
33
38
|
const e = /* @__PURE__ */ new Set();
|
|
34
|
-
return
|
|
35
|
-
const
|
|
36
|
-
let
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
return p.forEach((r) => {
|
|
40
|
+
const n = P(r.path), t = D(n), i = F(n);
|
|
41
|
+
let a = "";
|
|
42
|
+
i.forEach((c) => {
|
|
43
|
+
a = a ? `${a}${t}${c}` : c, a && e.add(a);
|
|
39
44
|
});
|
|
40
45
|
}), Array.from(e);
|
|
41
|
-
}, [
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
r.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
return r.every((c) => (n = n ? `${n}${t}${c}` : c, N.has(n)));
|
|
61
|
-
}, k = x(() => !d || !b[d] ? [] : b[d].sort((e, t) => {
|
|
62
|
-
const o = y(e.path), r = y(t.path), n = h.includes(o), c = h.includes(r);
|
|
63
|
-
if (n && !c) return -1;
|
|
64
|
-
if (!n && c) return 1;
|
|
65
|
-
const i = { restored: 0, updated: 1, unchanged: 2 };
|
|
66
|
-
return i[e.action] - i[t.action];
|
|
67
|
-
}), [d, b, h]), F = d && S(d) !== d && d !== "" && d !== "/", B = k.length + (F ? 1 : 0), T = ({ index: e, style: t }) => {
|
|
68
|
-
if (F && e === 0)
|
|
69
|
-
return /* @__PURE__ */ l(
|
|
70
|
-
"div",
|
|
46
|
+
}, [p]), { selectedFolder: s, setSelectedFolder: f, hasSubdirectories: G, isVisible: M, expandParentFolders: b, toggleFolder: _ } = ee(
|
|
47
|
+
l,
|
|
48
|
+
I,
|
|
49
|
+
R,
|
|
50
|
+
{ splitPath: F, getPathSeparator: D, hasLeadingSeparator: !1 }
|
|
51
|
+
);
|
|
52
|
+
J(() => {
|
|
53
|
+
l.length > 0 && s === "" && f(l[0]);
|
|
54
|
+
}, [l, s, f]);
|
|
55
|
+
const $ = (e) => Object.entries(w).some(([r, n]) => r.startsWith(e) && n.some((t) => t.action === "restored" || t.action === "updated")), T = x(() => !s || !w[s] ? [] : w[s].sort((e, r) => {
|
|
56
|
+
const n = g(e.path), t = g(r.path), i = l.includes(n), a = l.includes(t);
|
|
57
|
+
if (i && !a) return -1;
|
|
58
|
+
if (!i && a) return 1;
|
|
59
|
+
const c = { restored: 0, updated: 1, unchanged: 2 };
|
|
60
|
+
return c[e.action] - c[r.action];
|
|
61
|
+
}), [s, w, l]), v = s && P(s) !== s && s !== "" && s !== "/", j = T.length + (v ? 1 : 0), H = ({ index: e, style: r }) => {
|
|
62
|
+
if (v && e === 0)
|
|
63
|
+
return /* @__PURE__ */ o(
|
|
64
|
+
se,
|
|
71
65
|
{
|
|
72
|
-
style:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
console.log("normalizedParentPath :", v), !(!v || v === "") && (E(v), P(v));
|
|
66
|
+
style: r,
|
|
67
|
+
onGoUp: () => {
|
|
68
|
+
const W = P(s), y = g(W);
|
|
69
|
+
!y || y === "" || (b(y), f(y));
|
|
77
70
|
},
|
|
78
|
-
|
|
79
|
-
/* @__PURE__ */ a("div", { className: s.fileName, children: "..." }),
|
|
80
|
-
/* @__PURE__ */ a("div", { className: s.status }),
|
|
81
|
-
/* @__PURE__ */ a("div", {})
|
|
82
|
-
]
|
|
71
|
+
gridTemplateColumns: E
|
|
83
72
|
}
|
|
84
73
|
);
|
|
85
|
-
const
|
|
86
|
-
if (!
|
|
87
|
-
const
|
|
88
|
-
return /* @__PURE__ */
|
|
74
|
+
const n = v ? e - 1 : e, t = T[n];
|
|
75
|
+
if (!t) return null;
|
|
76
|
+
const i = F(t.path), a = i[i.length - 1], c = g(t.path), N = l.includes(c), O = $(c), K = t.action, U = t.action === "restored", V = U ? "New" : t.action;
|
|
77
|
+
return /* @__PURE__ */ d(
|
|
89
78
|
"div",
|
|
90
79
|
{
|
|
91
|
-
style:
|
|
92
|
-
className: `${
|
|
80
|
+
style: { ...r, gridTemplateColumns: E },
|
|
81
|
+
className: `${h.snapshotFile} ${N ? h.fileIsDir : ""}`,
|
|
93
82
|
onClick: () => {
|
|
94
|
-
|
|
83
|
+
N && (f(c), b(c));
|
|
95
84
|
},
|
|
96
85
|
children: [
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
|
|
86
|
+
/* @__PURE__ */ d("div", { className: h.fileName, children: [
|
|
87
|
+
N ? /* @__PURE__ */ o(Q, { type: "fm-directory", size: 16 }) : /* @__PURE__ */ o(X, { filename: a || "" }),
|
|
99
88
|
" ",
|
|
100
|
-
|
|
89
|
+
U && /* @__PURE__ */ o("span", { className: m.newFileIndicator }),
|
|
101
90
|
" ",
|
|
102
|
-
|
|
103
|
-
|
|
91
|
+
a,
|
|
92
|
+
O && /* @__PURE__ */ o("i", {})
|
|
104
93
|
] }),
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ o("div", { className: `${m.status} ${m[K]}`, children: /* @__PURE__ */ o("i", { children: V }) }),
|
|
95
|
+
/* @__PURE__ */ o("div", { className: m.fileSize, children: N ? "-" : B(t.size) })
|
|
107
96
|
]
|
|
108
97
|
}
|
|
109
98
|
);
|
|
110
99
|
};
|
|
111
|
-
return /* @__PURE__ */
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
e === "restored" ? "New" : e
|
|
127
|
-
] }, e)) }),
|
|
128
|
-
/* @__PURE__ */ l("div", { className: s.search, children: [
|
|
129
|
-
/* @__PURE__ */ a(C, { type: "search", size: 16 }),
|
|
130
|
-
/* @__PURE__ */ a("input", { type: "text", placeholder: "Search in current Directory...", value: z, onChange: (e) => U(e.target.value) })
|
|
131
|
-
] })
|
|
132
|
-
] })
|
|
133
|
-
] }),
|
|
134
|
-
/* @__PURE__ */ l("div", { className: s.browserContent, children: [
|
|
135
|
-
/* @__PURE__ */ l("div", { className: `${s.sidebar} styled__scrollbar`, children: [
|
|
136
|
-
/* @__PURE__ */ a("div", { className: s.sidebarHeader, children: "Directories" }),
|
|
137
|
-
h.map((e) => {
|
|
138
|
-
const t = p(e), o = t[t.length - 1], r = t.length - 1, n = N.has(e), c = L(e), i = H(e);
|
|
139
|
-
return r === 0 || R(e) ? /* @__PURE__ */ l(
|
|
140
|
-
"div",
|
|
141
|
-
{
|
|
142
|
-
className: `${s.directory} ${d === e ? s.selected : ""} ${i ? "" : s.directoryEmpty}`,
|
|
143
|
-
style: { paddingLeft: `${r * 20}px` },
|
|
144
|
-
onClick: () => {
|
|
145
|
-
P(e), E(e);
|
|
146
|
-
},
|
|
147
|
-
children: [
|
|
148
|
-
i ? /* @__PURE__ */ a(
|
|
149
|
-
"button",
|
|
150
|
-
{
|
|
151
|
-
className: s.toggleButton,
|
|
152
|
-
onClick: (m) => {
|
|
153
|
-
m.stopPropagation(), M(e);
|
|
154
|
-
},
|
|
155
|
-
children: n ? "-" : "+"
|
|
156
|
-
}
|
|
157
|
-
) : /* @__PURE__ */ a("span", { className: `${s.togglePlaceholder}` }),
|
|
158
|
-
/* @__PURE__ */ l("span", { className: s.dirName, children: [
|
|
159
|
-
/* @__PURE__ */ a(C, { type: "fm-directory", size: 14 }),
|
|
160
|
-
" ",
|
|
161
|
-
o,
|
|
162
|
-
c && /* @__PURE__ */ a("span", { className: s.notification })
|
|
163
|
-
] })
|
|
164
|
-
]
|
|
165
|
-
},
|
|
166
|
-
e
|
|
167
|
-
) : null;
|
|
168
|
-
})
|
|
169
|
-
] }),
|
|
170
|
-
/* @__PURE__ */ a("div", { className: s.content, children: /* @__PURE__ */ l("div", { className: s.fileList, children: [
|
|
171
|
-
/* @__PURE__ */ l("div", { className: s.header, children: [
|
|
172
|
-
/* @__PURE__ */ a("div", { children: "Name" }),
|
|
173
|
-
/* @__PURE__ */ a("div", { children: "Status" }),
|
|
174
|
-
/* @__PURE__ */ a("div", { children: "Size" })
|
|
100
|
+
return /* @__PURE__ */ d("div", { className: h.snapshotBrowser, children: [
|
|
101
|
+
/* @__PURE__ */ o(
|
|
102
|
+
te,
|
|
103
|
+
{
|
|
104
|
+
search: C,
|
|
105
|
+
onSearchChange: A,
|
|
106
|
+
leftContent: S && /* @__PURE__ */ d("div", { className: h.stats, children: [
|
|
107
|
+
/* @__PURE__ */ o("strong", { children: "Summary: " }),
|
|
108
|
+
" ",
|
|
109
|
+
Y(S.total_files),
|
|
110
|
+
" Items ",
|
|
111
|
+
" • ",
|
|
112
|
+
B(S.bytes_restored),
|
|
113
|
+
"/",
|
|
114
|
+
B(S.total_bytes)
|
|
175
115
|
] }),
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
116
|
+
rightContent: /* @__PURE__ */ o("div", { className: m.filters, children: Object.keys(u).map((e) => /* @__PURE__ */ d("label", { children: [
|
|
117
|
+
/* @__PURE__ */ o("input", { type: "checkbox", checked: u[e], onChange: (r) => L({ ...u, [e]: r.target.checked }) }),
|
|
118
|
+
e === "restored" ? "New" : e
|
|
119
|
+
] }, e)) })
|
|
120
|
+
}
|
|
121
|
+
),
|
|
122
|
+
/* @__PURE__ */ d("div", { className: h.browserContent, children: [
|
|
123
|
+
/* @__PURE__ */ o(
|
|
124
|
+
re,
|
|
125
|
+
{
|
|
126
|
+
directories: l,
|
|
127
|
+
selectedFolder: s,
|
|
128
|
+
expandedFolders: I,
|
|
129
|
+
onDirectoryClick: (e) => {
|
|
130
|
+
f(e), b(e);
|
|
131
|
+
},
|
|
132
|
+
onToggleFolder: _,
|
|
133
|
+
isVisible: M,
|
|
134
|
+
hasSubdirectories: G,
|
|
135
|
+
renderDirectoryExtra: (e) => $(e) ? /* @__PURE__ */ o("span", { className: m.notification }) : null
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
/* @__PURE__ */ o("div", { className: h.content, children: /* @__PURE__ */ o(
|
|
139
|
+
oe,
|
|
140
|
+
{
|
|
141
|
+
files: Array(j),
|
|
142
|
+
height: window.innerHeight - (k ? 370 : 250),
|
|
143
|
+
itemSize: ae,
|
|
144
|
+
headerContent: /* @__PURE__ */ d(q, { children: [
|
|
145
|
+
/* @__PURE__ */ o("div", { children: "Name" }),
|
|
146
|
+
/* @__PURE__ */ o("div", { children: "Status" }),
|
|
147
|
+
/* @__PURE__ */ o("div", { children: "Size" })
|
|
148
|
+
] }),
|
|
149
|
+
renderRow: H,
|
|
150
|
+
selectedFolder: s || null,
|
|
151
|
+
gridTemplateColumns: E
|
|
152
|
+
}
|
|
153
|
+
) })
|
|
188
154
|
] })
|
|
189
155
|
] });
|
|
190
156
|
};
|
|
191
157
|
export {
|
|
192
|
-
|
|
158
|
+
ye as default
|
|
193
159
|
};
|
|
194
160
|
//# sourceMappingURL=RestoredFileBrowser.js.map
|