peter 5 lat temu
rodzic
commit
070d3d254b

+ 5
- 0
src/frontend/src/app/@theme/components/header/header.component.html Wyświetl plik

@@ -1,4 +1,9 @@
1 1
 <div class="header-container">
2
+  <div>
3
+    <a (click)="toggleSidebar()" href="#" class="sidebar-toggle">
4
+      <nb-icon icon="menu-2-outline"></nb-icon>
5
+    </a>
6
+  </div>
2 7
   <div class="logo-container">
3 8
     <a (click)="toggleSidebar()" href="#" class="sidebar-toggle">
4 9
       <nb-icon icon="menu-2-outline"></nb-icon>

+ 32
- 0
src/frontend/src/app/frontcraft/pages/armory/armory.component.html Wyświetl plik

@@ -0,0 +1,32 @@
1
+<nb-card 
2
+class = "col-12 col-xl-9"
3
+status="control">
4
+    <nb-card-header style="text-transform: capitalize;">
5
+        <h4>
6
+            Armory
7
+        </h4>
8
+    </nb-card-header>
9
+
10
+    <nb-card-body>
11
+        <div>
12
+            <input name="Character" [(ngModel)]="charactername"  placeholder="Character Name" nbInput>
13
+            <nb-select [(selected)]="server" placeholder="Spec">
14
+                <nb-option *ngFor="let sv of servers" [value]="sv">{{sv}}</nb-option>
15
+            </nb-select>
16
+            <button nbButton
17
+              (click)="submit()"
18
+              status="primary"
19
+              size="medium"
20
+              [disabled]="charactername == ''"
21
+              [class.btn-pulse]="submitted">
22
+                Go
23
+            </button>
24
+        </div>
25
+        
26
+        <div>
27
+            <ng-container *ngFor="let item of gear">
28
+                <wowhead [item]="item"></wowhead><br />
29
+            </ng-container>
30
+        </div>
31
+    </nb-card-body>
32
+</nb-card>

+ 82
- 0
src/frontend/src/app/frontcraft/pages/armory/armory.component.ts Wyświetl plik

@@ -0,0 +1,82 @@
1
+import { Component, OnInit } from '@angular/core';
2
+import { Item } from '../../../../../../backend/Types/Types';
3
+
4
+@Component({
5
+  selector: 'armory',
6
+  templateUrl: './armory.component.html',
7
+})
8
+export class FrontcraftArmoryComponent implements OnInit{
9
+
10
+  servers = servers
11
+  charactername = ""
12
+  server = "Gandling"
13
+  region = "EU"
14
+  gear:string[] = []
15
+
16
+  constructor(
17
+  ){}
18
+
19
+  async submit(){
20
+    const dataLink = "https://classic.warcraftlogs.com:443/v1/parses/character/"+this.charactername.toLowerCase().replace(/^\w/, c => c.toUpperCase())+"/"+this.server+"/"+this.region+"?api_key=c698515ab4f592cdb848d80b3abe616c&metric=dps"
21
+
22
+    fetch(dataLink).then(raw => raw.json().then((json:any[]) => {
23
+      if(json.length < 1) return
24
+      let min = -1
25
+      let data = null
26
+
27
+      json.forEach(item => {
28
+        if(item.startTime > min){
29
+          min = item.startTime
30
+          data = item
31
+        }
32
+      })
33
+
34
+      this.gear = data.gear.map(item => {return <Item>{
35
+        itemname: item.name,
36
+        iconname: item.icon.replace('.jpg', ''),
37
+        quality: item.quality.replace(/^\w/, c => c.toUpperCase()),
38
+        url: "https://classic.wowhead.com/item="+item.id
39
+      }})
40
+    }))
41
+  }
42
+
43
+  async ngOnInit(){
44
+
45
+  }
46
+}
47
+
48
+const servers = [
49
+  "Ashbringer"
50
+  ,"Bloodfang"
51
+  ,"Dreadmist"
52
+  ,"Firemaw"
53
+  ,"Flamelash"
54
+  ,"Gandling"
55
+  ,"Gehennas"
56
+  ,"Golemagg"
57
+  ,"Hydraxian Waterlords"
58
+  ,"Judgement"
59
+  ,"Mirage Rach"
60
+  ,"Mograine"
61
+  ,"Nethergarde"
62
+  ,"Noggenfogg"
63
+  ,"Pyrewood Village"
64
+  ,"Razorgore"
65
+  ,"Shazzrah"
66
+  ,"Skullflame"
67
+  ,"Stonespine"
68
+  ,"Ten Storms"
69
+  ,"Zandalar Tribe"
70
+  ,"Amnennar"
71
+  ,"Auberdine"
72
+  ,"Finkle"
73
+  ,"Sulfuron"
74
+  ,"Everlook"
75
+  ,"Lucifron"
76
+  ,"Razorfen"
77
+  ,"Patchwerk"
78
+  ,"Venoxis"
79
+  ,"Dragon’s Call"
80
+  ,"Lakeshire"
81
+  ,"Transcendence"
82
+]

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

@@ -58,7 +58,7 @@ export class FrontcraftCharacterComponent implements OnInit{
58 58
               name: data.encounterName,
59 59
               date: data.startTime
60 60
             }
61
-            this.gear1 = data.gear.map(item => {return <Item>{
61
+            this.gear2 = data.gear.map(item => {return <Item>{
62 62
               itemname: item.name,
63 63
               iconname: item.icon.replace('.jpg', ''),
64 64
               quality: item.quality.replace(/^\w/, c => c.toUpperCase()),
@@ -77,9 +77,7 @@ export class FrontcraftCharacterComponent implements OnInit{
77 77
               date: data.startTime
78 78
             }
79 79
 
80
-            
81
-
82
-            this.gear2 = data.gear.map(item => {return <Item>{
80
+            this.gear1 = data.gear.map(item => {return <Item>{
83 81
               itemname: item.name,
84 82
               iconname: item.icon.replace('.jpg', ''),
85 83
               quality: item.quality.replace(/^\w/, c => c.toUpperCase()),

+ 4
- 0
src/frontend/src/app/frontcraft/pages/pages-layout.component.ts Wyświetl plik

@@ -26,6 +26,10 @@ export class PagesLayoutComponent implements AfterContentInit{
26 26
     icon: 'book-open-outline',
27 27
     title: 'Loot Rules',
28 28
     link: '/frontcraft/rules',
29
+  },{
30
+  icon: "shield",
31
+  title: 'Armory',
32
+  link: '/frontcraft/armory'
29 33
   }]
30 34
   
31 35
   constructor(

+ 5
- 0
src/frontend/src/app/frontcraft/pages/pages-routing.module.ts Wyświetl plik

@@ -9,6 +9,7 @@ import { FrontcraftArchiveComponent } from './raid/archive.component';
9 9
 import { FrontcraftShopComponent } from './shop/shop.component';
10 10
 import { FrontcraftRulesComponent } from './rules/rules.component';
11 11
 import { FrontcraftCharactersComponent } from './characters/characters.component';
12
+import { FrontcraftArmoryComponent } from './armory/armory.component';
12 13
 
13 14
 export const routes: Routes = [
14 15
     {
@@ -43,6 +44,10 @@ export const routes: Routes = [
43 44
                 path: 'rules',
44 45
                 component: FrontcraftRulesComponent
45 46
             },
47
+            {
48
+                path: 'armory',
49
+                component: FrontcraftArmoryComponent
50
+            },
46 51
             {
47 52
                 path: '**',
48 53
                 redirectTo: 'raids'

+ 3
- 1
src/frontend/src/app/frontcraft/pages/pages.module.ts Wyświetl plik

@@ -40,6 +40,7 @@ import { FrontcraftCharactersComponent } from './characters/characters.component
40 40
 import { FrontcraftBuyTokenComponent } from './shop/buytoken.component';
41 41
 import { FrontcraftItemComponent } from './shop/item.component';
42 42
 import { FrontcraftWowheadComponent } from './shop/wowhead.component';
43
+import { FrontcraftArmoryComponent } from './armory/armory.component';
43 44
 
44 45
 
45 46
 @NgModule({
@@ -84,7 +85,8 @@ import { FrontcraftWowheadComponent } from './shop/wowhead.component';
84 85
     FrontcraftCreateRaidsComponent,
85 86
     FrontcraftBuyTokenComponent,
86 87
     FrontcraftWowheadComponent,
87
-    FrontcraftItemComponent
88
+    FrontcraftItemComponent,
89
+    FrontcraftArmoryComponent
88 90
   ],
89 91
   entryComponents: [
90 92
     FrontcraftItemSelectComponent,

Ładowanie…
Anuluj
Zapisz