Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions SingularityUI/app/handlebarsHelpers.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,19 @@ Handlebars.registerHelper 'ifShellRequestHasOutputFilename', (statuses, options)
if status.outputFilename
return options.fn @
return options.inverse @

Handlebars.registerHelper 'reverseEach', (context, options) ->
ret = ''
if context and context.length > 0
i = context.length - 1
while i >= 0
ret += options.fn(context[i])
i--
else
ret = options.inverse(this)
ret

Handlebars.registerHelper 'ifCurrentState', (state, updates, options) ->
lastState = _.last updates
if lastState.taskState is state then options.fn @ else options.inverse @

15 changes: 12 additions & 3 deletions SingularityUI/app/styles/detailHeader.styl
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,17 @@

&:hover
opacity 0.3
.task-state-header-label
display table-cell
.task-state-header
padding-top 5px
li.breadcrumb-wide
max-width 50%

.title-button
position absolute
right 15px
top 20px
position absolute
right 15px
top 20px

.medium-weight
font-weight 500
6 changes: 3 additions & 3 deletions SingularityUI/app/templates/taskDetail/taskHistory.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
</tr>
</thead>
<tbody>
{{#each data.taskUpdates}}
<tr>
{{#reverseEach data.taskUpdates}}
<tr{{#ifCurrentState taskState ../data.taskUpdates}} class="medium-weight"{{/ifCurrentState}}>
<td>
{{humanizeText taskState}}
</td>
Expand All @@ -33,7 +33,7 @@
{{timestampFromNow timestamp}}
</td>
</tr>
{{/each}}
{{/reverseEach}}
</tbody>
</table>
{{else}}
Expand Down
67 changes: 29 additions & 38 deletions SingularityUI/app/templates/taskDetail/taskOverview.hbs
Original file line number Diff line number Diff line change
@@ -1,30 +1,20 @@
{{#if data.isStillRunning}}
{{! If there's a TaskCleanup object associated with this task, display its info }}
{{#if data.cleanup}}
<div class="alert alert-warning" role="alert">
<b>Task is cleaning:</b> {{ data.cleanup.cleanupType }}
{{#if data.cleanup.message}}
({{ data.cleanup.message }})
{{/if}}
</div>
{{else}}
{{#if data.isCleaning}}
<div class="alert alert-warning" role="alert">
<b>Task is terminating:</b> To issue a non-graceful termination (kill -term), click Destroy Task.
</div>
{{/if}}
{{/if}}
{{/if}}

{{! Part of taskBase }}
<header class='detail-header'>
<div class="row">
{{! Left side }}
<div class="col-md-10">
{{#if data.taskUpdates}}
{{#withLast data.taskUpdates}}
<div class="col-md-2 task-state-header">
<h3><span class="label label-{{getLabelClass taskState}} task-state-header-label">{{humanizeText taskState}}</span></h3>
</div>
{{/withLast}}
<div class="col-md-{{#if data.isStillRunning}}7{{else}}9{{/if}}">
{{else}}
<div class="col-md-{{#if data.isStillRunning}}8{{else}}10{{/if}}">
{{/if}}
{{#with data.task}}
<div style='font-weight: 500;'>
<ul class="breadcrumb">
<li>
<ul class="breadcrumb medium-weight">
<li class="breadcrumb-wide">
Request
<a href="{{appRoot}}/request/{{ taskRequest.request.id }}">
{{ taskRequest.request.id }}
Expand All @@ -40,10 +30,9 @@
Instance {{ taskId.instanceNo }}
</li>
</ul>
</div>
{{/with}}
</div>
<div class="col-md-2 button-container">
<div class="col-md-{{#if data.isStillRunning}}3{{else}}1{{/if}} button-container">
<a class="btn btn-default" data-action="viewObjectJSON">
JSON
</a>
Expand All @@ -66,18 +55,20 @@
</div>
</header>

{{#if data.taskUpdates}}
<div class="well text-muted">
{{#withLast data.taskUpdates}}
<span class="label label-{{getLabelClass taskState}}">{{humanizeText taskState}}</span>
as of
{{timestampFromNow timestamp}}
<span style="float: right;">
{{ ../data.task.offer.hostname }}
</span>
{{#if statusMessage}}
<br />{{ statusMessage }}
{{#if data.isStillRunning}}
{{! If there's a TaskCleanup object associated with this task, display its info }}
{{#if data.cleanup}}
<div class="alert alert-warning" role="alert">
<b>Task is cleaning:</b> {{ data.cleanup.cleanupType }}
{{#if data.cleanup.message}}
({{ data.cleanup.message }})
{{/if}}
{{/withLast}}
</div>
{{/if}}
</div>
{{else}}
{{#if data.isCleaning}}
<div class="alert alert-warning" role="alert">
<b>Task is terminating:</b> To issue a non-graceful termination (kill -term), click Destroy Task.
</div>
{{/if}}
{{/if}}
{{/if}}