Skip to content

Commit

Permalink
Fixed ActiveJobsHelper dependency for ActiveJobsController and JobSta…
Browse files Browse the repository at this point in the history
…tusData
  • Loading branch information
abujeda committed Oct 22, 2024
1 parent eb9ce2e commit ac322be
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions apps/dashboard/app/controllers/active_jobs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ def get_job(jobid, cluster)
ActiveJobs::Jobstatusdata.new(data, cluster, true)

rescue OodCore::JobAdapterError
OpenStruct.new(name: jobid, error: "No job details because job has already left the queue." , status: status_label("completed") )
OpenStruct.new(name: jobid, error: "No job details because job has already left the queue." , status: "completed" )
rescue => e
Rails.logger.info("#{e}:#{e.message}")
Rails.logger.info(e.backtrace.join("\n"))
OpenStruct.new(name: jobid, error: "No job details available.\n" + e.backtrace.to_s, status: status_label("") )
OpenStruct.new(name: jobid, error: "No job details available.\n" + e.backtrace.to_s, status: "" )
end
end

Expand Down
3 changes: 1 addition & 2 deletions apps/dashboard/app/models/active_jobs/jobstatusdata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ module ActiveJobs
# @author Brian L. McMichael
# @version 0.0.1
class Jobstatusdata
include ActiveJobsHelper
attr_reader :pbsid, :jobname, :username, :account, :status, :cluster, :cluster_title, :nodes, :starttime, :walltime, :walltime_used, :submit_args, :output_path, :nodect, :ppn, :total_cpu, :queue, :cput, :mem, :vmem, :shell_url, :file_explorer_url, :extended_available, :native_attribs, :error

Attribute = Struct.new(:name, :value)
Expand All @@ -28,7 +27,7 @@ def initialize(info, cluster=OODClusters.first, extended=false)
self.jobname = info.job_name
self.username = info.job_owner
self.account = info.accounting_id || ''
self.status = status_label(info.status.state.to_s)
self.status = info.status.state.to_s
self.cluster = cluster.id.to_s
self.cluster_title = cluster.metadata.title || cluster.id.to_s.titleize
self.walltime_used = info.wallclock_time.to_i > 0 ? pretty_time(info.wallclock_time) : ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="card-header">
<%# FIXME: ul/li with css %>
<strong>
<%= data.status %>
<%= status_label(data.status) %>
<span class="text-break ms-3"><%= data.jobname %></span>
<span class="ms-3"><%= data.pbsid %></span>
</strong>
Expand Down

0 comments on commit ac322be

Please sign in to comment.