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(),
model: null,
showCommand: 'column', // 'no', 'column', or 'inline'
showStats: false,
cpuMax: null,
memoryMax: null,

View File

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

View File

@ -24,22 +24,19 @@
<label>Host:</label>
{{#if model.primaryHost}}
{{#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}}
<span class="text-muted">None</span>
{{/if}}
</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">
<label>Container IP:</label>
{{model.displayIp}} {{copy-to-clipboard clipboardText=model.displayIp size='small'}}
</div>
<div class="col-flex">
<label>Docker ID:</label>
{{model.displayExternalId}} {{copy-to-clipboard clipboardText=model.externalId size='small'}}
</div>
</div>
<div class="container-flex bordered">
<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="name"}}
{{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="command"}}
<th class="actions" width="50">&nbsp;</th>
@ -18,7 +19,7 @@
</thead>
<tbody>
{{#each arranged as |container|}}
{{container-row model=container}}
{{container-row model=container showCommand="column" showHost=true}}
{{else}}
<tr><td colspan="6" class="text-center text-muted">You do not have any containers yet.</td></tr>
{{/each}}

View File

@ -11,7 +11,7 @@
</thead>
<tbody>
{{#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}}
<tr><td colspan="7" class="text-center text-muted">This host does not have any containers yet.</td></tr>
{{/each}}

View File

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

View File

@ -5,14 +5,14 @@
{{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="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="actions" width="70">&nbsp;</th>
</tr>
</thead>
<tbody>
{{#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}}
<tr><td colspan="7" class="text-center text-muted">This service does not have any containers yet.</td></tr>
{{/each}}

View File

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

View File

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

View File

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