Przeglądaj źródła

frontend work

master
peter 5 lat temu
rodzic
commit
fa165167d9

+ 1
- 0
src/backend/Types/Items.ts Wyświetl plik

@@ -104,6 +104,7 @@ export const T2:string[] = [
104 104
 "Chromatic Boots",
105 105
 "Taut Dragonhide Gloves",
106 106
 "Shimmering Geta",
107
+"Ring of Blackrock",
107 108
 "Elementium Threaded Cloak",
108 109
 "Angelista's Grasp",
109 110
 "Girdle of the Fallen Crusader",

+ 21
- 2
src/frontend/src/app/frontcraft/pages/character/character.component.html Wyświetl plik

@@ -22,10 +22,29 @@ status="control">
22 22
         <span *ngIf="link === 'owner'">
23 23
             Owned by <a [routerLink]="'/frontcraft/user/'+char.username"> {{char.username}} ({{char.rank}})</a>
24 24
         </span>
25
-        <br/><br />
25
+        <br/>
26
+        <br />
27
+        <br />
28
+
29
+        <h3>Tokens</h3>
26 30
         <span *ngFor="let token of tokens">
27 31
             [ {{token.level}} ]
28
-            <wowhead [item]="token"></wowhead>
32
+            <wowhead [item]="token"></wowhead><br />
29 33
         </span>
34
+
35
+        <br />
36
+        <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>
39
+        
40
+        <h5>{{boss1.name}} {{boss1.date | date : 'MMM d @ HH : mm'}}</h5>
41
+        <ng-container *ngFor="let item of gear1">
42
+            <wowhead [item]="item"></wowhead><br />
43
+        </ng-container>
44
+
45
+        <h5>{{boss2.name}} {{boss2.date | date : 'MMM d @ HH : mm'}}</h5>
46
+        <ng-container *ngFor="let item of gear2">
47
+            <wowhead [item]="item"></wowhead><br />
48
+        </ng-container>
30 49
     </nb-card-body>
31 50
 </nb-card>

+ 42
- 1
src/frontend/src/app/frontcraft/pages/character/character.component.ts Wyświetl plik

@@ -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
     }

+ 3
- 3
src/frontend/src/app/frontcraft/pages/raid/raid.component.ts Wyświetl plik

@@ -147,12 +147,12 @@ export class FrontcraftRaidComponent implements OnInit, OnDestroy{
147 147
       this.toast.show('Signup', 'Success', { status: 'success' })
148 148
     }
149 149
 
150
-    adminUnsign = async() => {
150
+    adminUnsign = async(character:Character) => {
151 151
       const manage =  this.api.get('manageRaid')
152 152
       if(!manage) return
153 153
       await manage.adminUnsign({
154
-        ...this.mySignup,
155
-        id: this.mySignup.characterid, 
154
+        ...character,
155
+        id: character['characterid']
156 156
       }, this.raid)
157 157
     }
158 158
 

+ 6
- 1
src/frontend/src/app/frontcraft/pages/shop/item.component.ts Wyświetl plik

@@ -9,7 +9,12 @@ import { _Tiers, allItems, Tiers } from '../../../../../../backend/Types/Items';
9 9
 @Component({
10 10
     selector: 'item',
11 11
     template: `
12
-        <span [ngStyle]="{'color':item.quality=='Epic'?'#a335ee':'#ff8000'}">
12
+        <span [ngStyle]="{'color':item.quality=='Poor'?'#9d9d9d':
13
+                                  item.quality=='Common'?'#FFFFFF':
14
+                                  item.quality=='Uncommon'?'#1eff00':
15
+                                  item.quality=='Rare'?'#0070dd':
16
+                                  item.quality=='Epic'?'#a335ee':
17
+                                  '#ff8000'}">
13 18
             <img style="min-width: 20px; width: 2.25vw; max-width: 35px" 
14 19
             [src]="'https://wow.zamimg.com/images/wow/icons/large/'+item.iconname+'.jpg'" />
15 20
             &nbsp;

Ładowanie…
Anuluj
Zapisz