]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-list/cephfs-list.component.ts
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / cephfs / cephfs-list / cephfs-list.component.ts
1 import { Component, OnInit } from '@angular/core';
2
3 import { I18n } from '@ngx-translate/i18n-polyfill';
4
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';
9
10 @Component({
11 selector: 'cd-cephfs-list',
12 templateUrl: './cephfs-list.component.html',
13 styleUrls: ['./cephfs-list.component.scss']
14 })
15 export class CephfsListComponent implements OnInit {
16 columns: CdTableColumn[];
17 filesystems: any = [];
18 selection = new CdTableSelection();
19
20 constructor(private cephfsService: CephfsService, private i18n: I18n) {}
21
22 ngOnInit() {
23 this.columns = [
24 {
25 name: this.i18n('Name'),
26 prop: 'mdsmap.fs_name',
27 flexGrow: 2
28 },
29 {
30 name: this.i18n('Created'),
31 prop: 'mdsmap.created',
32 flexGrow: 2
33 },
34 {
35 name: this.i18n('Enabled'),
36 prop: 'mdsmap.enabled',
37 flexGrow: 1
38 }
39 ];
40 }
41
42 loadFilesystems(context: CdTableFetchDataContext) {
43 this.cephfsService.list().subscribe(
44 (resp: any[]) => {
45 this.filesystems = resp;
46 },
47 () => {
48 context.error();
49 }
50 );
51 }
52
53 updateSelection(selection: CdTableSelection) {
54 this.selection = selection;
55 }
56 }