Skip to content

Commit

Permalink
patch OSC to fix bc card bug (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
johrstrom authored Jan 24, 2025
1 parent 9c17ac4 commit 8fca9a8
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<%-
session_class = status_context(session)
badge_class = "bg-#{session_class}"
alert_class = "alert-#{session_class}"
num_nodes = session.info.allocated_nodes.size
num_cores = session.info.procs.to_i
-%>

<div class="card-heading">
<div class="h5 card-header overflow-auto alert <%= alert_class %>">
<a href="<%= new_batch_connect_session_context_path(token: session.token) %>" class="alert-heading">
<span class="card-text"><%= session.title %></span>
</a>
<span class="card-text"> (<%= session.job_id %>)</span>
<div class="float-end">
<%- if session.starting? || session.running? -%>
<%- if num_nodes.positive? -%>
<span class="badge <%= badge_class %> rounded-pill"><%= pluralize(num_nodes, "node") %></span>
<span class="card-text"> | </span>
<%- end -%>
<%- if num_cores.positive? -%>
<span class="badge <%= badge_class %> rounded-pill"><%= pluralize(num_cores, "core") %></span>
<span class="card-text"> | </span>
<%- end -%>
<%- end -%>
<%= status(session) %>
<%- if session.completed? && !session.app.preset? -%>
<span class="card-text"> | </span>
<%= edit(session) %>
<%- end -%>
<%- if session.completed? -%>
<span class="card-text"> | </span>
<%= relaunch(session) %>
<%- end -%>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<%-
session_class = status_context(session)
badge_class = "bg-#{session_class}"
alert_class = "alert-#{session_class}"
num_nodes = session.info.allocated_nodes.size
num_cores = session.info.procs.to_i
-%>

<div class="card-heading">
<div class="h5 card-header overflow-auto alert <%= alert_class %>">
<a href="<%= new_batch_connect_session_context_path(token: session.token) %>" class="alert-heading">
<span class="card-text"><%= session.title %></span>
</a>
<span class="card-text"> (<%= session.job_id %>)</span>
<div class="float-end">
<%- if session.starting? || session.running? -%>
<%- if num_nodes.positive? -%>
<span class="badge <%= badge_class %> rounded-pill"><%= pluralize(num_nodes, "node") %></span>
<span class="card-text"> | </span>
<%- end -%>
<%- if num_cores.positive? -%>
<span class="badge <%= badge_class %> rounded-pill"><%= pluralize(num_cores, "core") %></span>
<span class="card-text"> | </span>
<%- end -%>
<%- end -%>
<%= status(session) %>
<%- if session.completed? && !session.app.preset? -%>
<span class="card-text"> | </span>
<%= edit(session) %>
<%- end -%>
<%- if session.completed? -%>
<span class="card-text"> | </span>
<%= relaunch(session) %>
<%- end -%>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<%-
session_class = status_context(session)
badge_class = "bg-#{session_class}"
alert_class = "alert-#{session_class}"
num_nodes = session.info.allocated_nodes.size
num_cores = session.info.procs.to_i
-%>

<div class="card-heading">
<div class="h5 card-header overflow-auto alert <%= alert_class %>">
<a href="<%= new_batch_connect_session_context_path(token: session.token) %>" class="alert-heading">
<span class="card-text"><%= session.title %></span>
</a>
<span class="card-text"> (<%= session.job_id %>)</span>
<div class="float-end">
<%- if session.starting? || session.running? -%>
<%- if num_nodes.positive? -%>
<span class="badge <%= badge_class %> rounded-pill"><%= pluralize(num_nodes, "node") %></span>
<span class="card-text"> | </span>
<%- end -%>
<%- if num_cores.positive? -%>
<span class="badge <%= badge_class %> rounded-pill"><%= pluralize(num_cores, "core") %></span>
<span class="card-text"> | </span>
<%- end -%>
<%- end -%>
<%= status(session) %>
<%- if session.completed? && !session.app.preset? -%>
<span class="card-text"> | </span>
<%= edit(session) %>
<%- end -%>
<%- if session.completed? -%>
<span class="card-text"> | </span>
<%= relaunch(session) %>
<%- end -%>
</div>
</div>
</div>

0 comments on commit 8fca9a8

Please sign in to comment.