1 import { Component, OnInit, ViewChild } from '@angular/core';
2 import { EliotserviceService } from '../eliotservice.service';
3 import { podDetails, podinfo, nodesDropDownDetails } from '../datainterface';
5 import {MatTableDataSource} from '@angular/material/table';
6 import { MatPaginator } from '@angular/material/paginator';
10 templateUrl: './pods.component.html',
11 styleUrls: ['./pods.component.scss']
13 export class PodsComponent implements OnInit {
15 podColumns: string [] = ['namespace','name','ready','status','restarts','age','ip','node','nominated','readiness'];
16 podDataSource = new MatTableDataSource<podinfo>(POD_INFO_LIST);
18 selectedNamespace: string;
25 podInfo = {} as podDetails;
28 // {value: 'eliot01', viewValue: 'eliot01'},
29 // {value: 'eliot02', viewValue: 'eliot02'},
30 // {value: 'eliot03', viewValue: 'eliot03'}
35 nodewise = {} as nodesDropDownDetails;
37 @ViewChild(MatPaginator, {static: true}) paginator: MatPaginator;
39 constructor(private serviceobj:EliotserviceService) { }
43 this.getPodsNamespace(this.selectedNamespace);
45 this.podDataSource.paginator = this.paginator;
52 console.log("on Node Selection triggered....");
53 console.log(this.selectedNode);
54 console.log("fiewofijwe");
55 this.podDataSource.filter = this.selectedNode.trim().toLowerCase();
58 podFilter(filterValue: string) {
59 this.podDataSource.filter = filterValue.trim().toLowerCase();
62 getPodsNamespace(selectedNamespace) {
63 this.serviceobj.getPodsInfo(selectedNamespace)
68 this.podArrayList = this.podInfo.eliotPods;
69 this.podDataSource = new MatTableDataSource(this.podArrayList);
70 this.podDataSource.paginator = this.paginator;
71 console.log(this.podArrayList);
73 error => console.log(error));
77 this.serviceobj.getNodesArray()
82 this.nodesArray = this.nodewise.nodesArray;
84 error => console.log(error));
89 const POD_INFO_LIST: podinfo[] = [
90 { namespace: '', name: '', ready: '', status: '',restarts: '', age: '', ip: '', node: '', nominated: '', readiness: ''}