Skip to content

Commit 2c23e78

Browse files
committed
Add basic home page for admin endpoint
1 parent 8c6f51e commit 2c23e78

File tree

5 files changed

+35
-0
lines changed

5 files changed

+35
-0
lines changed

lib/asciinema_web/admin/router.ex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@ defmodule AsciinemaWeb.Admin.Router do
1717

1818
live_dashboard "/dashboard", metrics: Asciinema.Telemetry
1919
oban_dashboard("/oban")
20+
21+
get "/", HomeController, :show
2022
end
2123
end
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
defmodule AsciinemaWeb.Admin.HomeController do
2+
use AsciinemaWeb, :controller
3+
4+
def show(conn, _params) do
5+
conn
6+
|> put_layout(:admin)
7+
|> render(:show)
8+
end
9+
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
defmodule AsciinemaWeb.Admin.HomeHTML do
2+
use AsciinemaWeb, :html
3+
4+
embed_templates "home_html/*"
5+
end
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<ul>
2+
<li><a href="/dashboard">Live dashboard</a></li>
3+
<li><a href="/oban">Oban dashboard</a></li>
4+
</ul>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<title>Admin panel - asciinema</title>
8+
</head>
9+
10+
<body>
11+
<div>
12+
{@inner_content}
13+
</div>
14+
</body>
15+
</html>

0 commit comments

Comments
 (0)