Ver código fonte

frontend work

master
peter 5 anos atrás
pai
commit
776c8c320b

+ 5
- 5
src/frontend/src/app/frontcraft/pages/character/character.component.html Ver arquivo

36
         <br />
36
         <br />
37
         <br />
37
         <br />
38
         <h3>Gear of the last two reported kills <a target="_blank" *ngIf="dataLink != null && dataLink != ''" style="size: 0.5em;" [href]="dataLink">(data)</a></h3>
38
         <h3>Gear of the last two reported kills <a target="_blank" *ngIf="dataLink != null && dataLink != ''" style="size: 0.5em;" [href]="dataLink">(data)</a></h3>
39
-        
40
-        <h5>{{boss1.name}} {{boss1.date | date : 'MMM d @ HH : mm'}}</h5>
41
-        <ng-container *ngFor="let item of gear1">
39
+        <h5>{{boss2.name}} {{boss2.date | date : 'MMM d @ HH : mm'}}</h5>
40
+        <ng-container *ngFor="let item of gear2">
42
             <wowhead [item]="item"></wowhead><br />
41
             <wowhead [item]="item"></wowhead><br />
43
         </ng-container>
42
         </ng-container>
44
 
43
 
45
-        <h5>{{boss2.name}} {{boss2.date | date : 'MMM d @ HH : mm'}}</h5>
46
-        <ng-container *ngFor="let item of gear2">
44
+        <h5>{{boss1.name}} {{boss1.date | date : 'MMM d @ HH : mm'}}</h5>
45
+        <ng-container *ngFor="let item of gear1">
47
             <wowhead [item]="item"></wowhead><br />
46
             <wowhead [item]="item"></wowhead><br />
48
         </ng-container>
47
         </ng-container>
48
+
49
     </nb-card-body>
49
     </nb-card-body>
50
 </nb-card>
50
 </nb-card>

+ 9
- 2
src/frontend/src/app/frontcraft/pages/character/character.component.ts Ver arquivo

48
 
48
 
49
           this.dataLink = "https://classic.warcraftlogs.com:443/v1/parses/character/"+this.char.charactername.replace(/^\w/, c => c.toUpperCase())+"/Gandling/EU?api_key=c698515ab4f592cdb848d80b3abe616c&metric=dps"
49
           this.dataLink = "https://classic.warcraftlogs.com:443/v1/parses/character/"+this.char.charactername.replace(/^\w/, c => c.toUpperCase())+"/Gandling/EU?api_key=c698515ab4f592cdb848d80b3abe616c&metric=dps"
50
 
50
 
51
+          
52
+
51
           fetch(this.dataLink).then(raw => raw.json().then((json) => {
53
           fetch(this.dataLink).then(raw => raw.json().then((json) => {
52
-            if(json.length > 0) return
54
+            if(json.length < 1) return
53
             const data = json[0]
55
             const data = json[0]
54
 
56
 
55
             this.boss2 = {
57
             this.boss2 = {
65
           }))
67
           }))
66
 
68
 
67
           fetch(this.dataLink).then(raw => raw.json().then((json) => {
69
           fetch(this.dataLink).then(raw => raw.json().then((json) => {
68
-            if(json.length > 1) return
70
+            if(json.length < 2) return
71
+            console.log(json);
72
+
69
             const data = json[1]
73
             const data = json[1]
70
 
74
 
71
             this.boss1 = {
75
             this.boss1 = {
72
               name: data.encounterName,
76
               name: data.encounterName,
73
               date: data.startTime
77
               date: data.startTime
74
             }
78
             }
79
+
80
+            
81
+
75
             this.gear2 = data.gear.map(item => {return <Item>{
82
             this.gear2 = data.gear.map(item => {return <Item>{
76
               itemname: item.name,
83
               itemname: item.name,
77
               iconname: item.icon.replace('.jpg', ''),
84
               iconname: item.icon.replace('.jpg', ''),

Carregando…
Cancelar
Salvar