Sha256: 58a172dfa70dd7c4875ce9a9769d0e278d2ae483784cd87f01b2426084a650ee
Contents?: true
Size: 1.42 KB
Versions: 2
Compression:
Stored size: 1.42 KB
Contents
import React from 'react'; import PropTypes from 'prop-types'; import { translate as __ } from 'foremanReact/common/I18n'; import { LoadingState, Alert } from 'patternfly-react'; import { STATUS } from 'foremanReact/constants'; import HostItem from './components/HostItem'; const TargetingHosts = ({ apiStatus, items }) => { if (apiStatus === STATUS.ERROR) { return ( <Alert type="error"> {__( 'There was an error while updating the status, try refreshing the page.' )} </Alert> ); } const tableBodyRows = items.length ? ( items.map(({ name, link, status, actions }) => ( <HostItem key={name} name={name} link={link} status={status} actions={actions} /> )) ) : ( <tr> <td colSpan="3">{__('No hosts found.')}</td> </tr> ); return ( <LoadingState loading={!items.length && apiStatus === STATUS.PENDING}> <div> <table className="table table-bordered table-striped table-hover"> <thead> <tr> <th>{__('Host')}</th> <th>{__('Status')}</th> <th>{__('Actions')}</th> </tr> </thead> <tbody>{tableBodyRows}</tbody> </table> </div> </LoadingState> ); }; TargetingHosts.propTypes = { apiStatus: PropTypes.string.isRequired, items: PropTypes.array.isRequired, }; export default TargetingHosts;
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
foreman_remote_execution-4.1.0 | webpack/react_app/components/TargetingHosts/TargetingHosts.js |
foreman_remote_execution-4.0.0 | webpack/react_app/components/TargetingHosts/TargetingHosts.js |