# All files / src/app/ceph/cluster/hosts/host-details host-details.component.ts

91.67% Statements 11/12
66.67% Branches 4/6
100% Functions 2/2
90% Lines 9/10

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    286x

    6x

    6x

    6x

    6x

    3x
    3x

    6x

    6x
     import { Component, Input, OnChanges } from '@angular/core';

    import { CdTableSelection } from '../../../../shared/models/cd-table-selection';
    import { Permission } from '../../../../shared/models/permissions';
    import { AuthStorageService } from '../../../../shared/services/auth-storage.service';

    @Component({
      selector: 'cd-host-details',
      template: require('./host-details.component.html'),
      styles: []
    })
    export class HostDetailsComponent implements OnChanges {
      grafanaPermission: Permission;
      @Input()
      selection: CdTableSelection;
      host: any;

      constructor(private authStorageService: AuthStorageService) {
        this.grafanaPermission = this.authStorageService.getPermissions().grafana;
      }

      ngOnChanges() {
        if (this.selection.hasSelection) {
          this.host = this.selection.first();
        }
      }
    }