Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update Redirect Flow, refactor flow list
- Loading branch information
Showing
4 changed files
with
83 additions
and
51 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
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* Utility function that creats a flow list of the given flow ids | ||
*/ | ||
define([ | ||
"require", | ||
"dojo/dom-construct", | ||
"dojo/on", | ||
"lodash", | ||
"../MainLayout" | ||
],function(require, domConstruct, on, _, MainLayout){ | ||
return function(flows, filter) { | ||
var ul = domConstruct.create("ul", { | ||
className: "flowlist" | ||
}); | ||
|
||
_.each(flows, function(flow) { | ||
var li = domConstruct.create("li", { | ||
'data-flow-id': flow.id | ||
}, ul); | ||
li.textContent = flow.response.contentLengthFormatted + " - " | ||
+ flow.request.date; | ||
}); | ||
|
||
if(ul.children.length > 0){ | ||
on(ul,"li:click",function(e){ | ||
//TODO: Use dojo attr (flow-id vs flowId seems unreliable) | ||
MainLayout.trafficPane.selectFlow(e.target.dataset.flowId); | ||
}); | ||
} | ||
|
||
return ul; | ||
} | ||
|
||
}); |