Skip to content

Commit 3468c1a

Browse files
committed
Use the Game Configuration view to display the server settings for a quick first-pass.
1 parent ffad306 commit 3468c1a

File tree

1 file changed

+44
-1
lines changed

1 file changed

+44
-1
lines changed

ui/App/components/ConfigContent.jsx

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@ class ConfigContent extends React.Component {
66
constructor(props) {
77
super(props);
88
this.getConfig = this.getConfig.bind(this);
9+
this.getServerSettings = this.getServerSettings.bind(this);
910
this.state = {
10-
config: {}
11+
config: {},
12+
serverSettings: {}
1113
}
1214
}
1315

1416
componentDidMount() {
1517
this.getConfig();
18+
this.getServerSettings();
1619
}
1720

1821
getConfig() {
@@ -30,6 +33,21 @@ class ConfigContent extends React.Component {
3033
});
3134
}
3235

36+
getServerSettings() {
37+
$.ajax({
38+
url: "/api/settings",
39+
dataType: "json",
40+
success: (resp) => {
41+
if (resp.success === true) {
42+
this.setState({serverSettings: resp.data})
43+
}
44+
},
45+
error: (xhr, status, err) => {
46+
console.log('/api/settings/get', status, err.toString());
47+
}
48+
});
49+
}
50+
3351
render() {
3452
return(
3553
<div className="content-wrapper">
@@ -80,6 +98,31 @@ class ConfigContent extends React.Component {
8098
</div>
8199
</div>
82100
</section>
101+
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>
125+
83126
</div>
84127
)
85128
}

0 commit comments

Comments
 (0)