feat: 工具配置 Ubuntu 化 + nvm 管理 Node 版本
- 工具目录重写为 Ubuntu 构建环境导向(7 项),每项带安装命令提示 (apt/nvm,未安装时一键复制) - 新增 nvm 工具条目(真实检测,本机验证 0.40.6);Node.js 改为 nvm 管理:默认版本可调,构建时通过 nvm install $NODE_VERSION 灵活指定版本 - DeployTool 新增 installHint 字段(模型/更新白名单/seed) - 新增 deploy/Dockerfile.buildnode:Ubuntu 22.04 + JDK17/Maven/Git/ Docker CLI/Golang + nvm 默认 Node(--build-arg NODE_VERSION 可改) - 工具页顶部说明条更新构建环境建议
This commit is contained in:
1 parent
d9d1dd5e99
commit
6841c1104a
6 files changed
+79
-22
No files matched your search
@@ -10,6 +10,7 @@ import {
|
||||
RefreshCw,
|
||||
Terminal,
|
||||
AlertCircle,
|
||||
Copy,
|
||||
} from 'lucide-react';
|
||||
import { toast } from 'sonner';
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
||||
@@ -26,6 +27,7 @@ interface DeployTool {
|
||||
installedVersion: string;
|
||||
installMode: 'preinstalled' | 'lazy' | 'disabled';
|
||||
path: string;
|
||||
installHint: string;
|
||||
enabled: boolean;
|
||||
lastCheck: string | null;
|
||||
errorMsg: string;
|
||||
@@ -176,7 +178,7 @@ export default function ToolConfig() {
|
||||
{/* Description bar */}
|
||||
<div className="px-5 py-2 border-b text-[12px] flex items-center gap-2" style={{ background: 'var(--panel-bg-secondary)', borderColor: 'var(--border-color)', color: 'var(--text-secondary)' }}>
|
||||
<Terminal className="w-3.5 h-3.5" style={{ color: 'var(--text-tertiary)' }} />
|
||||
管理 DevOps 工具的安装策略:预装在镜像中、首次使用自动下载(懒加载)、或禁用不安装
|
||||
构建环境建议 Ubuntu 22.04(apt 安装下方工具);Node 由 nvm 管理——默认版本可在此调整,流水线构建时用 <code className="px-1 rounded font-mono text-[11px]" style={{ background: 'var(--panel-bg)', color: 'var(--accent-blue)' }}>nvm install $NODE_VERSION</code> 灵活指定版本。可用 deploy/Dockerfile.buildnode 一键构建节点镜像
|
||||
</div>
|
||||
|
||||
{/* Content */}
|
||||
@@ -236,6 +238,17 @@ export default function ToolConfig() {
|
||||
<div>
|
||||
<div className="text-[14px] font-semibold mb-0.5" style={{ color: 'var(--text-primary)' }}>{tool.name}</div>
|
||||
<div className="text-[12px] font-mono mb-1" style={{ color: 'var(--text-tertiary)' }}>{tool.key}</div>
|
||||
{tool.installHint && tool.status !== 'installed' && (
|
||||
<button
|
||||
onClick={() => { navigator.clipboard.writeText(tool.installHint); toast.success('安装命令已复制'); }}
|
||||
className="mt-1 flex items-center gap-1.5 px-2 py-[3px] rounded font-mono text-[10px] max-w-full hover:opacity-80"
|
||||
style={{ background: 'var(--panel-bg-secondary)', color: 'var(--text-secondary)' }}
|
||||
title={tool.installHint}
|
||||
>
|
||||
<Copy className="w-2.5 h-2.5 flex-shrink-0" />
|
||||
<span className="truncate">{tool.installHint}</span>
|
||||
</button>
|
||||
)}
|
||||
{tool.status === 'installed' && tool.path && (
|
||||
<div className="text-[10px] mt-1 font-mono" style={{ color: 'var(--text-tertiary)' }}>路径: {tool.path}</div>
|
||||
)}
|
||||
@@ -262,7 +275,7 @@ export default function ToolConfig() {
|
||||
) : (
|
||||
tool.version && (
|
||||
<div className="text-[11px] mt-0.5" style={{ color: 'var(--text-tertiary)' }} title={tool.errorMsg || undefined}>
|
||||
期望 v{tool.version}
|
||||
{tool.key === 'nodejs' ? `默认 v${tool.version}(构建时可覆盖)` : `期望 v${tool.version}`}
|
||||
</div>
|
||||
)
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user