@@ -22,6 +22,7 @@ import {
2222 AddAutomaticBackupDialogConfig ,
2323} from '@app/backup/list/automatic-backup/add-dialog/component' ;
2424import { BackupService } from '@core/services/backup' ;
25+ import { ClusterService } from '@core/services/cluster' ;
2526import { NotificationService } from '@core/services/notification' ;
2627import { ProjectService } from '@core/services/project' ;
2728import { UserService } from '@core/services/user' ;
@@ -49,6 +50,7 @@ export class AutomaticBackupListComponent implements OnInit, OnDestroy {
4950 private _currentGroupConfig : GroupConfig ;
5051 private _selectedProject = { } as Project ;
5152 private _backups = [ ] ;
53+ private _clusters = [ ] ;
5254 dataSource = new MatTableDataSource < EtcdBackupConfig > ( ) ;
5355 isInitialized = true ;
5456
@@ -57,7 +59,7 @@ export class AutomaticBackupListComponent implements OnInit, OnDestroy {
5759 }
5860
5961 get columns ( ) : string [ ] {
60- return [ 'status' , 'name' , 'cluster' , 'destination' , 'schedule' , 'keep' , 'created' , 'actions' ] ;
62+ return [ 'status' , 'name' , 'clusterName' , ' cluster', 'destination' , 'schedule' , 'keep' , 'created' , 'actions' ] ;
6163 }
6264
6365 get isEmpty ( ) : boolean {
@@ -82,6 +84,7 @@ export class AutomaticBackupListComponent implements OnInit, OnDestroy {
8284
8385 constructor (
8486 private readonly _backupService : BackupService ,
87+ private readonly _clusterService : ClusterService ,
8588 private readonly _projectService : ProjectService ,
8689 private readonly _userService : UserService ,
8790 private readonly _matDialog : MatDialog ,
@@ -116,6 +119,13 @@ export class AutomaticBackupListComponent implements OnInit, OnDestroy {
116119 this . _backups = backups ;
117120 this . dataSource . data = this . _backups ;
118121 } ) ;
122+
123+ this . _projectService . selectedProject
124+ . pipe ( switchMap ( project => this . _clusterService . clusters ( project . id , false ) ) )
125+ . pipe ( takeUntil ( this . _unsubscribe ) )
126+ . subscribe ( clusters => {
127+ this . _clusters = clusters ;
128+ } ) ;
119129 }
120130
121131 ngOnDestroy ( ) : void {
@@ -136,6 +146,15 @@ export class AutomaticBackupListComponent implements OnInit, OnDestroy {
136146 return getBackupHealthStatus ( backup , condition ) ;
137147 }
138148
149+ getClusterName ( backup : EtcdBackupConfig ) : string {
150+ for ( const cluster of this . _clusters ) {
151+ if ( cluster . id === backup . spec . clusterId ) {
152+ return cluster . name ;
153+ }
154+ }
155+ return 'N/A' ;
156+ }
157+
139158 delete ( backup : EtcdBackupConfig ) : void {
140159 const config : MatDialogConfig = {
141160 data : {
0 commit comments