Skip to content

Commit 42a9d88

Browse files
UI improvements (#122)
* Split create & recover wallet * Rename peer nodes to add nodes * Improve error messages, fix some typos * Remove breadcrumbs & fix tx address bug * Even up the labels Co-authored-by: dangershony <dan.gershony@gmail.com>
1 parent 7917a2f commit 42a9d88

14 files changed

Lines changed: 270 additions & 177 deletions

File tree

src/Features/Blockcore.Features.ColdStaking/UI/NavItem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace Blockcore.Features.Wallet.UI
44
{
55
public class ColdStakingNavigationItem : INavigationItem
66
{
7-
public string Name => "ColdStaking";
7+
public string Name => "Cold Staking";
88

99
public string Navigation => "ColdStaking";
1010
}

src/Features/Blockcore.Features.ColdStaking/UI/Pages/ColdStake.razor

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,44 @@
1111

1212
@if (!NodeDeployments.GetFlags().ScriptFlags.HasFlag(ScriptVerify.CheckColdStakeVerify))
1313
{
14-
<h2>Coldstaking is not activated</h2>
14+
<h2>Cold staking is not activated</h2>
1515
return;
1616
}
1717

18-
<h2>Coldstaking Wallets</h2>
18+
<h2>Cold staking wallets</h2>
19+
20+
<p>Enable cold staking on an existing wallet.</p>
21+
22+
<hr />
23+
<div class="input-group mb-3">
24+
<div class="input-group-prepend">
25+
<span style="min-width: 10em" class="input-group-text" id="basic-addon1">Wallet Name:</span>
26+
</div>
27+
<input @bind="WalletName" type="text" class="form-control" placeholder="wallet name" />
28+
</div>
29+
30+
<div class="input-group mb-3">
31+
<div class="input-group-prepend">
32+
<span style="min-width: 10em" class="input-group-text">Password:</span>
33+
</div>
34+
<input @bind="Password" type="password" class="form-control" placeholder="password" />
35+
</div>
36+
37+
<div class="input-group mb-3">
38+
<button class="btn btn-info" @onclick="CreateColdStakeAccount">Create account</button>
39+
</div>
40+
<hr />
1941

2042
<p>Information about the deployed wallets.</p>
2143

2244
@{
2345
<table class="table">
2446
<thead>
2547
<tr>
26-
<th>Wallet / account</th>
27-
<th>Confirmed blanace</th>
48+
<th>Wallet / Account</th>
49+
<th>Confirmed balance</th>
2850
<th>Unconfirmed balance</th>
29-
<th>Actione</th>
51+
<th>Action</th>
3052
</tr>
3153
</thead>
3254
<tbody>
@@ -66,7 +88,7 @@
6688
var hotAccountBalance = ColdStakingManager.GetBalances(walletName, hotStakingAccount.Name).Single();
6789

6890
<tr>
69-
<td> @walletName <strong>/</strong>@hotStakingAccount.Name</td>
91+
<td> @walletName <strong>/</strong> @hotStakingAccount.Name</td>
7092
<td>@hotAccountBalance.AmountConfirmed</td>
7193
<td>@hotAccountBalance.AmountUnconfirmed</td>
7294
<td>
@@ -94,7 +116,7 @@
94116
<td>
95117
@if (accountBalance.AmountConfirmed + accountBalance.AmountUnconfirmed > 0)
96118
{
97-
<button class="btn btn-link btn-sm" @onclick="() => { NavigateToSetup(walletName); }">Setup</button>
119+
<button class="btn btn-link btn-sm" @onclick="() => { NavigateToSetup(walletName); }">Delegate</button>
98120
}
99121
</td>
100122
</tr>
@@ -103,26 +125,6 @@
103125
}
104126
</tbody>
105127
</table>
106-
<hr />
107-
<div class="input-group mb-3">
108-
<div class="input-group-prepend">
109-
<span class="input-group-text" id="basic-addon1">Wallet Name:</span>
110-
</div>
111-
<input @bind="WalletName" type="text" class="form-control" placeholder="wallet name" />
112-
</div>
113-
114-
<div class="input-group mb-3">
115-
<div class="input-group-prepend">
116-
<span class="input-group-text">Password:</span>
117-
</div>
118-
<input @bind="Password" type="password" class="form-control" placeholder="password" />
119-
</div>
120-
121-
<div class="input-group mb-3">
122-
<button class="btn btn-info" @onclick="CreateColdStakeAccount">Create account</button>
123-
</div>
124-
<hr />
125-
126128
}
127129

128130
@code
@@ -146,8 +148,8 @@
146148

147149
private void CreateColdStakeAccount()
148150
{
149-
if (string.IsNullOrEmpty(this.Password)) { this.Alert = "No password"; return; }
150-
if (string.IsNullOrEmpty(this.WalletName)) { this.Alert = "No WalletName"; return; }
151+
if (string.IsNullOrEmpty(this.Password)) { this.Alert = "Please enter a password"; return; }
152+
if (string.IsNullOrEmpty(this.WalletName)) { this.Alert = "Please enter a wallet name"; return; }
151153
this.Alert = string.Empty;
152154

153155
this.ColdStakingManager.GetOrCreateColdStakingAccount(this.WalletName, true, this.Password);

src/Features/Blockcore.Features.ColdStaking/UI/Pages/ColdStakeSetup.razor

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,31 @@
2020
@{
2121
var accountBalance = this.WalletManager.GetBalances(walletname, "account 0").Single();
2222

23-
<p>Amount Confirmed: <strong> @accountBalance.AmountConfirmed</strong></p>
24-
<p>Amount Unconfirmed: <strong>@accountBalance.AmountUnconfirmed</strong></p>
25-
<p>Spendable Amount: <strong> @accountBalance.SpendableAmount</strong></p>
26-
23+
<table class="table">
24+
<thead>
25+
<tr>
26+
<th>Amount Confirmed</th>
27+
<th>Amount Unconfirmed</th>
28+
<th>Spendable Amount</th>
29+
</tr>
30+
</thead>
31+
<tbody>
32+
<tr>
33+
<td>@accountBalance.AmountConfirmed</td>
34+
<td>@accountBalance.AmountUnconfirmed</td>
35+
<td>@accountBalance.SpendableAmount</td>
36+
</tr>
37+
</tbody>
38+
</table>
2739
<hr />
2840

2941
<div class="input-group mb-3">
3042
<div class="input-group-prepend">
31-
<span class="input-group-text" id="basic-addon1">ColdWalletAddress:</span>
43+
<span style="min-width: 10em" class="input-group-text" id="basic-addon1">ColdWalletAddress:</span>
3244
</div>
3345
<input @bind="ColdWalletAddress" type="text" class="form-control" placeholder="ColdWalletAddress" />
3446
<div class="input-group-append">
35-
<span class="input-group-text">from wallet: @walletname</span>
47+
<span style="min-width: 10em" class="input-group-text">from wallet: @walletname</span>
3648
</div>
3749
</div>
3850

@@ -45,34 +57,34 @@
4557

4658
<div class="input-group mb-3">
4759
<div class="input-group-prepend">
48-
<span class="input-group-text" id="basic-addon1">HotWalletAddress:</span>
60+
<span style="min-width: 10em" class="input-group-text" id="basic-addon1">HotWalletAddress:</span>
4961
</div>
5062
<input @bind="HotWalletAddress" type="text" class="form-control" placeholder="HotWalletAddress" />
5163
</div>
5264

5365
<div class="input-group mb-3">
5466
<div class="input-group-prepend">
55-
<span class="input-group-text">Amount:</span>
67+
<span style="min-width: 10em" class="input-group-text">Amount:</span>
5668
</div>
5769
<input @bind="Amount" type="text" class="form-control" placeholder="amount" />
5870
<div class="input-group-append">
59-
<span class="input-group-text">@this.Network.CoinTicker.ToUpper()</span>
71+
<span style="min-width: 10em" class="input-group-text">@this.Network.CoinTicker.ToUpper()</span>
6072
</div>
6173
</div>
6274

6375
<div class="input-group mb-3">
6476
<div class="input-group-prepend">
65-
<span class="input-group-text">Fee:</span>
77+
<span style="min-width: 10em" class="input-group-text">Fee:</span>
6678
</div>
6779
<input @bind="Fee" type="text" class="form-control" placeholder="fee" />
6880
<div class="input-group-append">
69-
<span class="input-group-text">Optional (default to low)</span>
81+
<span style="min-width: 10em" class="input-group-text">Optional (default to low)</span>
7082
</div>
7183
</div>
7284

7385
<div class="input-group mb-3">
7486
<div class="input-group-prepend">
75-
<span class="input-group-text">Password:</span>
87+
<span style="min-width: 10em" class="input-group-text">Password:</span>
7688
</div>
7789
<input @bind="Password" type="password" class="form-control" placeholder="password" />
7890
</div>
@@ -156,9 +168,9 @@
156168

157169
private async Task Setup()
158170
{
159-
if (string.IsNullOrEmpty(this.Password)) { this.Alert = "No password"; return; }
160-
if (string.IsNullOrEmpty(this.ColdWalletAddress)) { this.Alert = "No ColdWalletAddress"; return; }
161-
if (string.IsNullOrEmpty(this.HotWalletAddress)) { this.Alert = "No HotWalletAddress"; return; }
171+
if (string.IsNullOrEmpty(this.Password)) { this.Alert = "Please enter a password"; return; }
172+
if (string.IsNullOrEmpty(this.ColdWalletAddress)) { this.Alert = "Your cold wallet address is missing"; return; }
173+
if (string.IsNullOrEmpty(this.HotWalletAddress)) { this.Alert = "Your hot wallet address is missing"; return; }
162174

163175
this.Alert = string.Empty;
164176

src/Features/Blockcore.Features.ColdStaking/UI/Pages/ColdStakeWithdraw.razor

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,36 +30,36 @@
3030
<hr />
3131
<div class="input-group mb-3">
3232
<div class="input-group-prepend">
33-
<span class="input-group-text">Password:</span>
33+
<span style="min-width: 10em" class="input-group-text">Password:</span>
3434
</div>
3535
<input @bind="Password" type="password" class="form-control" placeholder="password" />
3636
</div>
3737

3838
<div class="input-group mb-3">
3939
<div class="input-group-prepend">
40-
<span class="input-group-text" id="basic-addon1">Address:</span>
40+
<span style="min-width: 10em" class="input-group-text" id="basic-addon1">Address:</span>
4141
</div>
4242
<input @bind="Address" type="text" class="form-control" placeholder="address" />
4343
<button class="btn btn-light btn-sm" @onclick="GenerateAddress">Get address from: @walletname</button>
4444
</div>
4545

4646
<div class="input-group mb-3">
4747
<div class="input-group-prepend">
48-
<span class="input-group-text">Amount:</span>
48+
<span style="min-width: 10em" class="input-group-text">Amount:</span>
4949
</div>
5050
<input @bind="Amount" type="text" class="form-control" placeholder="amount" />
5151
<div class="input-group-append">
52-
<span class="input-group-text">@this.Network.CoinTicker.ToUpper()</span>
52+
<span style="min-width: 10em" class="input-group-text">@this.Network.CoinTicker.ToUpper()</span>
5353
</div>
5454
</div>
5555

5656
<div class="input-group mb-3">
5757
<div class="input-group-prepend">
58-
<span class="input-group-text">Fee:</span>
58+
<span style="min-width: 10em" class="input-group-text">Fee:</span>
5959
</div>
6060
<input @bind="Fee" type="text" class="form-control" placeholder="fee" />
6161
<div class="input-group-append">
62-
<span class="input-group-text">Optional (default to low)</span>
62+
<span style="min-width: 10em" class="input-group-text">Optional (default to low)</span>
6363
</div>
6464
</div>
6565

@@ -112,8 +112,8 @@
112112

113113
private async Task Withdraw()
114114
{
115-
if (string.IsNullOrEmpty(this.Password)) { this.Alert = "No password"; return; }
116-
if (string.IsNullOrEmpty(this.Address)) { this.Alert = "No Address"; return; }
115+
if (string.IsNullOrEmpty(this.Password)) { this.Alert = "Please enter a password"; return; }
116+
if (string.IsNullOrEmpty(this.Address)) { this.Alert = "Please enter a withdrawal address"; return; }
117117
this.Alert = string.Empty;
118118

119119
try

src/Features/Blockcore.Features.Miner/UI/Pages/Stake.razor

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
<table class="table table-sm">
3636
<thead>
3737
<tr>
38-
<th>Wallet/account</th>
39-
<th>Blanace</th>
38+
<th>Wallet / Account</th>
39+
<th>Balance</th>
4040
</tr>
4141
</thead>
4242
<tbody>
@@ -61,14 +61,14 @@
6161
{
6262
<div class="input-group mb-3">
6363
<div class="input-group-prepend">
64-
<span class="input-group-text" id="basic-addon1">Wallet Name:</span>
64+
<span style="min-width: 10em" class="input-group-text" id="basic-addon1">Wallet Name:</span>
6565
</div>
6666
<input @bind="WalletName" type="text" class="form-control" placeholder="wallet name" />
6767
</div>
6868

6969
<div class="input-group mb-3">
7070
<div class="input-group-prepend">
71-
<span class="input-group-text">Password:</span>
71+
<span style="min-width: 10em" class="input-group-text">Password:</span>
7272
</div>
7373
<input @bind="Password" type="password" class="form-control" placeholder="password" />
7474
</div>
@@ -139,8 +139,8 @@
139139

140140
private void StartStaking()
141141
{
142-
if (string.IsNullOrEmpty(this.Password)) { this.Alert = "No password"; return; }
143-
if (string.IsNullOrEmpty(this.WalletName)) { this.Alert = "No password"; return; }
142+
if (string.IsNullOrEmpty(this.Password)) { this.Alert = "Please enter a password"; return; }
143+
if (string.IsNullOrEmpty(this.WalletName)) { this.Alert = "Please enter a wallet name"; return; }
144144

145145
var wallet = this.WalletManager.GetWallet(this.WalletName);
146146

src/Features/Blockcore.Features.NodeHost/UI/Pages/PeersNodes.razor renamed to src/Features/Blockcore.Features.NodeHost/UI/Pages/AddNodes.razor

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
@page "/peers-nodes"
1+
@page "/add-nodes"
22

33
@using Blockcore.Utilities.Extensions
44

55
@inject Blockcore.Connection.IConnectionManager ConnectionManager
66

7-
<h2>Connected peers</h2>
7+
<h2>Add new nodes</h2>
88

9-
<p>Information about connected peers.</p>
9+
<p>Add the IP address of known network peers.</p>
1010

1111
@{
1212
<div class="input-group mb-3">

src/Features/Blockcore.Features.NodeHost/UI/Pages/Logs.razor

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<h2>Node logs</h2>
66

77
@{
8-
<textarea class="w-100" rows="50">
9-
@(((Blockcore.FullNode)this.FullNode).LastLogOutput.TrimStart(' '));
10-
</textarea>
8+
<pre>
9+
@(((Blockcore.FullNode)this.FullNode).LastLogOutput.TrimStart(' '))
10+
</pre>
1111
}

src/Features/Blockcore.Features.NodeHost/UI/Pages/Peers.razor

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
@{
1111
<div class="input-group mb-3">
12-
<button class="btn btn-info" @onclick="NavigateToPeernodes">Add nodes</button>
12+
<button class="btn btn-info" @onclick="NavigateToAddNodes">Add nodes</button>
1313
</div>
1414
<hr />
1515
<table class="table">
@@ -37,8 +37,8 @@
3737

3838
@code
3939
{
40-
private void NavigateToPeernodes()
40+
private void NavigateToAddNodes()
4141
{
42-
NavigationManager.NavigateTo("peers-nodes");
42+
NavigationManager.NavigateTo("add-nodes");
4343
}
4444
}

0 commit comments

Comments
 (0)