Commit 862adc15 authored by wuyongsheng's avatar wuyongsheng

chore: merge

parents 848d2e0e 13ffe776
......@@ -78,6 +78,18 @@
.code {
background-color: rgba(247, 248, 250, 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 {
color: rgba(30, 38, 51, 1);
......
......@@ -27,10 +27,11 @@ import { getTokenInfo } from "@/utils/util";
type IAddEnvironmentProps = {
setAddopen: any;
setTitle: any;
};
const AddEnvironment = (props: IAddEnvironmentProps) => {
const { setAddopen } = props;
const { setAddopen, setTitle } = props;
const Message = useMessage();
let tokenInfo = getTokenInfo();
const [hpczoneList, setHpczoneList] = useState<Array<any>>([]); // 计算区列表 通过计算区列表和计算区id拿fileServerEndPoint
......@@ -63,6 +64,14 @@ const AddEnvironment = (props: IAddEnvironmentProps) => {
error: false,
text: "",
});
const [shellHelper] = useState({
error: false,
text: "请输入Shell脚本",
});
const [pythonHelper] = useState({
error: false,
text: "请输入Python脚本",
});
const onDrop = useCallback(
(acceptedFiles: any) => {
let origin = "";
......@@ -111,6 +120,10 @@ const AddEnvironment = (props: IAddEnvironmentProps) => {
setIsUploading(false);
setFilePaths([`/ProjectData/${homeDirectoryMountPoint}/${path}`]);
setFileName(path);
setFilePathsHelper({
error: false,
text: "",
});
},
});
setIsUploading(true);
......@@ -164,6 +177,7 @@ const AddEnvironment = (props: IAddEnvironmentProps) => {
{
onSuccess: () => {
Message.success("开始构建应用环境");
setTitle("");
setAddopen(false);
},
}
......@@ -339,7 +353,10 @@ const AddEnvironment = (props: IAddEnvironmentProps) => {
<SwitchBatchFolw
active={taskType}
setActive={setTaskType}
goBack={() => setAddopen(false)}
goBack={() => {
setTitle("");
setAddopen(false);
}}
></SwitchBatchFolw>
</div>
<div className={style.right}>
......@@ -499,6 +516,9 @@ const AddEnvironment = (props: IAddEnvironmentProps) => {
height="535px"
width={`${codeWidth}px`}
/>
{taskType === "BATCH" && !code && (
<div className={style.codeHelper}>{shellHelper.text}</div>
)}
</div>
</div>
</div>
......@@ -508,13 +528,16 @@ const AddEnvironment = (props: IAddEnvironmentProps) => {
Python脚本
<span className={style.required}>*</span>
</div>
<div className={style.code} id="addEnvironmentCode">
<div className={style.code}>
<Code
value={flowCode}
onChange={(e: string) => setFlowCode(e)}
height="535px"
width={`${codeWidth + 368}px`}
/>
{!flowCode && (
<div className={style.codeHelper}>{pythonHelper.text}</div>
)}
</div>
</div>
)}
......
......@@ -198,14 +198,16 @@ const UserResourcesEnvironment = () => {
<div className={style.environment}>
<div className={style.top}>
<div className={style.topLeft}>
<SearchInput
sx={{ width: 340, marginRight: "16px" }}
onKeyUp={(e: any) => {
if (e.keyCode === 13) {
setTitle(e.target.value);
}
}}
></SearchInput>
{!addOpen && (
<SearchInput
sx={{ width: 340, marginRight: "16px" }}
onKeyUp={(e: any) => {
if (e.keyCode === 13) {
setTitle(e.target.value);
}
}}
></SearchInput>
)}
{!addOpen && (
<MySelect
options={[
......@@ -264,7 +266,12 @@ const UserResourcesEnvironment = () => {
setSortState={setSortState}
></MyTable>
</div>
{addOpen && <AddEnvironment setAddopen={setAddopen}></AddEnvironment>}
{addOpen && (
<AddEnvironment
setAddopen={setAddopen}
setTitle={setTitle}
></AddEnvironment>
)}
{deleteOpen && (
<DeleteEnvironment
id={id}
......
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