Template for VK

This commit is contained in:
Vamsi Krishna B 2021-07-30 19:17:09 +05:30
parent 2a56cf0623
commit d2a950cca2
3 changed files with 36 additions and 0 deletions

View File

@ -78,4 +78,8 @@ defmodule ZcashExplorerWeb.PageController do
def nodes(conn, _params) do
render(conn, "nodes.html", page_title: "Zcash Nodes")
end
def vk(conn, _params) do
render(conn, "vk.html", csrf_token: get_csrf_token(), page_title: "Zcash Viewing Key")
end
end

View File

@ -40,6 +40,7 @@ defmodule ZcashExplorerWeb.Router do
get "/blocks", BlockController, :index
get "/mempool", PageController, :mempool
get "/nodes", PageController, :nodes
get "/vk", PageController, :vk
end
# Other scopes may use custom stacks.

View File

@ -0,0 +1,31 @@
<main class="py-4">
<div class="grid grid-cols-1 mx-8">
<h3 class="text-lg leading-6 font-medium text-gray-500 py-2">
Zcash Viewing Key
</h3>
<form class="space-y-8" action="/do_import_vk" method="post">
<div class="space-y-8 divide-y divide-gray-200 sm:space-y-5">
<div>
<p class="mt-1 mb-2 max-w-2xl text-sm text-gray-600">
Paste the viewing key, click on view transactions button and grab a coffee !
</p>
<input type="hidden" value="<%= @csrf_token %>" name="_csrf_token"/>
<textarea id="broadcast" name="tx-hex" rows="22" class="w-full shadow-sm bg-indigo-400 bg-opacity-5 focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm border border-gray-300 rounded-md font-mono text-green-400 "></textarea>
<div class="pt-5 pb-5">
<div class="flex justify-center">
<button type="submit" class="flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
Start importing
</button>
</div>
</div>
</div>
</div>
</form>
</div>
</main>