|
|
@@ -1,7 +1,7 @@
|
|
1
|
1
|
import { Component, OnInit, Input } from '@angular/core';
|
|
2
|
2
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
3
|
3
|
import { ApiService as ApiService } from '../../services/login-api';
|
|
4
|
|
-import { Spec, User, Character } from '../../../../../../backend/Types/Types';
|
|
|
4
|
+import { Spec, User, Character, Item } from '../../../../../../backend/Types/Types';
|
|
5
|
5
|
import { getClassColor } from '../../../../../../backend/Types/PlayerSpecs';
|
|
6
|
6
|
import { _Tiers } from '../../../../../../backend/Types/Items';
|
|
7
|
7
|
|
|
|
@@ -20,6 +20,12 @@ export class FrontcraftCharacterComponent implements OnInit{
|
|
20
|
20
|
} as any
|
|
21
|
21
|
color : string
|
|
22
|
22
|
tokens
|
|
|
23
|
+ dataLink = ""
|
|
|
24
|
+ boss1 = {}
|
|
|
25
|
+ gear1:string[] = []
|
|
|
26
|
+
|
|
|
27
|
+ boss2= {}
|
|
|
28
|
+ gear2:string[] = []
|
|
23
|
29
|
|
|
24
|
30
|
constructor(
|
|
25
|
31
|
private api: ApiService,
|
|
|
@@ -39,6 +45,41 @@ export class FrontcraftCharacterComponent implements OnInit{
|
|
39
|
45
|
this.api.get('ItemManager').getTokens(this.char, _Tiers, true).then(tokens => {
|
|
40
|
46
|
this.tokens = tokens
|
|
41
|
47
|
})
|
|
|
48
|
+
|
|
|
49
|
+ this.dataLink = 'https://classic.warcraftlogs.com/v1/rankings/character/'+this.char.charactername.replace(/^\w/, c => c.toUpperCase())+'/Gandling/EU?metric=dps&api_key=c698515ab4f592cdb848d80b3abe616c'
|
|
|
50
|
+
|
|
|
51
|
+
|
|
|
52
|
+ fetch(this.dataLink).then(raw => raw.json().then((json) => {
|
|
|
53
|
+ if(json.length-1 < 0) return
|
|
|
54
|
+ const data = json[json.length-1]
|
|
|
55
|
+
|
|
|
56
|
+ this.boss2 = {
|
|
|
57
|
+ name: data.encounterName,
|
|
|
58
|
+ date: data.startTime
|
|
|
59
|
+ }
|
|
|
60
|
+ this.gear1 = data.gear.map(item => {return <Item>{
|
|
|
61
|
+ itemname: item.name,
|
|
|
62
|
+ iconname: item.icon.replace('.jpg', ''),
|
|
|
63
|
+ quality: item.quality.replace(/^\w/, c => c.toUpperCase()),
|
|
|
64
|
+ url: "https://classic.wowhead.com/item="+item.id
|
|
|
65
|
+ }})
|
|
|
66
|
+ }))
|
|
|
67
|
+
|
|
|
68
|
+ fetch(this.dataLink).then(raw => raw.json().then((json) => {
|
|
|
69
|
+ if(json.length-2 < 0) return
|
|
|
70
|
+ const data = json[json.length-2]
|
|
|
71
|
+
|
|
|
72
|
+ this.boss1 = {
|
|
|
73
|
+ name: data.encounterName,
|
|
|
74
|
+ date: data.startTime
|
|
|
75
|
+ }
|
|
|
76
|
+ this.gear2 = data.gear.map(item => {return <Item>{
|
|
|
77
|
+ itemname: item.name,
|
|
|
78
|
+ iconname: item.icon.replace('.jpg', ''),
|
|
|
79
|
+ quality: item.quality.replace(/^\w/, c => c.toUpperCase()),
|
|
|
80
|
+ url: "https://classic.wowhead.com/item="+item.id
|
|
|
81
|
+ }})
|
|
|
82
|
+ }))
|
|
42
|
83
|
}
|
|
43
|
84
|
})
|
|
44
|
85
|
}
|