<% content_for :body_class, "admin-body" %>

<%= t("admin.stream_nodes.title") %>

<%= t("admin.stream_nodes.providers", cloud: @cloud_provider, dns: @dns_provider) %>

<%= button_to t("admin.stream_nodes.provision_lab"), admin_stream_nodes_path, method: :post, params: { kind: "lab" }, class: "admin-btn" %> <% if @hetzner_configured %> <%= button_to t("admin.stream_nodes.provision_cloud"), admin_stream_nodes_path, method: :post, params: { kind: "cloud" }, class: "admin-btn", form: { data: { confirm: t("admin.stream_nodes.provision_cloud_confirm") } } %> <% else %> <%= t("admin.stream_nodes.hetzner_token_missing") %> <% end %>

<% @nodes.each do |node| %> <% end %>
<%= t("admin.stream_nodes.col.slug") %> <%= t("admin.stream_nodes.col.role") %> <%= t("admin.stream_nodes.col.status") %> <%= t("admin.stream_nodes.col.slots") %> <%= t("admin.stream_nodes.col.hostname") %> <%= t("admin.stream_nodes.col.provider") %>
<%= node.slug %> <%= node.role %> <%= node.status %> <%= node.active_publishers %> / <%= node.max_publishers %> (free <%= node.free_slots %>) <%= node.hostname %> <%= node.provider %><% if node.provider_instance_id.present? %> ยท <%= node.provider_instance_id %><% end %> <% if node.slug != "home" %> <% if node.status == "ready" %> <%= button_to t("admin.stream_nodes.drain"), drain_admin_stream_node_path(node), method: :post, class: "admin-btn admin-btn-secondary" %> <% end %> <%= button_to t("admin.stream_nodes.destroy"), admin_stream_node_path(node), method: :delete, class: "admin-btn admin-btn-danger", form: { data: { confirm: t("admin.stream_nodes.destroy_confirm", slug: node.slug) } } %> <% end %>
<% if @lab_hosts.present? %>

<%= t("admin.stream_nodes.hosts_title") %>

<%= @lab_hosts %>
<% end %>