From 12ca86c601b6884c738f5bc70c6f554493f61227 Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Sun, 20 Nov 2022 01:11:14 +0100 Subject: [PATCH] Explorer redesign part 3 --- static/css/main.css | 41 +++- static/templates/address.html | 407 +++++++++++++++++---------------- static/templates/block.html | 10 +- static/templates/blocks.html | 6 +- static/templates/index.html | 46 ++-- static/templates/sendtx.html | 18 +- static/templates/tx.html | 38 +-- static/templates/txdetail.html | 20 +- static/templates/xpub.html | 198 ++++++++-------- 9 files changed, 417 insertions(+), 367 deletions(-) diff --git a/static/css/main.css b/static/css/main.css index 065d214b..5914af12 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -29,6 +29,14 @@ a:hover { text-decoration: underline; } +select { + border-radius: 0.5rem; + padding-left: 0.5rem; + border: 1px solid #ced4da; + color: var(--bs-body-color); + min-height: 45px; +} + #header { position: absolute; top: 0; @@ -55,6 +63,16 @@ a:hover { min-height: 50px; } +.badge { + vertical-align: middle; + filter: drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.15)); + text-transform: uppercase; + letter-spacing: 0.15em; + --bs-badge-padding-x: 0.8rem; + --bs-badge-font-weight: normal; + --bs-badge-border-radius: 0.6rem; +} + .bb-group { border: 0.6rem solid #f6f6f6; background-color: #f6f6f6; @@ -211,6 +229,11 @@ span.btn-paging:hover { font-weight: normal; } +.data-table tbody th { + color: #757575; + font-weight: normal; +} + .data-table tbody { background: white; border-radius: 8px; @@ -218,12 +241,14 @@ span.btn-paging:hover { } .data-table h3, +.data-table h5, .data-table h6 { margin-bottom: 0; } -.data-table h3 { - color: black; +.data-table h3, +.data-table h5 { + color: var(--bs-body-color); } .info-table tbody { @@ -304,7 +329,7 @@ span.btn-paging:hover { } .tx-detail:last-child { - margin-bottom: 3rem; + margin-bottom: 2rem; } .tx-detail span.ellipsis, @@ -392,6 +417,16 @@ span.btn-paging:hover { font-weight: bold; } +.txerror { + background-color: #c51f13b3; + color: white !important; +} + +.txerror a, +.txerror .txvalue { + color: white; +} + .tx-amt .amt:hover, .tx-amt.amt:hover { color: var(--bs-body-color); diff --git a/static/templates/address.html b/static/templates/address.html index 03fb4fa9..5af0b4cb 100644 --- a/static/templates/address.html +++ b/static/templates/address.html @@ -1,213 +1,218 @@ -{{define "specific"}}{{$cs := .CoinShortcut}}{{$addr := .Address}}{{$data := .}} -

{{if $addr.ContractInfo}}Contract {{$addr.ContractInfo.Name}}{{if $addr.ContractInfo.Symbol}} ({{$addr.ContractInfo.Symbol}}){{end}}{{else}}Address{{end}} {{formatAmount $addr.BalanceSat}} {{$cs}} -

-
- {{$addr.AddrStr}} -
-

Confirmed

-
-
- - - {{- if eq .ChainType 1 -}} - {{if $addr.ContractInfo}} - {{if $addr.ContractInfo.Type}} - - - - - {{end}} - {{if $addr.ContractInfo.CreatedInBlock}} - - - - - {{end}} - {{if $addr.ContractInfo.DestructedInBlock}} - - - - - {{end}} - {{end}} - - - - - - - - - - - - - - - - - - - - - {{if tokenCount $addr.Tokens "ERC20"}} - - - - - {{- end -}} - {{if tokenCount $addr.Tokens "ERC721"}} - - - - - {{- end -}} - {{if tokenCount $addr.Tokens "ERC1155"}} - - - - - {{- end -}} - - {{- else -}} - - - - - - - - - - - - - - - - - {{- end -}} - -
Contract type{{$addr.ContractInfo.Type}}
Created in Block{{$addr.ContractInfo.CreatedInBlock}}
Destructed in Block{{$addr.ContractInfo.DestructedInBlock}}
Balance{{formatAmount $addr.BalanceSat}} {{$cs}}
Transactions{{$addr.Txs}}
Non-contract Transactions{{$addr.NonTokenTxs}}
Internal Transactions{{$addr.InternalTxs}}
Nonce{{$addr.Nonce}}
ERC20 Tokens - - - - - - - - {{range $t := $addr.Tokens}} - {{if eq $t.Type "ERC20"}} - - - - - - {{end}} - {{end}} - -
ContractTokensTransfers
{{if $t.Name}}{{$t.Name}}{{else}}{{$t.Contract}}{{end}}{{formatAmountWithDecimals $t.BalanceSat $t.Decimals}} {{$t.Symbol}}{{$t.Transfers}}
-
ERC721 Tokens - - - - - - - - {{range $t := $addr.Tokens}} - {{if eq $t.Type "ERC721"}} - - - - - - {{end}} - {{end}} - -
ContractTokensTransfers
{{if $t.Name}}{{$t.Name}}{{else}}{{$t.Contract}}{{end}} - {{range $i, $iv := $t.Ids}}{{if $i}}, {{end}}{{formatAmountWithDecimals $iv 0}}{{end}} - {{$t.Transfers}}
-
ERC1155 Tokens - - - - - - - - {{range $t := $addr.Tokens}} - {{if eq $t.Type "ERC1155"}} - - - - - - {{end}} - {{end}} - -
ContractTokensTransfers
{{if $t.Name}}{{$t.Name}}{{else}}{{$t.Contract}}{{end}} - {{range $i, $iv := $t.MultiTokenValues}}{{if $i}}, {{end}}{{$iv.Value}} of ID {{$iv.Id}}{{end}} - {{$t.Transfers}}
-
Total Received{{formatAmount $addr.TotalReceivedSat}} {{$cs}}
Total Sent{{formatAmount $addr.TotalSentSat}} {{$cs}}
Final Balance{{formatAmount $addr.BalanceSat}} {{$cs}}
No. Transactions{{$addr.Txs}}
+{{define "specific"}}{{$addr := .Address}}{{$data := .}} +
+
+

{{if $addr.ContractInfo}}Contract {{$addr.ContractInfo.Name}}{{if $addr.ContractInfo.Symbol}} ({{$addr.ContractInfo.Symbol}}){{end}}{{else}}Address{{end}}

+
{{$addr.AddrStr}}
+

{{amount $addr.BalanceSat $data "copyable"}}

-
-
+
+
-{{- if $addr.UnconfirmedTxs -}} -

Unconfirmed

-
- - - - - - - - - - - -
Unconfirmed Balance{{formatAmount $addr.UnconfirmedBalanceSat}} {{$cs}}
No. Transactions{{$addr.UnconfirmedTxs}}
-
-{{- end}}{{if or $addr.Transactions $addr.Filter -}} -
-

Transactions

- -
+ + + + + + + {{if eq .ChainType 1}} + {{if $addr.ContractInfo}} + {{if $addr.ContractInfo.Type}} + + + + + {{end}} + {{if $addr.ContractInfo.CreatedInBlock}} + + + + + {{end}} + {{if $addr.ContractInfo.DestructedInBlock}} + + + + + {{end}} + {{end}} + + + + + + + + + + + + + + + + + + + + + {{if tokenCount $addr.Tokens "ERC20"}} + + + + + {{end}} + {{if tokenCount $addr.Tokens "ERC721"}} + + + + + {{end}} + {{if tokenCount $addr.Tokens "ERC1155"}} + + + + + {{end}} + + {{else}} + + + + + + + + + + + + + + + + + {{end}} + +
Confirmed
Contract type{{$addr.ContractInfo.Type}}
Created in Block{{$addr.ContractInfo.CreatedInBlock}}
Destructed in Block{{$addr.ContractInfo.DestructedInBlock}}
Balance{{amount $addr.BalanceSat $data "copyable"}}
Transactions{{$addr.Txs}}
Non-contract Transactions{{$addr.NonTokenTxs}}
Internal Transactions{{$addr.InternalTxs}}
Nonce{{$addr.Nonce}}
ERC20 Tokens + + + + + + + + {{range $t := $addr.Tokens}} + {{if eq $t.Type "ERC20"}} + + + + + + {{end}} + {{end}} + +
ContractTokensTransfers
{{if $t.Name}}{{$t.Name}}{{else}}{{$t.Contract}}{{end}}{{formatAmountWithDecimals $t.BalanceSat $t.Decimals}} {{$t.Symbol}}{{$t.Transfers}}
+
ERC721 Tokens + + + + + + + + {{range $t := $addr.Tokens}} + {{if eq $t.Type "ERC721"}} + + + + + + {{end}} + {{end}} + +
ContractTokensTransfers
{{if $t.Name}}{{$t.Name}}{{else}}{{$t.Contract}}{{end}} + {{range $i, $iv := $t.Ids}}{{if $i}}, {{end}}{{formatAmountWithDecimals $iv 0}}{{end}} + {{$t.Transfers}}
+
ERC1155 Tokens + + + + + + + + {{range $t := $addr.Tokens}} + {{if eq $t.Type "ERC1155"}} + + + + + + {{end}} + {{end}} + +
ContractTokensTransfers
{{if $t.Name}}{{$t.Name}}{{else}}{{$t.Contract}}{{end}} + {{range $i, $iv := $t.MultiTokenValues}}{{if $i}}, {{end}}{{$iv.Value}} of ID {{$iv.Id}}{{end}} + {{$t.Transfers}}
+
Total Received{{amount $addr.TotalReceivedSat $data "copyable"}}
Total Sent{{amount $addr.TotalSentSat $data "copyable"}}
Final Balance{{amount $addr.BalanceSat $data "copyable"}}
No. Transactions{{formatInt $addr.Txs}}
+{{if $addr.UnconfirmedTxs}} + + + + + + + + + + + + + + + +
Unconfirmed
Unconfirmed Balance{{amount $addr.UnconfirmedBalanceSat $data "copyable"}}
No. Transactions{{formatInt $addr.UnconfirmedTxs}}
+{{end}} +{{if or $addr.Transactions $addr.Filter}} +
+

Transactions

+
+ +
+
{{template "paging" $data}}
-
- {{- range $tx := $addr.Transactions}}{{$data := setTxToTemplateData $data $tx}}{{template "txdetail" $data}}{{end -}} +
+ {{range $tx := $addr.Transactions}}{{$data := setTxToTemplateData $data $tx}}{{template "txdetail" $data}}{{end}}
{{template "paging" $data }} {{end}}{{end}} \ No newline at end of file diff --git a/static/templates/block.html b/static/templates/block.html index 4ee93b7b..9edcfd24 100644 --- a/static/templates/block.html +++ b/static/templates/block.html @@ -1,4 +1,4 @@ -{{define "specific"}}{{$cs := .CoinShortcut}}{{$b := .Block}}{{$data := . -}} +{{define "specific"}}{{$cs := .CoinShortcut}}{{$b := .Block}}{{$data := .}}

Block

-{{- if $b.Transactions -}} -
-

Transactions

+{{if $b.Transactions}} +
+

Transactions

{{template "paging" $data}}
- {{- range $tx := $b.Transactions}}{{$data := setTxToTemplateData $data $tx}}{{template "txdetail" $data}}{{end -}} + {{range $tx := $b.Transactions}}{{$data := setTxToTemplateData $data $tx}}{{template "txdetail" $data}}{{end}}
{{template "paging" $data }} {{end}}{{end}} \ No newline at end of file diff --git a/static/templates/blocks.html b/static/templates/blocks.html index 01349c7b..23017a6e 100644 --- a/static/templates/blocks.html +++ b/static/templates/blocks.html @@ -3,7 +3,7 @@

Blocks

{{if $blocks.Blocks}}{{template "paging" $data }}{{end}}
-{{if $blocks.Blocks -}} +{{if $blocks.Blocks}}
@@ -16,7 +16,7 @@ - {{- range $b := $blocks.Blocks -}} + {{range $b := $blocks.Blocks}} @@ -24,7 +24,7 @@ - {{- end -}} + {{end}}
{{formatUint32 $b.Height}} {{$b.Hash}}{{formatUint32 $b.Txs}} {{formatUint32 $b.Size}}
diff --git a/static/templates/index.html b/static/templates/index.html index a5da0f92..b7e23060 100644 --- a/static/templates/index.html +++ b/static/templates/index.html @@ -1,11 +1,11 @@ {{define "specific"}}{{$cs := .CoinShortcut}}{{$bb := .Info.Blockbook}}{{$be := .Info.Backend}}

Application status

-{{- if $bb.InitialSync -}} +{{if $bb.InitialSync}}

Application is now in initial synchronization and does not provide any data.

-{{- end -}} -{{- if not $bb.SyncMode -}} +{{end}} +{{if not $bb.SyncMode}}

Synchronization with backend is disabled, the state of index is not up to date.

-{{- end -}} +{{end}}
@@ -50,7 +50,7 @@ - {{- if $bb.HasFiatRates -}} + {{if $bb.HasFiatRates}} @@ -59,7 +59,7 @@ - {{- end -}} + {{end}} @@ -67,19 +67,19 @@
Transactions in Mempool {{if .InternalExplorer}}{{$bb.MempoolSize}}{{else}}{{formatInt $bb.MempoolSize}}{{end}}
Current Fiat rates {{formatTime $bb.CurrentFiatRatesTime}}Historical Fiat rates {{formatTime $bb.HistoricalFiatRatesTime}}{{if $bb.HasTokenFiatRates}}
tokens {{formatTime $bb.HistoricalTokenFiatRatesTime}}{{end}}
Size On Disk {{formatInt64 $bb.DbSize}}
-
+
- {{- if $be.BackendError -}} + {{if $be.BackendError}} - {{- end -}} + {{end}} @@ -88,24 +88,24 @@ - {{- if $be.Subversion -}} + {{if $be.Subversion}} - {{- end -}} - {{- if $be.ProtocolVersion -}} + {{end}} + {{if $be.ProtocolVersion}} - {{- end -}} - {{- if $be.ConsensusVersion -}} + {{end}} + {{if $be.ConsensusVersion}} - {{- end -}} + {{end}} @@ -114,30 +114,30 @@ - {{- if $be.Timeoffset -}} + {{if $be.Timeoffset}} - {{- end -}} - {{- if $be.SizeOnDisk -}} + {{end}} + {{if $be.SizeOnDisk}} - {{- end -}} - {{- if $be.Consensus -}} + {{end}} + {{if $be.Consensus}} - {{- end -}} - {{- if $be.Warnings -}} + {{end}} + {{if $be.Warnings}} - {{- end -}} + {{end}}

Backend

Backend Error {{$be.BackendError}}
Chain {{$be.Chain}}Version {{$be.Version}}
Subversion {{$be.Subversion}}
Protocol Version {{$be.ProtocolVersion}}
Consensus Version {{$be.ConsensusVersion}}
Last Block {{formatInt $be.Blocks}}Difficulty {{$be.Difficulty}}
Timeoffset {{$be.Timeoffset}}
Size On Disk {{formatInt64 $be.SizeOnDisk}}
Consensus {{toJSON $be.Consensus}}
Warnings {{$be.Warnings}}
diff --git a/static/templates/sendtx.html b/static/templates/sendtx.html index 086925ca..40fef464 100644 --- a/static/templates/sendtx.html +++ b/static/templates/sendtx.html @@ -1,16 +1,16 @@ -{{define "specific" -}} +{{define "specific"}}

Send Raw Transaction

-
+
-{{- if .Status -}} -
{{.Status}}
-{{- end -}} -{{- if .Error -}} -
{{.Error.Text}}
-{{- end -}} -{{- end -}} \ No newline at end of file +{{if .Status}} +
{{.Status}}
+{{end}} +{{if .Error}} +
{{.Error.Text}}
+{{end}} +{{end}} \ No newline at end of file diff --git a/static/templates/tx.html b/static/templates/tx.html index 1f5e69bc..7eba2b8f 100644 --- a/static/templates/tx.html +++ b/static/templates/tx.html @@ -1,4 +1,4 @@ -{{define "specific"}}{{$cs := .CoinShortcut}}{{$tx := .Tx}} +{{define "specific"}}{{$tx := .Tx}}{{$data := .}}

Transaction

@@ -7,7 +7,7 @@
- {{- if $tx.Confirmations -}} + {{if $tx.Confirmations}} @@ -22,26 +22,26 @@ {{end}} - {{- if $tx.EthereumSpecific -}} + {{if $tx.EthereumSpecific}} {{if $tx.EthereumSpecific.Status}} {{if eq $tx.EthereumSpecific.Status 1}} - + {{else}} - {{if eq $tx.EthereumSpecific.Status -1}} + {{if eq $tx.EthereumSpecific.Status 1}} {{else}} {{end}} {{end}} {{else}} - + {{end}} - + @@ -49,16 +49,16 @@ - + - {{- else -}} + {{else}} - + - + {{if $tx.VSize}} @@ -71,26 +71,26 @@ - {{- end -}} - {{- end -}} - {{- end -}} - {{- if $tx.FeesSat -}} + {{end}} + {{end}} + {{end}} + {{if $tx.FeesSat}} - - {{end -}} + + {{end}} {{if not $tx.Confirmations}} - {{end -}} + {{end}}
Mined Time {{formatUnixTime $tx.Blocktime}}In Block Height {{formatInt $tx.Blockheight}}
StatusSuccessSuccessPendingUnknownFail{{if $tx.EthereumSpecific.Error}} ({{$tx.EthereumSpecific.Error}}){{end}}Failed{{if $tx.EthereumSpecific.Error}} {{$tx.EthereumSpecific.Error}}{{end}}
Value{{formatAmount $tx.ValueOutSat}} {{$cs}}{{amount $tx.ValueOutSat $data "copyable"}}
Gas Used / Limit
Gas Price{{formatAmount $tx.EthereumSpecific.GasPrice}} {{$cs}}{{amount $tx.EthereumSpecific.GasPrice $data "copyable"}}
Total Input{{formatAmount $tx.ValueInSat}} {{$cs}}{{amount $tx.ValueInSat $data "copyable"}}
Total Output{{formatAmount $tx.ValueOutSat}} {{$cs}}{{amount $tx.ValueOutSat $data "copyable"}}
Size {{formatInt $tx.Size}}
Fees{{formatAmount $tx.FeesSat}} {{$cs}}{{if $tx.Size}} ({{feePerByte $tx}}){{end}}
{{amount $tx.FeesSat $data "copyable"}}{{if $tx.Size}} ({{feePerByte $tx}}){{end}}
RBF {{if $tx.Rbf}} - ON + ON {{else}} OFF️ {{end}}

Details

diff --git a/static/templates/txdetail.html b/static/templates/txdetail.html index 49ae9543..8dc50703 100644 --- a/static/templates/txdetail.html +++ b/static/templates/txdetail.html @@ -3,9 +3,9 @@
{{$tx.Txid}} - {{- if $tx.Rbf}} RBF{{end -}} + {{if $tx.Rbf}} RBF{{end}}
- {{- if $tx.Blocktime}}
{{if $tx.Confirmations}}mined{{else}}first seen{{end}} {{formatUnixTime $tx.Blocktime}}
{{end -}} + {{if $tx.Blocktime}}
{{if $tx.Confirmations}}mined{{else}}first seen{{end}} {{formatUnixTime $tx.Blocktime}}
{{end}}
@@ -32,15 +32,15 @@
 
- {{- range $vout := $tx.Vout -}} + {{range $vout := $tx.Vout}}
{{range $a := $vout.Addresses}} {{if and (ne $a $addr) $vout.IsAddress}}{{$a}}{{else}}{{$a}}{{end}} - {{- else -}} + {{else}} Unparsed address - {{- end -}} + {{end}} {{amount $vout.ValueSat $data "copyable"}}{{if $vout.Spent}}{{else}}× {{end}} @@ -55,17 +55,17 @@