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

Kai Reinhard
07.30.2019 7559af2c79512175a0d37fb84b5c4fd58d406e6e
Showing now environment variables to copy for the user.
2 files modified
19 ■■■■ changed files
borgbutler-server/src/main/java/de/micromata/borgbutler/server/rest/queue/JsonJob.java 4 ●●●● patch | view | raw | blame | history
borgbutler-webapp/src/components/views/jobs/Job.jsx 15 ●●●● patch | view | raw | blame | history
borgbutler-server/src/main/java/de/micromata/borgbutler/server/rest/queue/JsonJob.java
@@ -35,6 +35,9 @@
    @Getter
    @Setter
    private long uniqueJobNumber;
    @Getter
    @Setter
    private String[] environmentVariables;
    public JsonJob() {
    }
@@ -51,6 +54,7 @@
        }
        this.commandLineAsString = borgJob.getCommandLineAsString();
        this.description = borgJob.getDescription();
        environmentVariables = borgJob.getCommand().getRepoConfig().getEnvironmentVariables();
    }
    /**
borgbutler-webapp/src/components/views/jobs/Job.jsx
@@ -56,6 +56,12 @@
        if ((job.status !== 'RUNNING' && job.status !== 'QUEUED') || job.cancellationRequested) {
            cancelDisabled = true;
        }
        let environmentVariables = '';
        if (job.environmentVariables && Array.isArray(job.environmentVariables)) {
            environmentVariables = job.environmentVariables.map((variable, index) => <React.Fragment>
                export &quot;{variable}&quot;;<br/>
            </React.Fragment>)
        }
        return (
            <ListGroupItem>
                {this.renderRedirect()}
@@ -64,8 +70,9 @@
                        <Button color="link" onClick={this.toggle}>{job.description}</Button>
                        {content}
                    </div>
                    <div className="job-cancel"><Button color={'danger'} onClick={() => this.cancelJob(job.uniqueJobNumber)}
                                             disabled={cancelDisabled}><IconCancel/></Button>
                    <div className="job-cancel"><Button color={'danger'}
                                                        onClick={() => this.cancelJob(job.uniqueJobNumber)}
                                                        disabled={cancelDisabled}><IconCancel/></Button>
                    </div>
                </div>
                <Collapse isOpen={this.state.collapse}>
@@ -81,6 +88,10 @@
                                    <th>Command line</th>
                                    <td>{job.commandLineAsString}</td>
                                </tr>
                                <tr>
                                    <th>Environment</th>
                                    <td>{environmentVariables}</td>
                                </tr>
                                </tbody>
                            </table>
                        </CardBody>