- {javaVersions.map((javaConfig) => {
- const env = javaEnvironments.find(e => e.version === javaConfig.key)
- const isInstalled = env?.installed || false
- const isInstalling = env?.installing || false
- // 当前系统架构下是否提供了安装包(系统信息未加载完成时不限制)
- const archSupported = !systemInfo || !!resolveJavaDownloadUrl(javaConfig)
-
- return (
-
- {/* 卡片头部 */}
-
-
-
-
- {javaConfig.version}
-
-
-
- {isInstalled ? (
- <>
-
-
已安装
- >
- ) : (
- <>
-
-
未安装
- >
- )}
-
-
+ javaCatalog ? (
+
+ {(() => {
+ const customVersionId = getCustomJavaVersionId()
+ const customEnv = customVersionId
+ ? javaEnvironments.find(env => env.version === customVersionId)
+ : undefined
+ const customUnsupportedMessage = getCustomJavaUnsupportedMessage()
+ const customProviderOptions = javaCatalog.providers.filter(provider => (
+ provider.source === 'download' &&
+ provider.supportsCustomVersion &&
+ javaCatalog.custom.providers.includes(provider.id as JavaDownloadProviderId)
+ ))
+ const isInstalled = customEnv?.installed || false
+ const isInstalling = customEnv?.installing || false
+
+ return (
+
+
+
+
+
+ 高级:自定义 Java 版本
+
+
+
+ {isInstalled ? (
+ <>
+
+
已安装
+ >
+ ) : (
+ <>
+
+
未安装
+ >
+ )}
+
+
+
+
+
+
+ setCustomJavaMajor(event.target.value)}
+ disabled={isInstalling}
+ className="w-full rounded border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-800 dark:text-white"
+ />
+
+
+
+
+
+
+
+
+
+
+ {!isInstalled ? (
+
+ ) : (
+
+ )}
+
+
- {/* 描述 */}
-
- {javaConfig.description}
-
+
+ {getProviderLabel(customJavaProvider)} · {getChannelLabel(customJavaChannel)} · {getCustomJavaLabel()}
+
- {/* 当前架构无安装包提示 */}
- {!isInstalled && !archSupported && (
-
- 该版本暂未提供当前架构({systemInfo?.arch || '未知'})的安装包
-
- )}
+ {customUnsupportedMessage && (
+
+
+
{customUnsupportedMessage}
+
+ )}
- {/* 安装进度 */}
- {isInstalling && (
-
-
-
- {env?.installStage === 'download' ? '正在下载...' :
- env?.installStage === 'extract' ? '正在解压...' : '正在安装...'}
-
- {Math.round(env?.installProgress || 0)}%
-
-
-
- {env?.installStage === 'download' ? '下载阶段 (70%)' :
- env?.installStage === 'extract' ? '解压阶段 (30%)' : ''}
-
-
- )}
+ {isInstalling && (
+
+
+
+ {customEnv?.installStage === 'download' ? '正在下载...' :
+ customEnv?.installStage === 'extract' ? '正在解压...' : '正在安装...'}
+
+ {Math.round(customEnv?.installProgress || 0)}%
+
+
+
+ )}
- {/* Java路径 */}
- {isInstalled && env?.javaExecutable && (
-
-
启动命令:
-
- {env.javaExecutable}
-
-
+ ) : (
+
)
- })}
-
)}
>
)}
diff --git a/client/src/pages/GameDeploymentPage.tsx b/client/src/pages/GameDeploymentPage.tsx
index 37ef867b..2b96a690 100644
--- a/client/src/pages/GameDeploymentPage.tsx
+++ b/client/src/pages/GameDeploymentPage.tsx
@@ -35,6 +35,7 @@ import ConfirmInstanceUpdateDialog from '@/components/ConfirmInstanceUpdateDialo
import FileDeploymentConflictDialog from '@/components/FileDeploymentConflictDialog'
import NetworkStatusBanner from '@/components/NetworkStatusBanner'
import SteamBranchSelector from '@/components/SteamBranchSelector'
+import { isLimitedGameServerArchitecture } from '@/utils/architectureSupport'
interface GameInfo {
game_nameCN: string
@@ -2543,9 +2544,9 @@ const GameDeploymentPage: React.FC = () => {
}
}, [activeTab, sponsorKeyValid, defaultGamePath, fetchSystemInfo])
- // 当检测到ARM架构时,如果当前标签页是不支持的标签页,则切换到minecraft标签页
+ // 当检测到非 x86_64 架构时,如果当前标签页是不支持的标签页,则切换到 minecraft 标签页
useEffect(() => {
- if (systemInfo && (systemInfo.arch === 'arm64' || systemInfo.arch === 'aarch64')) {
+ if (isLimitedGameServerArchitecture(systemInfo)) {
const unsupportedTabs = ['steamcmd', 'more-games', 'online-deploy']
if (unsupportedTabs.includes(activeTab)) {
setActiveTab('minecraft')
@@ -3693,8 +3694,8 @@ const GameDeploymentPage: React.FC = () => {
// 检查是否有任何游戏包含type信息
const hasGameTypes = availableOnlineGameTypes.length > 0
- // 检查是否为ARM架构,如果是则隐藏SteamCMD、更多游戏部署和在线部署标签页
- const isArmArchitecture = systemInfo?.arch === 'arm64' || systemInfo?.arch === 'aarch64'
+ // 非 x86_64 架构隐藏 SteamCMD、更多游戏部署和在线部署标签页
+ const hasLimitedGameServerSupport = isLimitedGameServerArchitecture(systemInfo)
const renderFileDeploySection = () => (
@@ -4362,13 +4363,13 @@ const GameDeploymentPage: React.FC = () => {
)
const tabs = [
- // 只有在非ARM架构时才显示SteamCMD标签页
- ...(isArmArchitecture ? [] : [{ id: 'steamcmd', name: 'SteamCMD', icon: Download }]),
+ // 只有在 x86_64 架构时才显示SteamCMD标签页
+ ...(hasLimitedGameServerSupport ? [] : [{ id: 'steamcmd', name: 'SteamCMD', icon: Download }]),
{ id: 'minecraft', name: 'Minecraft部署', icon: Pickaxe },
{ id: 'mrpack', name: 'Minecraft整合包部署', icon: Package },
{ id: 'file-deploy', name: '文件部署', icon: Archive },
- // 只有在非ARM架构时才显示更多游戏部署和在线部署标签页
- ...(isArmArchitecture ? [] : [
+ // 只有在 x86_64 架构时才显示更多游戏部署和在线部署标签页
+ ...(hasLimitedGameServerSupport ? [] : [
{ id: 'more-games', name: '更多游戏部署', icon: Server },
{ id: 'online-deploy', name: '在线部署', icon: ExternalLink }
])
diff --git a/client/src/pages/InstanceManagerPage.tsx b/client/src/pages/InstanceManagerPage.tsx
index 8b03ee7e..ab369db0 100644
--- a/client/src/pages/InstanceManagerPage.tsx
+++ b/client/src/pages/InstanceManagerPage.tsx
@@ -35,6 +35,7 @@ import RconConsole from '@/components/RconConsole'
import ConfirmDialog from '@/components/ConfirmDialog'
import SteamBranchSelector from '@/components/SteamBranchSelector'
import { formatFileSize } from '@/utils/format'
+import { isLimitedGameServerArchitecture } from '@/utils/architectureSupport'
import { io, Socket } from 'socket.io-client'
import config from '@/config'
@@ -594,7 +595,7 @@ const InstanceManagerPage: React.FC = () => {
fetchInstances()
fetchAvailableConfigs()
fetchSystemUsers()
- fetchSystemInfo() // 获取系统信息以检测ARM架构
+ fetchSystemInfo() // 获取系统信息以检测特殊架构
// 检查是否有待创建的实例(从游戏部署页面跳转过来)
const pendingInstanceStr = localStorage.getItem('pendingInstance')
@@ -713,9 +714,9 @@ const InstanceManagerPage: React.FC = () => {
}
}
- // 当检测到ARM架构时,如果当前标签页是实例市场,则切换到我的实例标签页
+ // 当检测到非 x86_64 架构时,如果当前标签页是实例市场,则切换到我的实例标签页
useEffect(() => {
- if (systemInfo && (systemInfo.arch === 'arm64' || systemInfo.arch === 'aarch64') && activeTab === 'market') {
+ if (isLimitedGameServerArchitecture(systemInfo) && activeTab === 'market') {
setActiveTab('instances')
}
}, [systemInfo, activeTab])
@@ -1589,8 +1590,8 @@ const InstanceManagerPage: React.FC = () => {
我的实例
- {/* 实例市场标签页 - 检测到ARM架构时隐藏 */}
- {!(systemInfo?.arch === 'arm64' || systemInfo?.arch === 'aarch64') && (
+ {/* 实例市场标签页 - 非 x86_64 架构时隐藏 */}
+ {!isLimitedGameServerArchitecture(systemInfo) && (
setActiveTab('market')}
className={`py-2 px-1 border-b-2 font-medium text-sm transition-colors ${activeTab === 'market'
diff --git a/client/src/pages/SettingsPage.tsx b/client/src/pages/SettingsPage.tsx
index 8d98b09c..1a791a0c 100644
--- a/client/src/pages/SettingsPage.tsx
+++ b/client/src/pages/SettingsPage.tsx
@@ -9,6 +9,7 @@ import { useWallpaperStore } from '@/stores/wallpaperStore'
import { useConsoleLogStore } from '@/stores/consoleLogStore'
import AutoRedirectControl from '@/components/AutoRedirectControl'
import apiClient from '@/utils/api'
+import { isLimitedGameServerArchitecture } from '@/utils/architectureSupport'
import {
Settings,
Monitor,
@@ -641,7 +642,7 @@ const SettingsPage: React.FC = () => {
// 页面加载时获取SteamCMD状态和本地设置
React.useEffect(() => {
fetchSteamCMDStatus()
- fetchSystemInfo() // 获取系统信息以检测ARM架构
+ fetchSystemInfo() // 获取系统信息以检测特殊架构
// 从localStorage加载网页设置
try {
@@ -1997,8 +1998,8 @@ const SettingsPage: React.FC = () => {