Skip to content

Commit

Permalink
original pod html code for now
Browse files Browse the repository at this point in the history
  • Loading branch information
celina-lopez committed Jan 22, 2025
1 parent 3b5d7ed commit 8c12caa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
11 changes: 10 additions & 1 deletion app/controllers/add_ons/processes_controller.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
class AddOns::ProcessesController < AddOns::BaseController
include LogColorsHelper

def index; end
def index
@pods = get_pods_for_add_on(@add_on)
end

def show
client = K8::Client.new(@add_on.cluster.kubeconfig)
@logs = client.get_pod_log(params[:id], @add_on.name)
end

private

def get_pods_for_add_on(add_on)
client = K8::Client.new(add_on.cluster.kubeconfig).client
client.get_pods(namespace: add_on.name)
end
end
14 changes: 7 additions & 7 deletions app/views/add_ons/processes/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
</div>

<%= turbo_frame_tag "pod_logs" do %>
<%= render(
"shared/partials/async_renderer",
view_model: Async::K8::PodsViewModel.new(
current_user,
add_on_id: @add_on.id
)
) %>
<% if @pods.empty? %>
<div>
<p class="text-gray-500">Nothing running in this namespace</p>
</div>
<% else %>
<%= render "processes/pods", pods: @pods, parent: @add_on %>
<% end %>
<% end %>
</div>
<% end %>

0 comments on commit 8c12caa

Please sign in to comment.