This repository has been archived by the owner on Jan 23, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds workflow actions "Replay" and "Jump to end"
- Loading branch information
1 parent
d38a02b
commit c1297fc
Showing
4 changed files
with
72 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,36 @@ | ||
requirejs.config(REQUIREJS_CONFIG); | ||
|
||
require(['lib/jquery', 'ambrose', 'lib/bootstrap'], function($, Ambrose) { | ||
require([ | ||
'lib/jquery', 'lib/uri', 'ambrose', 'lib/bootstrap' | ||
], function($, URI, Ambrose) { | ||
$(document).ready(function() { | ||
// parse uri params | ||
var uri = new URI(window.location.href); | ||
var params = uri.search(true); | ||
|
||
// initialize workflow and views | ||
console.info('Creating default workflow'); | ||
var workflow = Ambrose.Workflow(); | ||
var progressBar = Ambrose.View.ProgressBar(workflow, $('#ambrose-view-progress-bar')); | ||
var graph = Ambrose.View.Graph(workflow, $('#ambrose-view-graph')); | ||
var table = Ambrose.View.Table(workflow, $('#ambrose-view-table')); | ||
workflow.loadJobs(); | ||
workflow.startEventPolling(); | ||
|
||
// install workflow actions | ||
var workflowDropdown = $('#workflow-dropdown'); | ||
var playbackAction = $('<a href="#">') | ||
.appendTo($('<li>').appendTo(workflowDropdown)); | ||
|
||
// load jobs and poll for events | ||
if (params.replay) { | ||
delete params.replay; | ||
uri.search(params); | ||
playbackAction.text('Jump to end').attr('href', uri.toString()); | ||
workflow.replay(); | ||
} else { | ||
params.replay = true; | ||
uri.search(params); | ||
playbackAction.text('Replay').attr('href', uri.toString()); | ||
workflow.jumpToEnd(); | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters