11import React from 'react' ;
22import { IndexLink } from 'react-router' ;
33import Settings from './Config/Settings.jsx' ;
4+ import ServerSettings from './Config/ServerSettings.jsx' ;
45
56class ConfigContent extends React . Component {
67 constructor ( props ) {
@@ -16,6 +17,7 @@ class ConfigContent extends React.Component {
1617 componentDidMount ( ) {
1718 this . getConfig ( ) ;
1819 this . getServerSettings ( ) ;
20+ console . log ( this . state . serverSettings ) ;
1921 }
2022
2123 getConfig ( ) {
@@ -41,6 +43,7 @@ class ConfigContent extends React.Component {
4143 if ( resp . success === true ) {
4244 this . setState ( { serverSettings : resp . data } )
4345 }
46+ console . log ( this . state . serverSettings ) ;
4447 } ,
4548 error : ( xhr , status , err ) => {
4649 console . log ( '/api/settings/get' , status , err . toString ( ) ) ;
@@ -61,6 +64,45 @@ class ConfigContent extends React.Component {
6164 < li className = "active" > Here</ li >
6265 </ ol >
6366 </ section >
67+
68+ < section className = "content" >
69+ < div className = "box" >
70+ < div className = "box-header" >
71+ < h3 className = "box-title" > Server Settings</ h3 >
72+ </ div >
73+
74+ < div className = "box-body" >
75+ < div className = "row" >
76+ < div className = "col-md-6" >
77+ < div className = "server-settings-section" >
78+ < div className = "table-responsive" >
79+ < table >
80+ < thead >
81+ < tr >
82+ < th > Setting name</ th >
83+ < th > Setting value</ th >
84+ </ tr >
85+ </ thead >
86+ < tbody >
87+ { Object . keys ( this . state . serverSettings ) . map ( function ( key ) {
88+ var setting = this . state . serverSettings [ key ]
89+ console . log ( setting )
90+ return (
91+ < ServerSettings
92+ name = { key }
93+ setting = { setting }
94+ />
95+ )
96+ } , this ) }
97+ </ tbody >
98+ </ table >
99+ </ div >
100+ </ div >
101+ </ div >
102+ </ div >
103+ </ div >
104+ </ div >
105+ </ section >
64106
65107 < section className = "content" >
66108 < div className = "box" >
@@ -70,7 +112,7 @@ class ConfigContent extends React.Component {
70112
71113 < div className = "box-body" >
72114 < div className = "row" >
73- < div className = "col-md-4 " >
115+ < div className = "col-md-6 " >
74116 { Object . keys ( this . state . config ) . map ( function ( key ) {
75117 var conf = this . state . config [ key ]
76118 return (
@@ -99,29 +141,6 @@ class ConfigContent extends React.Component {
99141 </ div >
100142 </ section >
101143
102- < section className = "content" >
103- < div className = "box" >
104- < div className = "box-header" >
105- < h3 className = "box-title" > Server Settings</ h3 >
106- </ div >
107-
108- < div className = "box-body" >
109- < div className = "row" >
110- < div className = "col-md-4" >
111- { Object . keys ( this . state . serverSettings ) . map ( function ( key ) {
112- var value = this . state . serverSettings [ key ]
113- return (
114- < div className = "settings-section" key = { key } >
115- < h3 > { key } </ h3 >
116- < p > { value } </ p >
117- </ div >
118- )
119- } , this ) }
120- </ div >
121- </ div >
122- </ div >
123- </ div >
124- </ section >
125144
126145 </ div >
127146 )
0 commit comments