Archived
0

MCSM: частичное обновление информации в интерфейсе

This commit is contained in:
2017-05-02 21:07:51 +03:00
parent 41e7fad9e1
commit 8e1d0af68f
3 changed files with 22 additions and 16 deletions

View File

@@ -54,6 +54,9 @@ var NvLineChart = React.createClass({
});
var ServerInfo = React.createClass({
getInitialState: function(){return {
title: this.props.title
}},
render: function(){return(
ce('div', null,
ce('div', {className: 'pull-right'},
@@ -64,28 +67,17 @@ var ServerInfo = React.createClass({
ce('span', {className: 'glyphicon glyphicon-stop'}), nbsp+'остановка')
)
),
ce('h2', {style: {'margin-top': '0px'}}, this.props.title),
ce('h2', {style: {'margin-top': '0px'}}, this.state.title),
this.props.children
)
)}
});
var ServerListItem = React.createClass({
requestServerInfo: function() {
fetch('/mcsmanager/servers.json?clientid='+this.props.title)
.then(function(response){
response.json().then(function(data){
console.debug(data);
});
})
.catch(function(err){
console.error(err);
});
},
render: function(){
return(
ce('a', {className: 'list-group-item clearfix' + (this.props.active ? ' active' : ''), href: '#',
onClick: this.requestServerInfo},
onClick: this.props.onClick},
ce('span', {style: {'padding-top': '15px'}},
ce('span', {className: 'glyphicon glyphicon-tasks'}),
nbsp,