nv-log-bw 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/TOOL/once.html ADDED
@@ -0,0 +1,44 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>NV Log Viewer 示例</title>
5
+ <script>@SCRIPT@</script>
6
+ </head>
7
+ <body>
8
+ <h1>NV Log Viewer 演示</h1>
9
+
10
+ <button onclick="testOnce()">打开一次性日志查看器</button>
11
+ <button onclick="testManual()">手动创建日志查看器</button>
12
+
13
+ <script>
14
+ async function testOnce() {
15
+ const logger = await nvlogbw.once({
16
+ maxLogs: 500,
17
+ theme: 'dark',
18
+ hideButton: true,
19
+ autoDestroy: true
20
+ });
21
+
22
+ logger.addLog('🎉 一次性日志查看器已打开', 'success');
23
+ logger.addLog('🚀 可以正常记录日志', 'info');
24
+ logger.addLog('⚠️ 关闭窗口将自动销毁', 'warning');
25
+ }
26
+
27
+ async function testManual() {
28
+ const logger = document.createElement('nv-log-viewer');
29
+ logger.setAttribute('max-logs', '1000');
30
+ logger.setAttribute('theme', 'light');
31
+ logger.setAttribute('auto-destroy', 'false');
32
+
33
+ document.body.appendChild(logger);
34
+ await new Promise(resolve => setTimeout(resolve, 100));
35
+
36
+ logger.open();
37
+ logger.addLog('🔧 手动创建的日志查看器', 'info');
38
+ logger.addLog('💾 关闭后可以重新打开', 'success');
39
+
40
+ window.logger = logger;
41
+ }
42
+ </script>
43
+ </body>
44
+ </html>