Skip to content

Commit

Permalink
Fixes #38130 - add info to job details
Browse files Browse the repository at this point in the history
  • Loading branch information
MariaAga committed Jan 9, 2025
1 parent bacb4a2 commit 88b860a
Show file tree
Hide file tree
Showing 7 changed files with 457 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/controllers/api/v2/job_invocations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ def index
param :host_status, :bool, required: false, desc: N_('Show Job status for the hosts')
def show
set_hosts_and_template_invocations
@job_organization = Taxonomy.find_by(id: @job_invocation.task.input[:current_organization_id])
@job_location = Taxonomy.find_by(id: @job_invocation.task.input[:current_location_id])
if params[:host_status] == 'true'
set_statuses_and_smart_proxies
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/api/v2/job_invocations/base.json.rabl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
object @job_invocation

attributes :id, :description, :job_category, :targeting_id, :status, :start_at, :status_label, :ssh_user, :time_to_pickup
attributes :id, :description, :job_category, :targeting_id, :status, :start_at, :status_label, :ssh_user, :time_to_pickup, :concurrency_level, :execution_timeout_interval

node do |invocation|
pattern_template = invocation.pattern_template_invocations.first
Expand Down
38 changes: 38 additions & 0 deletions app/views/api/v2/job_invocations/show.json.rabl
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
object @job_invocation

attribute :pattern_template_invocations

extends 'api/v2/job_invocations/main'

node :job_organization do
@job_organization
end

node :job_location do
@job_location
end

# node :inputs do
# # @job_invocation.pattern_template_invocations[0][:input_values]
# @job_invocation.pattern_template_invocations[0].input_values
# # @job_invocation.pattern_template_invocations.map(&:input_values)
# # @job_invocation.pattern_template_invocations.map{ |invocation| invocation.input_values
# # }
# end

# child @job_invocation.pattern_template_invocations => :pattern_template_invocations do |template|
# puts template.inspect
# # @job_invocation.pattern_template_invocations
# child template.input_values => :input_values do
# attributes :template_input_name, :template_input_id
# node :value do |iv|
# iv.template_input.respond_to?(:hidden_value) && iv.template_input.hidden_value? ? '*' * 5 : iv.value
# end
# end
# end

# child @inputs do
# child :input_values do
# attributes :template_input_name, :template_input_id
# node :value do |iv|
# iv.template_input.respond_to?(:hidden_value) && iv.template_input.hidden_value? ? '*' * 5 : iv.value
# end
# end
# end
1 change: 1 addition & 0 deletions app/views/job_invocations/_tab_overview.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<% template_invocations = job_invocation.pattern_template_invocations %>
<%= job_invocation.pattern_template_invocations[0].input_values.inspect %>
<div class='row'>
<div class="col-xs-6 col-sm-6 col-md-6">
<%= render :partial => 'card_results', :locals => { :job_invocation => job_invocation } %>
Expand Down
Loading

0 comments on commit 88b860a

Please sign in to comment.