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

Kai Reinhard
14.33.2018 6a1a04156c341f59e3f86462ae974eb3e3411784
borgbutler-webapp/src/components/views/config/ConfigurationServerTab.jsx
@@ -77,6 +77,7 @@
        this.addDirectoryItem = this.addDirectoryItem.bind(this);
        this.removeDirectoryItem = this.removeDirectoryItem.bind(this);
        this.onResetConfiguration = this.onResetConfiguration.bind(this);
        this.onClearAllCaches = this.onClearAllCaches.bind(this);
        this.loadConfig = this.loadConfig.bind(this);
    }
@@ -143,6 +144,16 @@
        }
    }
    onClearAllCaches() {
        fetch(getRestServiceUrl("configuration/clearAllCaches"), {
            method: "GET",
            dataType: "JSON",
            headers: {
                "Content-Type": "text/plain; charset=utf-8"
            }
        })
    }
    addDirectoryItem() {
        directoryItems.push({
            index: directoryItems.length + 1,
@@ -163,12 +174,16 @@
        }
        if (this.state.failed) {
            return <ErrorAlertGenericRestFailure handleClick={this.loadConfig} />;
            return <ErrorAlertGenericRestFailure handleClick={this.loadConfig}/>;
        }
        return (
            <form>
                <FormLabelField>
                    <FormButton id={'clearCahces'} onClick={this.onClearCaches}> Clear all caches
                    </FormButton>
                </FormLabelField>
                <FormLabelField>
                    <Button className={'btn-outline-primary'}
                            onClick={() => this.setState({expertSettingsOpen: !this.state.expertSettingsOpen})}>
                        <IconWarning/> <I18n name={'configuration.forExpertsOnly'}/>