-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remold the allocation detail and task detail pages
Now that there is a task detail page, some of the content from the allocation detail page is better suited there.
- Loading branch information
1 parent
7fbec97
commit 6aa93c8
Showing
11 changed files
with
444 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import Ember from 'ember'; | ||
|
||
const { Controller, computed } = Ember; | ||
|
||
export default Controller.extend({ | ||
network: computed.alias('model.resources.networks.firstObject'), | ||
ports: computed('network.reservedPorts.[]', 'network.dynamicPorts.[]', function() { | ||
const ports = this.get('network.reservedPorts') | ||
.map(port => ({ | ||
name: port.Label, | ||
port: port.Value, | ||
isDynamic: false, | ||
})) | ||
.concat( | ||
this.get('network.dynamicPorts').map(port => ({ | ||
name: port.Label, | ||
port: port.Value, | ||
isDynamic: true, | ||
})) | ||
) | ||
.sortBy('name'); | ||
return ports; | ||
}), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,94 @@ | ||
{{#global-header class="page-header"}} | ||
<span class="breadcrumb">Allocations</span> | ||
{{#link-to "allocations.allocation" model.allocation class="breadcrumb"}} | ||
{{model.allocation.shortId}} | ||
{{/link-to}} | ||
{{#link-to "allocations.allocation.task" model.allocation model class="breadcrumb"}} | ||
{{model.name}} | ||
{{/link-to}} | ||
{{/global-header}} | ||
{{#gutter-menu class="page-body"}} | ||
{{partial "allocations/allocation/task/subnav"}} | ||
<section class="section"> | ||
<ul> | ||
<li>Name: {{model.name}}</li> | ||
<li>State: {{model.state}}</li> | ||
<li>CPU: {{model.resources.cpu}}</li> | ||
</ul> | ||
<h1 class="title"> | ||
{{model.name}} | ||
<span class="bumper-left tag {{model.stateClass}}">{{model.state}}</span> | ||
</h1> | ||
|
||
<div class="boxed-section is-small"> | ||
<div class="boxed-section-body inline-definitions"> | ||
<span class="label">Task Details</span> | ||
<span class="pair"> | ||
<span class="term">Started At</span> | ||
{{moment-format model.startedAt "MM/DD/YY HH:mm:ss"}} | ||
</span> | ||
{{#if model.finishedAt}} | ||
<span class="pair"> | ||
<span class="term">Finished At</span> | ||
{{moment-format model.finishedAt "MM/DD/YY HH:mm:ss"}} | ||
</span> | ||
{{/if}} | ||
<span class="pair"> | ||
<span class="term">Driver</span> | ||
{{model.task.driver}} | ||
</span> | ||
</div> | ||
</div> | ||
|
||
{{#if ports.length}} | ||
<div class="boxed-section"> | ||
<div class="boxed-section-head"> | ||
Addresses | ||
</div> | ||
<div class="boxed-section-body is-full-bleed"> | ||
{{#list-table source=ports class="addresses-list" as |t|}} | ||
{{#t.head}} | ||
<th class="is-1">Dynamic?</th> | ||
<th class="is-2">Name</th> | ||
<th>Address</th> | ||
{{/t.head}} | ||
{{#t.body as |row|}} | ||
<tr> | ||
<td>{{if row.model.isDynamic "Yes" "No"}}</td> | ||
<td>{{row.model.name}}</td> | ||
<td> | ||
<a href="http://{{model.allocation.node.address}}:{{row.model.port}}" target="_blank"> | ||
{{model.allocation.node.address}}:{{row.model.port}} | ||
</a> | ||
</td> | ||
</tr> | ||
{{/t.body}} | ||
{{/list-table}} | ||
</div> | ||
</div> | ||
{{/if}} | ||
|
||
<div class="boxed-section"> | ||
<div class="boxed-section-head"> | ||
Recent Events | ||
</div> | ||
<div class="boxed-section-body is-full-bleed"> | ||
{{#list-table source=(reverse model.events) class="is-striped task-events" as |t|}} | ||
{{#t.head}} | ||
<th class="is-3">Time</th> | ||
<th class="is-1">Type</th> | ||
<th>Description</th> | ||
{{/t.head}} | ||
{{#t.body as |row|}} | ||
<tr> | ||
<td>{{moment-format row.model.time "MM/DD/YY HH:mm:ss"}}</td> | ||
<td>{{row.model.type}}</td> | ||
<td> | ||
{{#if row.model.displayMessage}} | ||
{{row.model.displayMessage}} | ||
{{else}} | ||
<em>No message</em> | ||
{{/if}} | ||
</td> | ||
</tr> | ||
{{/t.body}} | ||
{{/list-table}} | ||
</div> | ||
</div> | ||
</section> | ||
{{/gutter-menu}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<div class="tabs is-subnav"> | ||
<ul> | ||
<li>{{#link-to "allocations.allocation.task.index" task.allocation task activeClass="is-active"}}Overview{{/link-to}}</li> | ||
<li>{{#link-to "allocations.allocation.task.index" model.allocation model activeClass="is-active"}}Overview{{/link-to}}</li> | ||
</ul> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.