1 import { Component, OnInit, ViewChild } from '@angular/core';
2 import { MatPaginator } from '@angular/material/paginator';
3 import {MatTableDataSource} from '@angular/material/table';
4 import { nodeDetailss, nodinfo } from './../../app/datainterface';
5 import { nodeDetails } from './../datainterface';
6 import { MyserviceService } from './../myservice.service';
10 selector: 'app-nodes',
11 templateUrl: './nodes.component.html',
12 styleUrls: ['./nodes.component.scss']
17 export class NodesComponent implements OnInit {
19 nodeInfo = {} as nodeDetails;
21 nodeArray = {} as nodinfo;
26 nodeColumns: string [] = ['nodeName','nodeStatus','nodeRole','age','version','internalIp','externalIp','osImage','kernel','containerRuntime'];
28 nodeDataSource= new MatTableDataSource<nodinfo>(NODE_INFO_LIST);
31 @ViewChild(MatPaginator, {static: true}) paginator: MatPaginator;
33 constructor(private serviceobj:MyserviceService) { }
37 this.nodeDataSource.paginator = this.paginator;
41 nodeFilter(filterValue: string) {
42 this.nodeDataSource.filter = filterValue.trim().toLowerCase();
47 this.serviceobj.getNodesInfoo()
51 this.nodeArrayList = this.nodeInfo.eliotNodes;
52 this.nodeDataSource = new MatTableDataSource(this.nodeArrayList);
53 this.nodeDataSource.paginator = this.paginator;
56 error => console.log(error));
61 const NODE_LIST: nodeDetailss[] = [
62 {position: 1, nodeName: 'eliot-master', role: 'master', nodeStatus: 'Ready'},
63 {position: 2, nodeName: 'eliot-worker01', role: 'worker', nodeStatus: 'NotReady'},
64 {position: 3, nodeName: 'eliot-worker02', role: 'worker', nodeStatus: 'Ready'}
67 const NODE_INFO_LIST: nodinfo[] = [
68 { nodeName: '', nodeStatus: '', nodeRole: '', age: '', version: '', internalIp: '', externalIp: '', osImage: '', kernel: '', containerRuntime: ''}