diff --git a/index.html b/index.html index 121e6ef..f1d8834 100644 --- a/index.html +++ b/index.html @@ -4,9 +4,9 @@
基于WebSocket的聊天系统实现
- 进入实验室 + 进入实验室 diff --git a/script.js b/script.js index 1324bf6..65e8c4f 100644 --- a/script.js +++ b/script.js @@ -46,17 +46,18 @@ updateActiveNavLink(); window.addEventListener('load', function() { // 获取当前页面的域名或IP const currentHost = window.location.hostname; - // 构建跳转URL (保持相同的协议和域名/IP,只修改端口) + // 构建跳转URL (保持相同的协议和域名/IP) const portainerUrl = `${window.location.protocol}//${currentHost}:9000`; const giteaUrl = `${window.location.protocol}//${currentHost}:3000`; const grafanaUrl = `${window.location.protocol}//${currentHost}:3001`; const jenkinsUrl = `${window.location.protocol}//${currentHost}:9095`; + const chatUrl = `${window.location.protocol}//${currentHost}/baseTalk`; // 设置链接的href属性和target属性,确保在新标签中打开 const portainerLink = document.getElementById('portainerLink'); const giteaLink = document.getElementById('giteaLink'); const grafanaLink = document.getElementById('grafanaLink'); const jenkinsLink = document.getElementById('jenkinsLink'); - + const chatLink = document.getElementById('chatLink'); if (portainerLink) { portainerLink.href = portainerUrl; portainerLink.target = '_blank'; @@ -73,6 +74,10 @@ window.addEventListener('load', function() { jenkinsLink.href = jenkinsUrl; jenkinsLink.target = '_blank'; } + if (chatLink) { + chatLink.href = chatUrl; + chatLink.target = '_blank'; + } }); // 粒子背景效果