@@ -3,7 +3,7 @@ import NewOrEditContainer from 'ui/pods/container/edit/new-or-edit';
33
44export default Ember . ObjectController . extend ( NewOrEditContainer , {
55 queryParams : [ 'tab' , 'hostId' ] ,
6- tab : 'basic ' ,
6+ tab : 'command ' ,
77 hostId : null ,
88 editing : false ,
99 saving : false ,
@@ -279,30 +279,27 @@ export default Ember.ObjectController.extend(NewOrEditContainer, {
279279
280280 // Volumes From
281281 hostContainerChoices : function ( ) {
282- var self = this ;
283282 var list = [ ] ;
284283
285- this . get ( 'controllers.hosts' ) . forEach ( function ( host ) {
286- // You can only mount volumes from the host the container will go on
287- if ( host . get ( 'id' ) === self . get ( 'requestedHostId' ) )
288- {
289- var containers = ( host . get ( 'instances' ) || [ ] ) . filter ( function ( instance ) {
290- // You can't mount volumes from other types of instances
291- return instance . get ( 'type' ) === 'container' ;
292- } ) ;
293-
294- list . pushObjects ( containers . map ( function ( container ) {
295- return {
296- group : host . get ( 'displayName' ) ,
297- id : container . get ( 'id' ) ,
298- name : container . get ( 'name' )
299- } ;
300- } ) ) ;
301- }
284+ this . get ( 'allHosts' ) . filter ( ( host ) => {
285+ return host . get ( 'id' ) === this . get ( 'requestedHostId' ) ;
286+ } ) . map ( ( host ) => {
287+ var containers = ( host . get ( 'instances' ) || [ ] ) . filter ( function ( instance ) {
288+ // You can't mount volumes from other types of instances
289+ return instance . get ( 'type' ) === 'container' ;
290+ } ) ;
291+
292+ list . pushObjects ( containers . map ( function ( container ) {
293+ return {
294+ group : host . get ( 'name' ) || '(' + host . get ( 'id' ) + ')' ,
295+ id : container . get ( 'id' ) ,
296+ name : container . get ( 'name' )
297+ } ;
298+ } ) ) ;
302299 } ) ;
303300
304- return list . sortBy ( 'group' , 'container. name' , 'container. id' ) ;
305- } . property ( 'controllers.hosts.@each.[]' , 'controllers.hosts [email protected] ') . volatile ( ) , 301+ return list . sortBy ( 'group' , 'name' , 'id' ) ;
302+ } . property ( 'allHosts [email protected] ' ) . volatile ( ) , 306303
307304 volumesFromArray : null ,
308305 initVolumesFrom : function ( ) {
@@ -388,12 +385,6 @@ export default Ember.ObjectController.extend(NewOrEditContainer, {
388385
389386 // Terminal
390387 terminal : 'both' ,
391- terminalChoices : [
392- { label : 'Yes (-i and -t)' , value : 'both' } ,
393- { label : 'Interactive (-i)' , value : 'interactive' } ,
394- { label : 'TTY (-t)' , value : 'terminal' } ,
395- { label : 'No' , value : 'none' } ,
396- ] ,
397388 terminalDidChange : function ( ) {
398389 var val = this . get ( 'terminal' ) ;
399390 var stdinOpen = ( val === 'interactive' || val === 'both' ) ;
0 commit comments