From 4b421c66a5a145320c601e20ad4957a515a4dc7f Mon Sep 17 00:00:00 2001
From: ZhaiSoul <842607283@qq.com>
Date: Wed, 29 Apr 2026 14:42:29 +0800
Subject: [PATCH] docs: improve NVIDIA GPU count input
---
.../components/NvidiaGpuConfig.tsx | 13 ++++++------
.../DockerComposeGenerator/generator/index.ts | 2 +-
.../hooks/useConfigGenerator.ts | 20 +++++++++----------
3 files changed, 17 insertions(+), 18 deletions(-)
diff --git a/docs/src/components/DockerComposeGenerator/components/NvidiaGpuConfig.tsx b/docs/src/components/DockerComposeGenerator/components/NvidiaGpuConfig.tsx
index 5863ac386..9c9be5e6a 100644
--- a/docs/src/components/DockerComposeGenerator/components/NvidiaGpuConfig.tsx
+++ b/docs/src/components/DockerComposeGenerator/components/NvidiaGpuConfig.tsx
@@ -16,6 +16,8 @@ export default function NvidiaGpuConfig({
onGpuCountChange,
onGpuDeviceIdChange,
}: Props) {
+ const showDeviceId = gpuCount !== "";
+
return (
@@ -25,16 +27,15 @@ export default function NvidiaGpuConfig({
onGpuCountChange(e.target.value)}
+ placeholder="all"
+ onChange={(e) => onGpuCountChange(e.target.value.replace(/\D/g, ""))}
/>
-
- Enter a number (e.g. 1, 2, 3) or "all" to use all GPUs
-
- {gpuCount !== "all" && (
+ {showDeviceId && (