frontend work
This commit is contained in:
@@ -36,15 +36,15 @@ status="control">
|
||||
<br />
|
||||
<br />
|
||||
<h3>Gear of the last two reported kills <a target="_blank" *ngIf="dataLink != null && dataLink != ''" style="size: 0.5em;" [href]="dataLink">(data)</a></h3>
|
||||
|
||||
<h5>{{boss2.name}} {{boss2.date | date : 'MMM d @ HH : mm'}}</h5>
|
||||
<ng-container *ngFor="let item of gear2">
|
||||
<wowhead [item]="item"></wowhead><br />
|
||||
</ng-container>
|
||||
|
||||
<h5>{{boss1.name}} {{boss1.date | date : 'MMM d @ HH : mm'}}</h5>
|
||||
<ng-container *ngFor="let item of gear1">
|
||||
<wowhead [item]="item"></wowhead><br />
|
||||
</ng-container>
|
||||
|
||||
<h5>{{boss2.name}} {{boss2.date | date : 'MMM d @ HH : mm'}}</h5>
|
||||
<ng-container *ngFor="let item of gear2">
|
||||
<wowhead [item]="item"></wowhead><br />
|
||||
</ng-container>
|
||||
</nb-card-body>
|
||||
</nb-card>
|
||||
|
||||
@@ -48,8 +48,10 @@ export class FrontcraftCharacterComponent implements OnInit{
|
||||
|
||||
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"
|
||||
|
||||
|
||||
|
||||
fetch(this.dataLink).then(raw => raw.json().then((json) => {
|
||||
if(json.length > 0) return
|
||||
if(json.length < 1) return
|
||||
const data = json[0]
|
||||
|
||||
this.boss2 = {
|
||||
@@ -65,13 +67,18 @@ export class FrontcraftCharacterComponent implements OnInit{
|
||||
}))
|
||||
|
||||
fetch(this.dataLink).then(raw => raw.json().then((json) => {
|
||||
if(json.length > 1) return
|
||||
if(json.length < 2) return
|
||||
console.log(json);
|
||||
|
||||
const data = json[1]
|
||||
|
||||
this.boss1 = {
|
||||
name: data.encounterName,
|
||||
date: data.startTime
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.gear2 = data.gear.map(item => {return <Item>{
|
||||
itemname: item.name,
|
||||
iconname: item.icon.replace('.jpg', ''),
|
||||
|
||||
Reference in New Issue
Block a user