Skip to content

Commit a64068e

Browse files
committed
docs: v1.9.6 changelog and harbor api
1 parent 665cbfb commit a64068e

File tree

6 files changed

+210
-15
lines changed

6 files changed

+210
-15
lines changed

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

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
2020
- [constructor()](./data-harbor#constructor)
2121
- [$harbor.onOfflineLog()](./data-harbor#onOfflineLog)
22+
- [$harbor.pause()](./data-harbor#pause)
23+
- [$harbor.resume()](./data-harbor#resume)
24+
- [$harbor.reharbor()](./data-harbor#reharbor)
2225

2326
#### RRWebPlugin#rrweb
2427

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

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
2020
- [constructor()](./data-harbor#constructor)
2121
- [$harbor.onOfflineLog()](./data-harbor#onOfflineLog)
22+
- [$harbor.pause()](./data-harbor#pause)
23+
- [$harbor.resume()](./data-harbor#resume)
24+
- [$harbor.reharbor()](./data-harbor#reharbor)
2225

2326
#### RRWebPlugin#rrweb
2427

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

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
import offlineLogImg from '@/assets/image/screenshot/v1.9.2-offline-log-size.png';
22

3+
## v1.9.6
4+
5+
- 🆕 DataHarborPlugin added a new prototype method. See details: https://github.com/HuolalaTech/page-spy/pull/110;
6+
- `$harbor.pause()`: Pause recording;
7+
- `$harbor.resume()`: Resume recording, corresponding to `pause()`;
8+
- `$harbor.reharbor()`: Clear the recorded data and remakes it.
9+
- 🆕 Add new prompt for "Object cannot be expanded" on the replay page;
10+
- 🐛 Fixed the display of `application/x-www-form-urlencoded` payload. See details: https://github.com/HuolalaTech/page-spy-web/issues/267;
11+
312
## v1.9.5
413

514
- 🆕 Add DockerHub image: https://hub.docker.com/r/huolalatech/page-spy-web;

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

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
import offlineLogImg from '@/assets/image/screenshot/v1.9.2-offline-log-size.png';
22

3+
## v1.9.6
4+
5+
- 🆕 DataHarborPlugin 插件新增原型方法。查看详情:https://github.com/HuolalaTech/page-spy/pull/110
6+
- `$harbor.pause()`:暂停记录;
7+
- `$harbor.resume()`: 恢复记录,和 `pause()` 对应;
8+
- `$harbor.reharbor()`:清空已记录的数据并重新制作。
9+
- 🆕 回放页面对于「对象不可展开」新增提示;
10+
- 🐛 修复 `application/x-www-form-urlencoded` 展示的 Payload。查看详情:https://github.com/HuolalaTech/page-spy-web/issues/267
11+
312
## v1.9.5
413

514
- 🆕 新增 DockerHub 镜像: https://hub.docker.com/r/huolalatech/page-spy-web;

src/pages/Docs/md/data-harbor.en.mdx

+94-10
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// Default 10MB.
1212
maximum?: number;
1313

14-
// Specit which types of data to cache
14+
// Specify which types of data to cache
1515
caredData?: Record<DataType, boolean>;
1616

1717
// Specify the offline log filename, with the default being named according to the current time
@@ -21,39 +21,123 @@
2121
onDownload?: (data: CacheMessageItem[]) => void;
2222
}
2323

24-
delcare class DataHarborPlugin implements PageSpyPlugin {
24+
declare class DataHarborPlugin implements PageSpyPlugin {
2525
constructor(config?: DataHarborConfig);
2626
}
2727
```
2828

29+
2930
#### onOfflineLog()#onOfflineLog
3031

31-
Upload / download log manaually.
32+
Manually download / upload offline logs.
3233

3334
- Type
3435

3536
```ts
3637
declare class DataHarborPlugin {
37-
onOfflineLog(type: 'download' | 'upload'): Promise<string | null | undefined>;
38+
onOfflineLog(type: 'download' | 'upload', clearCache?: boolean): Promise<string | null | undefined>;
3839
}
3940
```
4041

41-
- Details
42-
43-
If you hide the automatically rendered floating or want to automatically trigger offline log operations at certain times, you can achieve through this method.
44-
45-
Each invocation logs the entire current session. Once the upload is complete, a replay URL will be returned.
42+
If you hide the automatically rendered UI controls by `autoRender: false`, or you want to automatically trigger the offline log operation at certain times, you can use this method.
4643

44+
After each call, the recorded log data will be cleared by default and recording will be restarted; on the contrary, if the user upload / download the log multiple times through the buttons on the UI dialog, it will be a complete log from beginning to end of the current session. You can also control it yourself through the second parameter `clearCache: boolean`.
45+
46+
After the upload is completed, the replay URL will be returned and printed to the console.
47+
4748
- Example
4849

4950
```ts
51+
- details
5052
window.$harbor = new DataHarborPlugin();
5153

52-
// upload
54+
// Upload (clear existing data and re-record)
5355
const url = await window.$harbor.onOfflineLog('upload');
5456

57+
// Upload (do not clear data)
58+
const url = await window.$harbor.onOfflineLog('upload', false);
59+
5560
// download
5661
window.$harbor.onOfflineLog('download');
5762
```
5863

5964

65+
#### pause()#pause
66+
67+
Pause recording.
68+
69+
- Type
70+
71+
```ts
72+
declare class DataHarborPlugin {
73+
pause(): void;
74+
}
75+
```
76+
77+
More flexible control of logging behavior.
78+
79+
The data generated by the program after the pause will not be recorded. Call `$harbor.resume()` to resume.
80+
81+
- Example
82+
83+
```ts
84+
window.$harbor = new DataHarborPlugin();
85+
86+
// pause
87+
window.$harbor.pause();
88+
89+
// resume
90+
window.$harbor.resume();
91+
```
92+
93+
94+
#### resume()#resume
95+
96+
97+
Resume records.
98+
99+
- Type
100+
101+
```ts
102+
declare class DataHarborPlugin {
103+
resume(): void;
104+
}
105+
```
106+
107+
More flexible control of logging behavior.
108+
109+
- Details
110+
111+
Data during &lt;Pause - Resume&gt; will not be recorded.
112+
113+
- Example
114+
115+
```ts
116+
window.$harbor = new DataHarborPlugin();
117+
118+
// pause
119+
window.$harbor.pause();
120+
121+
// resume
122+
window.$harbor.resume();
123+
```
124+
125+
#### reharbor()#reharbor
126+
127+
Clear the recorded data and continue recording. In short, remastered.
128+
129+
- Type
130+
131+
```ts
132+
declare class DataHarborPlugin {
133+
reharbor(): void;
134+
}
135+
```
136+
137+
- Example
138+
139+
```ts
140+
window.$harbor = new DataHarborPlugin();
141+
142+
window.$harbor.reharbor();
143+
```

src/pages/Docs/md/data-harbor.zh.mdx

+92-5
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,12 @@
2121
onDownload?: (data: CacheMessageItem[]) => void;
2222
}
2323

24-
delcare class DataHarborPlugin implements PageSpyPlugin {
24+
declare class DataHarborPlugin implements PageSpyPlugin {
2525
constructor(config?: DataHarborConfig);
2626
}
2727
```
2828

2929

30-
3130
#### onOfflineLog()#onOfflineLog
3231

3332
手动操作离线日志的下载、上传。
@@ -36,26 +35,114 @@
3635

3736
```ts
3837
declare class DataHarborPlugin {
39-
onOfflineLog(type: 'download' | 'upload'): Promise<string | null | undefined>;
38+
onOfflineLog(type: 'download' | 'upload', clearCache?: boolean): Promise<string | null | undefined>;
4039
}
4140
```
4241

4342
- 详细信息
4443

4544
如果隐藏了自动渲染的 UI 控件,或者希望在某些时候自动触发队离线日志的操作,可以通过该方法实现。
4645

47-
每次调用都是当前会话的完整日志。上传完成后会返回回放的 URL,并打印到控制台。
46+
每次调用后,默认会清除已记录的日志数据、并重新开始记录;与之相反,用户通过 UI 弹窗上的按钮操作日志上传 / 下载多次都是当前会话从头到尾的完整日志。你也可以通过第二个参数 `clearCache: boolean` 自行控制。
47+
48+
上传完成后会返回回放的 URL,并打印到控制台。
4849

4950
- 示例
5051

5152
```ts
5253
window.$harbor = new DataHarborPlugin();
5354

54-
// 上传
55+
// 上传(清除已有数据、并重新记录)
5556
const url = await window.$harbor.onOfflineLog('upload');
5657

58+
// 上传(不清除数据)
59+
const url = await window.$harbor.onOfflineLog('upload', false);
60+
5761
// 下载
5862
window.$harbor.onOfflineLog('download');
5963
```
6064

6165

66+
#### pause()#pause
67+
68+
暂停记录。
69+
70+
- 类型
71+
72+
```ts
73+
declare class DataHarborPlugin {
74+
pause(): void;
75+
}
76+
```
77+
78+
- 详细信息
79+
80+
更加灵活的控制记录日志的行为。
81+
82+
暂停后程序产生的数据不会被记录,执行 `$harbor.resume()` 恢复。
83+
84+
- 示例
85+
86+
```ts
87+
window.$harbor = new DataHarborPlugin();
88+
89+
// 暂停
90+
window.$harbor.pause();
91+
92+
// 恢复
93+
window.$harbor.resume();
94+
```
95+
96+
97+
#### resume()#resume
98+
99+
恢复记录。
100+
101+
- 类型
102+
103+
```ts
104+
declare class DataHarborPlugin {
105+
resume(): void;
106+
}
107+
```
108+
109+
- 详细信息
110+
111+
更加灵活的控制记录日志的行为。
112+
113+
&lt;暂停 - 恢复&gt; 期间的数据不会被记录。
114+
115+
- 示例
116+
117+
```ts
118+
window.$harbor = new DataHarborPlugin();
119+
120+
// 暂停
121+
window.$harbor.pause();
122+
123+
// 恢复
124+
window.$harbor.resume();
125+
```
126+
127+
128+
#### reharbor()#reharbor
129+
130+
清空已记录的数据,并继续记录。简而言之,重新制作。
131+
132+
- 类型
133+
134+
```ts
135+
declare class DataHarborPlugin {
136+
reharbor(): void;
137+
}
138+
```
139+
140+
- 示例
141+
142+
```ts
143+
window.$harbor = new DataHarborPlugin();
144+
145+
window.$harbor.reharbor();
146+
```
147+
148+

0 commit comments

Comments
 (0)