peter 5 роки тому
джерело
коміт
776c8c320b

+ 5
- 5
src/frontend/src/app/frontcraft/pages/character/character.component.html Переглянути файл

@@ -36,15 +36,15 @@ status="control">
36 36
         <br />
37 37
         <br />
38 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 41
             <wowhead [item]="item"></wowhead><br />
43 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 46
             <wowhead [item]="item"></wowhead><br />
48 47
         </ng-container>
48
+
49 49
     </nb-card-body>
50 50
 </nb-card>

+ 9
- 2
src/frontend/src/app/frontcraft/pages/character/character.component.ts Переглянути файл

@@ -48,8 +48,10 @@ export class FrontcraftCharacterComponent implements OnInit{
48 48
 
49 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 53
           fetch(this.dataLink).then(raw => raw.json().then((json) => {
52
-            if(json.length > 0) return
54
+            if(json.length < 1) return
53 55
             const data = json[0]
54 56
 
55 57
             this.boss2 = {
@@ -65,13 +67,18 @@ export class FrontcraftCharacterComponent implements OnInit{
65 67
           }))
66 68
 
67 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 73
             const data = json[1]
70 74
 
71 75
             this.boss1 = {
72 76
               name: data.encounterName,
73 77
               date: data.startTime
74 78
             }
79
+
80
+            
81
+
75 82
             this.gear2 = data.gear.map(item => {return <Item>{
76 83
               itemname: item.name,
77 84
               iconname: item.icon.replace('.jpg', ''),

Завантаження…
Відмінити
Зберегти