1 import { Component, OnInit } from '@angular/core';
3 import { I18n } from '@ngx-translate/i18n-polyfill';
5 import { CephfsService } from '../../../shared/api/cephfs.service';
6 import { CellTemplate } from '../../../shared/enum/cell-template.enum';
7 import { CdTableColumn } from '../../../shared/models/cd-table-column';
8 import { CdTableFetchDataContext } from '../../../shared/models/cd-table-fetch-data-context';
9 import { CdTableSelection } from '../../../shared/models/cd-table-selection';
10 import { CdDatePipe } from '../../../shared/pipes/cd-date.pipe';
13 selector: 'cd-cephfs-list',
14 templateUrl: './cephfs-list.component.html',
15 styleUrls: ['./cephfs-list.component.scss']
17 export class CephfsListComponent implements OnInit {
18 columns: CdTableColumn[];
19 filesystems: any = [];
20 selection = new CdTableSelection();
23 private cephfsService: CephfsService,
24 private cdDatePipe: CdDatePipe,
31 name: this.i18n('Name'),
32 prop: 'mdsmap.fs_name',
36 name: this.i18n('Created'),
37 prop: 'mdsmap.created',
42 name: this.i18n('Enabled'),
43 prop: 'mdsmap.enabled',
45 cellTransformation: CellTemplate.checkIcon
50 loadFilesystems(context: CdTableFetchDataContext) {
51 this.cephfsService.list().subscribe(
53 this.filesystems = resp;
61 updateSelection(selection: CdTableSelection) {
62 this.selection = selection;