yrexpert-js
Version:
L'interface Web pour votre système expert...
96 lines (82 loc) • 2.5 kB
JavaScript
/*
!----------------------------------------------------------------------------!
! !
! Yexpert : (your) Système Expert sous Mumps GT.M et GNU/Linux !
! Copyright (C) 2001-2015 by Hamid LOUAKED (HL). !
! !
!----------------------------------------------------------------------------!
*/
var React = require('react')
var createReactClass = require('create-react-class')
var ReactBootstrap = require('react-bootstrap')
var {
Panel,
Grid,
Row,
Col
} = ReactBootstrap
var BuildDetails = require('./BuildDetails')
var MasterProcessDetails = require('./MasterProcessDetails')
var WorkerProcessDetailsTable = require('./WorkerProcessDetailsTable')
var OverviewPanel = createReactClass({
getInitialState: function () {
return {
status: 'initial'
}
},
componentWillMount: function () {
this.controller = require('./controller-OverviewPanel')(this.props.controller, this)
this.title = (
<h1>Overview {this.serverName}</h1>
)
},
componentWillUpdate: function () {
this.title = (
<h1>Overview {this.serverName}</h1>
)
},
componentWillReceiveProps: function (newProps) {
this.onNewProps(newProps)
},
render: function () {
// var componentPath = this.controller.updateComponentPath(this);
if (this.state.status === 'initial') {
return (
<Panel collapsible expanded={this.expanded} header={this.title} />
)
} else {
return (
<Panel
collapsible
expanded={this.expanded}
header={this.title}
bsStyle='primary'
>
<Grid
fluid
>
<Row>
<Col md={4}>
<BuildDetails
controller={this.controller}
/>
</Col>
<Col md={3}>
<MasterProcessDetails
controller={this.controller}
/>
</Col>
<Col md={5}>
<WorkerProcessDetailsTable
controller={this.controller}
/>
</Col>
</Row>
</Grid>
</Panel>
)
}
}
})
module.exports = OverviewPanel