MCSM: отображение реального списка серверов
This commit is contained in:
@@ -55,21 +55,13 @@ var NvLineChart = React.createClass({
|
||||
|
||||
var ServerListItem = React.createClass({
|
||||
render: function(){
|
||||
var status;
|
||||
if (this.props.stopped) {
|
||||
status = ce('span', {className: 'label label-danger'}, 'остановлен');
|
||||
} else {
|
||||
status = ce('span', {className: 'label label-primary'}, this.props.players);
|
||||
}
|
||||
|
||||
return(
|
||||
ce('a', {className: 'list-group-item clearfix' + (this.props.active ? ' active' : ''), href: '#'},
|
||||
ce('span', {style: {'padding-top': '15px'}},
|
||||
ce('span', {className: 'glyphicon glyphicon-tasks'}),
|
||||
nbsp,
|
||||
this.props.title
|
||||
),
|
||||
ce('span', {className: 'pull-right'}, status)
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -77,12 +69,6 @@ var ServerListItem = React.createClass({
|
||||
|
||||
var ServerList = React.createClass({
|
||||
render: function(){return(
|
||||
ce('div', {className: 'list-group'},
|
||||
ce(ServerListItem, {title: 'Server 1 [hub-1]', players: 42}),
|
||||
ce(ServerListItem, {title: 'Server 2 [skywars-1]', players: 6, active: true}),
|
||||
ce(ServerListItem, {title: 'Server 3 [bedwars-3]', players: 23}),
|
||||
ce(ServerListItem, {title: 'Server 4', stopped: true}),
|
||||
ce(ServerListItem, {title: 'Server 5', stopped: true})
|
||||
)
|
||||
ce('div', {className: 'list-group'}, this.props.children)
|
||||
)}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user