commit
876852ca9c
@ -1,3 +1,50 @@ |
||||
$primary: #2a3f54; |
||||
$secondary: #39c4a9; |
||||
$tertiary: #39c4a9; |
||||
// general |
||||
$primary: #193653; |
||||
$secondary: #49a2ee; |
||||
$tertiary: #41c3a9; |
||||
$additional-font: #a3ceff; |
||||
|
||||
// footer |
||||
$footer-background-color: $primary; |
||||
$footer-title-color: #fff; |
||||
$footer-text-color: $additional-font; |
||||
$footer-item-disc-color: $additional-font; |
||||
.footer-logo { filter: brightness(0) invert(1); } |
||||
|
||||
// dashboard |
||||
$dashboard-line-color-price: $tertiary; // price left border |
||||
|
||||
$dashboard-banner-chart-legend-value-color: $additional-font; // chart labels |
||||
|
||||
$dashboard-stats-item-value-color: $additional-font; // stat values |
||||
|
||||
$dashboard-stats-item-border-color: $tertiary; // stat border |
||||
|
||||
$dashboard-banner-gradient-start: $primary; // gradient begin |
||||
|
||||
$dashboard-banner-gradient-end: lighten($primary, 5); // gradient end |
||||
|
||||
$dashboard-banner-network-plain-container-background-color: #244468; // stats bg |
||||
|
||||
|
||||
// navigation |
||||
.navbar { box-shadow: 0px 0px 30px 0px rgba(21, 53, 80, 0.12); } // header shadow |
||||
$header-icon-border-color-hover: $tertiary; // top border on hover |
||||
$header-icon-color-hover: $tertiary; // nav icon on hover |
||||
.dropdown-item:hover, .dropdown-item:focus { background-color: $tertiary !important; } // dropdown item on hover |
||||
|
||||
// buttons |
||||
$btn-line-bg: #fff; // button bg |
||||
$btn-line-color: $tertiary; // button border and font color && hover bg color |
||||
$btn-copy-color: $tertiary; // btn copy |
||||
$btn-qr-color: $tertiary; // btn qr-code |
||||
|
||||
//links & tile |
||||
.tile a { color: $tertiary !important; } // links color for badges |
||||
.tile-type-block { |
||||
border-left: 4px solid $tertiary; |
||||
} // tab active bg |
||||
|
||||
// card |
||||
$card-background-1: $secondary; |
||||
$card-tab-active: $secondary; |
||||
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 12 KiB |
@ -0,0 +1,46 @@ |
||||
defmodule BlockScoutWeb.AddressLogsController do |
||||
@moduledoc """ |
||||
Manages events logs tab. |
||||
""" |
||||
|
||||
import BlockScoutWeb.AddressController, only: [transaction_count: 1, validation_count: 1] |
||||
import BlockScoutWeb.Chain, only: [paging_options: 1, next_page_params: 3, split_list_by_page: 1] |
||||
|
||||
alias Explorer.{Chain, Market} |
||||
alias Explorer.ExchangeRates.Token |
||||
alias Indexer.Fetcher.CoinBalanceOnDemand |
||||
|
||||
use BlockScoutWeb, :controller |
||||
|
||||
def index(conn, %{"address_id" => address_hash_string} = params) do |
||||
with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), |
||||
{:ok, address} <- Chain.hash_to_address(address_hash) do |
||||
logs_plus_one = Chain.address_to_logs(address, paging_options(params)) |
||||
{results, next_page} = split_list_by_page(logs_plus_one) |
||||
|
||||
next_page_url = |
||||
case next_page_params(next_page, results, params) do |
||||
nil -> |
||||
nil |
||||
|
||||
next_page_params -> |
||||
address_logs_path(conn, :index, address, next_page_params) |
||||
end |
||||
|
||||
render( |
||||
conn, |
||||
"index.html", |
||||
address: address, |
||||
logs: results, |
||||
coin_balance_status: CoinBalanceOnDemand.trigger_fetch(address), |
||||
exchange_rate: Market.get_exchange_rate(Explorer.coin()) || Token.null(), |
||||
transaction_count: transaction_count(address), |
||||
validation_count: validation_count(address), |
||||
next_page_url: next_page_url |
||||
) |
||||
else |
||||
_ -> |
||||
not_found(conn) |
||||
end |
||||
end |
||||
end |
@ -0,0 +1,82 @@ |
||||
<section class="container"> |
||||
<%= render BlockScoutWeb.AddressView, "overview.html", assigns %> |
||||
<div class="card"> |
||||
<%= render BlockScoutWeb.AddressView, "_tabs.html", assigns %> |
||||
|
||||
<div class="card-body"> |
||||
|
||||
<h2 class="card-title"><%= gettext "Logs" %></h2> |
||||
|
||||
<%= if @next_page_url do %> |
||||
<%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "top", cur_page_number: "1", show_pagination_limit: true, next_page_path: @next_page_url %> |
||||
<% end %> |
||||
|
||||
<%= if !@next_page_url do %> |
||||
<%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "top", cur_page_number: "1", show_pagination_limit: true %> |
||||
<% end %> |
||||
|
||||
<%= if Enum.count(@logs) > 0 do %> |
||||
<%= for log <- @logs do %> |
||||
<div data-test="transaction_log" class="tile tile-muted"> |
||||
<dl class="row"> |
||||
<dt class="col-md-2"> <%= gettext "Transaction" %> </dt> |
||||
<dd class="col-md-10"> |
||||
<h3 class=""> |
||||
<%= link( |
||||
log.transaction, |
||||
to: transaction_path(@conn, :show, log.transaction), |
||||
"data-test": "log_address_link", |
||||
"data-address-hash": log.transaction |
||||
) %> |
||||
</h3> |
||||
</dd> |
||||
<dt class="col-md-2"><%= gettext "Topics" %></dt> |
||||
<dd class="col-md-10"> |
||||
<div class="raw-transaction-log-topics"> |
||||
<%= unless is_nil(log.first_topic) do %> |
||||
<div class="text-dark"> |
||||
<span class="text-dark">[0]</span> |
||||
<%= log.first_topic %> |
||||
</div> |
||||
<% end %> |
||||
<%= unless is_nil(log.second_topic) do %> |
||||
<div class="text-dark"> |
||||
<span class="">[1] </span> |
||||
<%= log.second_topic %> |
||||
</div> |
||||
<% end %> |
||||
<%= unless is_nil(log.third_topic) do %> |
||||
<div class="text-dark"> |
||||
<span>[2]</span> |
||||
<%= log.third_topic %> |
||||
</div> |
||||
<% end %> |
||||
<%= unless is_nil(log.fourth_topic) do %> |
||||
<div class="text-dark"> |
||||
<span>[3]</span> |
||||
<%= log.fourth_topic %> |
||||
</div> |
||||
<% end %> |
||||
</div> |
||||
</dd> |
||||
<dt class="col-md-2"> |
||||
<%= gettext "Data" %> |
||||
</dt> |
||||
<dd class="col-md-10"> |
||||
<%= unless is_nil(log.data) do %> |
||||
<div class="text-dark raw-transaction-log-data"> |
||||
<%= log.data %> |
||||
</div> |
||||
<% end %> |
||||
</dd> |
||||
</dl> |
||||
</div> |
||||
<% end %> |
||||
<% else %> |
||||
<div class="tile tile-muted text-center"> |
||||
<span><%= gettext "There are no logs for this address." %></span> |
||||
</div> |
||||
<% end %> |
||||
</div> |
||||
</div> |
||||
</section> |
@ -0,0 +1,3 @@ |
||||
defmodule BlockScoutWeb.AddressLogsView do |
||||
use BlockScoutWeb, :view |
||||
end |
@ -0,0 +1,33 @@ |
||||
defmodule BlockScoutWeb.API.RPC.EthRPCView do |
||||
use BlockScoutWeb, :view |
||||
|
||||
defstruct [:result, :id, :error] |
||||
|
||||
def render("show.json", %{result: result, id: id}) do |
||||
%__MODULE__{ |
||||
result: result, |
||||
id: id |
||||
} |
||||
end |
||||
|
||||
def render("error.json", %{error: message, id: id}) do |
||||
%__MODULE__{ |
||||
error: message, |
||||
id: id |
||||
} |
||||
end |
||||
|
||||
defimpl Poison.Encoder, for: BlockScoutWeb.API.RPC.EthRPCView do |
||||
def encode(%BlockScoutWeb.API.RPC.EthRPCView{result: result, id: id, error: error}, _options) when is_nil(error) do |
||||
""" |
||||
{"jsonrpc":"2.0","result":"#{result}","id":#{id}} |
||||
""" |
||||
end |
||||
|
||||
def encode(%BlockScoutWeb.API.RPC.EthRPCView{id: id, error: error}, _options) do |
||||
""" |
||||
{"jsonrpc":"2.0","error": #{error},"id": #{id}} |
||||
""" |
||||
end |
||||
end |
||||
end |
Loading…
Reference in new issue