Archived
0

MCSM: отображение реального списка серверов

This commit is contained in:
2017-05-01 14:42:16 +03:00
parent 26352ef17e
commit c8fc952ffc
5 changed files with 58 additions and 29 deletions

View File

@@ -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)
)}
});