add control domain VM
This commit is contained in:
@@ -146,6 +146,13 @@ export const createGetObjects = (ids) => _createCollectionWrapper(
|
||||
// ===================================================================
|
||||
// Global selectors.
|
||||
|
||||
export { _objects as objects }
|
||||
|
||||
export const controllerVms = createFilter(
|
||||
_objects,
|
||||
(object) => object.type === 'VM-controller'
|
||||
)
|
||||
|
||||
export const hosts = createSort(
|
||||
createFilter(_objects, (object) => object.type === 'host')
|
||||
)
|
||||
|
||||
@@ -18,6 +18,7 @@ import {
|
||||
create as createSelector,
|
||||
createFilter,
|
||||
createGetObject,
|
||||
controllerVms,
|
||||
messages
|
||||
} from 'selectors'
|
||||
|
||||
@@ -66,6 +67,7 @@ const NavTabs = ({ children }) => (
|
||||
const getPool = createGetObject(
|
||||
(...args) => getHost(...args).$pool
|
||||
)
|
||||
|
||||
const getLogs = createFilter(
|
||||
messages,
|
||||
createSelector(
|
||||
@@ -75,6 +77,15 @@ const NavTabs = ({ children }) => (
|
||||
true
|
||||
)
|
||||
|
||||
const getControllerVm = createFilter(
|
||||
controllerVms,
|
||||
createSelector(
|
||||
getHost,
|
||||
({ id }) => (controller) => controller.$container === id
|
||||
),
|
||||
true
|
||||
)
|
||||
|
||||
return (state, props) => {
|
||||
const host = getHost(state, props)
|
||||
if (!host) {
|
||||
@@ -82,6 +93,7 @@ const NavTabs = ({ children }) => (
|
||||
}
|
||||
|
||||
return {
|
||||
controllerVm: getControllerVm(state, props),
|
||||
logs: getLogs(state, props),
|
||||
host,
|
||||
pool: getPool(state, props)
|
||||
@@ -144,6 +156,7 @@ export default class Host extends Component {
|
||||
}
|
||||
const childProps = assign(pick(this.props, [
|
||||
'addTag',
|
||||
'controllerVm',
|
||||
'host',
|
||||
'logs'
|
||||
]), pick(this.state, [
|
||||
|
||||
@@ -3,5 +3,6 @@ import React from 'react'
|
||||
import { Debug } from 'utils'
|
||||
|
||||
export default ({
|
||||
controllerVm,
|
||||
host
|
||||
}) => <div><Debug value={host} /></div>
|
||||
}) => <div><Debug value={host} /><Debug value={controllerVm} /></div>
|
||||
|
||||
Reference in New Issue
Block a user