@@ -32,14 +32,97 @@ export default withMermaid({
32
32
description : 'A powerful automotive ECU development tool' ,
33
33
head : [
34
34
[ 'link' , { rel : 'icon' , type : 'image/png' , href : 'https://ecubus.oss-cn-chengdu.aliyuncs.com/img/logo256.png' } ] ,
35
+
35
36
[ 'meta' , { property : 'og:type' , content : 'website' } ] ,
36
37
[ 'meta' , { property : 'og:locale' , content : 'en' } ] ,
37
38
[ 'meta' , { property : 'og:title' , content : 'EcuBus-Pro | A powerful automotive ECU development tool' } ] ,
38
39
[ 'meta' , { property : 'og:site_name' , content : 'EcuBus-Pro' } ] ,
39
40
[ 'meta' , { property : 'og:image' , content : 'https://ecubus.oss-cn-chengdu.aliyuncs.com/img/logo256.png' } ] ,
40
41
[ 'meta' , { property : 'og:url' , content : 'https://app.whyengineer.com' } ] ,
41
42
[ 'meta' , { name : 'google-site-verification' , content : '8p_3SCSQGHvWlpmik3zhY902wyQ0QwxQsHaBJocrxfA' } ] ,
43
+ [ 'script' , { } ,
44
+ `
45
+ window.__rum = {
46
+ pid: 'fx08lzooek@df6c2cc04f6d757',
47
+ endpoint: 'https://fx08lzooek-default-cn.rum.aliyuncs.com',
48
+ // 设置环境信息,参考值:'prod' | 'gray' | 'pre' | 'daily' | 'local'
49
+ env: 'prod',
50
+ // 设置路由模式, 参考值:'history' | 'hash'
51
+ spaMode: 'history',
52
+ collectors: {
53
+
54
+ perf: false,
55
+
56
+ webVitals: false,
57
+
58
+ api: false,
59
+
60
+ staticResource: true,
61
+
62
+ jsError: false,
63
+
64
+ consoleError: false,
65
+
66
+ action: true,
67
+ },
68
+ // 链路追踪配置开关,默认关闭
69
+ tracing: true,
70
+ };
71
+ `
72
+ ] ,
73
+ [ 'script' , { src : 'https://sdk.rum.aliyuncs.com/v2/browser-sdk.js' , crossorigin : 'anonymous' } ] ,
74
+ [ 'script' , { src : 'https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/viewerjs/1.10.4/viewer.min.js' } ] ,
75
+ [ 'link' , { rel : 'stylesheet' , href : 'https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/viewerjs/1.10.4/viewer.min.css' } ] ,
76
+ [ 'script' , { } ,
77
+ `
78
+
79
+ // 初始化图片查看器
80
+ function initImageViewer() {
81
+
82
+ const container = document.querySelector('.content-container');
83
+ if (!container) return;
84
+
85
+
86
+ container.addEventListener('click', function(e) {
87
+ if (e.target.tagName === 'IMG') {
88
+ e.preventDefault();
89
+
90
+ const images = Array.from(document.querySelectorAll('.content-container img'));
91
+ const currentIndex = images.indexOf(e.target);
92
+
93
+ const viewerContainer = document.createElement('div');
94
+ viewerContainer.style.display = 'none';
95
+ document.body.appendChild(viewerContainer);
96
+
97
+ images.forEach(img => viewerContainer.appendChild(img.cloneNode(true)));
98
+
99
+ const viewer = new Viewer(viewerContainer, {
100
+ zoomRatio: 0.1,
101
+ hidden: function() {
102
+ viewer.destroy();
103
+ document.body.removeChild(viewerContainer);
104
+ }
105
+ });
106
+
107
+ viewer.show();
108
+ viewer.view(currentIndex);
109
+ }
110
+ });
111
+ }
112
+
113
+ // 等待 VitePress 加载完成
114
+ window.addEventListener('load', () => {
115
+ // 初始化
116
+ initImageViewer();
117
+
118
+
119
+ });
120
+
121
+ `
122
+ ] ,
123
+
42
124
] ,
125
+
43
126
lastUpdated : true ,
44
127
45
128
themeConfig : {
@@ -80,7 +163,7 @@ export default withMermaid({
80
163
{ text : 'Graph' , link : '/docs/um/graph/graph.md' } ,
81
164
{ text : 'CLI' , link : '/docs/um/cli' } ,
82
165
{
83
- text : 'Script' , link : '/docs/um/script' , items : [
166
+ text : 'Script' , link : '/docs/um/script' , items : [
84
167
{ text : 'Use External Package' , link : '/docs/um/scriptExternal' } ,
85
168
]
86
169
} ,
@@ -96,7 +179,7 @@ export default withMermaid({
96
179
text : 'Example' ,
97
180
98
181
items : [
99
-
182
+
100
183
{
101
184
text : 'CAN' , items : [
102
185
{ text : 'CAN Basic' , link : '/examples/can/readme' , } ,
0 commit comments