ha-handler/lib/ha_handler/web/templates/index.html.eex
Timothée Floure abcd3337dd
All checks were successful
continuous-integration/drone/push Build is passing
Add minimal handler clustering logic
2022-05-22 14:30:44 +02:00

174 lines
4.1 KiB
Elixir

<!DOCTYPE html>
<html>
<head>
<title>[HA] <%= hostname %></title>
<link rel="stylesheet" href="/static/app.css">
</head>
<body>
<main>
<div>
<img id="logo" src="/static/logo.svg" />
</div>
<h1>Recycled Cloud HA handler</h1>
<p>
This service supervises the various components of
the Recycled Cloud's High Availability
infrastruture. Documentation and source code can be
found on <a
href="https://code.recycled.cloud/RecycledCloud/ha-handler">our
software forge</a>.
</p>
<hr />
<h2>Handler</h2>
<p>
<b>Local instance:</b> <%= otp_app %> <b>v<%= version %></b> (<%= env %>) running on <b><%= hostname %></b>
</p>
<table>
<thead>
<tr>
<th>Instance</th>
<th>Version</th>
<th>Env</th>
<th>Status</th>
<th>Uptime</th>
</tr>
</thead>
<tbody>
<%= for instance <- handler_status do %>
<tr>
<td><%= instance.node %></td>
<td><%= instance.version %></td>
<td><%= instance.env %></td>
<td><%= instance.status %></td>
<td><%= instance.uptime %>m</td>
</tr>
<% end %>
</tbody>
</table>
<hr />
<h2>HAProxy</h2>
<h3>Frontends</h3>
<table>
<thead>
<tr>
<th>Name</th>
<th>Status</th>
<th>Bytes in</th>
<th>Bytes out</th>
</tr>
</thead>
<tbody>
<%= for entry <- Map.get(haproxy_stats, "Frontend") do %>
<tr>
<td><%= entry["pxname"] %></td>
<td><%= entry["status"] %></td>
<td><%= entry["bin"] %></td>
<td><%= entry["bout"] %></td>
</tr>
<% end %>
</tbody>
</table>
<h3>Backends</h3>
<table>
<thead>
<tr>
<th>Name</th>
<th>Status</th>
<th>algo</th>
</tr>
</thead>
<tbody>
<%= for entry <- Map.get(haproxy_stats, "Backend") do %>
<tr>
<td><%= entry["pxname"] %></td>
<td><%= entry["status"] %></td>
<td><%= entry["algo"] %></td>
</tr>
<% end %>
</tbody>
</table>
<h3>Servers</h3>
<table>
<thead>
<tr>
<th>Name</th>
<th>Status</th>
<th>Mode</th>
<th>Address</th>
</tr>
</thead>
<tbody>
<%= for entry <- Map.get(haproxy_stats, "Server") do %>
<tr>
<td><%= entry["pxname"] %>/<%= entry["svname"] %></td>
<td><%= entry["status"] %></td>
<td><%= entry["mode"] %></td>
<td><%= entry["addr"] %></td>
</tr>
<% end %>
</tbody>
</table>
<hr />
<h2>PostgreSQL</h2>
<table>
<thead>
<tr>
<th>Hostname</th>
<th>Version</th>
<th>Status</th>
<th>Operation</th>
</tr>
</thead>
<tbody>
<%= for entry <- pgsql_status do %>
<tr>
<td><%= entry[:hostname] %></td>
<td><%= entry[:version] %></td>
<td><%= entry[:status] %></td>
<td><%= entry[:mode] %></td>
</tr>
<% end %>
</tbody>
</table>
<hr />
<h2>DRBD</h2>
<table>
<thead>
<tr>
<th>Hostname</th>
<th>Version</th>
<th>Status</th>
<th>Operation</th>
</tr>
</thead>
<tbody>
<%= for entry <- drbd_status do %>
<tr>
<td><%= entry[:hostname] %></td>
<td><%= entry[:version] %></td>
<td><%= entry[:status] %></td>
<td><%= entry[:mode] %></td>
</tr>
<% end %>
</tbody>
</table>
</main>
</body>
</html>