Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI improvements #122

Merged
merged 7 commits into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Features/Blockcore.Features.ColdStaking/UI/NavItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Blockcore.Features.Wallet.UI
{
public class ColdStakingNavigationItem : INavigationItem
{
public string Name => "ColdStaking";
public string Name => "Cold Staking";

public string Navigation => "ColdStaking";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,44 @@

@if (!NodeDeployments.GetFlags().ScriptFlags.HasFlag(ScriptVerify.CheckColdStakeVerify))
{
<h2>Coldstaking is not activated</h2>
<h2>Cold staking is not activated</h2>
return;
}

<h2>Coldstaking Wallets</h2>
<h2>Cold staking wallets</h2>

<p>Enable cold staking on an existing wallet.</p>

<hr />
<div class="input-group mb-3">
<div class="input-group-prepend">
<span style="min-width: 10em" class="input-group-text" id="basic-addon1">Wallet Name:</span>
</div>
<input @bind="WalletName" type="text" class="form-control" placeholder="wallet name" />
</div>

<div class="input-group mb-3">
<div class="input-group-prepend">
<span style="min-width: 10em" class="input-group-text">Password:</span>
</div>
<input @bind="Password" type="password" class="form-control" placeholder="password" />
</div>

<div class="input-group mb-3">
<button class="btn btn-info" @onclick="CreateColdStakeAccount">Create account</button>
</div>
<hr />

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

@{
<table class="table">
<thead>
<tr>
<th>Wallet / account</th>
<th>Confirmed blanace</th>
<th>Wallet / Account</th>
<th>Confirmed balance</th>
<th>Unconfirmed balance</th>
<th>Actione</th>
<th>Action</th>
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -66,7 +88,7 @@
var hotAccountBalance = ColdStakingManager.GetBalances(walletName, hotStakingAccount.Name).Single();

<tr>
<td> @walletName <strong>/</strong>@hotStakingAccount.Name</td>
<td> @walletName <strong>/</strong> @hotStakingAccount.Name</td>
<td>@hotAccountBalance.AmountConfirmed</td>
<td>@hotAccountBalance.AmountUnconfirmed</td>
<td>
Expand Down Expand Up @@ -94,7 +116,7 @@
<td>
@if (accountBalance.AmountConfirmed + accountBalance.AmountUnconfirmed > 0)
{
<button class="btn btn-link btn-sm" @onclick="() => { NavigateToSetup(walletName); }">Setup</button>
<button class="btn btn-link btn-sm" @onclick="() => { NavigateToSetup(walletName); }">Delegate</button>
}
</td>
</tr>
Expand All @@ -103,26 +125,6 @@
}
</tbody>
</table>
<hr />
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">Wallet Name:</span>
</div>
<input @bind="WalletName" type="text" class="form-control" placeholder="wallet name" />
</div>

<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text">Password:</span>
</div>
<input @bind="Password" type="password" class="form-control" placeholder="password" />
</div>

<div class="input-group mb-3">
<button class="btn btn-info" @onclick="CreateColdStakeAccount">Create account</button>
</div>
<hr />

}

@code
Expand All @@ -146,8 +148,8 @@

private void CreateColdStakeAccount()
{
if (string.IsNullOrEmpty(this.Password)) { this.Alert = "No password"; return; }
if (string.IsNullOrEmpty(this.WalletName)) { this.Alert = "No WalletName"; return; }
if (string.IsNullOrEmpty(this.Password)) { this.Alert = "Please enter a password"; return; }
if (string.IsNullOrEmpty(this.WalletName)) { this.Alert = "Please enter a wallet name"; return; }
this.Alert = string.Empty;

this.ColdStakingManager.GetOrCreateColdStakingAccount(this.WalletName, true, this.Password);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,31 @@
@{
var accountBalance = this.WalletManager.GetBalances(walletname, "account 0").Single();

<p>Amount Confirmed: <strong> @accountBalance.AmountConfirmed</strong></p>
<p>Amount Unconfirmed: <strong>@accountBalance.AmountUnconfirmed</strong></p>
<p>Spendable Amount: <strong> @accountBalance.SpendableAmount</strong></p>

<table class="table">
<thead>
<tr>
<th>Amount Confirmed</th>
<th>Amount Unconfirmed</th>
<th>Spendable Amount</th>
</tr>
</thead>
<tbody>
<tr>
<td>@accountBalance.AmountConfirmed</td>
<td>@accountBalance.AmountUnconfirmed</td>
<td>@accountBalance.SpendableAmount</td>
</tr>
</tbody>
</table>
<hr />

<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">ColdWalletAddress:</span>
<span style="min-width: 10em" class="input-group-text" id="basic-addon1">ColdWalletAddress:</span>
</div>
<input @bind="ColdWalletAddress" type="text" class="form-control" placeholder="ColdWalletAddress" />
<div class="input-group-append">
<span class="input-group-text">from wallet: @walletname</span>
<span style="min-width: 10em" class="input-group-text">from wallet: @walletname</span>
</div>
</div>

Expand All @@ -45,34 +57,34 @@

<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">HotWalletAddress:</span>
<span style="min-width: 10em" class="input-group-text" id="basic-addon1">HotWalletAddress:</span>
</div>
<input @bind="HotWalletAddress" type="text" class="form-control" placeholder="HotWalletAddress" />
</div>

<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text">Amount:</span>
<span style="min-width: 10em" class="input-group-text">Amount:</span>
</div>
<input @bind="Amount" type="text" class="form-control" placeholder="amount" />
<div class="input-group-append">
<span class="input-group-text">@this.Network.CoinTicker.ToUpper()</span>
<span style="min-width: 10em" class="input-group-text">@this.Network.CoinTicker.ToUpper()</span>
</div>
</div>

<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text">Fee:</span>
<span style="min-width: 10em" class="input-group-text">Fee:</span>
</div>
<input @bind="Fee" type="text" class="form-control" placeholder="fee" />
<div class="input-group-append">
<span class="input-group-text">Optional (default to low)</span>
<span style="min-width: 10em" class="input-group-text">Optional (default to low)</span>
</div>
</div>

<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text">Password:</span>
<span style="min-width: 10em" class="input-group-text">Password:</span>
</div>
<input @bind="Password" type="password" class="form-control" placeholder="password" />
</div>
Expand Down Expand Up @@ -156,9 +168,9 @@

private async Task Setup()
{
if (string.IsNullOrEmpty(this.Password)) { this.Alert = "No password"; return; }
if (string.IsNullOrEmpty(this.ColdWalletAddress)) { this.Alert = "No ColdWalletAddress"; return; }
if (string.IsNullOrEmpty(this.HotWalletAddress)) { this.Alert = "No HotWalletAddress"; return; }
if (string.IsNullOrEmpty(this.Password)) { this.Alert = "Please enter a password"; return; }
if (string.IsNullOrEmpty(this.ColdWalletAddress)) { this.Alert = "Your cold wallet address is missing"; return; }
if (string.IsNullOrEmpty(this.HotWalletAddress)) { this.Alert = "Your hot wallet address is missing"; return; }

this.Alert = string.Empty;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,36 +30,36 @@
<hr />
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text">Password:</span>
<span style="min-width: 10em" class="input-group-text">Password:</span>
</div>
<input @bind="Password" type="password" class="form-control" placeholder="password" />
</div>

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

<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text">Amount:</span>
<span style="min-width: 10em" class="input-group-text">Amount:</span>
</div>
<input @bind="Amount" type="text" class="form-control" placeholder="amount" />
<div class="input-group-append">
<span class="input-group-text">@this.Network.CoinTicker.ToUpper()</span>
<span style="min-width: 10em" class="input-group-text">@this.Network.CoinTicker.ToUpper()</span>
</div>
</div>

<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text">Fee:</span>
<span style="min-width: 10em" class="input-group-text">Fee:</span>
</div>
<input @bind="Fee" type="text" class="form-control" placeholder="fee" />
<div class="input-group-append">
<span class="input-group-text">Optional (default to low)</span>
<span style="min-width: 10em" class="input-group-text">Optional (default to low)</span>
</div>
</div>

Expand Down Expand Up @@ -112,8 +112,8 @@

private async Task Withdraw()
{
if (string.IsNullOrEmpty(this.Password)) { this.Alert = "No password"; return; }
if (string.IsNullOrEmpty(this.Address)) { this.Alert = "No Address"; return; }
if (string.IsNullOrEmpty(this.Password)) { this.Alert = "Please enter a password"; return; }
if (string.IsNullOrEmpty(this.Address)) { this.Alert = "Please enter a withdrawal address"; return; }
this.Alert = string.Empty;

try
Expand Down
12 changes: 6 additions & 6 deletions src/Features/Blockcore.Features.Miner/UI/Pages/Stake.razor
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
<table class="table table-sm">
<thead>
<tr>
<th>Wallet/account</th>
<th>Blanace</th>
<th>Wallet / Account</th>
<th>Balance</th>
</tr>
</thead>
<tbody>
Expand All @@ -61,14 +61,14 @@
{
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">Wallet Name:</span>
<span style="min-width: 10em" class="input-group-text" id="basic-addon1">Wallet Name:</span>
</div>
<input @bind="WalletName" type="text" class="form-control" placeholder="wallet name" />
</div>

<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text">Password:</span>
<span style="min-width: 10em" class="input-group-text">Password:</span>
</div>
<input @bind="Password" type="password" class="form-control" placeholder="password" />
</div>
Expand Down Expand Up @@ -139,8 +139,8 @@

private void StartStaking()
{
if (string.IsNullOrEmpty(this.Password)) { this.Alert = "No password"; return; }
if (string.IsNullOrEmpty(this.WalletName)) { this.Alert = "No password"; return; }
if (string.IsNullOrEmpty(this.Password)) { this.Alert = "Please enter a password"; return; }
if (string.IsNullOrEmpty(this.WalletName)) { this.Alert = "Please enter a wallet name"; return; }

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
@page "/peers-nodes"
@page "/add-nodes"

@using Blockcore.Utilities.Extensions

@inject Blockcore.Connection.IConnectionManager ConnectionManager

<h2>Connected peers</h2>
<h2>Add new nodes</h2>

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

@{
<div class="input-group mb-3">
Expand Down
6 changes: 3 additions & 3 deletions src/Features/Blockcore.Features.NodeHost/UI/Pages/Logs.razor
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<h2>Node logs</h2>

@{
<textarea class="w-100" rows="50">
@(((Blockcore.FullNode)this.FullNode).LastLogOutput.TrimStart(' '));
</textarea>
<pre>
@(((Blockcore.FullNode)this.FullNode).LastLogOutput.TrimStart(' '))
</pre>
}
6 changes: 3 additions & 3 deletions src/Features/Blockcore.Features.NodeHost/UI/Pages/Peers.razor
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@{
<div class="input-group mb-3">
<button class="btn btn-info" @onclick="NavigateToPeernodes">Add nodes</button>
<button class="btn btn-info" @onclick="NavigateToAddNodes">Add nodes</button>
</div>
<hr />
<table class="table">
Expand Down Expand Up @@ -37,8 +37,8 @@

@code
{
private void NavigateToPeernodes()
private void NavigateToAddNodes()
{
NavigationManager.NavigateTo("peers-nodes");
NavigationManager.NavigateTo("add-nodes");
}
}
Loading