]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/blob
14b01a140428ea0f3696799e0469053be6a86763
[ceph-ci.git] /
1 import { Component, Input, OnChanges } from '@angular/core';
2 import { CdTableColumn } from '~/app/shared/models/cd-table-column';
3 import {
4   ALLOW_READ_THROUGH_TEXT,
5   HOST_STYLE,
6   MULTIPART_MIN_PART_TEXT,
7   MULTIPART_SYNC_THRESHOLD_TEXT,
8   RETAIN_HEAD_OBJECT_TEXT,
9   StorageClassDetails,
10   TARGET_ACCESS_KEY_TEXT,
11   TARGET_PATH_TEXT,
12   TARGET_SECRET_KEY_TEXT
13 } from '../models/rgw-storage-class.model';
14
15 @Component({
16   selector: 'cd-rgw-storage-class-details',
17   templateUrl: './rgw-storage-class-details.component.html',
18   styleUrls: ['./rgw-storage-class-details.component.scss']
19 })
20 export class RgwStorageClassDetailsComponent implements OnChanges {
21   @Input()
22   selection: StorageClassDetails;
23   columns: CdTableColumn[] = [];
24   storageDetails: StorageClassDetails;
25   allowReadThroughText = ALLOW_READ_THROUGH_TEXT;
26   retainHeadObjectText = RETAIN_HEAD_OBJECT_TEXT;
27   multipartMinPartText = MULTIPART_MIN_PART_TEXT;
28   multipartSyncThreholdText = MULTIPART_SYNC_THRESHOLD_TEXT;
29   targetAccessKeyText = TARGET_ACCESS_KEY_TEXT;
30   targetSecretKeyText = TARGET_SECRET_KEY_TEXT;
31   targetPathText = TARGET_PATH_TEXT;
32   hostStyleText = HOST_STYLE;
33
34   ngOnChanges() {
35     if (this.selection) {
36       this.storageDetails = {
37         access_key: this.selection.access_key,
38         secret: this.selection.secret,
39         target_path: this.selection.target_path,
40         multipart_min_part_size: this.selection.multipart_min_part_size,
41         multipart_sync_threshold: this.selection.multipart_sync_threshold,
42         host_style: this.selection.host_style,
43         retain_head_object: this.selection.retain_head_object,
44         allow_read_through: this.selection.allow_read_through
45       };
46     }
47   }
48 }