-
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
22 changed files
with
648 additions
and
42 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
UI/src/app/_components/error-report/error-report.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<div class="d-flex justify-content-center mt-5 pt-5" *ngIf="loading"> | ||
<div class="spinner spinner-border"></div> | ||
</div> | ||
<button (click)="this.locationBackService.goBack()" id="backBtn" title="Go back"><i class="fas fa-arrow-left"></i> Back</button> | ||
<div id="page" *ngIf="validReport"> | ||
<div id="text"> | ||
<h1>:(</h1> | ||
<h2>There was an unexpected error. Please open a bug report on the project's Github page or contact one of | ||
the developers.</h2> | ||
</div> | ||
<div style="text-align: center"> | ||
<a id="bugReportButton" class="btn btn-lg btn-custom" [attr.href]="bugReportUrl" target="_blank" role="button">Open a bug report on Github</a> | ||
</div> | ||
<div class="col"> | ||
<h3>Stacktrace:</h3> | ||
<pre id="stacktrace">{{ currentReport.stacktrace }}</pre> | ||
</div> | ||
<div class="col"> | ||
<h3>Error datetime</h3> | ||
<h4>{{ currentReport.datetime | date:'YYYY-MM-dd HH:mm:ss' }}</h4> | ||
</div> | ||
<div id="row"> | ||
<div class="col"> | ||
<h3>Logs:</h3> | ||
<pre class="limit" id="logs">{{ currentReport.logs }}</pre> | ||
</div> | ||
<div class="col"> | ||
<h3>Config file:</h3> | ||
<pre class="limit" id="config">{{ currentReport.config | json }}</pre> | ||
</div> | ||
</div> | ||
</div> | ||
<div id="page" *ngIf="!validReport && !loading"> | ||
<div id="text"> | ||
<h1>:(</h1> | ||
<h2>Error report not found.</h2> | ||
</div> | ||
</div> |
136 changes: 136 additions & 0 deletions
136
UI/src/app/_components/error-report/error-report.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
/* Based on https://codepen.io/xontab/pen/JrVaYR */ | ||
#page { | ||
height: 100%; | ||
margin: 0 auto; | ||
width: 80%; | ||
font-size: 1.9vw; | ||
font-family: Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif; | ||
color: #fefeff; | ||
} | ||
|
||
@media (min-width: 840px) { | ||
#page { | ||
font-size: 140%; | ||
width: 800px; | ||
} | ||
} | ||
|
||
#text { | ||
vertical-align: middle; | ||
} | ||
|
||
h1, | ||
h2, | ||
h3, | ||
h4, | ||
h5 { | ||
font-weight: normal; | ||
padding: 0; | ||
margin: 25px 0; | ||
margin-top: 0; | ||
font-weight: 300; | ||
} | ||
|
||
h1 { | ||
font-size: 6.5em; | ||
margin-bottom: 10px; | ||
} | ||
|
||
h2 { | ||
font-size: 1.5em; | ||
} | ||
|
||
h4 { | ||
font-size: 1.4em; | ||
line-height: 1.5em; | ||
} | ||
|
||
h5 { | ||
line-height: 1.1em; | ||
font-size: 1.3em; | ||
} | ||
|
||
.limit { | ||
overflow-x: scroll; | ||
width: 300px; | ||
} | ||
|
||
#row { | ||
display: flex; | ||
flex-direction: row; | ||
align-items: stretch; | ||
justify-content: space-between; | ||
height: 200px; | ||
} | ||
|
||
.col { | ||
padding: 1em; | ||
} | ||
|
||
.btn-custom { | ||
background-color: white; | ||
color: #007bff; | ||
border-color: #007bff; | ||
} | ||
|
||
.btn-custom:hover { | ||
color: #fff; | ||
background-color: #0062cc; | ||
border-color: #005cbf; | ||
} | ||
|
||
::-webkit-scrollbar { | ||
width: 8px; | ||
height: 8px; | ||
} | ||
|
||
::-webkit-scrollbar-button { | ||
width: 0px; | ||
height: 0px; | ||
} | ||
|
||
::-webkit-scrollbar-thumb { | ||
background: #e1e1e1; | ||
border: 0px none #ffffff; | ||
border-radius: 0px; | ||
} | ||
|
||
::-webkit-scrollbar-thumb:hover { | ||
background: #ffffff; | ||
} | ||
|
||
::-webkit-scrollbar-thumb:active { | ||
background: #ffffff; | ||
} | ||
|
||
::-webkit-scrollbar-track { | ||
background: #868686; | ||
border: 0px none #ffffff; | ||
border-radius: 0px; | ||
} | ||
|
||
::-webkit-scrollbar-track:hover { | ||
background: #868686; | ||
} | ||
|
||
::-webkit-scrollbar-track:active { | ||
background: #727272; | ||
} | ||
|
||
::-webkit-scrollbar-corner { | ||
background: transparent; | ||
} | ||
|
||
#backBtn { | ||
position: absolute; | ||
z-index: 99; | ||
border: none; | ||
outline: none; | ||
background-color: #fbfbfb; | ||
color: black; | ||
padding: 10px; | ||
border-radius: 5px; | ||
font-size: 18px; | ||
top: 10px; | ||
left: 10px; | ||
} |
69 changes: 69 additions & 0 deletions
69
UI/src/app/_components/error-report/error-report.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import { Component, OnInit, OnDestroy, AfterViewInit, Renderer2, ElementRef } from '@angular/core'; | ||
import { ActivatedRoute } from '@angular/router'; | ||
import { SocketService } from 'src/app/_services/socket.service'; | ||
import { ErrorReport } from 'src/app/_models/ErrorReport'; | ||
import { NavbarVisibilityService } from 'src/app/_services/navbar-visibility.service'; | ||
import { LocationBackService } from 'src/app/_services/locationBack.service'; | ||
|
||
@Component({ | ||
selector: 'app-error-report', | ||
templateUrl: './error-report.component.html', | ||
styleUrls: ['./error-report.component.scss'] | ||
}) | ||
export class ErrorReportComponent implements OnInit, OnDestroy, AfterViewInit { | ||
public currentReportId: string = "blank"; | ||
public currentReport: ErrorReport = {} as ErrorReport; | ||
public loading = true; | ||
public validReport = false; | ||
public bugReportUrl = ""; | ||
|
||
constructor( | ||
public route: ActivatedRoute, | ||
public socketService: SocketService, | ||
public navbarVisibilityService: NavbarVisibilityService, | ||
public locationBackService: LocationBackService, | ||
private renderer: Renderer2, | ||
private el: ElementRef | ||
) { | ||
navbarVisibilityService.hideNavbar(); | ||
this.route.params.subscribe((params) => { | ||
if (params.errorReportId) { | ||
this.currentReportId = params.errorReportId; | ||
} | ||
}); | ||
} | ||
|
||
ngAfterViewInit() { | ||
this.renderer.setStyle( | ||
this.el.nativeElement.ownerDocument.body, | ||
'background', | ||
'#3973aa' | ||
); | ||
} | ||
|
||
ngOnInit() { | ||
this.socketService.getErrorReportById(this.currentReportId) | ||
.then((errorReport) => { | ||
this.currentReport = errorReport as ErrorReport; | ||
this.loading = false; | ||
this.validReport = true; | ||
let bugTitle = "[Bug] "+this.currentReport.stacktrace.split("\n")[0]; | ||
this.bugReportUrl = `https://github.com/josephdadams/TallyArbiter/issues/new?labels=bug&template=bug.yaml&title=${encodeURIComponent(bugTitle)}&version=${this.socketService.version}&config=${encodeURIComponent(JSON.stringify(this.currentReport.config, null, 2))}&logs=${encodeURIComponent(this.currentReport.logs)}&stacktrace=${encodeURIComponent(this.currentReport.stacktrace)}`; | ||
console.log("Error report found:"); | ||
console.log(errorReport); | ||
}) | ||
.catch((response) => { | ||
this.loading = false; | ||
console.log("Error report not found"); | ||
}); | ||
} | ||
|
||
ngOnDestroy() { | ||
this.renderer.removeStyle( | ||
this.el.nativeElement.ownerDocument.body, | ||
'background' | ||
); | ||
this.navbarVisibilityService.showNavbar(); | ||
} | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
UI/src/app/_components/error-reports-list/error-reports-list.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<div class="d-flex justify-content-center mt-5 pt-5" *ngIf="!socketService.errorReports"> | ||
<div class="spinner spinner-border"></div> | ||
</div> | ||
<div *ngIf="socketService.errorReports"> | ||
<div class="container mt-5"> | ||
<div class="form-group" *ngIf="socketService.errorReports.length > 0"> | ||
<select class='form-control col-xs-6 col-md-3' (change)="selectErrorReport($event)"> | ||
<option disabled selected>-- Select an error report --</option> | ||
<option [value]="errorReport.id" *ngFor="let errorReport of socketService.errorReports">{{errorReport.datetime}}</option> | ||
</select> | ||
</div> | ||
</div> | ||
<h2 class="lead mt-5" *ngIf="socketService.errorReports.length == 0">Hurray! No error report detected.</h2> | ||
</div> |
Empty file.
26 changes: 26 additions & 0 deletions
26
UI/src/app/_components/error-reports-list/error-reports-list.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Component, OnInit, ViewEncapsulation } from '@angular/core'; | ||
import { Router } from '@angular/router'; | ||
import { SocketService } from 'src/app/_services/socket.service'; | ||
|
||
@Component({ | ||
selector: 'app-error-reports-list', | ||
templateUrl: './error-reports-list.component.html', | ||
styleUrls: ['./error-reports-list.component.scss'] | ||
}) | ||
export class ErrorReportsListComponent implements OnInit { | ||
constructor( | ||
private router: Router, | ||
public socketService: SocketService, | ||
) { | ||
console.log(this.socketService.errorReports); | ||
|
||
} | ||
|
||
public selectErrorReport(id: any) { | ||
this.router.navigate(["/", "errors", id.target.value]); | ||
} | ||
|
||
ngOnInit(): void { | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.