-
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): uploads list local and remote
- Loading branch information
1 parent
27f4730
commit 713e839
Showing
16 changed files
with
382 additions
and
338 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 | ||
--- | ||
|
||
The uploads list now has two views, one for local uploads only and one for all uploads including from other devices. |
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
29 changes: 0 additions & 29 deletions
29
apps/renterd/components/Uploads/EmptyState/StateNoneMatching.tsx
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
apps/renterd/components/Uploads/EmptyState/StateNoneYet.tsx
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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,47 @@ | ||
import { Code, LinkButton, Text } from '@siafoundation/design-system' | ||
import { CloudUpload32 } from '@siafoundation/react-icons' | ||
import { routes } from '../../config/routes' | ||
import { useFilesManager } from '../../contexts/filesManager' | ||
import { useUploads } from '../../contexts/uploads' | ||
|
||
export function StateNoneYet() { | ||
const { activeView } = useUploads() | ||
const { activeBucketName: activeBucket } = useFilesManager() | ||
|
||
const href = activeBucket | ||
? routes.buckets.files | ||
.replace('[bucket]', activeBucket) | ||
.replace('[path]', '') | ||
: routes.buckets.index | ||
|
||
return ( | ||
<div className="flex flex-col gap-10 justify-center items-center h-[400px]"> | ||
<Text> | ||
<CloudUpload32 className="scale-[200%]" /> | ||
</Text> | ||
<div className="flex flex-col gap-3 items-center"> | ||
<Text color="subtle" className="text-center max-w-[500px]"> | ||
{activeView === 'localUploads' ? ( | ||
<> | ||
The <Code>{activeBucket}</Code> bucket does not have any active | ||
uploads from this session. | ||
</> | ||
) : ( | ||
<> | ||
The <Code>{activeBucket}</Code> bucket does not have any active | ||
uploads. | ||
</> | ||
)} | ||
</Text> | ||
<LinkButton | ||
href={href} | ||
onClick={(e) => { | ||
e.stopPropagation() | ||
}} | ||
> | ||
{activeBucket ? 'View files' : 'View buckets list'} | ||
</LinkButton> | ||
</div> | ||
</div> | ||
) | ||
} |
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,60 @@ | ||
import { | ||
Button, | ||
PaginatorKnownTotal, | ||
PaginatorMarker, | ||
} from '@siafoundation/design-system' | ||
import { useUploads } from '../../contexts/uploads' | ||
|
||
export function UploadsStatsMenu() { | ||
const { | ||
activeData, | ||
abortAll, | ||
activeView, | ||
remoteUploads, | ||
localUploads, | ||
setActiveView, | ||
} = useUploads() | ||
|
||
const paginatorEl = | ||
activeView === 'globalUploads' ? ( | ||
<PaginatorMarker | ||
marker={remoteUploads.marker} | ||
nextMarker={remoteUploads.nextMarker} | ||
isMore={remoteUploads.hasMore} | ||
limit={remoteUploads.limit} | ||
pageTotal={remoteUploads.datasetPageTotal} | ||
isLoading={remoteUploads.datasetState === 'loading'} | ||
/> | ||
) : ( | ||
<PaginatorKnownTotal | ||
offset={localUploads.offset} | ||
limit={localUploads.limit} | ||
total={localUploads.datasetPageTotal} | ||
isLoading={localUploads.datasetState === 'loading'} | ||
/> | ||
) | ||
|
||
return ( | ||
<div className="flex gap-3 w-full"> | ||
<Button | ||
onClick={() => setActiveView('localUploads')} | ||
variant={activeView === 'localUploads' ? 'active' : 'inactive'} | ||
> | ||
Local uploads ({localUploads.datasetTotal.toLocaleString()}) | ||
</Button> | ||
<Button | ||
onClick={() => setActiveView('globalUploads')} | ||
variant={activeView === 'globalUploads' ? 'active' : 'inactive'} | ||
> | ||
All uploads | ||
</Button> | ||
<div className="flex-1" /> | ||
{activeData.datasetPageTotal > 0 && ( | ||
<Button onClick={abortAll}> | ||
Abort ({activeData.datasetPageTotal}) | ||
</Button> | ||
)} | ||
{paginatorEl} | ||
</div> | ||
) | ||
} |
30 changes: 0 additions & 30 deletions
30
apps/renterd/components/Uploads/UploadsStatsMenu/index.tsx
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.