Sha256: 058f3579040b818ef3247d355c7331d94edea9393de3b7b134a0ed7fccbc1d70

Contents?: true

Size: 1.18 KB

Versions: 3

Compression:

Stored size: 1.18 KB

Contents

import React from 'react';
import { Icon } from 'patternfly-react';
import PropTypes from 'prop-types';
import { translate as __ } from 'foremanReact/common/I18n';

const HostStatus = ({ status }) => {
  switch (status) {
    case 'cancelled':
      return (
        <div>
          <Icon type="pf" name="warning-triangle-o" /> {__('Cancelled')}
        </div>
      );
    case 'N/A':
      return (
        <div>
          <Icon type="fa" name="question" /> {__('Awaiting start')}
        </div>
      );
    case 'running':
      return (
        <div>
          <Icon type="pf" name="running" /> {__('Pending')}
        </div>
      );
    case 'planned':
      return (
        <div>
          <Icon type="pf" name="build" /> {__('Scheduled')}
        </div>
      );
    case 'warning':
    case 'error':
      return (
        <div>
          <Icon type="pf" name="error-circle-o" /> {__('Failed')}
        </div>
      );
    case 'success':
      return (
        <div>
          <Icon type="pf" name="ok" /> {__('Succeeded')}
        </div>
      );
    default:
      return <span>{status}</span>;
  }
};

HostStatus.propTypes = {
  status: PropTypes.string.isRequired,
};

export default HostStatus;

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
foreman_remote_execution-14.1.2 webpack/react_app/components/TargetingHosts/components/HostStatus.js
foreman_remote_execution-14.1.1 webpack/react_app/components/TargetingHosts/components/HostStatus.js
foreman_remote_execution-14.1.0 webpack/react_app/components/TargetingHosts/components/HostStatus.js