From dc62692f8541440ea15678092201040a73ae1516 Mon Sep 17 00:00:00 2001 From: Aki Wu Date: Thu, 16 Nov 2023 11:44:38 +0800 Subject: [PATCH] ui update --- app/views/layouts/application.html.erb | 8 ++- app/views/messages/_show_message.html.erb | 88 ++++++++++++----------- app/views/messages/show.html.erb | 2 +- 3 files changed, 51 insertions(+), 47 deletions(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 27c02a9..bccdb82 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -23,9 +23,11 @@ <%= render "messages/messages_count", messages_count: @messages_count %>
- <%= form_with url: "/message", method: :get do |form| %> - <%= form.text_field :tx_or_hash, class: "ml-6 mr-6 mb-2 p-1.5 text-md bg-transparent", style: "border: 1px solid lightgrey; width: 90%", placeholder: "tx hash or msg hash" %> - <% end %> +
+ <%= form_with url: "/message", method: :get do |form| %> + <%= form.text_field :tx_or_hash, class: "p-1.5 text-md bg-transparent", style: "border: 1px solid lightgrey; box-sizing: border-box; width: 100%", placeholder: "tx hash or msg hash" %> + <% end %> +
<%= yield %>
diff --git a/app/views/messages/_show_message.html.erb b/app/views/messages/_show_message.html.erb index 54d57de..ea96cdc 100644 --- a/app/views/messages/_show_message.html.erb +++ b/app/views/messages/_show_message.html.erb @@ -2,33 +2,33 @@
-
+
Direction
-
+
<%= link_to message.from_network.name, network_messages_path(message.from_network.name), class: 'underline' %> -> <%= link_to message.to_network.name, network_messages_path('_', message.to_network.name), class: 'underline' %>
-
+
Index
-
#<%= message.index %>
+
#<%= message.index %>
-
+
Status
-
+
<%= message.status_label %>
-
+
Message Hash
-
<%= message.msg_hash %>
+
<%= message.msg_hash %>
-
+
Message
-
+
<% if message.msgport_payload.blank? %> <%= message.encoded %> @@ -40,89 +40,91 @@
-
+
Message Gas Limit
-
<%= message.gas_limit %>
+
<%= message.gas_limit %>
-
+
Message Root
-
<%= message.root %>
+
<%= message.root %>
-
+
Proof
-
-
<%= message.proof.nil? ? '' : JSON.pretty_generate(message.proof) %>
+
+
+ <%= message.proof.nil? ? '' : message.proof %> +
-
+
<%= message.from_network.display_name %>
SOURCE CHAIN
-
+
Source Chain Id
-
<%= message.from_network.chain_id %>
+
<%= message.from_network.chain_id %>
-
+
From Address
-
<%= from_link(message) %>
+
<%= from_link(message) %>
-
+
Transaction Hash
-
<%= transaction_link(message.from_network, message.transaction_hash) %>
+
<%= transaction_link(message.from_network, message.transaction_hash) %>
-
+
Block Number
-
<%= block_link(message.from_network, message.block_number) %>
+
<%= block_link(message.from_network, message.block_number) %>
-
+
Block Timestamp
-
<%= Time.at(message.block_timestamp) %>
+
<%= Time.at(message.block_timestamp) %>
-
+
Age
-
<%= time_ago_in_words(Time.at(message.block_timestamp)) %> ago
+
<%= time_ago_in_words(Time.at(message.block_timestamp)) %> ago
-
+
<%= message.to_network.display_name %>
TARGET CHAIN
-
+
Target Chain Id
-
<%= message.to_network.chain_id %>
+
<%= message.to_network.chain_id %>
-
+
To Address
-
<%= to_link(message) %>
+
<%= to_link(message) %>
-
+
Dispatch Transaction Hash
-
+
<% if message.dispatch_transaction_hash %> <%= transaction_link(message.to_network, message.dispatch_transaction_hash) %> <% end %>
-
+
Dispatch Block Number
-
+
<% if message.dispatch_block_number %> <%= block_link(message.to_network, message.dispatch_block_number) %> <% end %>
-
+
Dispatch Block Timestamp
-
+
<% if message.dispatch_block_timestamp %> <%= Time.at(message.dispatch_block_timestamp) %> <% end %>
-
+
Send-to-Dispatch Time Spent
-
+
<% if message.dispatch_block_timestamp %> <%= time_consumption(message) %> <% end %> diff --git a/app/views/messages/show.html.erb b/app/views/messages/show.html.erb index bb4b150..7d28744 100644 --- a/app/views/messages/show.html.erb +++ b/app/views/messages/show.html.erb @@ -1,6 +1,6 @@ <%= turbo_stream_from("message") %> -
+
<%= render "show_message", message: @message %>