add missing files
This commit is contained in:
15
src/xo-app/dashboard/index.js
Normal file
15
src/xo-app/dashboard/index.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import { routes } from 'utils'
|
||||
|
||||
import Overview from './overview'
|
||||
|
||||
const Dashboard = routes({
|
||||
onEnter: (state, replace) => {
|
||||
replace(`${state.location.pathname}/overview`)
|
||||
}
|
||||
}, [
|
||||
{ ...Overview.route, path: 'overview' }
|
||||
])(
|
||||
({ children }) => children
|
||||
)
|
||||
|
||||
export default Dashboard
|
||||
62
src/xo-app/dashboard/overview/index.js
Normal file
62
src/xo-app/dashboard/overview/index.js
Normal file
@@ -0,0 +1,62 @@
|
||||
import _ from 'messages'
|
||||
import React, { Component } from 'react'
|
||||
import { Row, Col } from 'grid'
|
||||
import {
|
||||
pools,
|
||||
hosts,
|
||||
vms
|
||||
} from 'selectors'
|
||||
import {
|
||||
connectStore,
|
||||
routes
|
||||
} from 'utils'
|
||||
|
||||
@routes()
|
||||
@connectStore(() => {
|
||||
return (state, props) => {
|
||||
return {
|
||||
nPools: pools(state, props).length,
|
||||
nHosts: hosts(state, props).length,
|
||||
nVms: vms(state, props).length
|
||||
}
|
||||
}
|
||||
})
|
||||
export default class Overview extends Component {
|
||||
render () {
|
||||
return <div className='container-fluid'>
|
||||
{/* <h2>{_('overviewDashboardPage')}</h2> */}
|
||||
<Row>
|
||||
<Col mediumSize={4}>
|
||||
<div className='card'>
|
||||
<div className='card-header'>
|
||||
{_('poolPanel', { pools: this.props.nPools })}
|
||||
</div>
|
||||
<div className='card-block'>
|
||||
<p>{this.props.nPools}</p>
|
||||
</div>
|
||||
</div>
|
||||
</Col>
|
||||
<Col mediumSize={4}>
|
||||
<div className='card'>
|
||||
<div className='card-header'>
|
||||
{_('hostPanel', { hosts: this.props.nHosts })}
|
||||
</div>
|
||||
<div className='card-block'>
|
||||
<p>{this.props.nHosts}</p>
|
||||
</div>
|
||||
</div>
|
||||
</Col>
|
||||
<Col mediumSize={4}>
|
||||
<div className='card'>
|
||||
<div className='card-header'>
|
||||
{_('vmPanel', { vms: this.props.nVms })}
|
||||
</div>
|
||||
<div className='card-block'>
|
||||
<p>{this.props.nVms}</p>
|
||||
</div>
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user