Commit f8baa77d authored by chenshouchao's avatar chenshouchao

feat: 构建应用环境提示优化

parent 7bd76622
...@@ -78,6 +78,18 @@ ...@@ -78,6 +78,18 @@
.code { .code {
background-color: rgba(247, 248, 250, 1); background-color: rgba(247, 248, 250, 1);
flex: 1; flex: 1;
position: relative;
}
.codeHelper {
width: 100%;
box-sizing: border-box;
position: absolute;
bottom: 0;
color: rgba(255, 78, 78, 1);
font-size: 12px;
line-height: 20px;
padding: 6px 20px;
background-color: rgba(255, 232, 232, 1);
} }
.label { .label {
color: rgba(30, 38, 51, 1); color: rgba(30, 38, 51, 1);
......
...@@ -63,6 +63,14 @@ const AddEnvironment = (props: IAddEnvironmentProps) => { ...@@ -63,6 +63,14 @@ const AddEnvironment = (props: IAddEnvironmentProps) => {
error: false, error: false,
text: "", text: "",
}); });
const [shellHelper] = useState({
error: false,
text: "请输入Shell脚本",
});
const [pythonHelper] = useState({
error: false,
text: "请输入Python脚本",
});
const onDrop = useCallback( const onDrop = useCallback(
(acceptedFiles: any) => { (acceptedFiles: any) => {
let origin = ""; let origin = "";
...@@ -111,6 +119,10 @@ const AddEnvironment = (props: IAddEnvironmentProps) => { ...@@ -111,6 +119,10 @@ const AddEnvironment = (props: IAddEnvironmentProps) => {
setIsUploading(false); setIsUploading(false);
setFilePaths([`/ProjectData/${homeDirectoryMountPoint}/${path}`]); setFilePaths([`/ProjectData/${homeDirectoryMountPoint}/${path}`]);
setFileName(path); setFileName(path);
setFilePathsHelper({
error: false,
text: "",
});
}, },
}); });
setIsUploading(true); setIsUploading(true);
...@@ -499,6 +511,9 @@ const AddEnvironment = (props: IAddEnvironmentProps) => { ...@@ -499,6 +511,9 @@ const AddEnvironment = (props: IAddEnvironmentProps) => {
height="535px" height="535px"
width={`${codeWidth}px`} width={`${codeWidth}px`}
/> />
{taskType === "BATCH" && !code && (
<div className={style.codeHelper}>{shellHelper.text}</div>
)}
</div> </div>
</div> </div>
</div> </div>
...@@ -508,13 +523,16 @@ const AddEnvironment = (props: IAddEnvironmentProps) => { ...@@ -508,13 +523,16 @@ const AddEnvironment = (props: IAddEnvironmentProps) => {
Python脚本 Python脚本
<span className={style.required}>*</span> <span className={style.required}>*</span>
</div> </div>
<div className={style.code} id="addEnvironmentCode"> <div className={style.code}>
<Code <Code
value={flowCode} value={flowCode}
onChange={(e: string) => setFlowCode(e)} onChange={(e: string) => setFlowCode(e)}
height="535px" height="535px"
width={`${codeWidth + 368}px`} width={`${codeWidth + 368}px`}
/> />
{!flowCode && (
<div className={style.codeHelper}>{pythonHelper.text}</div>
)}
</div> </div>
</div> </div>
)} )}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment