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

Kai Reinhard
16.55.2018 285e777052a1ee995cf56b9dc7a5e1e6d796a352
file list...
1 files renamed
2 files modified
71 ■■■■ changed files
borgbutler-webapp/src/components/views/archives/ArchiveView.jsx 6 ●●●● patch | view | raw | blame | history
borgbutler-webapp/src/components/views/archives/FileListFilters.jsx 38 ●●●●● patch | view | raw | blame | history
borgbutler-webapp/src/components/views/archives/FileListPanel.jsx 27 ●●●● patch | view | raw | blame | history
borgbutler-webapp/src/components/views/archives/ArchiveView.jsx
@@ -5,7 +5,7 @@
import ErrorAlert from '../../general/ErrorAlert';
import {IconRefresh} from "../../general/IconComponents";
import classNames from "classnames";
import FileListTable from "./FileListTable";
import FileListPanel from "./FileListPanel";
class ArchiveView extends React.Component {
@@ -175,8 +175,8 @@
                        </Table>
                    </TabPane>
                    <TabPane tabId={'2'}>
                        <FileListTable
                            entries={this.props.entries}
                        <FileListPanel
                            archiveId={archive.id}
                        />
                    </TabPane>
                </TabContent>
borgbutler-webapp/src/components/views/archives/FileListFilters.jsx
@@ -15,19 +15,6 @@
                Filter:
            </FormLabel>
            <FormSelect
                value={filters.threshold}
                name={'threshold'}
                onChange={changeFilter}
                hint={<I18n name={'logviewer.filter.level.hint'}/>}
            >
                <FormOption value={'error'}/>
                <FormOption value={'warn'}/>
                <FormOption value={'info'}/>
                <FormOption value={'debug'}/>
                <FormOption value={'trace'}/>
            </FormSelect>
            <FormInput
                value={filters.search}
                name={'search'}
@@ -36,27 +23,6 @@
            />
            <FormSelect
                value={filters.locationFormat}
                name={'locationFormat'}
                onChange={changeFilter}
                hint={<I18n name={'logviewer.filter.location.hint'}/>}
            >
                <FormOption value={'none'} i18nKey={'common.none'}/>
                <FormOption value={'short'} i18nKey={'logviewer.filter.location.option.short'}/>
                <FormOption value={'normal'} i18nKey={'logviewer.filter.location.option.normal'}/>
            </FormSelect>
            <FormSelect
                value={filters.showStackTrace}
                name={'showStackTrace'}
                onChange={changeFilter}
                hint={<I18n name={'logviewer.filter.stacktraces.showHide.hint'}/>}
            >
                <FormOption value={'false'} i18nKey={'common.none'}/>
                <FormOption value={'true'} i18nKey={'logviewer.filter.stacktraces'}/>
            </FormSelect>
            <FormSelect
                value={filters.maxSize}
                name={'maxSize'}
                onChange={changeFilter}
@@ -78,12 +44,8 @@
FileListFilters.propTypes = {
    changeFilter: PropTypes.func.isRequired,
    filters: PropTypes.shape({
        threshold: PropTypes.oneOf(['error', 'warn', 'info', 'debug', 'trace']),
        search: PropTypes.string,
        locationFormat: PropTypes.oneOf(['none', 'short', 'normal']),
        showStackTrace: PropTypes.oneOf(['true', 'false']),
        maxSize: PropTypes.oneOf(['50', '100', '500', '1000', '10000']),
        ascendingOrder: PropTypes.oneOf(['true', 'false'])
    }).isRequired,
    loadLog: PropTypes.func.isRequired
};
borgbutler-webapp/src/components/views/archives/FileListPanel.jsx
File was renamed from borgbutler-webapp/src/components/views/archives/ArchiveFileListView.jsx
@@ -1,7 +1,6 @@
import React from 'react'
import {getRestServiceUrl, humanFileSize} from '../../../utilities/global';
import ErrorAlert from '../../general/ErrorAlert';
import {IconRefresh} from "../../general/IconComponents";
class ArchiveView extends React.Component {
@@ -16,16 +15,15 @@
    fetchArchiveFileList = (force) => {
        let forceReload = false;
        if (force && confirm('Are you sure you want to reload the archive file list? This may take a long time...')) {
        if (force && window.confirm('Are you sure you want to reload the archive file list? This may take a long time...')) {
            forceReload = true;
        }
        this.setState({
            isFetching: true,
            failed: false
        });
        fetch(getRestServiceUrl('repos/archive', {
            repo: this.state.repoId,
            archive: this.state.archiveId,
        fetch(getRestServiceUrl('archives/filelist', {
            archive: this.props.archiveId,
            force: forceReload
        }), {
            method: 'GET',
@@ -46,13 +44,12 @@
    render = () => {
        let content = undefined;
        let archive = this.state.archive;
        let pageHeader = '';
        if (this.state.isFetching) {
            content = <i>Loading...</i>;
        } else if (this.state.failed) {
            content = <ErrorAlert
                title={'Cannot load Repositories'}
                title={'Cannot load Archive file list'}
                description={'Something went wrong during contacting the rest api.'}
                action={{
                    handleClick: this.fetchArchive,
@@ -60,23 +57,11 @@
                }}
            />;
        } else if (this.state.archive) {
            pageHeader = <React.Fragment>
                {archive.repoDisplayName}
                <div
                    className={'btn btn-outline-primary refresh-button-right'}
                    onClick={this.fetchArchive.bind(this, true)}
                >
                    <IconRefresh/>
                </div>
            </React.Fragment>;
            content = <React.Fragment>
                Hurzel;
            </React.Fragment>;
        }
        return <React.Fragment>
            <PageHeader>
                {pageHeader}
            </PageHeader>
            {content}
        </React.Fragment>;
    };
@@ -84,7 +69,7 @@
    constructor(props) {
        super(props);
        this.fetchArchive = this.fetchArchive.bind(this);
        this.fetchArchiveFileList = this.fetchArchiveFileList.bind(this);
    }
}