1 import { Component, Input, OnChanges, ViewChild } from '@angular/core';
3 import { I18n } from '@ngx-translate/i18n-polyfill';
4 import { TabsetComponent } from 'ngx-bootstrap/tabs';
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';
13 selector: 'cd-pool-details',
14 templateUrl: './pool-details.component.html',
15 styleUrls: ['./pool-details.component.scss']
17 export class PoolDetailsComponent implements OnChanges {
18 cacheTierColumns: Array<CdTableColumn> = [];
21 selection: CdTableSelection;
23 permissions: Permissions;
26 @ViewChild(TabsetComponent)
27 tabsetChild: TabsetComponent;
28 selectedPoolConfiguration: RbdConfigurationEntry[];
30 constructor(private i18n: I18n, private poolService: PoolService) {
31 this.cacheTierColumns = [
34 name: this.i18n('Name'),
39 name: this.i18n('Cache Mode'),
43 prop: 'cache_min_evict_age',
44 name: this.i18n('Min Evict Age'),
48 prop: 'cache_min_flush_age',
49 name: this.i18n('Min Flush Age'),
53 prop: 'target_max_bytes',
54 name: this.i18n('Target Max Bytes'),
58 prop: 'target_max_objects',
59 name: this.i18n('Target Max Objects'),
66 if (this.selection.hasSingleSelection) {
67 this.poolService.getConfiguration(this.selection.first().pool_name).subscribe((poolConf) => {
68 this.selectedPoolConfiguration = poolConf;