-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-uimanager.html
More file actions
43 lines (36 loc) · 1.6 KB
/
test-uimanager.html
File metadata and controls
43 lines (36 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>UIManager Test</title>
</head>
<body>
<h1>UIManager Test</h1>
<div id="test-output"></div>
<script type="module">
import { uiManager } from './src/components/UIManager.js';
const output = document.getElementById('test-output');
try {
console.log('uiManager:', uiManager);
console.log('uiManager.setPoseEstimator:', uiManager.setPoseEstimator);
console.log('typeof uiManager.setPoseEstimator:', typeof uiManager.setPoseEstimator);
if (typeof uiManager.setPoseEstimator === 'function') {
output.innerHTML = '<p style="color: green;">✅ setPoseEstimator 方法存在且为函数</p>';
} else {
output.innerHTML = '<p style="color: red;">❌ setPoseEstimator 方法不存在或不是函数</p>';
}
// 列出所有可用的方法
const methods = Object.getOwnPropertyNames(Object.getPrototypeOf(uiManager))
.filter(name => typeof uiManager[name] === 'function' && name !== 'constructor');
output.innerHTML += '<h3>可用方法:</h3><ul>';
methods.forEach(method => {
output.innerHTML += `<li>${method}</li>`;
});
output.innerHTML += '</ul>';
} catch (error) {
console.error('测试失败:', error);
output.innerHTML = `<p style="color: red;">❌ 测试失败: ${error.message}</p>`;
}
</script>
</body>
</html>