Skip to content

Commit

Permalink
View changes to display nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
anurag committed Jun 6, 2019
1 parent 6169fec commit a7bec26
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 45 deletions.
Binary file added assets/static/images/render.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion lib/elixir_cluster_demo_web/controllers/page_controller.ex
Expand Up @@ -2,6 +2,8 @@ defmodule ElixirClusterDemoWeb.PageController do
use ElixirClusterDemoWeb, :controller

def index(conn, _params) do
render(conn, "index.html")
self_node = inspect(node())
nodes = inspect(Node.list())
render(conn, "index.html", %{node: self_node, nodes: nodes})
end
end
13 changes: 4 additions & 9 deletions lib/elixir_cluster_demo_web/templates/layout/app.html.eex
Expand Up @@ -4,19 +4,14 @@
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>ElixirClusterDemo · Phoenix Framework</title>
<link rel="stylesheet" href="<%= Routes.static_path(@conn, "/css/app.css") %>"/>
<title>Elixir Cluster on Render with libcluster</title>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
</head>
<body>
<header>
<section class="container">
<nav role="navigation">
<ul>
<li><a href="https://hexdocs.pm/phoenix/overview.html">Get Started</a></li>
</ul>
</nav>
<a href="http://phoenixframework.org/" class="phx-logo">
<img src="<%= Routes.static_path(@conn, "/images/phoenix.png") %>" alt="Phoenix Framework Logo"/>
<a href="https://render.com">
<img src="<%= Routes.static_path(@conn, "/images/render.png") %>" alt="Render Logo"/>
</a>
</section>
</header>
Expand Down
56 changes: 21 additions & 35 deletions lib/elixir_cluster_demo_web/templates/page/index.html.eex
@@ -1,35 +1,21 @@
<section class="phx-hero">
<h1><%= gettext "Welcome to %{name}!", name: "Phoenix" %></h1>
<p>A productive web framework that<br/>does not compromise speed and maintainability.</p>
</section>

<section class="row">
<article class="column">
<h2>Resources</h2>
<ul>
<li>
<a href="https://hexdocs.pm/phoenix/overview.html">Guides &amp; Docs</a>
</li>
<li>
<a href="https://github.com/phoenixframework/phoenix">Source</a>
</li>
<li>
<a href="https://github.com/phoenixframework/phoenix/blob/v1.4/CHANGELOG.md">v1.4 Changelog</a>
</li>
</ul>
</article>
<article class="column">
<h2>Help</h2>
<ul>
<li>
<a href="https://elixirforum.com/c/phoenix-forum">Forum</a>
</li>
<li>
<a href="https://webchat.freenode.net/?channels=elixir-lang">#elixir-lang on Freenode IRC</a>
</li>
<li>
<a href="https://twitter.com/elixirphoenix">Twitter @elixirphoenix</a>
</li>
</ul>
</article>
</section>
<div class="container">
<div class="row text-center justify-content-center">
<div class="col">
<h1 class="display-4">Distributed Elixir Cluster with libcluster</h1>
<p>Learn more at <a href="https://render.com/docs/deploy-elixir-cluster">https://render.com/docs/deploy-elixir-cluster</a>.
</div>
</div>
</div>
<div class="mt-3">
<table class="table table-bordered table-striped">
<tbody>
<tr>
<th scope="row" class="p-3">Current Node</th>
<td class="p-3"><%= @node %></td>
</tr>
<tr>
<th scope="row" class="p-3">Other Nodes</th>
<td class="p-3"><%= @nodes %></td>
</tbody>
</table>
</div>

0 comments on commit a7bec26

Please sign in to comment.