Show docker id on container

This commit is contained in:
Vincent Fiduccia 2016-03-03 15:28:51 -07:00
parent a168c595c8
commit 0b3a6f2371
10 changed files with 20 additions and 21 deletions

View File

@ -5,6 +5,7 @@ export default Ember.Component.extend(FasterLinksAndMenus,{
projects: Ember.inject.service(), projects: Ember.inject.service(),
model: null, model: null,
showCommand: 'column', // 'no', 'column', or 'inline'
showStats: false, showStats: false,
cpuMax: null, cpuMax: null,
memoryMax: null, memoryMax: null,

View File

@ -18,7 +18,7 @@
{{/if}} {{/if}}
<td data-title="Image:" class="clip"> <td data-title="Image:" class="clip">
{{model.displayImage}} {{model.displayImage}}
{{#if (and (not showStats) model.command)~}} {{#if (eq showCommand "inline")~}}
({{model.command}}) ({{model.command}})
{{/if}} {{/if}}
</td> </td>
@ -32,7 +32,7 @@
{{/if}} {{/if}}
</td> </td>
{{else}} {{else}}
{{#unless model.isVm}} {{#if (eq showCommand "column")}}
<td data-title="Command:" class="clip"> <td data-title="Command:" class="clip">
{{#if model.command}} {{#if model.command}}
{{model.command}} {{model.command}}
@ -40,7 +40,7 @@
<span class="text-muted">None</span> <span class="text-muted">None</span>
{{/if}} {{/if}}
</td> </td>
{{/unless}} {{/if}}
{{/if}} {{/if}}
<td data-title="Actions:" class="actions"> <td data-title="Actions:" class="actions">
{{partial "fast-action-menu"}} {{partial "fast-action-menu"}}

View File

@ -24,22 +24,19 @@
<label>Host:</label> <label>Host:</label>
{{#if model.primaryHost}} {{#if model.primaryHost}}
{{#link-to "host" model.primaryHost.id}}{{model.primaryHost.displayName}}{{/link-to}} {{#link-to "host" model.primaryHost.id}}{{model.primaryHost.displayName}}{{/link-to}}
{{copy-to-clipboard clipboardText=model.primaryHost.displayIp tooltipText="Copy IP To Clipboard" size="small"}}
{{else}} {{else}}
<span class="text-muted">None</span> <span class="text-muted">None</span>
{{/if}} {{/if}}
</div> </div>
<div class="col-flex">
<label>Host IP:</label>
{{#if model.primaryHost}}
{{model.primaryHost.displayIp}} {{copy-to-clipboard clipboardText=model.primaryHost.displayIp size='small'}}
{{else}}
<span class="text-muted">N/A</span>
{{/if}}
</div>
<div class="col-flex"> <div class="col-flex">
<label>Container IP:</label> <label>Container IP:</label>
{{model.displayIp}} {{copy-to-clipboard clipboardText=model.displayIp size='small'}} {{model.displayIp}} {{copy-to-clipboard clipboardText=model.displayIp size='small'}}
</div> </div>
<div class="col-flex">
<label>Docker ID:</label>
{{model.displayExternalId}} {{copy-to-clipboard clipboardText=model.externalId size='small'}}
</div>
</div> </div>
<div class="container-flex bordered"> <div class="container-flex bordered">
<div class="col-flex"> <div class="col-flex">

View File

@ -11,6 +11,7 @@
{{sortable-th sortable=this action="changeSort" name="state" width="125"}} {{sortable-th sortable=this action="changeSort" name="state" width="125"}}
{{sortable-th sortable=this action="changeSort" name="name"}} {{sortable-th sortable=this action="changeSort" name="name"}}
{{sortable-th sortable=this action="changeSort" name="ip" width="110" label="IP Address"}} {{sortable-th sortable=this action="changeSort" name="ip" width="110" label="IP Address"}}
{{sortable-th sortable=this action="changeSort" name="host" label="Host"}}
{{sortable-th sortable=this action="changeSort" name="image"}} {{sortable-th sortable=this action="changeSort" name="image"}}
{{sortable-th sortable=this action="changeSort" name="command"}} {{sortable-th sortable=this action="changeSort" name="command"}}
<th class="actions" width="50">&nbsp;</th> <th class="actions" width="50">&nbsp;</th>
@ -18,7 +19,7 @@
</thead> </thead>
<tbody> <tbody>
{{#each arranged as |container|}} {{#each arranged as |container|}}
{{container-row model=container}} {{container-row model=container showCommand="column" showHost=true}}
{{else}} {{else}}
<tr><td colspan="6" class="text-center text-muted">You do not have any containers yet.</td></tr> <tr><td colspan="6" class="text-center text-muted">You do not have any containers yet.</td></tr>
{{/each}} {{/each}}

View File

@ -11,7 +11,7 @@
</thead> </thead>
<tbody> <tbody>
{{#each arranged as |container|}} {{#each arranged as |container|}}
{{container-row model=container showStats=true cpuMax=cpuMax memoryMax=memoryMax storageMax=storageMax networkMax=networkMax}} {{container-row model=container showStats=true showCommand="inline" cpuMax=cpuMax memoryMax=memoryMax storageMax=storageMax networkMax=networkMax}}
{{else}} {{else}}
<tr><td colspan="7" class="text-center text-muted">This host does not have any containers yet.</td></tr> <tr><td colspan="7" class="text-center text-muted">This host does not have any containers yet.</td></tr>
{{/each}} {{/each}}

View File

@ -149,6 +149,10 @@ var Container = Resource.extend({
displayImage: function() { displayImage: function() {
return (this.get('imageUuid')||'').replace(/^docker:/,''); return (this.get('imageUuid')||'').replace(/^docker:/,'');
}.property('imageUuid'), }.property('imageUuid'),
displayExternalId: function() {
return (Ember.Handlebars.Utils.escapeExpression(this.get('externalId').substr(0,12))+"&hellip;").htmlSafe();
}.property('externalId'),
}); });
Container.reopenClass({ Container.reopenClass({

View File

@ -5,14 +5,14 @@
{{sortable-th sortable=this action="changeSort" name="name"}} {{sortable-th sortable=this action="changeSort" name="name"}}
{{sortable-th sortable=this action="changeSort" name="ip" width="110" label="IP Address"}} {{sortable-th sortable=this action="changeSort" name="ip" width="110" label="IP Address"}}
{{sortable-th sortable=this action="changeSort" name="host"}} {{sortable-th sortable=this action="changeSort" name="host"}}
{{sortable-th sortable=this action="changeSort" name="image" label="Image (Command)"}} {{sortable-th sortable=this action="changeSort" name="image" label="Image"}}
<th class="stats">Stats</th> <th class="stats">Stats</th>
<th class="actions" width="70">&nbsp;</th> <th class="actions" width="70">&nbsp;</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{{#each arranged as |container|}} {{#each arranged as |container|}}
{{container-row model=container showStats=true showHost=true cpuMax=cpuMax memoryMax=memoryMax storageMax=storageMax networkMax=networkMax}} {{container-row model=container showStats=true showHost=true showCommand="no" cpuMax=cpuMax memoryMax=memoryMax storageMax=storageMax networkMax=networkMax}}
{{else}} {{else}}
<tr><td colspan="7" class="text-center text-muted">This service does not have any containers yet.</td></tr> <tr><td colspan="7" class="text-center text-muted">This service does not have any containers yet.</td></tr>
{{/each}} {{/each}}

View File

@ -227,10 +227,6 @@ export default Ember.Service.extend({
} }
} }
if ( obj.type )
{
}
var output = store.createRecord(obj, type); var output = store.createRecord(obj, type);
if (output && output.metadata && output.metadata.uid) if (output && output.metadata && output.metadata.uid)
{ {

View File

@ -17,7 +17,7 @@
</thead> </thead>
<tbody> <tbody>
{{#each arranged as |instance|}} {{#each arranged as |instance|}}
{{container-row model=instance}} {{container-row model=instance showCommand="no"}}
{{else}} {{else}}
<tr><td colspan="5" class="text-center text-muted">You do not have any virtual machines yet.</td></tr> <tr><td colspan="5" class="text-center text-muted">You do not have any virtual machines yet.</td></tr>
{{/each}} {{/each}}

View File

@ -22,7 +22,7 @@
"license": "Apache-2.0", "license": "Apache-2.0",
"devDependencies": { "devDependencies": {
"broccoli-asset-rev": "^2.2.0", "broccoli-asset-rev": "^2.2.0",
"ember-api-store": "^1.2.15", "ember-api-store": "^1.2.16",
"ember-browserify": "^1.0.1", "ember-browserify": "^1.0.1",
"ember-cli": "^2.3.0", "ember-cli": "^2.3.0",
"ember-cli-app-version": "^1.0.0", "ember-cli-app-version": "^1.0.0",