mirror of https://github.com/micromata/borgbackup-butler.git

Kai Reinhard
05.21.2019 172a5c10b74d5e4152fc21fbf9695d599043804a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import React from 'react';
import { Collapse, Button, CardBody, Card } from 'reactstrap';
import Job from "./Job";
 
class JobQueue extends React.Component {
    constructor(props) {
        super(props);
        this.toggle = this.toggle.bind(this);
        this.state = {collapse: true};
    }
 
    toggle() {
        this.setState({collapse: !this.state.collapse});
    }
 
    render() {
        return (
            <div>
                <Button color="primary" onClick={this.toggle} style={{ marginBottom: '1rem' }}>{this.props.queue.repo}</Button>
                <Collapse isOpen={this.state.collapse}>
                    <Card>
                        <CardBody>
                            {this.props.queue.jobs
                                .map((job, index) => <Job
                                    job={job}
                                    key={job.commandLineAsString}
                                />)}
                        </CardBody>
                    </Card>
                </Collapse>
            </div>
        );
    }
}
 
export default JobQueue;