.server_show h2 = @server.name .server-info p strong Status: span[class="status status--#{@server.status}"] = @server.status.humanize p strong Port: = @server.port p strong Template: = link_to @server.server_template.name, @server.server_template - if @server.last_health_check_at p strong Last Health Check: = time_ago_in_words(@server.last_health_check_at) .server-actions - case @server.status - when "stopped", "failed" = button_to "Spawn Server", spawn_server_path(@server), method: :post, class: "btn btn--primary" = button_to "Start Server", start_server_path(@server), method: :post, class: "btn btn--success" - when "starting", "running" = button_to "Stop Server", stop_server_path(@server), method: :post, class: "btn btn--warning" = button_to "Restart Server", restart_server_path(@server), method: :post, class: "btn btn--warning" = button_to "Delete Server", server_path(@server), method: :delete, data: { confirm: "Are you sure? This will stop and remove the server." }, class: "btn btn--danger" = link_to "Back to Servers", servers_path, class: "btn" section.job-logs h3 Job History - if @server.job_logs.recent.limit(5).any? table.table.table--compact thead tr th Job th Status th Started th Duration th Actions tbody - @server.job_logs.recent.limit(5).each do |job_log| tr td= job_log.job_class td span class="badge badge--#{job_log.status}" = job_log.status.titleize td= job_log.started_at&.strftime("%H:%M:%S") || "-" td= job_log.duration ? "#{job_log.duration.round(1)}s" : "-" td= link_to "View", job_log_path(job_log), class: "btn btn--small" p= link_to "View All Jobs →", job_logs_path(server_id: @server.id), class: "link" - else p.text-muted No jobs executed yet. section.logs h3 Live Logs #log-output em Loading logs... javascript: document.addEventListener('DOMContentLoaded', function() { const serverId = #{@server.id}; const consumer = ActionCable.createConsumer(); const logOutput = document.getElementById('log-output'); consumer.subscriptions.create({channel: "LogChannel", server_id: serverId}, { received: function(data) { if (data.line) { const line = document.createElement('div'); line.textContent = data.line; logOutput.appendChild(line); logOutput.scrollTop = logOutput.scrollHeight; } else if (data.error) { const error = document.createElement('div'); error.className = 'error'; error.textContent = data.error; logOutput.appendChild(error); } } }); });