diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index c1e2e42..0000000 --- a/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -# 使用官方的 Node.js 运行时镜像作为基础镜像 -FROM node:lts-alpine - -# 设置工作目录 -WORKDIR /app -# 复制项目文件到工作目录 -COPY hubcmdui/ . -# 安装项目依赖 -RUN npm install - -# 暴露应用程序的端口 -EXPOSE 3000 - -# 运行应用程序 -CMD ["node", "server.js"] \ No newline at end of file diff --git a/hubcmdui/config.json b/hubcmdui/config.json deleted file mode 100644 index e69de29..0000000 diff --git a/hubcmdui/web/index.html b/hubcmdui/docker-proxy.html similarity index 74% rename from hubcmdui/web/index.html rename to hubcmdui/docker-proxy.html index e51e7d6..d6e15ef 100644 --- a/hubcmdui/web/index.html +++ b/hubcmdui/docker-proxy.html @@ -53,10 +53,11 @@ } .container { max-width: 800px; - width: 90%; + min-width: 800px; /* 固定容器宽度 */ + width: 100%; margin: 20px auto; background: white; - padding: 20px; + padding: 30px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); flex-grow: 1; @@ -96,15 +97,20 @@ button:hover { background-color: #2c974b; } + /* 广告容器样式 */ .ad-container { display: flex; justify-content: center; align-items: center; - margin-top: 30px; + margin-top: 90px; /* 与获取命令按钮之间的间距 */ margin-bottom: 30px; + max-width: 800px; + min-width: 800px; } .ad-container img { max-width: 100%; + width: 750; /* 广告图片宽度 */ + height: 300px; /* 广告图片高度 */ border-radius: 8px; } pre { @@ -114,27 +120,20 @@ overflow: auto; font-size: 14px; border: 1px solid #e1e4e8; - position: relative; } .copy-btn { - position: absolute; - top: 8px; - right: 8px; + float: right; padding: 6px 12px; font-size: 12px; - background-color: #f0f0f0; - color: #333; + margin-top: -5px; + background-color: #0366d6; + color: white; border: none; border-radius: 4px; cursor: pointer; - transition: background-color 0.3s, color 0.3s; - font-family: 'Arial', sans-serif; - font-weight: 500; - border-radius: 12px; } .copy-btn:hover { - background-color: #e0e0e0; - color: #000; + background-color: #0256b9; } .step { margin-bottom: 25px; @@ -179,6 +178,10 @@ #backToTopBtn:hover { background-color: #0256b9; } + #backToTopBtn:before { + display: inline-block; + font-size: 20px; + } #backToTopBtn::after { content: '返回顶部'; display: none; @@ -194,33 +197,6 @@ #backToTopBtn:hover::after { display: block; } - @media (max-width: 768px) { - .nav-menu { - display: none; - } - .header-content { - flex-direction: column; - } - .logo { - margin-bottom: 10px; - } - .input-group { - flex-direction: column; - } - .container { - width: 100%; - padding: 10px; - } - .ad-container img { - width: 100%; - height: auto; - } - } - @media (min-width: 769px) { - .nav-menu { - display: flex; - } - }
@@ -247,7 +223,7 @@ @@ -268,8 +244,6 @@ // 设置当前年份 document.getElementById('currentYear').textContent = new Date().getFullYear(); - let proxyDomain = 'your_domain'; // 默认代理加速地址 - // 生成加速命令 function generateCommands() { const imageInput = document.getElementById('imageInput').value.trim(); @@ -277,6 +251,8 @@ alert('请输入 Docker 镜像'); return; } + // docker镜像加速地址,请把下面your_domain改为你实际的加速地址 + const proxyDomain = 'your_domain'; //例如:hub.baidu.com let [imageName, tag] = imageInput.split(':'); tag = tag || 'latest'; @@ -306,7 +282,8 @@ cmdDiv.className = 'step'; cmdDiv.innerHTML = `${command.cmd}
+ ${command.cmd}
+
`;
container.appendChild(cmdDiv);
});
@@ -333,46 +310,6 @@
behavior: 'smooth'
});
}
-
- // 获取并加载配置
- async function loadConfig() {
- try {
- const response = await fetch('/api/config');
- const config = await response.json();
- if (config.logo) {
- document.querySelector('.logo').src = config.logo;
- }
- if (config.menuItems && Array.isArray(config.menuItems)) {
- const navMenu = document.querySelector('.nav-menu');
- navMenu.innerHTML = ''; // 清空菜单
- config.menuItems.forEach(item => {
- const a = document.createElement('a');
- a.href = item.link;
- a.textContent = item.text;
- if (item.newTab) {
- a.target = '_blank';
- }
- navMenu.appendChild(a);
- });
- }
- if (config.adImage && config.adImage.url) {
- const adContainer = document.getElementById('adContainer');
- const adLink = adContainer.querySelector('a');
- const adImage = adContainer.querySelector('img');
- adLink.href = config.adImage.link;
- adImage.src = config.adImage.url;
- adImage.alt = config.adImage.alt || '广告图片';
- adContainer.style.display = 'flex';
- }
- if (config.proxyDomain) {
- proxyDomain = config.proxyDomain;
- }
- } catch (error) {
- console.error('加载配置失败:', error);
- }
- }
-
- loadConfig();