Toggle navigation
Toggle navigation
This project
Loading...
Sign in
卢阳
/
front_backend_zImage
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
ly0303521
2026-01-09 14:41:55 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f78d7c0694f38fba176ba5aa2a0e2250e858b992
f78d7c06
1 parent
91528abb
添加生成按钮提示,确保用户输入内容并上传图片
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
z-image-generator/components/InputBar.tsx
z-image-generator/components/InputBar.tsx
View file @
f78d7c0
...
...
@@ -73,8 +73,13 @@ const InputBar: React.FC<InputBarProps> = ({ onGenerate, isGenerating, incomingP
};
const handleGenerate = async () => {
if (
!prompt.trim() ||
isGenerating || isSubmittingLocal) return;
if (isGenerating || isSubmittingLocal) return;
if (!prompt.trim()) {
alert("请描述您的创意内容");
return;
}
if (isVideoMode && !imageFile) {
alert("请上传一张图片以生成视频。");
return;
...
...
@@ -312,10 +317,10 @@ const InputBar: React.FC<InputBarProps> = ({ onGenerate, isGenerating, incomingP
<button
onClick={handleGenerate}
disabled={
!prompt.trim() || isGenerating || isSubmittingLocal || (isVideoMode && !imageFile)
}
disabled={
isGenerating || isSubmittingLocal
}
className={`
flex items-center justify-center w-10 h-10 md:w-12 md:h-12 rounded-full transition-all duration-200
${(
prompt.trim() && !isGenerating && (!isVideoMode || imageFile)
)
${(
!isGenerating && !isSubmittingLocal
)
? 'bg-black dark:bg-white text-white dark:text-black hover:scale-105 active:scale-95 shadow-md'
: 'bg-gray-200 dark:bg-gray-700 text-gray-400 cursor-not-allowed'}
`}
...
...
Please
register
or
login
to post a comment