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 { CdTableColumn } from '../../../shared/models/cd-table-column';
7 import { CdTableFetchDataContext } from '../../../shared/models/cd-table-fetch-data-context';
8 import { CdTableSelection } from '../../../shared/models/cd-table-selection';
11 selector: 'cd-cephfs-list',
12 templateUrl: './cephfs-list.component.html',
13 styleUrls: ['./cephfs-list.component.scss']
15 export class CephfsListComponent implements OnInit {
16 columns: CdTableColumn[];
17 filesystems: any = [];
18 selection = new CdTableSelection();
20 constructor(private cephfsService: CephfsService, private i18n: I18n) {}
25 name: this.i18n('Name'),
26 prop: 'mdsmap.fs_name',
30 name: this.i18n('Created'),
31 prop: 'mdsmap.created',
35 name: this.i18n('Enabled'),
36 prop: 'mdsmap.enabled',
42 loadFilesystems(context: CdTableFetchDataContext) {
43 this.cephfsService.list().subscribe(
45 this.filesystems = resp;
53 updateSelection(selection: CdTableSelection) {
54 this.selection = selection;