Skip to content

Commit f1a3d36

Browse files
committed
docs: update faq and offline-log
1 parent 7118ef2 commit f1a3d36

File tree

4 files changed

+37
-4
lines changed

4 files changed

+37
-4
lines changed

src/pages/Docs/md/faq.en.mdx

+18-1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,23 @@ window.$pageSpy = new PageSpy({
6868

6969
// Set logo style
7070
logoStyle: {}, // Only applicable for browser environment
71+
72+
// All internal plugins are carried with PageSpy by default out of the box. You can disable some plugins as needed.
73+
disabledPlugins: [],
74+
75+
// Specify whether the SDK is allowed to serialize non-primitive data types when collecting offline data
76+
serializeData: false,
77+
78+
// Indicate whether authorization is required. If enabled, PageSpy generates a 6-digit random number (below "secret") as a password for the debug room,
79+
// which is required for developers to access the debug room
80+
useSecret: false,
81+
82+
// Specify how many messages to cache.
83+
// The data is primarily used to configure the maximum number of historical data the SDK can send after the debugging terminal goes online.
84+
messageCapacity: 1000,
85+
86+
// Disable on production environment
87+
disabledOnProd: true, // Only applicable for miniprogram
7188
})
7289
```
7390

@@ -410,7 +427,7 @@ pm2 restart page-spy-api
410427

411428
### Under what conditions will a room connection be automatically destroyed? #auto-destroy
412429

413-
> View configuration: [`https://github.com/HuolalaTech/page-spy-api/blob/master/room/local_room.go#L297-L323`](https://github.com/HuolalaTech/page-spy-api/blob/master/room/local_room.go#L297-L323)
430+
> View configuration: https://github.com/HuolalaTech/page-spy-api/blob/master/room/local_room.go#L297-L323
414431
415432
- If a room is created and no SDK or debugging end enters, it will be destroyed after 1 minute (this scenario does not exist in actual use).
416433
- If both SDK and debugging end disconnect, it will be destroyed after 1 minute.

src/pages/Docs/md/faq.zh.mdx

+17-1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,22 @@ window.$pageSpy = new PageSpy({
7070

7171
// 设置 logo 样式
7272
logoStyle: {}, // 仅适用浏览器环境的 SDK
73+
74+
// PageSpy 内置的插件都是开箱即用的,你可以手动指定禁用哪些插件
75+
disabledPlugins: [],
76+
77+
// 是否允许 SDK 在收集离线日志时,序列化非基本类型的数据,序列化的目的是方便在回放时查看
78+
serializeData: false,
79+
80+
// 是否启用权限认证功能。启用后,SDK 会生成 6 位数的随机 “密钥”;调试端进入房间时要求输入对应的密钥
81+
useSecret: false,
82+
83+
// SDK 在调试端进入房间之前会在内存中缓存数据,以便于调试端进入房间后可以看到之前的数据。
84+
// 但数据体积会越来越大,因此可以指定 SDK 在本地最多缓存多少条数据记录。
85+
messageCapacity: 1000,
86+
87+
// 生产环境禁用
88+
disabledOnProd: true, // 仅适用小程序环境的 SDK
7389
})
7490
```
7591

@@ -414,7 +430,7 @@ SDK 可以对页面进行 “截图” 并发送到调试端,但由于:
414430

415431
### 房间连接什么情况下会自动销毁?#auto-destroy
416432

417-
> 查看配置:[`https://github.com/HuolalaTech/page-spy-api/blob/master/room/local_room.go#L297-L323`](https://github.com/HuolalaTech/page-spy-api/blob/master/room/local_room.go#L297-L323)
433+
> 查看配置:https://github.com/HuolalaTech/page-spy-api/blob/master/room/local_room.go#L297-L323
418434
419435
- 房间创建后,无 SDK 或调试端进入,1 分钟后销毁(实际使用过程中,该场景不存在);
420436
- SDK 和调试端都已断开连接,1 分钟后销毁;

src/pages/Docs/md/offline-log.en.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ After PageSpy's SDK supported [plugin registration](./plugins), the development
3030
>
3131
> Concept: The data generated by PageSpy is continuously sent to the "data harbor". After organizing, packaging, and compressing the data, the "data port" stores the data in "containers" (memory or local temp file), awaiting further instructions.
3232
33-
It internally listens for the "public-data" event (see [what is the `"public-data"` event?](./plugins#convention)) to enable offline data caching. It also provides features to handle log data from the SDK-rendered component. When an issue is found on the client, testers can directly upload / download the data. This innovation breaks the previous requirement of having "the client and the debugger online simultaneously."
33+
It internally listens for the `"public-data"` event (see [what is the "public-data" event?](./plugins#convention)) to enable offline data caching. It also provides features to handle log data from the SDK-rendered component. When an issue is found on the client, testers can directly upload / download the data. This innovation breaks the previous requirement of having "the client and the debugger online simultaneously."
3434

3535
### How to Use#how-to-use
3636

src/pages/Docs/md/offline-log.zh.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import replayGif from '@/assets/image/screenshot/replay-page.gif';
3030
>
3131
> 心智模型:PageSpy 产生的数据会源源不断的被送到 “数据港口”,在对数据进行整理、打包、压缩后,“数据港口” 将数据存放在 “集装箱”(内存或本地临时文件)中,等待下一步指示。
3232
33-
它在内部监听 "public-data" 事件([什么是 `"public-data"` 事件?](./plugins#convention)),进而实现离线缓存数据的功能,同时在 SDK 渲染的控件中提供上传、下载数据的功能。当客户端发现问题时,测试同学可以直接上传或者下载数据,这一创新打破了以往「客户端和调试端必须同时在线」的前提要求。
33+
它在内部监听 `"public-data"` 事件([什么是 "public-data" 事件?](./plugins#convention)),进而实现离线缓存数据的功能,同时在 SDK 渲染的控件中提供上传、下载数据的功能。当客户端发现问题时,测试同学可以直接上传或者下载数据,这一创新打破了以往「客户端和调试端必须同时在线」的前提要求。
3434

3535
### 如何使用#how-to-use
3636

0 commit comments

Comments
 (0)