dotfiles/app/lib/prymn_web/live/server_live/show.html.heex
Nikos Papadakis be7f584010
app: a nice poc background connection with the agent
Dynamically supervise a GRPC connection and keep it alive for a while,
using a timeout to kill the process on inactivity.

The Connection GenServer keeps the connection alive, while listening to
a health stream from the GRPC endpoint, notifying any subscribed
listeners about changes to health.

This health is then propagated to the main servers page.

Also create a looping get_sys_info which retrieves some basic system
information.
2023-08-26 00:51:04 +03:00

43 lines
1.2 KiB
Text

<.header>
Server <%= @server.name %>
</.header>
<section :if={@server.status == :unregistered} class="my-10">
<p class="mb-9">
Connect to your server using root credentials and execute the following command:
</p>
<div class="group inline-flex items-center rounded-lg bg-gray-800 p-4 pl-6 text-white">
<code class="flex gap-4">
<span class="select-none text-gray-500">#</span>
<span class="flex-1">
<%= @registration_command %>
</span>
</code>
<button type="button" tabindex="-1">
<.icon
name="hero-document-duplicate-solid"
class="invisible ml-4 animate-bounce text-gray-500 group-hover:visible"
/>
</button>
</div>
</section>
<section :if={@server.status == :registered} class="my-10 flex rounded bg-gray-800 p-5 text-white">
<div>
<p class="text-xl"><%= @uptime || "" %>s</p>
<p class="text-sm">Uptime</p>
</div>
<div class="ml-4">
<p class="text-xl"><%= Enum.count(@cpus || []) %></p>
<p class="text-sm">CPUs</p>
</div>
<div class="ml-4">
<p class="text-xl">
<%= @used_memory || 0 %> / <%= @total_memory || 0 %>
<span>GiB</span>
</p>
<p class="text-sm">Memory</p>
</div>
</section>
<.back navigate={~p"/servers"}>Back to servers</.back>