File tree Expand file tree Collapse file tree 3 files changed +48
-2
lines changed Expand file tree Collapse file tree 3 files changed +48
-2
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ class ConfigContent extends React.Component {
4747 < section className = "content" >
4848 < div className = "box" >
4949 < div className = "box-header" >
50- < h3 className = "box-title" > Manage Server Configuration</ h3 >
50+ < h3 className = "box-title" > Game Configuration</ h3 >
5151 </ div >
5252
5353 < div className = "box-body" >
Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+
3+ class ModPacks extends React . Component {
4+ constructor ( props ) {
5+ super ( props )
6+ }
7+
8+ render ( ) {
9+ return (
10+ < div className = "box" >
11+ < div className = "box-header" >
12+ < h3 className = "box-title" > Mod Packs</ h3 >
13+ </ div >
14+
15+ < div className = "box-body" >
16+ < p > itest</ p >
17+ </ div >
18+ </ div >
19+ )
20+ }
21+
22+ }
23+
24+ export default ModPacks
Original file line number Diff line number Diff line change @@ -2,22 +2,26 @@ import React from 'react';
22import { IndexLink } from 'react-router' ;
33import ModList from './Mods/ListMods.jsx' ;
44import InstalledMods from './Mods/InstalledMods.jsx' ;
5+ import ModPacks from './Mods/ModPacks.jsx'
56
67class ModsContent extends React . Component {
78 constructor ( props ) {
89 super ( props ) ;
910 this . componentDidMount = this . componentDidMount . bind ( this ) ;
1011 this . toggleMod = this . toggleMod . bind ( this ) ;
1112 this . loadInstalledModList = this . loadInstalledModList . bind ( this ) ;
13+ this . loadModPackList = this . loadModPackList . bind ( this ) ;
1214 this . state = {
1315 installedMods : [ ] ,
14- listMods : [ ]
16+ listMods : [ ] ,
17+ modPacks : [ ] ,
1518 } ;
1619 }
1720
1821 componentDidMount ( ) {
1922 this . loadModList ( ) ;
2023 this . loadInstalledModList ( ) ;
24+ this . loadModPackList ( ) ;
2125 }
2226
2327 loadModList ( ) {
@@ -51,6 +55,21 @@ class ModsContent extends React.Component {
5155 } ) ;
5256 }
5357
58+ loadModPackList ( ) {
59+ $ . ajax ( {
60+ url : "/api/mods/packs/list" ,
61+ dataType : "json" ,
62+ success : ( resp ) => {
63+ if ( resp . success === true ) {
64+ this . setState ( { modPacks : resp . data } )
65+ console . log ( this . state )
66+ } else {
67+ this . setState ( { modPacks : [ ] } )
68+ }
69+ }
70+ } )
71+ }
72+
5473 toggleMod ( modName ) {
5574 $ . ajax ( {
5675 url : "/api/mods/toggle/" + modName ,
@@ -88,6 +107,9 @@ class ModsContent extends React.Component {
88107 { ...this . state }
89108 toggleMod = { this . toggleMod }
90109 />
110+ < ModPacks
111+
112+ />
91113
92114 </ section >
93115 </ div >
You can’t perform that action at this time.
0 commit comments