From 1c087fae322a1b07bb7bd554ee10ff473c47c727 Mon Sep 17 00:00:00 2001
From: Fin Reinhard <fin.reinhard@icloud.com>
Date: Tue, 22 Jan 2019 20:51:03 +0000
Subject: [PATCH] Merge branch 'master' into feature/15-archive-view-url

---
 borgbutler-webapp/src/containers/WebApp.jsx |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/borgbutler-webapp/src/containers/WebApp.jsx b/borgbutler-webapp/src/containers/WebApp.jsx
index 73d1b82..1aeed96 100644
--- a/borgbutler-webapp/src/containers/WebApp.jsx
+++ b/borgbutler-webapp/src/containers/WebApp.jsx
@@ -17,6 +17,7 @@
 import Footer from '../components/views/footer/Footer';
 import {loadVersion} from '../actions';
 import {getTranslation} from '../utilities/i18n';
+import ConfigureRepoPage from '../components/views/repos/ConfigureRepoPage';
 
 class WebApp extends React.Component {
 
@@ -24,11 +25,11 @@
 
     componentDidMount = () => {
         this.props.loadVersion();
-        this.interval = setInterval(() => this.fetchJobStatistics(), 5000);
+        this.interval = setInterval(() => this.fetchSystemInfo(), 5000);
     };
 
-    fetchJobStatistics = () => {
-        fetch(getRestServiceUrl('jobs/statistics'), {
+    fetchSystemInfo = () => {
+        fetch(getRestServiceUrl('system/info'), {
             method: 'GET',
             headers: {
                 'Accept': 'application/json'
@@ -37,7 +38,7 @@
             .then(response => response.json())
             .then(json => {
                 this.setState({
-                    statistics: json
+                    systemInfo: json
                 });
             })
             .catch();
@@ -45,15 +46,20 @@
 
     render() {
         let jobsBadge = '';
-        if (this.state && this.state.statistics && this.state.statistics.numberOfRunningAndQueuedJobs > 0) {
-            jobsBadge = <Badge color="danger" pill>{this.state.statistics.numberOfRunningAndQueuedJobs}</Badge>;
+        const statistics = (this.state && this.state.systemInfo) ? this.state.systemInfo.queueStatistics : null;
+        if (statistics && statistics.numberOfRunningAndQueuedJobs > 0) {
+            jobsBadge = <Badge color="danger" pill>{statistics.numberOfRunningAndQueuedJobs}</Badge>;
+        }
+        let configurationBadge = '';
+        if (this.state && this.state.systemInfo && !this.state.systemInfo.configurationOK) {
+            configurationBadge = <Badge color="danger" pill>!</Badge>;
         }
         let routes = [
             ['Start', '/', Start],
             ['Repositories', '/repos', RepoListView],
             ['Job monitor', '/jobmonitor', JobMonitorView, {badge: jobsBadge}],
             [getTranslation('logviewer'), '/logging', LogPage],
-            [getTranslation('configuration'), '/config', ConfigurationPage]
+            [getTranslation('configuration'), '/config', ConfigurationPage, {badge: configurationBadge}]
         ];
 
         if (isDevelopmentMode()) {
@@ -76,8 +82,9 @@
                                     />
                                 ))
                             }
-                            <Route path={'/repoArchives/:id'} component={RepoArchiveListView}/>
+                            <Route path={'/repoArchives/:id/:displayName'} component={RepoArchiveListView} />
                             <Route path={'/archives/:repoId/:archiveId/'} component={ArchiveView} />
+                            <Route path={'/repo/configure'} component={ConfigureRepoPage} />
                         </Switch>
                     </div>
                     <Footer versionInfo={this.props.version}/>

--
Gitblit v1.10.0