@@ -22,12 +22,11 @@ export default class LogsToolbarController {
22
22
/**
23
23
* @param {!ui.router.$state } $state
24
24
* @param {!StateParams } $stateParams
25
- * @param {!backendApi.ReplicationControllerPods } replicationControllerPods
26
25
* @param {!backendApi.Logs } podLogs
27
26
* @param {!../logs_service.LogColorInversionService } logsColorInversionService
28
27
* @ngInject
29
28
*/
30
- constructor ( $state , $stateParams , replicationControllerPods , podLogs , logsColorInversionService ) {
29
+ constructor ( $state , $stateParams , podLogs , podContainers , logsColorInversionService ) {
31
30
/** @private {!ui.router.$state} */
32
31
this . state_ = $state ;
33
32
@@ -37,38 +36,16 @@ export default class LogsToolbarController {
37
36
*/
38
37
this . logsColorInversionService_ = logsColorInversionService ;
39
38
40
- /** @export {!Array<!backendApi.ReplicationControllerPodWithContainers >} */
41
- this . pods = replicationControllerPods . pods ;
39
+ /** @export {!Array<string >} */
40
+ this . containers = podContainers . containers ;
42
41
43
- /**
44
- * Currently chosen pod.
45
- * @export {!backendApi.ReplicationControllerPodWithContainers|undefined}
46
- */
47
- this . pod = this . findPodByName_ ( this . pods , $stateParams . podId ) ;
48
-
49
- /** @export {!Array<!backendApi.PodContainer>} */
50
- this . containers = this . pod . podContainers ;
51
-
52
- /** @export {!backendApi.PodContainer} */
53
- this . container = this . initializeContainer_ ( this . containers , podLogs . container ) ;
54
-
55
- /**
56
- * Pod creation time.
57
- * @export {?string}
58
- */
59
- this . podCreationTime = this . pod . startTime ;
60
-
61
- /**
62
- * Namespace.
63
- * @private {string}
64
- */
65
- this . namespace_ = $stateParams . rcNamespace ;
42
+ /** @export {string} */
43
+ this . container = $stateParams . container || this . containers [ 0 ] ;
66
44
67
45
/**
68
- * Replication Controller name.
69
- * @private {string}
46
+ * @export {../logs_state.StateParams}
70
47
*/
71
- this . replicationControllerName_ = $stateParams . replicationController ;
48
+ this . stateParams = $stateParams ;
72
49
}
73
50
74
51
/**
@@ -79,28 +56,16 @@ export default class LogsToolbarController {
79
56
*/
80
57
isTextColorInverted ( ) { return this . logsColorInversionService_ . getInverted ( ) ; }
81
58
82
- /**
83
- * Execute a code when a user changes the selected option of a pod element.
84
- * @param {string } podId
85
- * @return {string }
86
- * @export
87
- */
88
- onPodChange ( podId ) {
89
- return this . state_ . transitionTo (
90
- logs , new StateParams (
91
- this . namespace_ , this . replicationControllerName_ , podId , this . container . name ) ) ;
92
- }
93
-
94
59
/**
95
60
* Execute a code when a user changes the selected option of a container element.
96
61
* @param {string } container
97
62
* @return {string }
98
63
* @export
99
64
*/
100
65
onContainerChange ( container ) {
101
- return this . state_ . transitionTo (
102
- logs , new StateParams (
103
- this . namespace_ , this . replicationControllerName_ , this . pod . name , container ) ) ;
66
+ return this . state_ . go (
67
+ logs ,
68
+ new StateParams ( this . stateParams . objectNamespace , this . stateParams . objectName , container ) ) ;
104
69
}
105
70
106
71
/**
0 commit comments