fix: 修复 ESLint 配置及组件弃用属性警告,优化代码格式

1. 工程配置:
- 更新 tsconfig.json include 规则,解决 eslint.config.ts 未被包含的问题。

2. 组件重构 (Material UI 适配):
- Navbar: 替换已弃用的 PaperProps 为 slotProps.paper。
- TimestampToDatetime / DatetimeToTimestamp: 替换已弃用的 InputProps 为 slotProps.input。

3. 类型与逻辑修复:
- utils/recordUtils.tsx: 引入缺失依赖,忽略 UNSAFE_replayCanvas 等类型报错,修复构建问题。
- utils/messages.tsx: 完善事件参数类型定义。

4. 其他优化:
- 统一 App.css 代码格式。
- 补充部分组件 (CopyButton, TimestampExecution) 的 React 导入和类型定义。
This commit is contained in:
雨霖铃
2026-02-13 23:46:16 +08:00
parent 50034331bc
commit 3ece5e2e96
9 changed files with 37 additions and 45 deletions
+7 -4
View File
@@ -21,7 +21,8 @@ export const downloadHtmlInBackground = (events: unknown[]) => {
<script src="https://cdn.jsdelivr.net/npm/rrweb-player@latest/dist/index.js"></script>
<script type="module">
import { getReplayConsolePlugin } from 'https://esm.sh/@rrweb/rrweb-plugin-console-replay?bundle';
import { getReplayConsolePlugin } from 'https://esm.sh/@rrweb/rrweb-plugin-console-replay?bundle';
import rrwebPlayer from 'rrweb-player';
const events = JSON.parse(\`${safeEventsString}\`);
@@ -37,14 +38,16 @@ export const downloadHtmlInBackground = (events: unknown[]) => {
// --- 👇 关键修复:添加下面这行 ---
// 这会告诉 rrweb 关闭严格的 iframe 沙盒限制
// 从而消除 "Blocked script execution" 错误
// @ts-ignore
UNSAFE_replayCanvas: true,
// ------------------------------
// @ts-ignore
plugins: [
getReplayConsolePlugin({
level: ['info', 'log', 'warn', 'error'],
})
]
}),
],
},
});
</script>
@@ -59,7 +62,7 @@ export const downloadHtmlInBackground = (events: unknown[]) => {
url: reader.result as string,
filename: `replay-${Date.now()}.html`,
saveAs: true,
});
}).then(r => console.log(r));
};
reader.readAsDataURL(blob);
};