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

Kai Reinhard
18.14.2018 d381b714f91c5e19a4193bf520e885b5dcae5e5d
Treeview finished.
2 files modified
17 ■■■■■ changed files
borgbutler-webapp/src/components/views/archives/FileListEntry.jsx 3 ●●●● patch | view | raw | blame | history
borgbutler-webapp/src/components/views/archives/FileListPanel.jsx 14 ●●●●● patch | view | raw | blame | history
borgbutler-webapp/src/components/views/archives/FileListEntry.jsx
@@ -4,6 +4,7 @@
import {IconDownload} from '../../general/IconComponents';
import {getResponseHeaderFilename, getRestServiceUrl, humanFileSize} from '../../../utilities/global';
import fileDownload from 'js-file-download';
import {Button} from 'reactstrap';
function download(archiveId, fileNumber) {
    let filename;
@@ -35,7 +36,7 @@
function FileListEntry({archiveId, entry, search, mode, changeCurrentDirectory}) {
    let path;
    if (mode === 'tree' && entry.type === 'd') {
        path = <a href={'#'} onClick={() => changeCurrentDirectory(entry.path)}><Highlight search={search}>{entry.displayPath}</Highlight></a>;
        path = <Button color={'link'} onClick={() => changeCurrentDirectory(entry.path)}><Highlight search={search}>{entry.displayPath}</Highlight></Button>;
    } else {
        path = <Highlight search={search}>{entry.displayPath}</Highlight>;
    }
borgbutler-webapp/src/components/views/archives/FileListPanel.jsx
@@ -95,19 +95,23 @@
                </React.Fragment>;
            } else {
                if (this.state.filter.mode === 'tree' && this.state.filter.currentDirectory.length > 0) {
                    console.log(this.state.filter.currentDirectory);
                    let dirs = this.state.filter.currentDirectory.split('/');
                    let breadcrumbs = [];
                    for (let i = 0; i < dirs.length - 1; i++) {
                        let path = '';
                        for (let j = 0; j <= i; j++) {
                            path += dirs[j] + '/';
                            path += dirs[j];
                            if (j < i) {
                                path += '/';
                            }
                        }
                        breadcrumbs.push(<BreadcrumbItem key={i}><a onClick={() => this.changeCurrentDirectory(path)}
                                                                  href="#">{dirs[i]}</a></BreadcrumbItem>);
                        breadcrumbs.push(<BreadcrumbItem key={i}><Button color={'link'} onClick={() => this.changeCurrentDirectory(path)}
                                                                  >{dirs[i]}</Button></BreadcrumbItem>);
                    }
                    breadcrumb = <Breadcrumb>
                        <BreadcrumbItem><a onClick={() => this.changeCurrentDirectory('')}
                                                       href="#">Top</a></BreadcrumbItem>
                        <BreadcrumbItem><Button color={'link'} onClick={() => this.changeCurrentDirectory('')}
                                                       >Top</Button></BreadcrumbItem>
                        {breadcrumbs}
                        <BreadcrumbItem active>{dirs[dirs.length - 1]}</BreadcrumbItem>
                    </Breadcrumb>;