some bug fixes, some optimizations

This commit is contained in:
simon987
2019-02-11 20:10:33 -05:00
parent 51eb9ae6da
commit 4edf354f8d
13 changed files with 141 additions and 61 deletions

View File

@@ -4,35 +4,31 @@
<mat-card-subtitle>{{"project.create_subtitle" | translate}}</mat-card-subtitle>
<mat-card-content>
<form (ngSubmit)="onSubmit()">
<mat-form-field appearance="outline">
<mat-label>{{"project.name" | translate}}</mat-label>
<input type="text" matInput [(ngModel)]="project.name" name="name" [placeholder]="'project.name' | translate">
<input type="text" matInput [(ngModel)]="project.name" [placeholder]="'project.name' | translate">
</mat-form-field>
<mat-form-field appearance="outline">
<mat-label>{{ "project.clone_url" | translate}}</mat-label>
<input type="text" matInput [(ngModel)]="project.clone_url" name="clone_url"
[placeholder]="'project.clone_url_placeholder' | translate">
<input type="text" matInput [(ngModel)]="project.clone_url"
[placeholder]="'project.clone_url_placeholder' | translate">
</mat-form-field>
<mat-form-field appearance="outline">
<mat-label>{{ "project.git_repo" | translate }}</mat-label>
<input type="text" matInput [(ngModel)]="project.git_repo" name="git_repo"
[placeholder]="'project.git_repo_placeholder' | translate">
<input type="text" matInput [(ngModel)]="project.git_repo"
[placeholder]="'project.git_repo_placeholder' | translate">
<mat-hint align="start">
{{"project.git_repo_hint" | translate}}
</mat-hint>
</mat-form-field>
<mat-checkbox matInput [(ngModel)]="project.public" name="public" style="padding-top: 1em">
<mat-checkbox matInput [(ngModel)]="project.public" style="padding-top: 1em">
{{"project.public" | translate}}</mat-checkbox>
<input type="hidden" name="version" value="{{project.version}}">
</form>
</mat-card-content>
<mat-card-actions>
<button mat-raised-button color="primary" type="submit">{{'project.create' | translate}}</button>
<button mat-raised-button color="primary" (click)="onSubmit()">{{'project.create' | translate}}</button>
</mat-card-actions>
</mat-card>
</div>

View File

@@ -71,7 +71,7 @@ export class ProjectDashboardComponent implements OnInit {
}
this.noTasks = false;
this.timeline.data.labels = this.snapshots.map(s => s.time_stamp as any);
this.timeline.data.labels = this.snapshots.map(s => s.time_stamp * 1000 as any);
this.timeline.data.datasets = this.makeTimelineDataset(this.snapshots);
this.timeline.update();
this.statusPie.data.datasets = [
@@ -164,7 +164,7 @@ export class ProjectDashboardComponent implements OnInit {
this.timeline = new Chart(ctx, {
type: "bar",
data: {
labels: this.snapshots.map(s => s.time_stamp as any),
labels: this.snapshots.map(s => s.time_stamp * 1000 as any),
datasets: this.makeTimelineDataset(this.snapshots),
},
options: {
@@ -198,11 +198,16 @@ export class ProjectDashboardComponent implements OnInit {
private setupStatusPie() {
if (this.lastSnapshot == null || (this.lastSnapshot.awaiting_verification_count == 0 &&
if (this.lastSnapshot == undefined || (this.lastSnapshot.awaiting_verification_count == 0 &&
this.lastSnapshot.closed_task_count == 0 &&
this.lastSnapshot.new_task_count == 0 &&
this.lastSnapshot.failed_task_count == 0)) {
this.noTasks = true;
this.lastSnapshot = {
closed_task_count: 0, time_stamp: 0, failed_task_count: 0,
new_task_count: 0, awaiting_verification_count: 0
}
}
let elem = document.getElementById("status-pie") as any;