Commit f47349e4 authored by aiduck's avatar aiduck

14

parent 894b2296
{ {
"name": "@tuia/rip", "name": "@tuia/rip",
"version": "0.1.2", "version": "0.1.3",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
...@@ -1690,7 +1690,7 @@ ...@@ -1690,7 +1690,7 @@
}, },
"commander": { "commander": {
"version": "2.20.0", "version": "2.20.0",
"resolved": "https://registry.npm.taobao.org/commander/download/commander-2.20.0.tgz?cache=0&sync_timestamp=1564195111889&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.20.0.tgz", "resolved": "http://registry.npm.taobao.org/commander/download/commander-2.20.0.tgz",
"integrity": "sha1-1YuytcHuj4ew00ACfp6U4iLFpCI=", "integrity": "sha1-1YuytcHuj4ew00ACfp6U4iLFpCI=",
"dev": true "dev": true
}, },
...@@ -1838,7 +1838,7 @@ ...@@ -1838,7 +1838,7 @@
}, },
"cross-env": { "cross-env": {
"version": "5.2.0", "version": "5.2.0",
"resolved": "https://registry.npm.taobao.org/cross-env/download/cross-env-5.2.0.tgz", "resolved": "http://registry.npm.taobao.org/cross-env/download/cross-env-5.2.0.tgz",
"integrity": "sha1-bs1MAV1Xc+YUA57lKQdmabnRJvI=", "integrity": "sha1-bs1MAV1Xc+YUA57lKQdmabnRJvI=",
"dev": true, "dev": true,
"requires": { "requires": {
...@@ -2393,8 +2393,7 @@ ...@@ -2393,8 +2393,7 @@
"ansi-regex": { "ansi-regex": {
"version": "2.1.1", "version": "2.1.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
...@@ -2415,14 +2414,12 @@ ...@@ -2415,14 +2414,12 @@
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
...@@ -2437,20 +2434,17 @@ ...@@ -2437,20 +2434,17 @@
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
...@@ -2567,8 +2561,7 @@ ...@@ -2567,8 +2561,7 @@
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
...@@ -2580,7 +2573,6 @@ ...@@ -2580,7 +2573,6 @@
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
...@@ -2595,7 +2587,6 @@ ...@@ -2595,7 +2587,6 @@
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
...@@ -2603,14 +2594,12 @@ ...@@ -2603,14 +2594,12 @@
"minimist": { "minimist": {
"version": "0.0.8", "version": "0.0.8",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"minipass": { "minipass": {
"version": "2.3.5", "version": "2.3.5",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.2", "safe-buffer": "^5.1.2",
"yallist": "^3.0.0" "yallist": "^3.0.0"
...@@ -2629,7 +2618,6 @@ ...@@ -2629,7 +2618,6 @@
"version": "0.5.1", "version": "0.5.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
} }
...@@ -2710,8 +2698,7 @@ ...@@ -2710,8 +2698,7 @@
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
...@@ -2723,7 +2710,6 @@ ...@@ -2723,7 +2710,6 @@
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
...@@ -2809,8 +2795,7 @@ ...@@ -2809,8 +2795,7 @@
"safe-buffer": { "safe-buffer": {
"version": "5.1.2", "version": "5.1.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
...@@ -2846,7 +2831,6 @@ ...@@ -2846,7 +2831,6 @@
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",
...@@ -2866,7 +2850,6 @@ ...@@ -2866,7 +2850,6 @@
"version": "3.0.1", "version": "3.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
} }
...@@ -2910,14 +2893,12 @@ ...@@ -2910,14 +2893,12 @@
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"yallist": { "yallist": {
"version": "3.0.3", "version": "3.0.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
} }
} }
}, },
...@@ -2970,7 +2951,7 @@ ...@@ -2970,7 +2951,7 @@
}, },
"globals": { "globals": {
"version": "11.12.0", "version": "11.12.0",
"resolved": "https://registry.npm.taobao.org/globals/download/globals-11.12.0.tgz?cache=0&sync_timestamp=1563721993391&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fglobals%2Fdownload%2Fglobals-11.12.0.tgz", "resolved": "https://registry.npm.taobao.org/globals/download/globals-11.12.0.tgz",
"integrity": "sha1-q4eVM4hooLq9hSV1gBjCp+uVxC4=", "integrity": "sha1-q4eVM4hooLq9hSV1gBjCp+uVxC4=",
"dev": true "dev": true
}, },
...@@ -3387,7 +3368,7 @@ ...@@ -3387,7 +3368,7 @@
}, },
"lodash": { "lodash": {
"version": "4.17.15", "version": "4.17.15",
"resolved": "https://registry.npm.taobao.org/lodash/download/lodash-4.17.15.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Flodash%2Fdownload%2Flodash-4.17.15.tgz", "resolved": "https://registry.npm.taobao.org/lodash/download/lodash-4.17.15.tgz",
"integrity": "sha1-tEf2ZwoEVbv+7dETku/zMOoJdUg=", "integrity": "sha1-tEf2ZwoEVbv+7dETku/zMOoJdUg=",
"dev": true "dev": true
}, },
...@@ -3575,7 +3556,7 @@ ...@@ -3575,7 +3556,7 @@
}, },
"mkdirp": { "mkdirp": {
"version": "0.5.1", "version": "0.5.1",
"resolved": "https://registry.npm.taobao.org/mkdirp/download/mkdirp-0.5.1.tgz", "resolved": "http://registry.npm.taobao.org/mkdirp/download/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"dev": true, "dev": true,
"requires": { "requires": {
...@@ -3889,7 +3870,7 @@ ...@@ -3889,7 +3870,7 @@
}, },
"path-key": { "path-key": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "http://registry.npm.taobao.org/path-key/download/path-key-2.0.1.tgz", "resolved": "https://registry.npm.taobao.org/path-key/download/path-key-2.0.1.tgz",
"integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=",
"dev": true "dev": true
}, },
...@@ -4265,7 +4246,7 @@ ...@@ -4265,7 +4246,7 @@
}, },
"schema-utils": { "schema-utils": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/schema-utils/download/schema-utils-1.0.0.tgz?cache=0&sync_timestamp=1563466381874&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fschema-utils%2Fdownload%2Fschema-utils-1.0.0.tgz", "resolved": "http://registry.npm.taobao.org/schema-utils/download/schema-utils-1.0.0.tgz",
"integrity": "sha1-C3mpMgTXtgDUsoUNH2bCo0lRx3A=", "integrity": "sha1-C3mpMgTXtgDUsoUNH2bCo0lRx3A=",
"dev": true, "dev": true,
"requires": { "requires": {
...@@ -5027,7 +5008,7 @@ ...@@ -5027,7 +5008,7 @@
"dependencies": { "dependencies": {
"schema-utils": { "schema-utils": {
"version": "0.4.7", "version": "0.4.7",
"resolved": "https://registry.npm.taobao.org/schema-utils/download/schema-utils-0.4.7.tgz?cache=0&sync_timestamp=1563466381874&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fschema-utils%2Fdownload%2Fschema-utils-0.4.7.tgz", "resolved": "http://registry.npm.taobao.org/schema-utils/download/schema-utils-0.4.7.tgz",
"integrity": "sha1-unT1l9K+LqiAExdG7hfQoJPGgYc=", "integrity": "sha1-unT1l9K+LqiAExdG7hfQoJPGgYc=",
"dev": true, "dev": true,
"requires": { "requires": {
......
{ {
"name": "@tuia/rip", "name": "@tuia/rip",
"version": "0.1.3", "version": "0.1.4",
"description": "Tools for user behavior recording and playback based on rrweb", "description": "Tools for user behavior recording and playback based on rrweb",
"main": "dist/index.js", "main": "dist/index.js",
"scripts": { "scripts": {
......
...@@ -26,6 +26,15 @@ class Monitor { ...@@ -26,6 +26,15 @@ class Monitor {
} else { } else {
this.reset({ userIdentifier }); this.reset({ userIdentifier });
} }
this.tracksWorker.onmessage = (event) => {
switch(event.data) {
case "resetRecord":
this.record();
break;
default:
console.log("unknow action", event.data);
}
}
} }
/** /**
* 关闭rrweb * 关闭rrweb
...@@ -84,8 +93,7 @@ class Monitor { ...@@ -84,8 +93,7 @@ class Monitor {
*/ */
reset(event) { reset(event) {
console.log("重置数据"); console.log("重置数据");
this.record(); this.tracksWorker.postMessage({ type: "reset", payload: event })
this.tracksWorker.postMessage({ type: "reset", payload: event });
} }
} }
......
...@@ -33,6 +33,7 @@ onmessage = ({ data: { type, payload } }) => { ...@@ -33,6 +33,7 @@ onmessage = ({ data: { type, payload } }) => {
// todo : 重置参数,重新生成recordKey // todo : 重置参数,重新生成recordKey
reporter.updateData(payload); reporter.updateData(payload);
reporter.reset(); reporter.reset();
postMessage('resetRecord');
log("path", reporter.baseInfo.path); log("path", reporter.baseInfo.path);
log("分片id", reporter.recordKey); log("分片id", reporter.recordKey);
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment