]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/image-list/image-list.component.ts
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / block / mirroring / image-list / image-list.component.ts
index 3867da7db92a5deafaa055729a1002c5cfa58628..015031ebeebf30b6214f4da94f39983736a9e64d 100644 (file)
@@ -1,9 +1,9 @@
 import { Component, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core';
 
-import { I18n } from '@ngx-translate/i18n-polyfill';
 import { Subscription } from 'rxjs';
 
-import { RbdMirroringService } from '../../../../shared/api/rbd-mirroring.service';
+import { RbdMirroringService } from '~/app/shared/api/rbd-mirroring.service';
+import { TableStatusViewCache } from '~/app/shared/classes/table-status-view-cache';
 
 @Component({
   selector: 'cd-mirroring-images',
@@ -33,45 +33,47 @@ export class ImageListComponent implements OnInit, OnDestroy {
     columns: {}
   };
 
-  constructor(private rbdMirroringService: RbdMirroringService, private i18n: I18n) {}
+  tableStatus = new TableStatusViewCache();
+
+  constructor(private rbdMirroringService: RbdMirroringService) {}
 
   ngOnInit() {
     this.image_error.columns = [
-      { prop: 'pool_name', name: this.i18n('Pool'), flexGrow: 2 },
-      { prop: 'name', name: this.i18n('Image'), flexGrow: 2 },
-      { prop: 'description', name: this.i18n('Issue'), flexGrow: 4 },
+      { prop: 'pool_name', name: $localize`Pool`, flexGrow: 2 },
+      { prop: 'name', name: $localize`Image`, flexGrow: 2 },
+      { prop: 'description', name: $localize`Issue`, flexGrow: 4 },
       {
         prop: 'state',
-        name: this.i18n('State'),
+        name: $localize`State`,
         cellTemplate: this.stateTmpl,
         flexGrow: 1
       }
     ];
 
     this.image_syncing.columns = [
-      { prop: 'pool_name', name: this.i18n('Pool'), flexGrow: 2 },
-      { prop: 'name', name: this.i18n('Image'), flexGrow: 2 },
+      { prop: 'pool_name', name: $localize`Pool`, flexGrow: 2 },
+      { prop: 'name', name: $localize`Image`, flexGrow: 2 },
       {
         prop: 'progress',
-        name: this.i18n('Progress'),
+        name: $localize`Progress`,
         cellTemplate: this.progressTmpl,
         flexGrow: 2
       },
       {
         prop: 'state',
-        name: this.i18n('State'),
+        name: $localize`State`,
         cellTemplate: this.syncTmpl,
         flexGrow: 1
       }
     ];
 
     this.image_ready.columns = [
-      { prop: 'pool_name', name: this.i18n('Pool'), flexGrow: 2 },
-      { prop: 'name', name: this.i18n('Image'), flexGrow: 2 },
-      { prop: 'description', name: this.i18n('Description'), flexGrow: 4 },
+      { prop: 'pool_name', name: $localize`Pool`, flexGrow: 2 },
+      { prop: 'name', name: $localize`Image`, flexGrow: 2 },
+      { prop: 'description', name: $localize`Description`, flexGrow: 4 },
       {
         prop: 'state',
-        name: this.i18n('State'),
+        name: $localize`State`,
         cellTemplate: this.stateTmpl,
         flexGrow: 1
       }
@@ -81,6 +83,7 @@ export class ImageListComponent implements OnInit, OnDestroy {
       this.image_error.data = data.content_data.image_error;
       this.image_syncing.data = data.content_data.image_syncing;
       this.image_ready.data = data.content_data.image_ready;
+      this.tableStatus = new TableStatusViewCache(data.status);
     });
   }