diff options
author | Jim Shaver <dcypherd@gmail.com> | 2015-05-31 01:21:44 -0400 |
---|---|---|
committer | Jim Shaver <dcypherd@gmail.com> | 2015-05-31 01:21:44 -0400 |
commit | b51363b3ca43f6572acb673186e6ae78a1f48434 (patch) | |
tree | a7488b32871c142141a813dc6ff2ede172672c31 /web/src/js/actions.js | |
parent | 4fe2c069cca07aadf983f54e18dac4de492d5d69 (diff) | |
parent | 06fba18106a8f759ec6f08453e86772a170c653b (diff) | |
download | mitmproxy-b51363b3ca43f6572acb673186e6ae78a1f48434.tar.gz mitmproxy-b51363b3ca43f6572acb673186e6ae78a1f48434.tar.bz2 mitmproxy-b51363b3ca43f6572acb673186e6ae78a1f48434.zip |
Merge remote-tracking branch 'upstream/master' into print-bracket-fix
Conflicts:
examples/har_extractor.py
examples/nonblocking.py
examples/read_dumpfile
libmproxy/web/app.py
Diffstat (limited to 'web/src/js/actions.js')
-rw-r--r-- | web/src/js/actions.js | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/web/src/js/actions.js b/web/src/js/actions.js index 64cd68a7..2455a52e 100644 --- a/web/src/js/actions.js +++ b/web/src/js/actions.js @@ -1,4 +1,6 @@ var $ = require("jquery"); +var _ = require("lodash"); +var AppDispatcher = require("./dispatcher.js").AppDispatcher; var ActionTypes = { // Connection @@ -43,7 +45,8 @@ var SettingsActions = { $.ajax({ type: "PUT", url: "/settings", - data: settings + contentType: 'application/json', + data: JSON.stringify(settings) }); /* @@ -94,11 +97,22 @@ var FlowActions = { revert: function(flow){ $.post("/flows/" + flow.id + "/revert"); }, - update: function (flow) { + update: function (flow, nextProps) { + /* + //Facebook Flux: We do an optimistic update on the client already. + var nextFlow = _.cloneDeep(flow); + _.merge(nextFlow, nextProps); AppDispatcher.dispatchViewAction({ type: ActionTypes.FLOW_STORE, cmd: StoreCmds.UPDATE, - data: flow + data: nextFlow + }); + */ + $.ajax({ + type: "PUT", + url: "/flows/" + flow.id, + contentType: 'application/json', + data: JSON.stringify(nextProps) }); }, clear: function(){ @@ -107,7 +121,7 @@ var FlowActions = { }; var Query = { - FILTER: "f", + SEARCH: "s", HIGHLIGHT: "h", SHOW_EVENTLOG: "e" }; @@ -117,5 +131,7 @@ module.exports = { ConnectionActions: ConnectionActions, FlowActions: FlowActions, StoreCmds: StoreCmds, + SettingsActions: SettingsActions, + EventLogActions: EventLogActions, Query: Query };
\ No newline at end of file |