You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
90 lines
1.7 KiB
90 lines
1.7 KiB
import PropTypes from 'prop-types';
|
|
import React from 'react';
|
|
import FieldSet from 'Components/FieldSet';
|
|
import LoadingIndicator from 'Components/Loading/LoadingIndicator';
|
|
import Table from 'Components/Table/Table';
|
|
import TableBody from 'Components/Table/TableBody';
|
|
import QueuedTaskRowConnector from './QueuedTaskRowConnector';
|
|
|
|
const columns = [
|
|
{
|
|
name: 'trigger',
|
|
label: '',
|
|
isVisible: true
|
|
},
|
|
{
|
|
name: 'commandName',
|
|
label: 'Name',
|
|
isVisible: true
|
|
},
|
|
{
|
|
name: 'queued',
|
|
label: 'Queued',
|
|
isVisible: true
|
|
},
|
|
{
|
|
name: 'started',
|
|
label: 'Started',
|
|
isVisible: true
|
|
},
|
|
{
|
|
name: 'ended',
|
|
label: 'Ended',
|
|
isVisible: true
|
|
},
|
|
{
|
|
name: 'duration',
|
|
label: 'Duration',
|
|
isVisible: true
|
|
},
|
|
{
|
|
name: 'actions',
|
|
isVisible: true
|
|
}
|
|
];
|
|
|
|
function QueuedTasks(props) {
|
|
const {
|
|
isFetching,
|
|
isPopulated,
|
|
items
|
|
} = props;
|
|
|
|
return (
|
|
<FieldSet legend="Queue">
|
|
{
|
|
isFetching && !isPopulated &&
|
|
<LoadingIndicator />
|
|
}
|
|
|
|
{
|
|
isPopulated &&
|
|
<Table
|
|
columns={columns}
|
|
>
|
|
<TableBody>
|
|
{
|
|
items.map((item) => {
|
|
return (
|
|
<QueuedTaskRowConnector
|
|
key={item.id}
|
|
{...item}
|
|
/>
|
|
);
|
|
})
|
|
}
|
|
</TableBody>
|
|
</Table>
|
|
}
|
|
</FieldSet>
|
|
);
|
|
}
|
|
|
|
QueuedTasks.propTypes = {
|
|
isFetching: PropTypes.bool.isRequired,
|
|
isPopulated: PropTypes.bool.isRequired,
|
|
items: PropTypes.array.isRequired
|
|
};
|
|
|
|
export default QueuedTasks;
|