File

src/app/ceph/cephfs/cephfs-clients/cephfs-clients.component.ts

Implements

OnInit

Metadata

selector cd-cephfs-clients
styleUrls ./cephfs-clients.component.scss
templateUrl ./cephfs-clients.component.html

Index

Properties
Methods
Inputs

Constructor

constructor(cephfsService: CephfsService, i18n: I18n)
Parameters :
Name Type Optional
cephfsService CephfsService No
i18n I18n No

Inputs

id
Type : number

Methods

ngOnInit
ngOnInit()
Returns : void
refresh
refresh()
Returns : void

Properties

clients
Type : any
viewCacheStatus
Type : ViewCacheStatus
import { Component, Input, OnInit } from '@angular/core';

import { I18n } from '@ngx-translate/i18n-polyfill';

import { CephfsService } from '../../../shared/api/cephfs.service';
import { ViewCacheStatus } from '../../../shared/enum/view-cache-status.enum';

@Component({
  selector: 'cd-cephfs-clients',
  templateUrl: './cephfs-clients.component.html',
  styleUrls: ['./cephfs-clients.component.scss']
})
export class CephfsClientsComponent implements OnInit {
  @Input()
  id: number;

  clients: any;
  viewCacheStatus: ViewCacheStatus;

  constructor(private cephfsService: CephfsService, private i18n: I18n) {}

  ngOnInit() {
    this.clients = {
      columns: [
        { prop: 'id', name: this.i18n('id') },
        { prop: 'type', name: this.i18n('type') },
        { prop: 'state', name: this.i18n('state') },
        { prop: 'version', name: this.i18n('version') },
        { prop: 'hostname', name: this.i18n('Host') },
        { prop: 'root', name: this.i18n('root') }
      ],
      data: []
    };

    this.clients.data = [];
    this.viewCacheStatus = ViewCacheStatus.ValueNone;
  }

  refresh() {
    this.cephfsService.getClients(this.id).subscribe((data: any) => {
      this.viewCacheStatus = data.status;
      this.clients.data = data.data;
    });
  }
}
<cd-view-cache [status]="viewCacheStatus"></cd-view-cache>

<cd-table [data]="clients.data"
          [columns]="clients.columns"
          (fetchData)="refresh()"
          [header]="false">
</cd-table>

./cephfs-clients.component.scss

Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""