-
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 alert improvements and reset account drift
- Loading branch information
1 parent
8aa3db0
commit 1053c50
Showing
26 changed files
with
605 additions
and
306 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 @@ | ||
--- | ||
'@siafoundation/react-renterd': minor | ||
--- | ||
|
||
Added useAccountResetDrift. |
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': patch | ||
--- | ||
|
||
Fixed an issue where the alerts list would trigger an excessive number of API calls to fetch contract and host metadata. |
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 @@ | ||
--- | ||
'@siafoundation/design-system': minor | ||
--- | ||
|
||
Table now has row specific cell class name props that do not apply to the table header. |
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 | ||
--- | ||
|
||
Account alerts now feature an accounts context menu with the option to reset account drift. Closes https://github.com/SiaFoundation/web/issues/524 |
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,7 @@ | ||
--- | ||
'hostd': minor | ||
'renterd': minor | ||
'walletd': minor | ||
--- | ||
|
||
Context menus now all use a caret icon. |
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 contract set change alert data fields are now displayed as one field that shows additions and removals for each contract in one timeline. |
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 | ||
--- | ||
|
||
Alert table row cell content is now aligned to the top of each row. |
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,73 @@ | ||
import { | ||
DropdownMenu, | ||
DropdownMenuItem, | ||
Button, | ||
DropdownMenuLeftSlot, | ||
DropdownMenuLabel, | ||
Text, | ||
copyToClipboard, | ||
} from '@siafoundation/design-system' | ||
import { Copy16, ResetAlt16, CaretDown16 } from '@siafoundation/react-icons' | ||
import { useAccountResetDrift } from '@siafoundation/react-renterd' | ||
|
||
type Props = { | ||
id: string | ||
contentProps?: React.ComponentProps<typeof DropdownMenu>['contentProps'] | ||
buttonProps?: React.ComponentProps<typeof Button> | ||
trigger?: React.ReactNode | ||
} | ||
|
||
export function AccountContextMenu({ | ||
id, | ||
contentProps, | ||
buttonProps, | ||
trigger, | ||
}: Props) { | ||
const resetDrift = useAccountResetDrift() | ||
return ( | ||
<DropdownMenu | ||
trigger={ | ||
trigger || ( | ||
<Button icon="hover" variant="ghost" {...buttonProps}> | ||
<CaretDown16 /> | ||
</Button> | ||
) | ||
} | ||
contentProps={{ | ||
align: 'start', | ||
...contentProps, | ||
onClick: (e) => { | ||
e.stopPropagation() | ||
}, | ||
}} | ||
> | ||
<div className="px-1.5 py-1"> | ||
<Text size="14" weight="medium" color="subtle"> | ||
Account {id.slice(0, 20)}... | ||
</Text> | ||
</div> | ||
<DropdownMenuLabel>Actions</DropdownMenuLabel> | ||
<DropdownMenuItem | ||
onSelect={() => | ||
resetDrift.post({ | ||
params: { | ||
id, | ||
}, | ||
}) | ||
} | ||
> | ||
<DropdownMenuLeftSlot> | ||
<ResetAlt16 /> | ||
</DropdownMenuLeftSlot> | ||
Reset account drift | ||
</DropdownMenuItem> | ||
<DropdownMenuLabel>Copy</DropdownMenuLabel> | ||
<DropdownMenuItem onSelect={() => copyToClipboard(id, 'account ID')}> | ||
<DropdownMenuLeftSlot> | ||
<Copy16 /> | ||
</DropdownMenuLeftSlot> | ||
Account ID | ||
</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
Oops, something went wrong.