Skip to content

Commit

Permalink
Added download execFiles button. Fixes #295
Browse files Browse the repository at this point in the history
WIP #295. updated seeds
  • Loading branch information
brollb committed Jun 16, 2016
1 parent f95125a commit a866695
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ define([
options.skipAttributes = {
name: true,
status: true,
execFiles: true,
stdout: true,
debug: true
};
Expand Down
5 changes: 1 addition & 4 deletions src/plugins/ExecutePipeline/ExecutePipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,7 @@ define([
this.outputLineCount[jobId] = actualLine + 1;
return executor.getOutput(hash, currentLine, actualLine+1)
.then(outputLines => {
var job = this.nodes[jobId],
stdout = this.core.getAttribute(job, 'stdout'),
var stdout = this.core.getAttribute(job, 'stdout'),
output = outputLines.map(o => o.output).join(''),
jobName = this.core.getAttribute(job, 'name');

Expand Down Expand Up @@ -462,15 +461,13 @@ define([
.then(stdout => {
this.core.setAttribute(job, 'stdout', stdout);
if (info.status !== 'SUCCESS') {
name = this.core.getAttribute(this.nodes[opId], 'name');
// Download all files
this.result.addArtifact(info.resultHashes[name + '-all-files']);
// Set the job to failed! Store the error
this.core.setAttribute(this.nodes[jobId], 'status', 'fail');
this.logger.info(`Setting ${jobId} status to "fail"`);
this.onPipelineComplete(`Operation "${opId}" failed! ${JSON.stringify(info)}`); // Failed
} else {
name = this.core.getAttribute(this.nodes[opId], 'name');
if (this.debug) {
this.result.addArtifact(info.resultHashes[name + '-all-files']);
}
Expand Down
Binary file modified src/seeds/minimal/minimal.webgmex
Binary file not shown.
Binary file modified src/seeds/pipeline/pipeline.webgmex
Binary file not shown.
Binary file modified src/seeds/project/project.webgmex
Binary file not shown.
26 changes: 23 additions & 3 deletions src/visualizers/panels/ForgeActionButton/Actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,24 @@ define([
};
});

////////////// Downloading files //////////////
var downloadAttrs = [
'data',
'execFiles'
],
download = {};

downloadAttrs.forEach(attr => {
download[attr] = function() {
return downloadButton.call(this, attr);
};
});

// Add download model button
var downloadButton = function() {
var downloadButton = function(attr) {
var id = this._currentNodeId,
node = this.client.getNode(id),
hash = node.getAttribute('data');
hash = node.getAttribute(attr);

if (hash) {
return '/rest/blob/download/' + hash;
Expand Down Expand Up @@ -231,7 +244,14 @@ define([
{
name: 'Download',
icon: 'play_for_work',
href: downloadButton // function to create href url
href: download.data // function to create href url
}
],
Job: [
{
name: 'Download Execution Files',
icon: 'play_for_work',
href: download.execFiles
}
],
Pipeline: [
Expand Down

0 comments on commit a866695

Please sign in to comment.