Skip to content
This repository was archived by the owner on Jan 8, 2024. It is now read-only.

Commit 0f22dbe

Browse files
author
Matt Jeanes
committed
Upgrade to latest angular template and upgrade to net core/aspnet core 2.1.1
1 parent c0a7ed2 commit 0f22dbe

38 files changed

+1575
-891
lines changed

SystemChecker.Migrations/SystemChecker.Migrations.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp2.0</TargetFramework>
5+
<TargetFramework>netcoreapp2.1</TargetFramework>
66
</PropertyGroup>
77

88
<ItemGroup>

SystemChecker.Model/SystemChecker.Model.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.0</TargetFramework>
4+
<TargetFramework>netcoreapp2.1</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>

SystemChecker.Service/SystemChecker.Service.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>netcoreapp2.0</TargetFramework>
3+
<TargetFramework>netcoreapp2.1</TargetFramework>
44
<LangVersion>latest</LangVersion>
55
<OutputType>Exe</OutputType>
66
</PropertyGroup>

SystemChecker.Web/.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ node_modules
22
bin
33
obj
44
wwwroot/dist
5-
webpack.config.js
6-
webpack.config.js.map
7-
webpack.config.vendor.js
8-
webpack.config.vendor.js.map
95
*.user
106
logs
117
yarn-error.log

SystemChecker.Web/.vscode/launch.json

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,12 @@
22
"version": "0.2.0",
33
"configurations": [
44
{
5-
"name": "Run (No Scheduler)",
6-
"type": "clr",
7-
"request": "launch",
8-
"preLaunchTask": "build",
9-
"program": "${workspaceRoot}/bin/Debug/net471/win-x64/SystemChecker.Web.exe",
10-
"args": ["--port", "51114", "--no-scheduler"],
11-
"cwd": "${workspaceRoot}",
12-
"stopAtEntry": true,
13-
"launchBrowser": {
14-
"enabled": true,
15-
"args": "${auto-detect-url}",
16-
"windows": {
17-
"command": "cmd.exe",
18-
"args": "/C start ${auto-detect-url}"
19-
},
20-
"osx": {
21-
"command": "open"
22-
},
23-
"linux": {
24-
"command": "xdg-open"
25-
}
26-
},
27-
"env": {
28-
"ASPNETCORE_ENVIRONMENT": "Development"
29-
},
30-
"sourceFileMap": {
31-
"/Views": "${workspaceRoot}/Views"
32-
}
33-
},
34-
{
35-
"name": "Run (With Scheduler)",
36-
"type": "clr",
5+
"name": ".NET Core Launch",
6+
"type": "coreclr",
377
"request": "launch",
388
"preLaunchTask": "build",
39-
"program": "${workspaceRoot}/bin/Debug/net471/win-x64/SystemChecker.Web.exe",
40-
"args": ["--port", "51114"],
9+
"program": "${workspaceRoot}/bin/Debug/netcoreapp2.1/SystemChecker.Web.dll",
10+
"args": [],
4111
"cwd": "${workspaceRoot}",
4212
"stopAtEntry": false,
4313
"launchBrowser": {

SystemChecker.Web/.vscode/tasks.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@
1313
],
1414
"problemMatcher": []
1515
},
16+
{
17+
"label": "clean",
18+
"command": "dotnet",
19+
"type": "shell",
20+
"args": [
21+
"clean"
22+
],
23+
"problemMatcher": "$msCompile"
24+
},
1625
{
1726
"label": "build",
1827
"command": "dotnet",

SystemChecker.Web/ClientApp/app/app.module.ts

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,6 @@ import {
4848
MatTooltipModule,
4949
} from "@angular/material";
5050

51-
import {
52-
DataTableModule,
53-
DropdownModule,
54-
GrowlModule,
55-
} from "primeng/primeng";
56-
5751
import {
5852
CovalentDialogsModule,
5953
CovalentLoadingModule,
@@ -65,6 +59,10 @@ import {
6559

6660
registerLocaleData(localeGB);
6761

62+
export function JwtTokenGetter(): string {
63+
return store.get("token");
64+
}
65+
6866
const routes: Routes = [
6967
{ path: "", redirectTo: "dashboard", pathMatch: "full" },
7068
{ path: "dashboard", component: DashboardComponent, data: { title: "Dashboard", noDashboardLink: true } },
@@ -100,8 +98,11 @@ routes.forEach(x => {
10098
HttpModule,
10199
FormsModule,
102100
RouterModule.forRoot(routes),
103-
DataTableModule,
104-
DropdownModule,
101+
JwtModule.forRoot({
102+
config: {
103+
tokenGetter: JwtTokenGetter,
104+
},
105+
}),
105106
MatButtonModule,
106107
MatCardModule,
107108
MatInputModule,
@@ -111,20 +112,12 @@ routes.forEach(x => {
111112
ReactiveFormsModule,
112113
MatDatepickerModule,
113114
MatNativeDateModule,
114-
GrowlModule,
115115
CovalentDialogsModule,
116116
NgxChartsModule,
117117
MatTooltipModule,
118118
CovalentLoadingModule,
119119
MatIconModule,
120120
HttpClientModule,
121-
JwtModule.forRoot({
122-
config: {
123-
tokenGetter: () => {
124-
return store.get("token");
125-
},
126-
},
127-
}),
128121
],
129122
declarations: [
130123
AppComponent,

SystemChecker.Web/ClientApp/app/dashboard/dashboard.component.ts

Lines changed: 64 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { AfterViewInit, Component, NgZone, OnDestroy, OnInit, ViewChild } from "@angular/core";
1+
import { AfterViewInit, Component, NgZone, OnDestroy, OnInit /*ViewChild*/ } from "@angular/core";
22
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";
54

65
import { CheckResultStatus } from "../app.enums";
76
import { ICheck, ICheckGroup, ICheckType, IEnvironment, ISettings } from "../app.interfaces";
@@ -37,31 +36,31 @@ export class DashboardComponent implements AfterViewInit, OnInit, OnDestroy {
3736
}],
3837
}];
3938
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+
//];
5251
public activeOption: boolean | null = true;
5352
public resultOption: CheckResultStatus | null = null;
54-
public environmentOptions: SelectItem[] = [];
53+
//public environmentOptions: SelectItem[] = [];
5554
public environmentOption: number | null = null;
5655
public environmentLookup: {
5756
[key: string]: IEnvironment;
5857
};
59-
public checkGroupOptions: SelectItem[] = [];
58+
//public checkGroupOptions: SelectItem[] = [];
6059
public checkGroupOption: number | null = null;
6160
public checkGroupLookup: {
6261
[key: string]: ICheckGroup;
6362
};
64-
public typeOptions: SelectItem[] = [];
63+
//public typeOptions: SelectItem[] = [];
6564
public typeOption: number | null = null;
6665
public typeLookup: {
6766
[key: string]: ICheckType;
@@ -76,7 +75,7 @@ export class DashboardComponent implements AfterViewInit, OnInit, OnDestroy {
7675
Global: {},
7776
};
7877
public types: ICheckType[] = [];
79-
@ViewChild("dt") private dataTable: DataTable;
78+
//@ViewChild("dt") private dataTable: DataTable;
8079
private hub = new HubConnectionBuilder()
8180
.withUrl("hub/dashboard", { transport: HttpTransportType.WebSockets })
8281
.build();
@@ -100,32 +99,32 @@ export class DashboardComponent implements AfterViewInit, OnInit, OnDestroy {
10099
delete this.types;
101100
this.types = await this.appService.getTypes();
102101

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+
//});
111110

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+
//});
120119

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+
//});
129128

130129
delete this.checks;
131130
this.checks = await this.appService.getAll(true);
@@ -150,8 +149,8 @@ export class DashboardComponent implements AfterViewInit, OnInit, OnDestroy {
150149
}
151150
}
152151
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);
155154
this.updateCharts();
156155
}
157156
public async run(check: ICheck) {
@@ -209,29 +208,29 @@ export class DashboardComponent implements AfterViewInit, OnInit, OnDestroy {
209208
};
210209
});
211210
}
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+
//}
228227
public onChartSelect(results: IChart, event: { name: string, value: number }) {
229228
const selected = results.results.find(x => x.name === event.name);
230229
if (selected) {
231230
this.resultOption = selected.type;
232231
this.environmentOption = results.environmentID;
233-
this.updateResultFilter();
234-
this.updateEnvironmentFilter();
232+
//this.updateResultFilter();
233+
//this.updateEnvironmentFilter();
235234
}
236235
}
237236
public onCheckSelected(event: { data: ICheck }) {
@@ -240,8 +239,8 @@ export class DashboardComponent implements AfterViewInit, OnInit, OnDestroy {
240239
public setEnvironment(id: number) {
241240
this.environmentOption = id;
242241
this.resultOption = null;
243-
this.updateEnvironmentFilter();
244-
this.updateResultFilter();
242+
//this.updateEnvironmentFilter();
243+
//this.updateResultFilter();
245244
}
246245
public trackChart(index: number, chart: IChart) {
247246
return chart ? chart.environmentID : undefined;

SystemChecker.Web/ClientApp/app/details/details.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { Component, NgZone, OnDestroy, OnInit } from "@angular/core";
22
import { ActivatedRoute } from "@angular/router";
3-
import { HubConnectionBuilder, HttpTransportType } from "@aspnet/signalr";
3+
import { HttpTransportType, HubConnectionBuilder } from "@aspnet/signalr";
44
import { TdLoadingService } from "@covalent/core";
5+
import { first } from "rxjs/operators";
56

67
import { ICheck, ICheckResults } from "../app.interfaces";
78
import { AppService, MessageService, UtilService } from "../services";
@@ -51,7 +52,7 @@ export class DetailsComponent implements OnInit, OnDestroy {
5152
}
5253
public async ngOnInit() {
5354
try {
54-
const params = await this.activatedRoute.params.first().toPromise();
55+
const params = await this.activatedRoute.params.pipe(first()).toPromise();
5556
this.checkID = parseInt(params.id);
5657
this.check = await this.appService.get(this.checkID);
5758
await this.loadResults();

SystemChecker.Web/ClientApp/app/edit/edit.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Location } from "@angular/common";
22
import { Component, OnInit } from "@angular/core";
33
import { AbstractControl, FormArray, FormBuilder, FormGroup, ValidationErrors, ValidatorFn, Validators } from "@angular/forms";
44
import { ActivatedRoute, Router } from "@angular/router";
5+
import { first } from "rxjs/operators";
56

67
import { ICheckDetail, ICheckNotification, ICheckNotificationType, ICheckSchedule, ICheckType, IOption, ISettings, ISubCheck, ISubCheckType } from "../app.interfaces";
78
import { RunCheckComponent } from "../components";
@@ -73,7 +74,7 @@ export class EditComponent implements OnInit, ICanComponentDeactivate {
7374
private router: Router, private formBuilder: FormBuilder) { this.createForm(); }
7475
public async ngOnInit() {
7576
try {
76-
const params = await this.activatedRoute.params.first().toPromise();
77+
const params = await this.activatedRoute.params.pipe(first()).toPromise();
7778
const id = parseInt(params.id);
7879
if (id) {
7980
this.check = await this.appService.getDetails(id);

SystemChecker.Web/ClientApp/app/guards/can-deactivate.guard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Injectable } from "@angular/core";
22
import { CanDeactivate } from "@angular/router";
3-
import { Observable } from "rxjs/Observable";
3+
import { Observable } from "rxjs";
44

55
export interface ICanComponentDeactivate {
66
canDeactivate: () => Observable<boolean> | Promise<boolean> | boolean;

0 commit comments

Comments
 (0)