import gql from 'graphql-tag' import { Query } from 'react-apollo' import Interface from './Interface' const INTERFACES_FULL = gql` query INTERFACES_FULL { interfaces { id interfaceName workerScript { path mtime updated } workerProcess { pid killed signalCode exitCode spawnfile spawnargs } ports { id interfaceName host device name description } connections { id port { id interfaceName host device name description } workerProcess { pid killed signalCode exitCode spawnfile spawnargs } } options { name type description values } } } ` const INTERFACES = gql` query INTERFACES { interfaces { interfaceName ports { id } connections { id } } } ` const InterfaceList = props => ( {({ data }, loading, error) => { if (loading) return

Loading interfaces...

if (error) return

Error loading interfaces: {error.message}

if (!data) return

No interfaces found.

const { interfaces } = data return (

Interface List

{loading ? (

Loading interfaces...

) : ( interfaces && interfaces.map(iface => ( )) )}
) }}
) export default InterfaceList export { INTERFACES, INTERFACES_FULL }