From 9926a79503c9bd6454c076f2b60cd577f6061e4d Mon Sep 17 00:00:00 2001
From: Kai Reinhard <K.Reinhard@micromata.de>
Date: Sat, 19 Feb 2022 07:29:58 +0000
Subject: [PATCH] Using Borg version 1.1.17 as default. Version is now configurable via web client and json file.

---
 borgbutler-webapp/src/components/views/config/ConfigurationServerTab.jsx |   26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/borgbutler-webapp/src/components/views/config/ConfigurationServerTab.jsx b/borgbutler-webapp/src/components/views/config/ConfigurationServerTab.jsx
index 8fdc69b..8a53b9f 100644
--- a/borgbutler-webapp/src/components/views/config/ConfigurationServerTab.jsx
+++ b/borgbutler-webapp/src/components/views/config/ConfigurationServerTab.jsx
@@ -35,8 +35,8 @@
             .then((data) => {
                 this.setState({
                     loading: false,
-                    borgVersion: data.borgVersion,
-                    borgBinary: data.borgVersion.borgBinary,
+                    borgConfig: data.borgConfig,
+                    borgBinary: data.borgConfig.borgBinary,
                     ...data.serverConfiguration
                 })
             })
@@ -56,6 +56,7 @@
             loading: true,
             failed: false,
             port: 9042,
+            borgVersion: "1.1.17",
             webdevelopmentMode: false,
             showDemoRepos: true,
             maxArchiveContentCacheCapacityMb: 100,
@@ -88,9 +89,10 @@
                 maxArchiveContentCacheCapacityMb: this.state.maxArchiveContentCacheCapacityMb,
                 webDevelopmentMode: this.state.webDevelopmentMode,
                 showDemoRepos: this.state.showDemoRepos,
-                borgCommand: this.state.borgCommand
+                borgCommand: this.state.borgCommand,
+                borgVersion: this.state.borgVersion,
             },
-            borgVersion: {
+            borgConfig: {
                 borgBinary: this.state.borgBinary
             }
         };
@@ -121,12 +123,12 @@
         if (this.state.failed) {
             return <ErrorAlertGenericRestFailure handleClick={this.loadConfig}/>;
         }
-        const borgVersion = this.state.borgVersion;
+        const borgConfig = this.state.borgConfig;
         let borgInfoColor = 'success';
-        let borgInfoMessage = `Borg version '${borgVersion.version}' is OK.`;
-        if (!borgVersion.versionOK) {
+        let borgInfoMessage = `Borg version '${borgConfig.version}' is OK.`;
+        if (!borgConfig.versionOK) {
             borgInfoColor = 'danger';
-            borgInfoMessage = borgVersion.statusMessage;
+            borgInfoMessage = borgConfig.statusMessage;
         }
         return (
             <React.Fragment>
@@ -138,9 +140,9 @@
                                 value={this.state.borgBinary}
                                 name={'borgBinary'}
                                 onChange={this.handleTextChange}
-                                hint={`Choose your OS and BorgButler will download and use a ready to run borg binary from ${borgVersion.binariesDownloadUrl} or choose a manual installed version.`}
+                                hint={`Choose your OS and BorgButler will download and use a ready to run borg binary from ${borgConfig.binariesDownloadUrl} or choose a manual installed version.`}
                             >
-                                {borgVersion.borgBinaries
+                                {borgConfig.borgBinaries
                                     .map((binary, index) => <FormOption label={binary[1]} value={binary[0]}
                                                                         key={index}/>)}
                                 <FormOption label={'Manual'} value={'manual'}/>
@@ -157,6 +159,10 @@
                             {borgInfoMessage}
                         </Alert>
                     </FormGroup>
+                    <FormLabelInputField label={'Borg version'} fieldLength={2}
+                                         name={'borgVersion'} value={this.state.borgVersion}
+                                         onChange={this.handleTextChange}
+                                         placeholder="Enter borg version (e. g. 1.1.17)"/>
                     <FormLabelInputField label={'Port'} fieldLength={2} type="number" min={0} max={65535}
                                          step={1}
                                          name={'port'} value={this.state.port}

--
Gitblit v1.10.0