File tree 2 files changed +15
-10
lines changed
2 files changed +15
-10
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
3
angular . module ( 'openshiftConsole' )
4
- . directive ( 'containerStatuses' , function ( $filter ) {
4
+ . directive ( 'containerStatuses' , function ( $filter , $timeout ) {
5
5
return {
6
6
restrict : 'E' ,
7
7
scope : {
@@ -13,16 +13,21 @@ angular.module('openshiftConsole')
13
13
link : function ( scope ) {
14
14
scope . hasDebugTerminal = angular . isFunction ( scope . startDebugTerminal ) ;
15
15
16
- scope . podContainerStatuses = _ . get ( scope . pod , 'status.containerStatuses' , [ ] ) ;
17
- scope . podContainerInitStatuses = _ . get ( scope . pod , 'status.initContainerStatuses' , [ ] ) ;
18
-
19
16
var haveContainersFailed = function ( containerStatuses ) {
20
17
return _ . some ( containerStatuses , function ( containerStatus ) {
21
18
return $filter ( 'isContainerFailed' ) ( containerStatus ) !== false ;
22
19
} ) ;
23
20
} ;
24
21
25
- scope . expandInitContainers = scope . initContainersFailed = haveContainersFailed ( scope . podContainerInitStatuses ) ;
22
+ scope . $watch ( 'pod.status.initContainerStatuses' , function ( updatedInitContainerStatuses ) {
23
+ scope . initContainersFailed = haveContainersFailed ( updatedInitContainerStatuses ) ;
24
+
25
+ $timeout ( function ( ) {
26
+ if ( scope . expandInitContainers !== false ) {
27
+ scope . expandInitContainers = scope . initContainersFailed ;
28
+ }
29
+ } , 250 ) ;
30
+ } , true ) ;
26
31
27
32
scope . toggleInitContainer = function ( ) {
28
33
scope . expandInitContainers = ! scope . expandInitContainers ;
Original file line number Diff line number Diff line change 9
9
< h4 row >
10
10
< span > < i class ="pficon " ng-class ="{'pficon-ok': !initContainersFailed} "> </ i > </ span >
11
11
< span flex >
12
- < span ng-if ="!initContainersFailed "> {{podContainerInitStatuses .length}}</ span >
13
- < ng-pluralize count ="podContainerInitStatuses .length "
12
+ < span ng-if ="!initContainersFailed "> {{pod.status.initContainerStatuses .length}}</ span >
13
+ < ng-pluralize count ="pod.status.initContainerStatuses .length "
14
14
when ="{'1': 'Init Container','other': 'Init Containers'} ">
15
15
</ ng-pluralize >
16
16
< span ng-if ="!initContainersFailed "> completed successfully</ span >
@@ -19,9 +19,9 @@ <h4 row>
19
19
< a class ="page-header-link " href ="" ng-click ="toggleInitContainer() " ng-if ="expandInitContainers "> Hide Details</ a >
20
20
</ h4 >
21
21
22
- < div class ="pod-template-block "
22
+ < div class ="pod-template-block animate-if "
23
23
ng-if ="expandInitContainers "
24
- ng-repeat ="containerStatus in podContainerInitStatuses " >
24
+ ng-repeat ="containerStatus in pod.status.initContainerStatuses " >
25
25
26
26
< div class ="pod-template ">
27
27
< div class ="component-label "> Init Container: {{containerStatus.name}}</ div >
@@ -48,7 +48,7 @@ <h4 row>
48
48
</ div >
49
49
</ div >
50
50
51
- < div ng-repeat ="containerStatus in podContainerStatuses " >
51
+ < div ng-repeat ="containerStatus in pod.status.containerStatuses " >
52
52
< h4 > Container {{containerStatus.name}}</ h4 >
53
53
54
54
< dl class ="dl-horizontal left ">
You can’t perform that action at this time.
0 commit comments