Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
fix ui
Browse files Browse the repository at this point in the history
  • Loading branch information
wuminzhe committed Apr 7, 2024
1 parent 23ab275 commit 2022ca9
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 10 deletions.
18 changes: 16 additions & 2 deletions app/assets/stylesheets/application.tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,22 @@ html, body {
/* background-color: rgb(252, 251, 248); */
}

table, dd {
font-family: "Ubuntu Mono", monospace;
dd {
font-family: "Noto Sans Mono", monospace;
font-optical-sizing: auto;
font-weight: 400;
font-style: normal;
font-variation-settings:
"wdth" 100;
}

.mono {
font-family: "Noto Sans Mono", monospace;
font-optical-sizing: auto;
font-weight: 400;
font-style: normal;
font-variation-settings:
"wdth" 100;
}

.pagination a {
Expand Down
2 changes: 1 addition & 1 deletion app/models/message.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Message < ApplicationRecord

def status_label
if status == 'accepted'
'Accepted'
'Pending'
elsif status == 'root_ready'
'Root Ready'
elsif status == 'dispatch_success'
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<%= csp_meta_tag %>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Ubuntu+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Mono&display=swap" rel="stylesheet">

<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
<%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>
Expand Down
10 changes: 6 additions & 4 deletions app/views/messages/_message.html.erb
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
<tr id="message_<%= message.identifier %>" class="bg-white border-b dark:bg-gray-800 dark:border-gray-700">
<td class="whitespace-nowrap px-6 py-4"><%= link_to short(message.msg_hash), message_by_tx_or_hash_path(message.msg_hash), class: 'underline' %></td>
<td class="whitespace-nowrap px-6 py-4 mono"><%= link_to short(message.msg_hash), message_by_tx_or_hash_path(message.msg_hash), class: 'underline' %></td>
<td class="whitespace-nowrap px-6 py-4">
<div class="<%= status_style(message.status) %>">
<div class="<%= status_style(message.status) %>" style="width: fit-content">
<%= link_to message.status_label, "#{request.path}?status=#{message.status}" %>
</div>
</td>
<td class="whitespace-nowrap px-6 py-4">
<%= 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' %>
<td class="whitespace-nowrap px-6 py-4 text-left"><%= address_link_short(message.from_network, message.from) %></td>
<td class="whitespace-nowrap px-6 py-4 text-left"><%= address_link_short(message.to_network, message.to) %></td>
<td class="whitespace-nowrap px-6 py-4 text-left mono"><%= address_link_short(message.from_network, message.from) %></td>
<td class="whitespace-nowrap px-6 py-4 text-left mono"><%= address_link_short(message.to_network, message.to) %></td>
<td class="whitespace-nowrap px-6 py-4 text-left"><%= time_ago_in_words(message.block_timestamp) %> ago</td>
<td class="whitespace-nowrap px-6 py-4">
<% if message.dispatch_block_timestamp %>
<%= time_consumption(message) %>
<% else %>
-
<% end %>
</td>
<td class="whitespace-nowrap px-6 py-2"><%= link_to "MORE", message_by_tx_or_hash_path(message.msg_hash), class: "underline" %></td>
Expand Down
2 changes: 1 addition & 1 deletion app/views/messages/_show_message.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<dt class="text-sm font-medium leading-6 text-gray-900">Direction</dt>
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-3 sm:mt-0">
<%= 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' %>
</dd>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/messages/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="relative overflow-hidden">


<table class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400">
<table class="w-full text-xs text-left rtl:text-right text-gray-500 dark:text-gray-400">
<thead class="text-xs text-gray-700 uppercase dark:text-gray-400">
<tr>
<th scope="col" class="px-6 py-3">Hash</th>
Expand Down

0 comments on commit 2022ca9

Please sign in to comment.