From add986cff9c8e1a00428122a0d5515e6bd00120f Mon Sep 17 00:00:00 2001
From: Kai Reinhard <K.Reinhard@micromata.de>
Date: Sat, 05 Jan 2019 03:03:04 +0000
Subject: [PATCH] Job monitor...
---
borgbutler-webapp/src/components/views/jobs/JobQueue.jsx | 42 +++++++++++++++++++++++++++++++-----------
1 files changed, 31 insertions(+), 11 deletions(-)
diff --git a/borgbutler-webapp/src/components/views/jobs/JobQueue.jsx b/borgbutler-webapp/src/components/views/jobs/JobQueue.jsx
index 965b678..58e7711 100644
--- a/borgbutler-webapp/src/components/views/jobs/JobQueue.jsx
+++ b/borgbutler-webapp/src/components/views/jobs/JobQueue.jsx
@@ -1,16 +1,36 @@
import React from 'react';
+import { Collapse, Button, CardBody, Card } from 'reactstrap';
import Job from "./Job";
-function JobQueue({queue}) {
- return (
- <div>
- <h2>{queue.repo}</h2>
- {queue.jobs
- .map((job, index) => <Job
- job={job}
- key={job.commandLineAsString}
- />)}
- </div>
- )
+class JobQueue extends React.Component {
+ constructor(props) {
+ super(props);
+ this.toggle = this.toggle.bind(this);
+ this.state = {collapse: true};
+ }
+
+ toggle() {
+ this.setState({collapse: !this.state.collapse});
+ }
+
+ render() {
+ return (
+ <div>
+ <Button color="primary" onClick={this.toggle} style={{ marginBottom: '1rem' }}>{this.props.queue.repo}</Button>
+ <Collapse isOpen={this.state.collapse}>
+ <Card>
+ <CardBody>
+ {this.props.queue.jobs
+ .map((job, index) => <Job
+ job={job}
+ key={job.commandLineAsString}
+ />)}
+ </CardBody>
+ </Card>
+ </Collapse>
+ </div>
+ );
+ }
}
+
export default JobQueue;
--
Gitblit v1.10.0