From 6a1a04156c341f59e3f86462ae974eb3e3411784 Mon Sep 17 00:00:00 2001
From: Kai Reinhard <K.Reinhard@micromata.de>
Date: Fri, 14 Dec 2018 06:33:02 +0000
Subject: [PATCH] clear all caches.
---
borgbutler-webapp/src/components/views/config/ConfigurationServerTab.jsx | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/borgbutler-webapp/src/components/views/config/ConfigurationServerTab.jsx b/borgbutler-webapp/src/components/views/config/ConfigurationServerTab.jsx
index 3e64086..58bcce2 100644
--- a/borgbutler-webapp/src/components/views/config/ConfigurationServerTab.jsx
+++ b/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'}/>
--
Gitblit v1.10.0