-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
212 additions
and
127 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
src/Features/Blockcore.Features.NodeHost/UI/Pages/About.razor
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,55 @@ | ||
@page "/about" | ||
|
||
@using Blockcore.Utilities.Extensions | ||
|
||
@inject IFullNode FullNode | ||
@inject NBitcoin.Network Network | ||
@inject NBitcoin.ChainIndexer ChainIndexer | ||
@inject Blockcore.Connection.IConnectionManager ConnectionManager | ||
@inject Blockcore.Interfaces.IInitialBlockDownloadState InitialBlockDownloadState | ||
@inject NavigationManager NavigationManager | ||
|
||
@{ | ||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pb-2 mb-3 border-bottom"> | ||
<h1 class="h2"><strong>About @this.Network.CoinTicker.ToUpper()</strong></h1> | ||
<div class="btn-toolbar mb-2 mb-md-0"> | ||
<span class="float-right"> | ||
<a class="btn btn-sm btn-primary mr-1" href="/docs/index.html" target="_blank" role="button"><span class="oi oi-code" aria-hidden="true"></span> Open API</a> | ||
<a class="btn btn-sm btn-primary mr-1" href="/ws-ui/index.html" target="_blank" role="button"><span class="oi oi-link-intact" aria-hidden="true"></span> Web Socket</a> | ||
<a class="btn btn-sm btn-primary mr-1" href="https://www.blockcore.net" target="_blank" role="button"><span class="oi oi-external-link" aria-hidden="true"></span> Blockcore</a> | ||
</span> | ||
</div> | ||
</div> | ||
|
||
<div class="row mb-3"> | ||
<div class="col-xl-12 col-sm-12 "> | ||
<div class="card"> | ||
<div class="card-body"> | ||
<div class="table-responsive"> | ||
<h5 class="card-title">Node Information</h5> | ||
<table> | ||
<tbody> | ||
<tr> | ||
<td style="min-width: 11em">Agent name:</td> | ||
<td>@this.ConnectionManager.ConnectionSettings.Agent</td> | ||
</tr> | ||
<tr> | ||
<td style="min-width: 11em">Node version:</td> | ||
<td>@this.FullNode.Version?.ToString()</td> | ||
</tr> | ||
<tr> | ||
<td style="min-width: 11em">Protocol version:</td> | ||
<td>@this.Network.Consensus.ConsensusFactory.Protocol.ProtocolVersion</td> | ||
</tr> | ||
<tr> | ||
<td style="min-width: 11em">Current tip Hash:</td> | ||
<td>@this.ChainIndexer.Tip.HashBlock</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
</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
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
33 changes: 33 additions & 0 deletions
33
src/Features/Blockcore.Features.NodeHost/UI/Shared/Dropdown.razor
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,33 @@ | ||
@typeparam TItem | ||
<div class="dropdown dropleft"> | ||
<button class="btn btn-primary btn-sm dropdown-toggle mr-1" data-toggle="dropdown" type="button" @onclick="e => this.show=!this.show " | ||
aria-haspopup="true" aria-expanded="false"> | ||
@Tip | ||
</button> | ||
<CascadingValue name="Dropdown" Value="@this"> | ||
<div class="dropdown-menu @(show? "show":"")" > | ||
@ChildContent | ||
</div> | ||
</CascadingValue> | ||
</div> | ||
|
||
@code { | ||
[Parameter] | ||
public RenderFragment InitialTip{get;set;} | ||
[Parameter] | ||
public RenderFragment ChildContent{get;set;} | ||
[Parameter] | ||
public EventCallback<TItem> OnSelected {get;set;} | ||
|
||
private bool show = false; | ||
private RenderFragment Tip ; | ||
|
||
protected override void OnInitialized(){ this.Tip = InitialTip; } | ||
public async Task HandleSelect(TItem item, RenderFragment<TItem> contentFragment) | ||
{ | ||
this.Tip= contentFragment.Invoke(item); | ||
this.show=false; | ||
StateHasChanged(); | ||
await this.OnSelected.InvokeAsync(item); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/Features/Blockcore.Features.NodeHost/UI/Shared/DropdownListItem.razor
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,12 @@ | ||
@typeparam TItem | ||
<a class="dropdown-item" Item="@Item" @onclick="e=> Dropdown.HandleSelect(Item, ChildContent)" >@ChildContent(Item)</a> | ||
|
||
@code { | ||
[CascadingParameter(Name="Dropdown")] | ||
public Dropdown<TItem> Dropdown {get;set;} | ||
|
||
[Parameter] | ||
public TItem Item{get;set;} | ||
[Parameter] | ||
public RenderFragment<TItem> ChildContent {get;set;} | ||
} |
Oops, something went wrong.