aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/stores
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2014-09-18 02:22:10 +0200
committerMaximilian Hils <git@maximilianhils.com>2014-09-18 02:22:10 +0200
commit0d64cc93278d39bd4c87cf5110d326f57574c8a1 (patch)
tree41cdb8ea3fdd51304c23234ca8fd7c2372d96988 /web/src/js/stores
parent6a161be6b4c526fcc5f6581c7faff00a2c976f37 (diff)
downloadmitmproxy-0d64cc93278d39bd4c87cf5110d326f57574c8a1.tar.gz
mitmproxy-0d64cc93278d39bd4c87cf5110d326f57574c8a1.tar.bz2
mitmproxy-0d64cc93278d39bd4c87cf5110d326f57574c8a1.zip
flowtable: add selection indicator, add keyboard navigation
Diffstat (limited to 'web/src/js/stores')
-rw-r--r--web/src/js/stores/flowstore.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/web/src/js/stores/flowstore.js b/web/src/js/stores/flowstore.js
index a5cb74ba..ba5b0788 100644
--- a/web/src/js/stores/flowstore.js
+++ b/web/src/js/stores/flowstore.js
@@ -35,9 +35,8 @@ _.extend(FlowView.prototype, EventEmitter.prototype, {
this.emit("change");
},
_update: function(flow){
- console.debug("FIXME: Use UUID");
var idx = _.findIndex(this.flows, function(f){
- return flow.request.timestamp_start == f.request.timestamp_start;
+ return flow.id === f.id;
});
if(idx < 0){
@@ -61,7 +60,13 @@ _.extend(_FlowStore.prototype, EventEmitter.prototype, {
var view = new FlowView(this, !since);
$.getJSON("/static/flows.json", function(flows){
+ flows = flows.concat(_.cloneDeep(flows)).concat(_.cloneDeep(flows));
+ var id = 1;
+ flows.forEach(function(flow){
+ flow.id = "uuid-"+id++;
+ })
view.add_bulk(flows);
+
});
return view;