Sha256: 1c443e7eaa143a08306cfa78758d977deb8bec61673de442ce95fbe6dd222ce9

Contents?: true

Size: 1.34 KB

Versions: 16

Compression:

Stored size: 1.34 KB

Contents

import React from 'react';
import PropTypes from 'prop-types';
import { Alert, Card, Row, Col } from 'patternfly-react';
import { translate as __ } from 'foremanReact/common/I18n';

const Locks = ({ locks }) => (
  <div>
    <Alert type="info">
      {__(
        'You can find resource locks on this page. Exclusive lock marked with locked icon means that no other task can use locked resource while this task is running. Non-exclusive lock marked with unlocked icon means other tasks can access the resource freely, it is only used to indicate the relation of this task with the resource'
      )}
    </Alert>
    <Card.Grid>
      <Row>
        {locks.map((lock, key) => (
          <Col xs={6} sm={4} md={4} key={key}>
            <Card className="card-pf-aggregate-status" accented>
              <Card.Title>
                <span
                  className={`fa ${
                    lock.exclusive ? 'fa-lock' : 'fa-unlock-alt'
                  }`}
                />
                {lock.resource_type}
              </Card.Title>
              <Card.Body>
                {`id:${lock.resource_id}`}
                <br />
              </Card.Body>
            </Card>
          </Col>
        ))}
      </Row>
    </Card.Grid>
  </div>
);

Locks.propTypes = {
  locks: PropTypes.array,
};

Locks.defaultProps = {
  locks: [],
};

export default Locks;

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
foreman-tasks-4.1.6 webpack/ForemanTasks/Components/TaskDetails/Components/Locks.js
foreman-tasks-5.2.3 webpack/ForemanTasks/Components/TaskDetails/Components/Locks.js
foreman-tasks-5.2.2 webpack/ForemanTasks/Components/TaskDetails/Components/Locks.js
foreman-tasks-5.2.1 webpack/ForemanTasks/Components/TaskDetails/Components/Locks.js
foreman-tasks-5.2.0 webpack/ForemanTasks/Components/TaskDetails/Components/Locks.js
foreman-tasks-5.1.1 webpack/ForemanTasks/Components/TaskDetails/Components/Locks.js
foreman-tasks-5.1.0 webpack/ForemanTasks/Components/TaskDetails/Components/Locks.js
foreman-tasks-4.1.5 webpack/ForemanTasks/Components/TaskDetails/Components/Locks.js
foreman-tasks-4.1.4 webpack/ForemanTasks/Components/TaskDetails/Components/Locks.js
foreman-tasks-4.1.3 webpack/ForemanTasks/Components/TaskDetails/Components/Locks.js
foreman-tasks-5.0.0 webpack/ForemanTasks/Components/TaskDetails/Components/Locks.js
foreman-tasks-4.1.2 webpack/ForemanTasks/Components/TaskDetails/Components/Locks.js
foreman-tasks-4.1.1 webpack/ForemanTasks/Components/TaskDetails/Components/Locks.js
foreman-tasks-4.0.1 webpack/ForemanTasks/Components/TaskDetails/Components/Locks.js
foreman-tasks-4.1.0 webpack/ForemanTasks/Components/TaskDetails/Components/Locks.js
foreman-tasks-4.0.0 webpack/ForemanTasks/Components/TaskDetails/Components/Locks.js