Commit f47349e4 authored by aiduck's avatar aiduck

14

parent 894b2296
{
"name": "@tuia/rip",
"version": "0.1.2",
"version": "0.1.3",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......@@ -1690,7 +1690,7 @@
},
"commander": {
"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=",
"dev": true
},
......@@ -1838,7 +1838,7 @@
},
"cross-env": {
"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=",
"dev": true,
"requires": {
......@@ -2393,8 +2393,7 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"aproba": {
"version": "1.2.0",
......@@ -2415,14 +2414,12 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
......@@ -2437,20 +2434,17 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"core-util-is": {
"version": "1.0.2",
......@@ -2567,8 +2561,7 @@
"inherits": {
"version": "2.0.3",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"ini": {
"version": "1.3.5",
......@@ -2580,7 +2573,6 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
......@@ -2595,7 +2587,6 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
......@@ -2603,14 +2594,12 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"minipass": {
"version": "2.3.5",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
......@@ -2629,7 +2618,6 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
......@@ -2710,8 +2698,7 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"object-assign": {
"version": "4.1.1",
......@@ -2723,7 +2710,6 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
......@@ -2809,8 +2795,7 @@
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"safer-buffer": {
"version": "2.1.2",
......@@ -2846,7 +2831,6 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
......@@ -2866,7 +2850,6 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
......@@ -2910,14 +2893,12 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"yallist": {
"version": "3.0.3",
"bundled": true,
"dev": true,
"optional": true
"dev": true
}
}
},
......@@ -2970,7 +2951,7 @@
},
"globals": {
"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=",
"dev": true
},
......@@ -3387,7 +3368,7 @@
},
"lodash": {
"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=",
"dev": true
},
......@@ -3575,7 +3556,7 @@
},
"mkdirp": {
"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=",
"dev": true,
"requires": {
......@@ -3889,7 +3870,7 @@
},
"path-key": {
"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=",
"dev": true
},
......@@ -4265,7 +4246,7 @@
},
"schema-utils": {
"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=",
"dev": true,
"requires": {
......@@ -5027,7 +5008,7 @@
"dependencies": {
"schema-utils": {
"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=",
"dev": true,
"requires": {
......
{
"name": "@tuia/rip",
"version": "0.1.3",
"version": "0.1.4",
"description": "Tools for user behavior recording and playback based on rrweb",
"main": "dist/index.js",
"scripts": {
......
......@@ -26,6 +26,15 @@ class Monitor {
} else {
this.reset({ userIdentifier });
}
this.tracksWorker.onmessage = (event) => {
switch(event.data) {
case "resetRecord":
this.record();
break;
default:
console.log("unknow action", event.data);
}
}
}
/**
* 关闭rrweb
......@@ -84,8 +93,7 @@ class Monitor {
*/
reset(event) {
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 } }) => {
// todo : 重置参数,重新生成recordKey
reporter.updateData(payload);
reporter.reset();
postMessage('resetRecord');
log("path", reporter.baseInfo.path);
log("分片id", reporter.recordKey);
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