添加开发环境跳转coder-server

This commit is contained in:
chicrobot committed 2025-11-22 01:23:38 +08:00
1 parent bdd9f6c589
commit a9cb7f9d15
2 files changed
+39 -12

No files matched your search

+27
View File
@@ -53,6 +53,7 @@ window.addEventListener('load', function() {
const jenkinsUrl = `${window.location.protocol}//${currentHost}:9095`;
const chatUrl = `${window.location.protocol}//${currentHost}/baseTalk`;
const cloudreveUrl = `${window.location.protocol}//${currentHost}:5212`;
const codeServerUrl = `${window.location.protocol}//${currentHost}:8443`;
// 构建博客文章URL,指向8090端口
const blogBaseUrl = `${window.location.protocol}//${currentHost}:8090`;
@@ -63,6 +64,7 @@ window.addEventListener('load', function() {
const jenkinsLink = document.getElementById('jenkinsLink');
const chatLink = document.getElementById('chatLink');
const cloudreveLink = document.getElementById('cloudreveLink');
const codeServerLink = document.getElementById('codeServerLink');
if (portainerLink) {
portainerLink.href = portainerUrl;
@@ -88,6 +90,10 @@ window.addEventListener('load', function() {
cloudreveLink.href = cloudreveUrl;
cloudreveLink.target = '_blank';
}
if (codeServerLink) {
codeServerLink.href = codeServerUrl;
codeServerLink.target = '_blank';
}
// 处理博客文章链接
const blogPosts = document.querySelectorAll('.thought-card');
@@ -102,6 +108,27 @@ window.addEventListener('load', function() {
window.open(postUrl, '_blank');
});
});
// 快速启动项目按钮处理
const templateButtons = document.querySelectorAll('.template-button');
const projectTemplates = [
{ type: 'frontend', name: '前端项目', url: '/?folder=/config/workspace' },
{ type: 'backend', name: '后端服务', url: '/?folder=/config/workspace' },
{ type: 'fullstack', name: '全栈应用', url: '/?folder=/config/workspace' }
];
templateButtons.forEach((button, index) => {
if (projectTemplates[index]) {
button.addEventListener('click', () => {
// 构建基于当前域名的URL
const baseUrl = `${window.location.protocol}//${currentHost}:8443`;
const targetUrl = `${baseUrl}${projectTemplates[index].url}`;
window.open(targetUrl, '_blank');
});
}
});
});
// 粒子背景效果