mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 18:18:25 +00:00
[web] update build
This commit is contained in:
parent
aecc267eb9
commit
59dc5e4687
@ -134,9 +134,9 @@
|
|||||||
"use strict";function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r["default"]=e,r}function _toConsumableArray(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)}function _defineProperty(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function reduce(){var e=arguments.length<=0||void 0===arguments[0]?defaultState:arguments[0],r=arguments[1];switch(r.type){case INIT:return _extends({},e,_defineProperty({},r.queue,[]));case ENQUEUE:return _extends({},e,_defineProperty({},r.queue,[].concat(_toConsumableArray(e[r.queue]),[r.msg])));case CLEAR:return _extends({},e,_defineProperty({},r.queue,null));default:return e}}function handleWsMsg(e){return function(r,t){var n=handlers[e.type];return r(e.cmd===websocketActions.CMD_RESET?fetchData(n.MSG_TYPE):t().msgQueue[n.MSG_TYPE]?{type:ENQUEUE,queue:n.MSG_TYPE,msg:e}:n.handleWsMsg(e))}}function fetchData(e){return function(r){var t=handlers[e];r(init(t.MSG_TYPE)),(0,_utils.fetchApi)(t.DATA_URL).then(function(e){return e.json()}).then(function(t){return r(receive(e,t))})["catch"](function(t){return r(fetchError(e,t))})}}function receive(e,r){return function(t,n){var o=handlers[e],i=n().msgQueue[o.MSG_TYPE]||[];t(clear(o.MSG_TYPE)),t(o.receiveData(r.data));var s=!0,u=!1,a=void 0;try{for(var c,l=i[Symbol.iterator]();!(s=(c=l.next()).done);s=!0){var _=c.value;t(o.handleWsMsg(_))}}catch(f){u=!0,a=f}finally{try{!s&&l["return"]&&l["return"]()}finally{if(u)throw a}}}}function init(e){return{type:INIT,queue:e}}function clear(e){return{type:CLEAR,queue:e}}function fetchError(e,r){var t;return t={type:FETCH_ERROR},_defineProperty(t,"type",e),_defineProperty(t,"error",r),t}Object.defineProperty(exports,"__esModule",{value:!0}),exports.FETCH_ERROR=exports.CLEAR=exports.ENQUEUE=exports.INIT=void 0;var _extends=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},_handlers;exports["default"]=reduce,exports.handleWsMsg=handleWsMsg,exports.fetchData=fetchData,exports.receive=receive,exports.init=init,exports.clear=clear,exports.fetchError=fetchError;var _utils=require("../utils"),_websocket=require("./websocket"),websocketActions=_interopRequireWildcard(_websocket),_eventLog=require("./eventLog"),eventLogActions=_interopRequireWildcard(_eventLog),_flows=require("./flows"),flowsActions=_interopRequireWildcard(_flows),_settings=require("./settings"),settingsActions=_interopRequireWildcard(_settings),INIT=exports.INIT="MSG_QUEUE_INIT",ENQUEUE=exports.ENQUEUE="MSG_QUEUE_ENQUEUE",CLEAR=exports.CLEAR="MSG_QUEUE_CLEAR",FETCH_ERROR=exports.FETCH_ERROR="MSG_QUEUE_FETCH_ERROR",handlers=(_handlers={},_defineProperty(_handlers,eventLogActions.MSG_TYPE,eventLogActions),_defineProperty(_handlers,flowsActions.MSG_TYPE,flowsActions),_defineProperty(_handlers,settingsActions.MSG_TYPE,settingsActions),_handlers),defaultState={};
|
"use strict";function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r["default"]=e,r}function _toConsumableArray(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)}function _defineProperty(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function reduce(){var e=arguments.length<=0||void 0===arguments[0]?defaultState:arguments[0],r=arguments[1];switch(r.type){case INIT:return _extends({},e,_defineProperty({},r.queue,[]));case ENQUEUE:return _extends({},e,_defineProperty({},r.queue,[].concat(_toConsumableArray(e[r.queue]),[r.msg])));case CLEAR:return _extends({},e,_defineProperty({},r.queue,null));default:return e}}function handleWsMsg(e){return function(r,t){var n=handlers[e.type];return r(e.cmd===websocketActions.CMD_RESET?fetchData(n.MSG_TYPE):t().msgQueue[n.MSG_TYPE]?{type:ENQUEUE,queue:n.MSG_TYPE,msg:e}:n.handleWsMsg(e))}}function fetchData(e){return function(r){var t=handlers[e];r(init(t.MSG_TYPE)),(0,_utils.fetchApi)(t.DATA_URL).then(function(e){return e.json()}).then(function(t){return r(receive(e,t))})["catch"](function(t){return r(fetchError(e,t))})}}function receive(e,r){return function(t,n){var o=handlers[e],i=n().msgQueue[o.MSG_TYPE]||[];t(clear(o.MSG_TYPE)),t(o.receiveData(r.data));var s=!0,u=!1,a=void 0;try{for(var c,l=i[Symbol.iterator]();!(s=(c=l.next()).done);s=!0){var _=c.value;t(o.handleWsMsg(_))}}catch(f){u=!0,a=f}finally{try{!s&&l["return"]&&l["return"]()}finally{if(u)throw a}}}}function init(e){return{type:INIT,queue:e}}function clear(e){return{type:CLEAR,queue:e}}function fetchError(e,r){var t;return t={type:FETCH_ERROR},_defineProperty(t,"type",e),_defineProperty(t,"error",r),t}Object.defineProperty(exports,"__esModule",{value:!0}),exports.FETCH_ERROR=exports.CLEAR=exports.ENQUEUE=exports.INIT=void 0;var _extends=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},_handlers;exports["default"]=reduce,exports.handleWsMsg=handleWsMsg,exports.fetchData=fetchData,exports.receive=receive,exports.init=init,exports.clear=clear,exports.fetchError=fetchError;var _utils=require("../utils"),_websocket=require("./websocket"),websocketActions=_interopRequireWildcard(_websocket),_eventLog=require("./eventLog"),eventLogActions=_interopRequireWildcard(_eventLog),_flows=require("./flows"),flowsActions=_interopRequireWildcard(_flows),_settings=require("./settings"),settingsActions=_interopRequireWildcard(_settings),INIT=exports.INIT="MSG_QUEUE_INIT",ENQUEUE=exports.ENQUEUE="MSG_QUEUE_ENQUEUE",CLEAR=exports.CLEAR="MSG_QUEUE_CLEAR",FETCH_ERROR=exports.FETCH_ERROR="MSG_QUEUE_FETCH_ERROR",handlers=(_handlers={},_defineProperty(_handlers,eventLogActions.MSG_TYPE,eventLogActions),_defineProperty(_handlers,flowsActions.MSG_TYPE,flowsActions),_defineProperty(_handlers,settingsActions.MSG_TYPE,settingsActions),_handlers),defaultState={};
|
||||||
|
|
||||||
},{"../utils":55,"./eventLog":42,"./flows":43,"./settings":46,"./websocket":52}],46:[function(require,module,exports){
|
},{"../utils":55,"./eventLog":42,"./flows":43,"./settings":46,"./websocket":52}],46:[function(require,module,exports){
|
||||||
"use strict";function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t}function reducer(){var e=arguments.length<=0||void 0===arguments[0]?defaultState:arguments[0],t=arguments[1];switch(t.type){case RECEIVE:return _extends({},e,{settings:t.settings});case UPDATE:return _extends({},e,{settings:_extends({},e.settings,t.settings)});default:return e}}function handleWsMsg(e){switch(e.cmd){case websocketActions.CMD_UPDATE:return updateSettings(e.data);default:return console.error("unknown settings update",e),{type:UNKNOWN_CMD,msg:e}}}function update(e){return _utils.fetchApi.put("/settings",e),{type:REQUEST_UPDATE}}function fetchData(){return msgQueueActions.fetchData(MSG_TYPE)}function receiveData(e){return{type:RECEIVE,settings:e}}function updateSettings(e){return{type:UPDATE,settings:e}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.UNKNOWN_CMD=exports.REQUEST_UPDATE=exports.UPDATE=exports.RECEIVE=exports.DATA_URL=exports.MSG_TYPE=void 0;var _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e};exports["default"]=reducer,exports.handleWsMsg=handleWsMsg,exports.update=update,exports.fetchData=fetchData,exports.receiveData=receiveData,exports.updateSettings=updateSettings;var _utils=require("../utils"),_msgQueue=require("./msgQueue"),msgQueueActions=_interopRequireWildcard(_msgQueue),MSG_TYPE=exports.MSG_TYPE="UPDATE_SETTINGS",DATA_URL=exports.DATA_URL="/settings",RECEIVE=exports.RECEIVE="RECEIVE",UPDATE=exports.UPDATE="UPDATE",REQUEST_UPDATE=exports.REQUEST_UPDATE="REQUEST_UPDATE",UNKNOWN_CMD=exports.UNKNOWN_CMD="SETTINGS_UNKNOWN_CMD",defaultState={settings:{}};
|
"use strict";function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t}function reducer(){var e=arguments.length<=0||void 0===arguments[0]?defaultState:arguments[0],t=arguments[1];switch(t.type){case RECEIVE:return _extends({},e,{settings:t.settings});case UPDATE:return _extends({},e,{settings:_extends({},e.settings,t.settings)});default:return e}}function handleWsMsg(e){switch(e.cmd){case websocketActions.CMD_UPDATE:return updateSettings(e.data);default:return console.error("unknown settings update",e),{type:UNKNOWN_CMD,msg:e}}}function update(e){return _utils.fetchApi.put("/settings",e),{type:REQUEST_UPDATE}}function fetchData(){return msgQueueActions.fetchData(MSG_TYPE)}function receiveData(e){return{type:RECEIVE,settings:e}}function updateSettings(e){return{type:UPDATE,settings:e}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.UNKNOWN_CMD=exports.REQUEST_UPDATE=exports.UPDATE=exports.RECEIVE=exports.DATA_URL=exports.MSG_TYPE=void 0;var _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e};exports["default"]=reducer,exports.handleWsMsg=handleWsMsg,exports.update=update,exports.fetchData=fetchData,exports.receiveData=receiveData,exports.updateSettings=updateSettings;var _utils=require("../utils"),_websocket=require("./websocket"),websocketActions=_interopRequireWildcard(_websocket),_msgQueue=require("./msgQueue"),msgQueueActions=_interopRequireWildcard(_msgQueue),MSG_TYPE=exports.MSG_TYPE="UPDATE_SETTINGS",DATA_URL=exports.DATA_URL="/settings",RECEIVE=exports.RECEIVE="RECEIVE",UPDATE=exports.UPDATE="UPDATE",REQUEST_UPDATE=exports.REQUEST_UPDATE="REQUEST_UPDATE",UNKNOWN_CMD=exports.UNKNOWN_CMD="SETTINGS_UNKNOWN_CMD",defaultState={settings:{}};
|
||||||
|
|
||||||
},{"../utils":55,"./msgQueue":45}],47:[function(require,module,exports){
|
},{"../utils":55,"./msgQueue":45,"./websocket":52}],47:[function(require,module,exports){
|
||||||
"use strict";function reducer(){var e=arguments.length<=0||void 0===arguments[0]?defaultState:arguments[0],t=arguments[1];switch(t.type){case SET_ACTIVE_MENU:return _extends({},e,{activeMenu:t.activeMenu});case _flows.SELECT_FLOW:var r=t.flowId&&!t.currentSelection,n=!t.flowId&&t.currentSelection;return r?_extends({},e,{activeMenu:"Flow"}):n&&"Flow"===e.activeMenu?_extends({},e,{activeMenu:"Start"}):e;default:return e}}function setActiveMenu(e){return{type:SET_ACTIVE_MENU,activeMenu:e}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.SET_ACTIVE_MENU=void 0;var _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};exports["default"]=reducer,exports.setActiveMenu=setActiveMenu;var _flows=require("./flows"),SET_ACTIVE_MENU=exports.SET_ACTIVE_MENU="SET_ACTIVE_MENU",defaultState={activeMenu:"Start"};
|
"use strict";function reducer(){var e=arguments.length<=0||void 0===arguments[0]?defaultState:arguments[0],t=arguments[1];switch(t.type){case SET_ACTIVE_MENU:return _extends({},e,{activeMenu:t.activeMenu});case _flows.SELECT_FLOW:var r=t.flowId&&!t.currentSelection,n=!t.flowId&&t.currentSelection;return r?_extends({},e,{activeMenu:"Flow"}):n&&"Flow"===e.activeMenu?_extends({},e,{activeMenu:"Start"}):e;default:return e}}function setActiveMenu(e){return{type:SET_ACTIVE_MENU,activeMenu:e}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.SET_ACTIVE_MENU=void 0;var _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};exports["default"]=reducer,exports.setActiveMenu=setActiveMenu;var _flows=require("./flows"),SET_ACTIVE_MENU=exports.SET_ACTIVE_MENU="SET_ACTIVE_MENU",defaultState={activeMenu:"Start"};
|
||||||
|
|
||||||
},{"./flows":43}],48:[function(require,module,exports){
|
},{"./flows":43}],48:[function(require,module,exports){
|
||||||
@ -149,9 +149,9 @@
|
|||||||
"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r["default"]=e,r}function add(e){return{type:ADD,item:e}}function update(e,r){return{type:UPDATE,id:e,item:r}}function remove(e){return{type:REMOVE,id:e}}function receive(e){return{type:RECEIVE,list:e}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.RECEIVE=exports.REMOVE=exports.UPDATE=exports.ADD=void 0,exports.add=add,exports.update=update,exports.remove=remove,exports.receive=receive;var _redux=require("redux"),_view=require("./utils/view"),viewActions=_interopRequireWildcard(_view),_main=require("./views/main.js"),_main2=_interopRequireDefault(_main),ADD=exports.ADD="FLOW_VIEWS_ADD",UPDATE=exports.UPDATE="FLOW_VIEWS_UPDATE",REMOVE=exports.REMOVE="FLOW_VIEWS_REMOVE",RECEIVE=exports.RECEIVE="FLOW_VIEWS_RECEIVE";exports["default"]=(0,_redux.combineReducers)({main:_main2["default"]});
|
"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r["default"]=e,r}function add(e){return{type:ADD,item:e}}function update(e,r){return{type:UPDATE,id:e,item:r}}function remove(e){return{type:REMOVE,id:e}}function receive(e){return{type:RECEIVE,list:e}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.RECEIVE=exports.REMOVE=exports.UPDATE=exports.ADD=void 0,exports.add=add,exports.update=update,exports.remove=remove,exports.receive=receive;var _redux=require("redux"),_view=require("./utils/view"),viewActions=_interopRequireWildcard(_view),_main=require("./views/main.js"),_main2=_interopRequireDefault(_main),ADD=exports.ADD="FLOW_VIEWS_ADD",UPDATE=exports.UPDATE="FLOW_VIEWS_UPDATE",REMOVE=exports.REMOVE="FLOW_VIEWS_REMOVE",RECEIVE=exports.RECEIVE="FLOW_VIEWS_RECEIVE";exports["default"]=(0,_redux.combineReducers)({main:_main2["default"]});
|
||||||
|
|
||||||
},{"./utils/view":49,"./views/main.js":51,"redux":"redux"}],51:[function(require,module,exports){
|
},{"./utils/view":49,"./views/main.js":51,"redux":"redux"}],51:[function(require,module,exports){
|
||||||
"use strict";function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t}function reduce(){var e=arguments.length<=0||void 0===arguments[0]?defaultState:arguments[0],t=arguments[1];switch(t.type){case UPDATE_HIGHLIGHT:return _extends({},e,{highlight:t.highlight});case SELECT:return _extends({},e,{selected:[t.id]});case UPDATE_FILTER:return _extends({},e,{filter:t.filter,view:(0,viewActions["default"])(e.view,viewActions.updateFilter(t.list,makeFilter(t.filter),makeSorter(e.sorter)))});case UPDATE_SORTER:var r={column:t.column,desc:t.desc};return _extends({},e,{sorter:r,view:(0,viewActions["default"])(e.view,viewActions.updateSorter(makeSorter(r)))});case viewsActions.ADD:return _extends({},e,{view:(0,viewActions["default"])(e.view,viewActions.add(t.item,makeFilter(e.filter),makeSorter(e.sorter)))});case viewsActions.UPDATE:return _extends({},e,{view:(0,viewActions["default"])(e.view,viewActions.update(t.id,t.item,makeFilter(e.filter),makeSorter(e.sorter)))});case viewsActions.REMOVE:return _extends({},e,{view:(0,viewActions["default"])(e.view,viewActions.remove(t.id))});case viewsActions.RECEIVE:return _extends({},e,{view:(0,viewActions["default"])(e.view,viewActions.receive(t.list,makeFilter(e.filter),makeSorter(e.sorter)))});default:return _extends({},e,{view:(0,viewActions["default"])(e.view,t)})}}function updateFilter(e){return function(t,r){return{type:UPDATE_FILTER,filter:e,list:r().flows.list}}}function updateHighlight(e){return{type:UPDATE_HIGHLIGHT,highlight:e}}function updateSorter(e,t){return{type:UPDATE_SORTER,column:e,desc:t}}function select(e){return function(t,r){t({type:SELECT,currentSelection:r().flows.views.main.selected[0],id:e})}}function makeFilter(e){return e?Filt.parse(e):void 0}function makeSorter(e){var t=e.column,r=e.desc,i=sortKeyFuns[t];return i?function(e,t){var n=i(e),s=i(t);return n>s?r?-1:1:s>n?r?1:-1:0}:void 0}Object.defineProperty(exports,"__esModule",{value:!0}),exports.SELECT=exports.UPDATE_HIGHLIGHT=exports.UPDATE_SORTER=exports.UPDATE_FILTER=void 0;var _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};exports["default"]=reduce,exports.updateFilter=updateFilter,exports.updateHighlight=updateHighlight,exports.updateSorter=updateSorter,exports.select=select;var _utils=require("../../flow/utils"),_view=require("../utils/view"),viewActions=_interopRequireWildcard(_view),_views=require("../views"),viewsActions=_interopRequireWildcard(_views),UPDATE_FILTER=exports.UPDATE_FILTER="FLOW_VIEWS_MAIN_UPDATE_FILTER",UPDATE_SORTER=exports.UPDATE_SORTER="FLOW_VIEWS_MAIN_UPDATE_SORTER",UPDATE_HIGHLIGHT=exports.UPDATE_HIGHLIGHT="FLOW_VIEWS_MAIN_UPDATE_HIGHLIGHT",SELECT=exports.SELECT="FLOW_VIEWS_MAIN_SELECT",sortKeyFuns={TLSColumn:function(e){return e.request.scheme},PathColumn:function(e){return _utils.RequestUtils.pretty_url(e.request)},MethodColumn:function(e){return e.request.method},StatusColumn:function(e){return e.response&&e.response.status_code},TimeColumn:function(e){return e.response&&e.response.timestamp_end-e.request.timestamp_start},SizeColumn:function(e){var t=e.request.contentLength;return e.response&&(t+=e.response.contentLength||0),t}},defaultState={highlight:null,selected:[],filter:null,sorter:{column:null,desc:!1},view:void 0};
|
"use strict";function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t}function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function reduce(){var e=arguments.length<=0||void 0===arguments[0]?defaultState:arguments[0],t=arguments[1];switch(t.type){case UPDATE_HIGHLIGHT:return _extends({},e,{highlight:t.highlight});case SELECT:return _extends({},e,{selected:[t.id]});case UPDATE_FILTER:return _extends({},e,{filter:t.filter,view:(0,viewActions["default"])(e.view,viewActions.updateFilter(t.list,makeFilter(t.filter),makeSorter(e.sorter)))});case UPDATE_SORTER:var r={column:t.column,desc:t.desc};return _extends({},e,{sorter:r,view:(0,viewActions["default"])(e.view,viewActions.updateSorter(makeSorter(r)))});case viewsActions.ADD:return _extends({},e,{view:(0,viewActions["default"])(e.view,viewActions.add(t.item,makeFilter(e.filter),makeSorter(e.sorter)))});case viewsActions.UPDATE:return _extends({},e,{view:(0,viewActions["default"])(e.view,viewActions.update(t.id,t.item,makeFilter(e.filter),makeSorter(e.sorter)))});case viewsActions.REMOVE:return _extends({},e,{view:(0,viewActions["default"])(e.view,viewActions.remove(t.id))});case viewsActions.RECEIVE:return _extends({},e,{view:(0,viewActions["default"])(e.view,viewActions.receive(t.list,makeFilter(e.filter),makeSorter(e.sorter)))});default:return _extends({},e,{view:(0,viewActions["default"])(e.view,t)})}}function updateFilter(e){return function(t,r){t({type:UPDATE_FILTER,filter:e,list:r().flows.list})}}function updateHighlight(e){return{type:UPDATE_HIGHLIGHT,highlight:e}}function updateSorter(e,t){return{type:UPDATE_SORTER,column:e,desc:t}}function select(e){return function(t,r){t({type:SELECT,currentSelection:r().flows.views.main.selected[0],id:e})}}function makeFilter(e){return e?_filt2["default"].parse(e):void 0}function makeSorter(e){var t=e.column,r=e.desc,i=sortKeyFuns[t];return i?function(e,t){var n=i(e),s=i(t);return n>s?r?-1:1:s>n?r?1:-1:0}:void 0}Object.defineProperty(exports,"__esModule",{value:!0}),exports.SELECT=exports.UPDATE_HIGHLIGHT=exports.UPDATE_SORTER=exports.UPDATE_FILTER=void 0;var _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};exports["default"]=reduce,exports.updateFilter=updateFilter,exports.updateHighlight=updateHighlight,exports.updateSorter=updateSorter,exports.select=select;var _filt=require("../../filt/filt"),_filt2=_interopRequireDefault(_filt),_utils=require("../../flow/utils"),_view=require("../utils/view"),viewActions=_interopRequireWildcard(_view),_views=require("../views"),viewsActions=_interopRequireWildcard(_views),UPDATE_FILTER=exports.UPDATE_FILTER="FLOW_VIEWS_MAIN_UPDATE_FILTER",UPDATE_SORTER=exports.UPDATE_SORTER="FLOW_VIEWS_MAIN_UPDATE_SORTER",UPDATE_HIGHLIGHT=exports.UPDATE_HIGHLIGHT="FLOW_VIEWS_MAIN_UPDATE_HIGHLIGHT",SELECT=exports.SELECT="FLOW_VIEWS_MAIN_SELECT",sortKeyFuns={TLSColumn:function(e){return e.request.scheme},PathColumn:function(e){return _utils.RequestUtils.pretty_url(e.request)},MethodColumn:function(e){return e.request.method},StatusColumn:function(e){return e.response&&e.response.status_code},TimeColumn:function(e){return e.response&&e.response.timestamp_end-e.request.timestamp_start},SizeColumn:function(e){var t=e.request.contentLength;return e.response&&(t+=e.response.contentLength||0),t}},defaultState={highlight:null,selected:[],filter:null,sorter:{column:null,desc:!1},view:void 0};
|
||||||
|
|
||||||
},{"../../flow/utils":54,"../utils/view":49,"../views":50}],52:[function(require,module,exports){
|
},{"../../filt/filt":53,"../../flow/utils":54,"../utils/view":49,"../views":50}],52:[function(require,module,exports){
|
||||||
"use strict";function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function reduce(){var e,t=arguments.length<=0||void 0===arguments[0]?defaultState:arguments[0],n=arguments[1];switch(n.type){case CONNECT:return _extends({},t,_defineProperty({},SYM_SOCKET,n.socket));case CONNECTED:return _extends({},t,{connected:!0});case DISCONNECT:return _extends({},t,{connected:!1});case DISCONNECTED:return _extends({},t,(e={},_defineProperty(e,SYM_SOCKET,null),_defineProperty(e,"connected",!1),e));default:return t}}function connect(){return function(e){var t=new WebSocket(location.origin.replace("http","ws")+"/updates");t.addEventListener("open",function(){return e(onConnect())}),t.addEventListener("close",function(){return e(onDisconnect())}),t.addEventListener("message",function(t){return e(onMessage(JSON.parse(t.data)))}),t.addEventListener("error",function(t){return e(onError(t))}),e({type:CONNECT,socket:t})}}function disconnect(){return function(e,t){t().settings[SYM_SOCKET].close(),e({type:DISCONNECT})}}function onConnect(){return function(e){e({type:CONNECTED}),e(settingsActions.fetchData()),e(flowsActions.fetchData()),e(eventLogActions.fetchData())}}function onMessage(e){return msgQueueActions.handleWsMsg(e)}function onDisconnect(){return function(e){e(eventLogActions.addLogEntry("WebSocket connection closed.")),e({type:DISCONNECTED})}}function onError(e){return function(t){t(eventLogActions.addLogEntry("WebSocket connection error.")),t({type:ERROR,error:e})}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.MESSAGE=exports.ERROR=exports.DISCONNECTED=exports.DISCONNECT=exports.CONNECTED=exports.CONNECT=exports.SYM_SOCKET=exports.CMD_RESET=exports.CMD_REMOVE=exports.CMD_UPDATE=exports.CMD_ADD=void 0;var _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};exports["default"]=reduce,exports.connect=connect,exports.disconnect=disconnect,exports.onConnect=onConnect,exports.onMessage=onMessage,exports.onDisconnect=onDisconnect,exports.onError=onError;var _actions=require("../actions.js"),_dispatcher=require("../dispatcher.js"),_msgQueue=require("./msgQueue"),msgQueueActions=_interopRequireWildcard(_msgQueue),_eventLog=require("./eventLog"),eventLogActions=_interopRequireWildcard(_eventLog),_flows=require("./flows"),flowsActions=_interopRequireWildcard(_flows),_settings=require("./settings"),settingsActions=_interopRequireWildcard(_settings),CMD_ADD=exports.CMD_ADD="add",CMD_UPDATE=exports.CMD_UPDATE="update",CMD_REMOVE=exports.CMD_REMOVE="remove",CMD_RESET=exports.CMD_RESET="reset",SYM_SOCKET=exports.SYM_SOCKET=Symbol("WEBSOCKET_SYM_SOCKET"),CONNECT=exports.CONNECT="WEBSOCKET_CONNECT",CONNECTED=exports.CONNECTED="WEBSOCKET_CONNECTED",DISCONNECT=exports.DISCONNECT="WEBSOCKET_DISCONNECT",DISCONNECTED=exports.DISCONNECTED="WEBSOCKET_DISCONNECTED",ERROR=exports.ERROR="WEBSOCKET_ERROR",MESSAGE=exports.MESSAGE="WEBSOCKET_MESSAGE",defaultState={connected:!1,socket:null};
|
"use strict";function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function reduce(){var e,t=arguments.length<=0||void 0===arguments[0]?defaultState:arguments[0],n=arguments[1];switch(n.type){case CONNECT:return _extends({},t,_defineProperty({},SYM_SOCKET,n.socket));case CONNECTED:return _extends({},t,{connected:!0});case DISCONNECT:return _extends({},t,{connected:!1});case DISCONNECTED:return _extends({},t,(e={},_defineProperty(e,SYM_SOCKET,null),_defineProperty(e,"connected",!1),e));default:return t}}function connect(){return function(e){var t=new WebSocket(location.origin.replace("http","ws")+"/updates");t.addEventListener("open",function(){return e(onConnect())}),t.addEventListener("close",function(){return e(onDisconnect())}),t.addEventListener("message",function(t){return e(onMessage(JSON.parse(t.data)))}),t.addEventListener("error",function(t){return e(onError(t))}),e({type:CONNECT,socket:t})}}function disconnect(){return function(e,t){t().settings[SYM_SOCKET].close(),e({type:DISCONNECT})}}function onConnect(){return function(e){e({type:CONNECTED}),e(settingsActions.fetchData()),e(flowsActions.fetchData()),e(eventLogActions.fetchData())}}function onMessage(e){return msgQueueActions.handleWsMsg(e)}function onDisconnect(){return function(e){e(eventLogActions.addLogEntry("WebSocket connection closed.")),e({type:DISCONNECTED})}}function onError(e){return function(t){t(eventLogActions.addLogEntry("WebSocket connection error.")),t({type:ERROR,error:e})}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.MESSAGE=exports.ERROR=exports.DISCONNECTED=exports.DISCONNECT=exports.CONNECTED=exports.CONNECT=exports.SYM_SOCKET=exports.CMD_RESET=exports.CMD_REMOVE=exports.CMD_UPDATE=exports.CMD_ADD=void 0;var _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};exports["default"]=reduce,exports.connect=connect,exports.disconnect=disconnect,exports.onConnect=onConnect,exports.onMessage=onMessage,exports.onDisconnect=onDisconnect,exports.onError=onError;var _actions=require("../actions.js"),_dispatcher=require("../dispatcher.js"),_msgQueue=require("./msgQueue"),msgQueueActions=_interopRequireWildcard(_msgQueue),_eventLog=require("./eventLog"),eventLogActions=_interopRequireWildcard(_eventLog),_flows=require("./flows"),flowsActions=_interopRequireWildcard(_flows),_settings=require("./settings"),settingsActions=_interopRequireWildcard(_settings),CMD_ADD=exports.CMD_ADD="add",CMD_UPDATE=exports.CMD_UPDATE="update",CMD_REMOVE=exports.CMD_REMOVE="remove",CMD_RESET=exports.CMD_RESET="reset",SYM_SOCKET=exports.SYM_SOCKET=Symbol("WEBSOCKET_SYM_SOCKET"),CONNECT=exports.CONNECT="WEBSOCKET_CONNECT",CONNECTED=exports.CONNECTED="WEBSOCKET_CONNECTED",DISCONNECT=exports.DISCONNECT="WEBSOCKET_DISCONNECT",DISCONNECTED=exports.DISCONNECTED="WEBSOCKET_DISCONNECTED",ERROR=exports.ERROR="WEBSOCKET_ERROR",MESSAGE=exports.MESSAGE="WEBSOCKET_MESSAGE",defaultState={connected:!1,socket:null};
|
||||||
|
|
||||||
},{"../actions.js":1,"../dispatcher.js":40,"./eventLog":42,"./flows":43,"./msgQueue":45,"./settings":46}],53:[function(require,module,exports){
|
},{"../actions.js":1,"../dispatcher.js":40,"./eventLog":42,"./flows":43,"./msgQueue":45,"./settings":46}],53:[function(require,module,exports){
|
||||||
|
Loading…
Reference in New Issue
Block a user