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

Kai Reinhard
16.27.2018 cd02fc4d873b8834e3aaef59ca5ff0490dccf76e
Not yet in use.
1 files added
40 ■■■■■ changed files
borgbutler-webapp/src/components/views/ConfirmReloadDialog.jsx 40 ●●●●● patch | view | raw | blame | history
borgbutler-webapp/src/components/views/ConfirmReloadDialog.jsx
New file
@@ -0,0 +1,40 @@
import React from 'react';
import { Button, Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap';
class ConfirmReloadDialog extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            modal: false
        };
        this.toggle = this.toggle.bind(this);
    }
    toggle() {
        this.setState({
            modal: !this.state.modal
        });
    }
    render() {
        return (
            <div>
                <Button color="danger" onClick={this.toggle}>{this.props.buttonLabel}</Button>
                <Modal isOpen={this.state.modal} toggle={this.toggle} className={this.props.className}>
                    <ModalHeader toggle={this.toggle}>Do you really want to reload?</ModalHeader>
                    <ModalBody>
                        Reloading of the data is time consuming for remote borg repos. Reloading is only required
                        if you assume that the cache data of BorgButler is outdated.
                    </ModalBody>
                    <ModalFooter>
                        <Button color="secondary" onClick={this.toggle}>Cancel</Button>
                        <Button color="primary" onClick={this.toggle}>Reload</Button>{' '}
                    </ModalFooter>
                </Modal>
            </div>
        );
    }
}
export default ConfirmReloadDialog;