-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: renterd multipart remote uploads
- Loading branch information
1 parent
c153545
commit 48e90d2
Showing
42 changed files
with
957 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'renterd': minor | ||
--- | ||
|
||
Buckets now have a third view for viewing all active uploads, both local and from other sessions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'renterd': minor | ||
--- | ||
|
||
Remote file uploads can now be aborted from the uploads explorer. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'renterd': minor | ||
--- | ||
|
||
The transfers bar now only lists downloads and shows two buttons with one navigating to the new uploads list. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
apps/renterd/components/Files/FilesExplorerModeContextMenu.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { | ||
Button, | ||
DropdownMenu, | ||
DropdownMenuItem, | ||
DropdownMenuLeftSlot, | ||
} from '@siafoundation/design-system' | ||
import { CloudUpload16, Earth16, Folder16 } from '@siafoundation/react-icons' | ||
import { useFilesManager } from '../../contexts/filesManager' | ||
import { useUploads } from '../../contexts/uploads' | ||
|
||
export function FilesExplorerModeContextMenu() { | ||
const { activeExplorerMode, setExplorerModeDirectory, setExplorerModeFlat } = | ||
useFilesManager() | ||
const { isViewingUploads, navigateToUploads } = useUploads() | ||
|
||
return ( | ||
<DropdownMenu | ||
trigger={ | ||
<Button | ||
tipSide="bottom" | ||
tip={ | ||
isViewingUploads | ||
? 'Viewing uploads' | ||
: activeExplorerMode === 'directory' | ||
? 'Viewing directory explorer' | ||
: 'Viewing all bucket files' | ||
} | ||
> | ||
{isViewingUploads ? ( | ||
<CloudUpload16 /> | ||
) : activeExplorerMode === 'directory' ? ( | ||
<Folder16 /> | ||
) : ( | ||
<Earth16 /> | ||
)} | ||
</Button> | ||
} | ||
contentProps={{ | ||
align: 'start', | ||
side: 'bottom', | ||
className: 'max-w-[300px]', | ||
}} | ||
> | ||
<DropdownMenuItem onSelect={setExplorerModeDirectory}> | ||
<DropdownMenuLeftSlot> | ||
<Folder16 /> | ||
</DropdownMenuLeftSlot> | ||
Directory | ||
</DropdownMenuItem> | ||
<DropdownMenuItem onSelect={setExplorerModeFlat}> | ||
<DropdownMenuLeftSlot> | ||
<Earth16 /> | ||
</DropdownMenuLeftSlot> | ||
All files | ||
</DropdownMenuItem> | ||
<DropdownMenuItem onSelect={navigateToUploads}> | ||
<DropdownMenuLeftSlot> | ||
<CloudUpload16 /> | ||
</DropdownMenuLeftSlot> | ||
Uploads | ||
</DropdownMenuItem> | ||
</DropdownMenu> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { ProgressBar, Text } from '@siafoundation/design-system' | ||
import { useMemo } from 'react' | ||
import { upperFirst } from '@technically/lodash' | ||
|
||
function getProgress(transfer: { loaded?: number; size?: number }) { | ||
return transfer.loaded !== undefined ? transfer.loaded / transfer.size : 1 | ||
} | ||
|
||
type Props = { | ||
loaded: number | ||
size: number | ||
status: string | ||
} | ||
|
||
export function TransferProgress({ loaded, size, status }: Props) { | ||
const progress = useMemo(() => getProgress({ loaded, size }), [loaded, size]) | ||
return ( | ||
<div className="flex flex-col gap-1 w-full"> | ||
<ProgressBar | ||
variant="accent" | ||
value={loaded} | ||
max={size} | ||
className={progress === 1 ? 'animate-pulse' : ''} | ||
/> | ||
<div className="flex gap-2 justify-between"> | ||
<Text size="12" color="subtle"> | ||
{upperFirst(status)} | ||
</Text> | ||
<Text size="12" color="subtle"> | ||
{(progress * 100).toFixed(0)}% | ||
</Text> | ||
</div> | ||
</div> | ||
) | ||
} |
Oops, something went wrong.