1
- import { AfterViewInit , Component , NgZone , OnDestroy , OnInit , ViewChild } from "@angular/core" ;
1
+ import { AfterViewInit , Component , NgZone , OnDestroy , OnInit /* ViewChild*/ } from "@angular/core" ;
2
2
import { Router } from "@angular/router" ;
3
- import { HubConnectionBuilder , HttpTransportType } from "@aspnet/signalr" ;
4
- import { DataTable , SelectItem } from "primeng/primeng" ;
3
+ import { HttpTransportType , HubConnectionBuilder } from "@aspnet/signalr" ;
5
4
6
5
import { CheckResultStatus } from "../app.enums" ;
7
6
import { ICheck , ICheckGroup , ICheckType , IEnvironment , ISettings } from "../app.interfaces" ;
@@ -37,31 +36,31 @@ export class DashboardComponent implements AfterViewInit, OnInit, OnDestroy {
37
36
} ] ,
38
37
} ] ;
39
38
public checks : ICheck [ ] = [ ] ;
40
- public activeOptions : SelectItem [ ] = [
41
- { label : "Yes" , value : true } ,
42
- { label : "No" , value : false } ,
43
- { label : "All" , value : null } ,
44
- ] ;
45
- public resultOptions : SelectItem [ ] = [
46
- { label : "All" , value : null } ,
47
- { label : "Successful" , value : CheckResultStatus . Success } ,
48
- { label : "Warning" , value : CheckResultStatus . Warning } ,
49
- { label : "Failed" , value : CheckResultStatus . Failed } ,
50
- { label : "Not run" , value : CheckResultStatus . NotRun } ,
51
- ] ;
39
+ // public activeOptions: SelectItem[] = [
40
+ // { label: "Yes", value: true },
41
+ // { label: "No", value: false },
42
+ // { label: "All", value: null },
43
+ // ];
44
+ // public resultOptions: SelectItem[] = [
45
+ // { label: "All", value: null },
46
+ // { label: "Successful", value: CheckResultStatus.Success },
47
+ // { label: "Warning", value: CheckResultStatus.Warning },
48
+ // { label: "Failed", value: CheckResultStatus.Failed },
49
+ // { label: "Not run", value: CheckResultStatus.NotRun },
50
+ // ];
52
51
public activeOption : boolean | null = true ;
53
52
public resultOption : CheckResultStatus | null = null ;
54
- public environmentOptions : SelectItem [ ] = [ ] ;
53
+ // public environmentOptions: SelectItem[] = [];
55
54
public environmentOption : number | null = null ;
56
55
public environmentLookup : {
57
56
[ key : string ] : IEnvironment ;
58
57
} ;
59
- public checkGroupOptions : SelectItem [ ] = [ ] ;
58
+ // public checkGroupOptions: SelectItem[] = [];
60
59
public checkGroupOption : number | null = null ;
61
60
public checkGroupLookup : {
62
61
[ key : string ] : ICheckGroup ;
63
62
} ;
64
- public typeOptions : SelectItem [ ] = [ ] ;
63
+ // public typeOptions: SelectItem[] = [];
65
64
public typeOption : number | null = null ;
66
65
public typeLookup : {
67
66
[ key : string ] : ICheckType ;
@@ -76,7 +75,7 @@ export class DashboardComponent implements AfterViewInit, OnInit, OnDestroy {
76
75
Global : { } ,
77
76
} ;
78
77
public types : ICheckType [ ] = [ ] ;
79
- @ViewChild ( "dt" ) private dataTable : DataTable ;
78
+ // @ViewChild ("dt") private dataTable: DataTable;
80
79
private hub = new HubConnectionBuilder ( )
81
80
. withUrl ( "hub/dashboard" , { transport : HttpTransportType . WebSockets } )
82
81
. build ( ) ;
@@ -100,32 +99,32 @@ export class DashboardComponent implements AfterViewInit, OnInit, OnDestroy {
100
99
delete this . types ;
101
100
this . types = await this . appService . getTypes ( ) ;
102
101
103
- delete this . environmentLookup ;
104
- this . environmentLookup = { } ;
105
- delete this . environmentOptions ;
106
- this . environmentOptions = [ { label : "All" , value : null } ] ;
107
- this . settings . Environments . map ( x => {
108
- this . environmentLookup [ x . ID ] = x ;
109
- this . environmentOptions . push ( { label : x . Name , value : x . ID } ) ;
110
- } ) ;
102
+ // delete this.environmentLookup;
103
+ // this.environmentLookup = {};
104
+ // delete this.environmentOptions;
105
+ // this.environmentOptions = [{ label: "All", value: null }];
106
+ // this.settings.Environments.map(x => {
107
+ // this.environmentLookup[x.ID] = x;
108
+ // this.environmentOptions.push({ label: x.Name, value: x.ID });
109
+ // });
111
110
112
- delete this . typeLookup ;
113
- this . typeLookup = { } ;
114
- delete this . typeOptions ;
115
- this . typeOptions = [ { label : "All" , value : null } ] ;
116
- this . types . map ( x => {
117
- this . typeLookup [ x . ID ] = x ;
118
- this . typeOptions . push ( { label : x . Name , value : x . ID } ) ;
119
- } ) ;
111
+ // delete this.typeLookup;
112
+ // this.typeLookup = {};
113
+ // delete this.typeOptions;
114
+ // this.typeOptions = [{ label: "All", value: null }];
115
+ // this.types.map(x => {
116
+ // this.typeLookup[x.ID] = x;
117
+ // this.typeOptions.push({ label: x.Name, value: x.ID });
118
+ // });
120
119
121
- delete this . checkGroupLookup ;
122
- this . checkGroupLookup = { } ;
123
- delete this . checkGroupOptions ;
124
- this . checkGroupOptions = [ { label : "All" , value : null } ] ;
125
- this . settings . CheckGroups . map ( x => {
126
- this . checkGroupLookup [ x . ID ] = x ;
127
- this . checkGroupOptions . push ( { label : x . Name , value : x . ID } ) ;
128
- } ) ;
120
+ // delete this.checkGroupLookup;
121
+ // this.checkGroupLookup = {};
122
+ // delete this.checkGroupOptions;
123
+ // this.checkGroupOptions = [{ label: "All", value: null }];
124
+ // this.settings.CheckGroups.map(x => {
125
+ // this.checkGroupLookup[x.ID] = x;
126
+ // this.checkGroupOptions.push({ label: x.Name, value: x.ID });
127
+ // });
129
128
130
129
delete this . checks ;
131
130
this . checks = await this . appService . getAll ( true ) ;
@@ -150,8 +149,8 @@ export class DashboardComponent implements AfterViewInit, OnInit, OnDestroy {
150
149
}
151
150
}
152
151
public updateActiveFilter ( ) {
153
- const col = this . dataTable . columns . find ( x => x . header === "Active" ) ! ;
154
- this . dataTable . filter ( this . activeOption , col . field , col . filterMatchMode ) ;
152
+ // const col = this.dataTable.columns.find(x => x.header === "Active")!;
153
+ // this.dataTable.filter(this.activeOption, col.field, col.filterMatchMode);
155
154
this . updateCharts ( ) ;
156
155
}
157
156
public async run ( check : ICheck ) {
@@ -209,29 +208,29 @@ export class DashboardComponent implements AfterViewInit, OnInit, OnDestroy {
209
208
} ;
210
209
} ) ;
211
210
}
212
- public updateResultFilter ( ) {
213
- const col = this . dataTable . columns . find ( x => x . header === "Last Result Status" ) ! ;
214
- this . dataTable . filter ( this . resultOption , col . field , col . filterMatchMode ) ;
215
- }
216
- public updateEnvironmentFilter ( ) {
217
- const col = this . dataTable . columns . find ( x => x . header === "Environment" ) ! ;
218
- this . dataTable . filter ( this . environmentOption , col . field , col . filterMatchMode ) ;
219
- }
220
- public updateTypeFilter ( ) {
221
- const col = this . dataTable . columns . find ( x => x . header === "Type" ) ! ;
222
- this . dataTable . filter ( this . typeOption , col . field , col . filterMatchMode ) ;
223
- }
224
- public updateCheckGroupFilter ( ) {
225
- const col = this . dataTable . columns . find ( x => x . header === "Group" ) ! ;
226
- this . dataTable . filter ( this . checkGroupOption , col . field , col . filterMatchMode ) ;
227
- }
211
+ // public updateResultFilter() {
212
+ // const col = this.dataTable.columns.find(x => x.header === "Last Result Status")!;
213
+ // this.dataTable.filter(this.resultOption, col.field, col.filterMatchMode);
214
+ // }
215
+ // public updateEnvironmentFilter() {
216
+ // const col = this.dataTable.columns.find(x => x.header === "Environment")!;
217
+ // this.dataTable.filter(this.environmentOption, col.field, col.filterMatchMode);
218
+ // }
219
+ // public updateTypeFilter() {
220
+ // const col = this.dataTable.columns.find(x => x.header === "Type")!;
221
+ // this.dataTable.filter(this.typeOption, col.field, col.filterMatchMode);
222
+ // }
223
+ // public updateCheckGroupFilter() {
224
+ // const col = this.dataTable.columns.find(x => x.header === "Group")!;
225
+ // this.dataTable.filter(this.checkGroupOption, col.field, col.filterMatchMode);
226
+ // }
228
227
public onChartSelect ( results : IChart , event : { name : string , value : number } ) {
229
228
const selected = results . results . find ( x => x . name === event . name ) ;
230
229
if ( selected ) {
231
230
this . resultOption = selected . type ;
232
231
this . environmentOption = results . environmentID ;
233
- this . updateResultFilter ( ) ;
234
- this . updateEnvironmentFilter ( ) ;
232
+ // this.updateResultFilter();
233
+ // this.updateEnvironmentFilter();
235
234
}
236
235
}
237
236
public onCheckSelected ( event : { data : ICheck } ) {
@@ -240,8 +239,8 @@ export class DashboardComponent implements AfterViewInit, OnInit, OnDestroy {
240
239
public setEnvironment ( id : number ) {
241
240
this . environmentOption = id ;
242
241
this . resultOption = null ;
243
- this . updateEnvironmentFilter ( ) ;
244
- this . updateResultFilter ( ) ;
242
+ // this.updateEnvironmentFilter();
243
+ // this.updateResultFilter();
245
244
}
246
245
public trackChart ( index : number , chart : IChart ) {
247
246
return chart ? chart . environmentID : undefined ;
0 commit comments