-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
112 additions
and
81 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export interface TotalGpWorld { | ||
imagesUrl: string; | ||
images: Image[]; | ||
} | ||
|
||
export interface Image { | ||
source: string; | ||
title: string; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,36 @@ | ||
import { HttpClient } from '@angular/common/http'; | ||
import { Component, OnInit } from '@angular/core'; | ||
import { Configuration } from '../../app.constants'; | ||
import { TotalGpWorld } from '../../domain/github/total-gp-world'; | ||
import { Observable } from 'rxjs'; | ||
import { map } from 'rxjs/operators'; | ||
|
||
@Component({ | ||
selector: 'info', | ||
templateUrl: './info.component.html', | ||
styleUrls: ['./info.component.scss'], | ||
}) | ||
export class InfoComponent implements OnInit { | ||
androidAppImages: any[]; | ||
androidAppImages: any[] = []; | ||
|
||
constructor(public config: Configuration) {} | ||
version: String; | ||
|
||
constructor(private http: HttpClient) {} | ||
|
||
ngOnInit() { | ||
const baseUrl = | ||
'https://raw.githubusercontent.com/wiki/fattazzo/total-gp-world/images/'; | ||
this.http | ||
.get<any>('./assets/version.json') | ||
.subscribe(data => (this.version = data['code'])); | ||
|
||
this.androidAppImages = []; | ||
this.androidAppImages.push({ | ||
source: `${baseUrl}sez_princ2.png`, | ||
title: 'Main window', | ||
}); | ||
this.androidAppImages.push({ | ||
source: `${baseUrl}drivers.png`, | ||
title: 'Drivers', | ||
}); | ||
this.androidAppImages.push({ | ||
source: `${baseUrl}driver_progress.png`, | ||
title: 'Driver progress', | ||
}); | ||
this.androidAppImages.push({ | ||
source: `${baseUrl}driver_ranking.png`, | ||
title: 'Driver ranking charts', | ||
}); | ||
this.androidAppImages.push({ | ||
source: `${baseUrl}driver_info.png`, | ||
title: 'Driver info', | ||
}); | ||
this.androidAppImages.push({ | ||
source: `${baseUrl}constructors.png`, | ||
title: 'Constructors', | ||
}); | ||
this.androidAppImages.push({ | ||
source: `${baseUrl}constructor_progress.png`, | ||
title: 'Constructor progress', | ||
}); | ||
this.androidAppImages.push({ | ||
source: `${baseUrl}constructor_info.png`, | ||
title: 'Constructor info', | ||
}); | ||
this.androidAppImages.push({ | ||
source: `${baseUrl}races.png`, | ||
title: 'Races', | ||
}); | ||
this.androidAppImages.push({ | ||
source: `${baseUrl}race_results.png`, | ||
title: 'Race results', | ||
}); | ||
this.androidAppImages.push({ | ||
source: `${baseUrl}race_stat_pittops.png`, | ||
title: 'Race pit stat', | ||
}); | ||
this.androidAppImages.push({ | ||
source: `${baseUrl}race_stat_positions.png`, | ||
title: 'Race positions stat', | ||
}); | ||
this.androidAppImages.push({ | ||
source: `${baseUrl}race_qualifications.png`, | ||
title: 'Race qualifications', | ||
}); | ||
this.androidAppImages.push({ | ||
source: `${baseUrl}race_info.png`, | ||
title: 'Race info', | ||
}); | ||
this.androidAppImages.push({ | ||
source: `${baseUrl}news.png`, | ||
title: 'News', | ||
}); | ||
this.androidAppImages.push({ | ||
source: `${baseUrl}stats_drivers_wins.png`, | ||
title: 'Drivers stats', | ||
}); | ||
this.androidAppImages.push({ | ||
source: `${baseUrl}stats_constructors_wins.png`, | ||
title: 'Constructors stats', | ||
}); | ||
this.androidAppImages.push({ | ||
source: `${baseUrl}stats_season_comparison.png`, | ||
title: 'Season stats', | ||
}); | ||
this.http | ||
.get<TotalGpWorld>('./assets/github/total-gp-world/config.json') | ||
.subscribe(config => { | ||
const baseUrl = config.imagesUrl; | ||
this.androidAppImages = config.images.map(img => { | ||
return { | ||
source: baseUrl + img.source, | ||
title: img.title, | ||
}; | ||
}); | ||
}); | ||
} | ||
} |
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,77 @@ | ||
{ | ||
"imagesUrl": "https://raw.githubusercontent.com/wiki/fattazzo/total-gp-world/images/", | ||
"images": [ | ||
{ | ||
"source": "sez_princ2.png", | ||
"title": "Main window" | ||
}, | ||
{ | ||
"source": "drivers.png", | ||
"title": "Drivers" | ||
}, | ||
{ | ||
"source": "driver_progress.png", | ||
"title": "Driver progress" | ||
}, | ||
{ | ||
"source": "driver_ranking.png", | ||
"title": "Driver ranking charts" | ||
}, | ||
{ | ||
"source": "driver_info.png", | ||
"title": "Driver info" | ||
}, | ||
{ | ||
"source": "constructors.png", | ||
"title": "Constructors" | ||
}, | ||
{ | ||
"source": "constructor_progress.png", | ||
"title": "Constructor progress" | ||
}, | ||
{ | ||
"source": "constructor_info.png", | ||
"title": "Constructor info" | ||
}, | ||
{ | ||
"source": "races.png", | ||
"title": "Races" | ||
}, | ||
{ | ||
"source": "race_results.png", | ||
"title": "Race results" | ||
}, | ||
{ | ||
"source": "race_stat_pittops.png", | ||
"title": "Race pit stat" | ||
}, | ||
{ | ||
"source": "race_stat_positions.png", | ||
"title": "Race positions stat" | ||
}, | ||
{ | ||
"source": "race_qualifications.png", | ||
"title": "Race qualifications" | ||
}, | ||
{ | ||
"source": "race_info.png", | ||
"title": "Race info" | ||
}, | ||
{ | ||
"source": "news.png", | ||
"title": "News" | ||
}, | ||
{ | ||
"source": "stats_drivers_wins.png", | ||
"title": "Drivers stats" | ||
}, | ||
{ | ||
"source": "stats_constructors_wins.png", | ||
"title": "Constructors stats" | ||
}, | ||
{ | ||
"source": "stats_season_comparison.png", | ||
"title": "Season stats" | ||
} | ||
] | ||
} |
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,3 @@ | ||
{ | ||
"code": "1.0" | ||
} |