mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-08 20:46:16 +08:00
Rewrite .eex into .heex
This commit is contained in:
parent
4e45ab13a7
commit
27f62eeb6d
6 changed files with 108 additions and 91 deletions
|
@ -1,40 +0,0 @@
|
|||
<div class="h-screen flex items-center justify-center bg-gray-900">
|
||||
<div class="flex flex-col space-y-4 items-center">
|
||||
<a href="<%= Routes.path(@conn, "/") %>">
|
||||
<img src="<%= Routes.static_path(@conn, "/images/logo.png") %>" height="128" width="128" alt="livebook" />
|
||||
</a>
|
||||
<div class="text-2xl text-gray-50">
|
||||
Authentication required
|
||||
</div>
|
||||
|
||||
<div class="max-w-2xl text-center text-gray-300">
|
||||
<%= if @auth_mode == :password do %>
|
||||
Type password to access the Livebook.
|
||||
<% else %>
|
||||
Please check out the console for authentication URL
|
||||
or type the token directly here.
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="text-2xl text-gray-50 w-full pt-2">
|
||||
<form method="post" class="flex flex-col space-y-4 items-center">
|
||||
<input type="hidden" value="<%= Phoenix.Controller.get_csrf_token() %>" name="_csrf_token"/>
|
||||
<%= if @auth_mode == :password do %>
|
||||
<div phx-feedback-for="password" class="<%= if(@errors, do: "show-errors w-[20ch]", else: "w-[20ch]") %>">
|
||||
<input type="password" name="password" class="input" placeholder="Password" autofocus />
|
||||
<% else %>
|
||||
<div phx-feedback-for="token" class="<%= if(@errors, do: "show-errors w-[20ch]", else: "w-[20ch]") %>">
|
||||
<input type="text" name="token" class="input" placeholder="Token" autofocus />
|
||||
<% end %>
|
||||
<%= for error <- @errors || [] do %>
|
||||
<span class="mt-1 hidden text-red-600 text-sm phx-form-error:block">
|
||||
<%= translate_error(error) %>
|
||||
</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<button type="submit" class="button-base button-blue">
|
||||
Authenticate
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
47
lib/livebook_web/templates/auth/index.html.heex
Normal file
47
lib/livebook_web/templates/auth/index.html.heex
Normal file
|
@ -0,0 +1,47 @@
|
|||
<div class="h-screen flex items-center justify-center bg-gray-900">
|
||||
<div class="flex flex-col space-y-4 items-center">
|
||||
<a href={Routes.path(@conn, "/")}>
|
||||
<img
|
||||
src={Routes.static_path(@conn, "/images/logo.png")}
|
||||
height="128"
|
||||
width="128"
|
||||
alt="livebook"
|
||||
/>
|
||||
</a>
|
||||
<div class="text-2xl text-gray-50">
|
||||
Authentication required
|
||||
</div>
|
||||
|
||||
<div class="max-w-2xl text-center text-gray-300">
|
||||
<%= if @auth_mode == :password do %>
|
||||
Type password to access the Livebook.
|
||||
<% else %>
|
||||
Please check out the console for authentication URL
|
||||
or type the token directly here.
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="text-2xl text-gray-50 w-full pt-2">
|
||||
<form method="post" class="flex flex-col space-y-4 items-center">
|
||||
<input type="hidden" value={Phoenix.Controller.get_csrf_token()} name="_csrf_token" />
|
||||
<div
|
||||
phx-feedback-for={@auth_mode}
|
||||
class={if(@errors, do: "show-errors w-[20ch]", else: "w-[20ch]")}
|
||||
>
|
||||
<%= if @auth_mode == :password do %>
|
||||
<input type="password" name="password" class="input" placeholder="Password" autofocus />
|
||||
<% else %>
|
||||
<input type="text" name="token" class="input" placeholder="Token" autofocus />
|
||||
<% end %>
|
||||
<%= for error <- @errors || [] do %>
|
||||
<span class="mt-1 hidden text-red-600 text-sm phx-form-error:block">
|
||||
<%= translate_error(error) %>
|
||||
</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<button type="submit" class="button-base button-blue">
|
||||
Authenticate
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,24 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<link rel="icon" type="image/svg+xml" href="<%= Routes.static_path(@conn, "/favicon.svg") %>" />
|
||||
<link rel="alternate icon" type="image/png" href="<%= Routes.static_path(@conn, "/favicon.png") %>" />
|
||||
<title><%= @status %> - Livebook</title>
|
||||
<link rel="stylesheet" href="<%= Routes.static_path(@conn, "/css/app.css") %>"/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="h-screen flex items-center justify-center bg-gray-900">
|
||||
<div class="flex flex-col space-y-4 items-center">
|
||||
<a href="<%= Routes.path(@conn, "/") %>">
|
||||
<img src="<%= Routes.static_path(@conn, "/images/logo.png") %>" height="128" width="128" alt="livebook" />
|
||||
</a>
|
||||
<div class="text-2xl text-gray-50">
|
||||
No Numbats here!
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
29
lib/livebook_web/templates/error/404.html.heex
Normal file
29
lib/livebook_web/templates/error/404.html.heex
Normal file
|
@ -0,0 +1,29 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="icon" type="image/svg+xml" href={Routes.static_path(@conn, "/favicon.svg")} />
|
||||
<link rel="alternate icon" type="image/png" href={Routes.static_path(@conn, "/favicon.png")} />
|
||||
<title><%= @status %> - Livebook</title>
|
||||
<link rel="stylesheet" href={Routes.static_path(@conn, "/css/app.css")} />
|
||||
</head>
|
||||
<body>
|
||||
<div class="h-screen flex items-center justify-center bg-gray-900">
|
||||
<div class="flex flex-col space-y-4 items-center">
|
||||
<a href={Routes.path(@conn, "/")}>
|
||||
<img
|
||||
src={Routes.static_path(@conn, "/images/logo.png")}
|
||||
height="128"
|
||||
width="128"
|
||||
alt="livebook"
|
||||
/>
|
||||
</a>
|
||||
<div class="text-2xl text-gray-50">
|
||||
No Numbats here!
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,27 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<link rel="icon" type="image/svg+xml" href="<%= Routes.static_path(@conn, "/favicon.svg") %>" />
|
||||
<link rel="alternate icon" type="image/png" href="<%= Routes.static_path(@conn, "/favicon.png") %>" />
|
||||
<title><%= @status %> - Livebook</title>
|
||||
<link rel="stylesheet" href="<%= Routes.static_path(@conn, "/css/app.css") %>"/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="h-screen flex items-center justify-center bg-gray-900">
|
||||
<div class="flex flex-col space-y-4 items-center">
|
||||
<a href="<%= Routes.path(@conn, "/") %>">
|
||||
<img src="<%= Routes.static_path(@conn, "/images/logo.png") %>" height="128" width="128" alt="livebook" />
|
||||
</a>
|
||||
<div class="text-2xl text-gray-50">
|
||||
Something went wrong.
|
||||
</div>
|
||||
<div class="text-lg text-gray-50">
|
||||
Check out the console for logs for more information.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
32
lib/livebook_web/templates/error/500.html.heex
Normal file
32
lib/livebook_web/templates/error/500.html.heex
Normal file
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="icon" type="image/svg+xml" href={Routes.static_path(@conn, "/favicon.svg")} />
|
||||
<link rel="alternate icon" type="image/png" href={Routes.static_path(@conn, "/favicon.png")} />
|
||||
<title><%= @status %> - Livebook</title>
|
||||
<link rel="stylesheet" href={Routes.static_path(@conn, "/css/app.css")} />
|
||||
</head>
|
||||
<body>
|
||||
<div class="h-screen flex items-center justify-center bg-gray-900">
|
||||
<div class="flex flex-col space-y-4 items-center">
|
||||
<a href={Routes.path(@conn, "/")}>
|
||||
<img
|
||||
src={Routes.static_path(@conn, "/images/logo.png")}
|
||||
height="128"
|
||||
width="128"
|
||||
alt="livebook"
|
||||
/>
|
||||
</a>
|
||||
<div class="text-2xl text-gray-50">
|
||||
Something went wrong.
|
||||
</div>
|
||||
<div class="text-lg text-gray-50">
|
||||
Check out the console for logs for more information.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Reference in a new issue