diff --git a/app/controllers/addresses_controller.rb b/app/controllers/addresses_controller.rb index 8704eb015..e49d29a39 100644 --- a/app/controllers/addresses_controller.rb +++ b/app/controllers/addresses_controller.rb @@ -12,5 +12,6 @@ def index def show @address = Address.find_by_address_hash(params[:id]) @transactions = @address.ckb_transactions.order('id desc').page(params[:page]).per(10) + @qr = RQRCode::QRCode.new("https://t.me/ckb_watch_bot?start=#{@address&.id}", :size => 7, :level => :l ) end end diff --git a/app/views/addresses/show.html.erb b/app/views/addresses/show.html.erb index a7260f220..5e5bc4354 100644 --- a/app/views/addresses/show.html.erb +++ b/app/views/addresses/show.html.erb @@ -10,7 +10,13 @@ <%= t 'address' %>: <%= render partial: 'shared/copy_to_clipboard', locals: {content: @address.address_hash,tip: t('copy_address_to_clipboard')} %> +
<%= @address.address_hash.to_s.gsub(/(.{16}).*(.{16})/, '\1...\2') %> @@ -56,6 +62,7 @@
Tx:<%= link_to transaction.tx_hash, transaction_path(transaction.tx_hash), class: 'font-medium text-blue-600 dark:text-blue-500 hover:underline' %> <%= t 'block' %>:<%= link_to transaction.block_number, block_path(transaction.block_number), class: 'font-medium text-blue-600 dark:text-blue-500 hover:underline' %> + <%= t('block_timestamp') %>: <%= Time.at((transaction.block_timestamp / 1000).to_i).strftime("%Y-%m-%d %H:%M:%S") %>
@@ -110,4 +117,82 @@
<%= render 'shared/disqus' %> - \ No newline at end of file + + + + + + \ No newline at end of file diff --git a/app/views/shared/_copy_to_clipboard.html.erb b/app/views/shared/_copy_to_clipboard.html.erb index 11241aedd..577ff94d5 100644 --- a/app/views/shared/_copy_to_clipboard.html.erb +++ b/app/views/shared/_copy_to_clipboard.html.erb @@ -3,7 +3,7 @@