]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-details/pool-details.component.ts
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / pool / pool-details / pool-details.component.ts
1 import { Component, Input, OnChanges, ViewChild } from '@angular/core';
2
3 import { I18n } from '@ngx-translate/i18n-polyfill';
4 import { TabsetComponent } from 'ngx-bootstrap/tabs';
5
6 import { PoolService } from '../../../shared/api/pool.service';
7 import { CdTableColumn } from '../../../shared/models/cd-table-column';
8 import { CdTableSelection } from '../../../shared/models/cd-table-selection';
9 import { RbdConfigurationEntry } from '../../../shared/models/configuration';
10 import { Permissions } from '../../../shared/models/permissions';
11
12 @Component({
13 selector: 'cd-pool-details',
14 templateUrl: './pool-details.component.html',
15 styleUrls: ['./pool-details.component.scss']
16 })
17 export class PoolDetailsComponent implements OnChanges {
18 cacheTierColumns: Array<CdTableColumn> = [];
19
20 @Input()
21 selection: CdTableSelection;
22 @Input()
23 permissions: Permissions;
24 @Input()
25 cacheTiers: any[];
26 @ViewChild(TabsetComponent)
27 tabsetChild: TabsetComponent;
28 selectedPoolConfiguration: RbdConfigurationEntry[];
29
30 constructor(private i18n: I18n, private poolService: PoolService) {
31 this.cacheTierColumns = [
32 {
33 prop: 'pool_name',
34 name: this.i18n('Name'),
35 flexGrow: 3
36 },
37 {
38 prop: 'cache_mode',
39 name: this.i18n('Cache Mode'),
40 flexGrow: 2
41 },
42 {
43 prop: 'cache_min_evict_age',
44 name: this.i18n('Min Evict Age'),
45 flexGrow: 2
46 },
47 {
48 prop: 'cache_min_flush_age',
49 name: this.i18n('Min Flush Age'),
50 flexGrow: 2
51 },
52 {
53 prop: 'target_max_bytes',
54 name: this.i18n('Target Max Bytes'),
55 flexGrow: 2
56 },
57 {
58 prop: 'target_max_objects',
59 name: this.i18n('Target Max Objects'),
60 flexGrow: 2
61 }
62 ];
63 }
64
65 ngOnChanges() {
66 if (this.selection.hasSingleSelection) {
67 this.poolService.getConfiguration(this.selection.first().pool_name).subscribe((poolConf) => {
68 this.selectedPoolConfiguration = poolConf;
69 });
70 }
71 }
72 }