Commit b35fe90f authored by wuyongsheng's avatar wuyongsheng

Merge branch 'feat-20221012-environment' into 'master'

Feat 20221012 environment

See merge request !210
parents 2c78102d c52b6560
......@@ -2,7 +2,7 @@
* @Author: 吴永生 15770852798@163.com
* @Date: 2022-10-19 17:09:23
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-10-31 11:22:34
* @LastEditTime: 2022-12-13 14:02:56
* @FilePath: /bkunyun/src/api/resourceCenter.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -107,7 +107,7 @@ const getActorEnvOptions = (params: {type: string}) => {
};
// 获取工作流模板
const getWorkflowspecList = (params: {productId?: string, title?: string}) => {
const getWorkflowspecList = (params: {productId?: string, title?: string, page: number, size: number}) => {
return request({
// url:`${Api.API_WORKFLOWSPEC_LIST}/${params.productId}`,
url:`${Api.API_WORKFLOWSPEC_LIST}`,
......
......@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-07-05 14:00:37
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-08 16:34:52
* @LastEditTime: 2022-12-13 14:21:36
* @FilePath: /bkunyun/src/api/workbench_api.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -27,6 +27,8 @@ function menu() {
type workflowspecTemplateParams = {
projectId: string;
title?: string;
page: number;
size: number;
};
// 查询项目下工作流模板列表
......
......@@ -16,7 +16,7 @@ interface ICardTableProps {
const CardTable = (props: ICardTableProps) => {
const {
data,
data=[],
renderItem,
tableKey = "id",
numberOfColumns: propsNumberOfColumns = 3,
......@@ -79,7 +79,7 @@ const CardTable = (props: ICardTableProps) => {
{renderBefore()}
</div>
)}
{data.map((item, index) => {
{data?.map((item, index) => {
return (
<div
className={style.itemBox}
......
......@@ -79,7 +79,7 @@ const VrituallyCardTable = (props: IVrituallyCardTableProps) => {
<div
style={{
display: "flex",
justifyContent: "space-between",
justifyContent: "flex-start",
alignItems: "center",
boxSizing: "border-box",
height: "100%",
......
......@@ -11,6 +11,7 @@ import FullScreenDrawer from "@/components/CommonComponents/FullScreenDrawer";
import ChevronLeftIcon from "@mui/icons-material/ChevronLeft";
import ChevronRightIcon from "@mui/icons-material/ChevronRight";
import useWindowSize from "@/hooks/useWindowSize";
import MyCircularProgress from "@/components/mui/MyCircularProgress";
type LogViewProps = {
logs: any[];
......@@ -37,6 +38,8 @@ const LogView = (props: LogViewProps) => {
const [leftButtonColor, setLeftButtonColor] = useState("#585D62");
const [rightButtonColor, setRightButtonColor] = useState("#585D62");
const [logLoading, setLogLoading] = useState<boolean>(true)
useEffect(() => {
setLogPath(logs[logCurrent]?.logPath);
......@@ -45,6 +48,7 @@ const LogView = (props: LogViewProps) => {
// 请求日志文本
useEffect(() => {
if (logPath) {
setLogLoading(true)
const path = logPath.slice(12);
CloudEController.JobFileDownloadText(
path,
......@@ -52,6 +56,8 @@ const LogView = (props: LogViewProps) => {
projectId as string
)?.then((res) => {
setLogText(res.data);
}).finally(()=>{
// setLogLoading(false)
});
} else {
setLogText("");
......@@ -179,10 +185,12 @@ const LogView = (props: LogViewProps) => {
<ChevronRightIcon />
</div>
</div>
<div className={style.logViewContent}>{logText}</div>
<div className={style.logViewBottom}>
<MyButton text="下载当前日志" onClick={handleDownLoad} />
</div>
<MyCircularProgress loading={logLoading} >
<div className={style.logViewContent}>{logText}</div>
<div className={style.logViewBottom}>
<MyButton text="下载当前日志" onClick={handleDownLoad} />
</div>
</MyCircularProgress>
</div>
</FullScreenDrawer>
);
......
......@@ -97,6 +97,22 @@
color: rgba(19, 112, 255, 1);
font-size: 14px;
}
.seeDataset {
width: 18px;
height: 18px;
background-image: url(../../../assets/project/taskResultsSeeIcon.svg);
}
.seeDataset:hover {
background-image: url(../../../assets/project/taskResultsSeeHoverIcon.svg);
}
.downloadFile {
width: 16px;
height: 16px;
background-image: url(../../../assets/project/taskResultsDownloadIcon.svg);
}
.downloadFile:hover {
background-image: url(../../../assets/project/taskResultsDownloadHoverIcon.svg);
}
.outputLiLeftImg {
box-shadow: 0px 5px 11px -5px rgba(19, 110, 250, 0.64);
}
......
......@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-06-21 20:03:56
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-09-06 10:54:40
* @LastEditTime: 2022-12-14 13:48:55
* @FilePath: /bkunyun/src/views/Project/ProjectSubmitWork/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -46,6 +46,8 @@ import {
getSameBatch,
} from "./utils";
import MyTooltip from "@/components/mui/MyTooltip";
import taskResultsFileIcon from "@/assets/project/taskResultsFileIcon.svg";
import taskResultsDatasetIcon from "@/assets/project/taskResultsDatasetIcon.svg";
import styles from "./index.module.css";
......@@ -72,7 +74,7 @@ const ProjectSubmitWork = observer(() => {
/** 选中的node Id */
const [activeFlowIndex, setActiveFlowIndex] = useState<string>("");
// const [showOptions, setShowOptions] = useState<boolean>(false);
const [randerOutputs1, setRanderOutputs] = useState<Array<any>>([]);
const [renderOutputs1, setRenderOutputs] = useState<Array<any>>([]);
const locationInfo: any = useLocation()?.state;
// const locationInfo: any = location?.state;
const navigate = useNavigate();
......@@ -97,7 +99,9 @@ const ProjectSubmitWork = observer(() => {
pollingInterval: 1000 * 20,
pollingWhenHidden: false,
onSuccess: (res: IResponse<ITaskInfo>) => {
getOutouts(res.data.outputs);
if(!activeFlowIndex) {
getOutputs(res.data.outputs);
}
getLogs(res.data);
setWorkFlowJobInfo(res.data);
const newWorkflowId = locationInfo?.taskId?.replaceAll("-", "");
......@@ -180,6 +184,7 @@ const ProjectSubmitWork = observer(() => {
const { run: getworkFlowTaskInfoRun } = useMyRequest(getworkFlowTaskInfo, {
onSuccess: (res) => {
setPatchInfo(res.data);
getOutputs(res.data.outputs)
},
});
......@@ -225,7 +230,8 @@ const ProjectSubmitWork = observer(() => {
}
}, [navigate, locationInfo.from, productId]);
const getOutouts = (outputs: any) => {
/** 获取输出文件 */
const getOutputs = (outputs: any) => {
if (outputs) {
let result = Object.keys(outputs);
let arr = result.map((item) => {
......@@ -233,8 +239,9 @@ const ProjectSubmitWork = observer(() => {
if (outputs[item].indexOf("dataset") !== -1) {
type = "dataset";
}
const nameArr = outputs[item]?.split('/') || []
return {
name: item,
name: nameArr.length ? nameArr[nameArr.length - 1] : '',
type,
path: outputs[item],
size: 0,
......@@ -242,20 +249,21 @@ const ProjectSubmitWork = observer(() => {
});
arr.forEach(async (item, index) => {
if (item.type === "dataset") {
await getDataSetSize(item, index);
await getDataSetSize(item, index,arr);
} else {
await getFileSize(item, index);
await getFileSize(item, index,arr);
}
});
randerOutputs = arr;
setRanderOutputs([...randerOutputs]);
setRenderOutputs([...randerOutputs]);
} else {
randerOutputs = [];
setRanderOutputs([]);
randerOutputs = []
setRenderOutputs([]);
}
};
const getDataSetSize = async (item: any, index: number) => {
const getDataSetSize = async (item: any, index: number, arr: any) => {
CloudEController.GetDatasetSize({
type: productId,
projectId: projectId as string,
......@@ -266,14 +274,14 @@ const ProjectSubmitWork = observer(() => {
})
?.then((res) => {
randerOutputs[index].size = `${res.data}条`;
setRanderOutputs([...randerOutputs]);
setRenderOutputs([...randerOutputs]);
})
?.catch(() => {
message.error("获取数据集大小失败");
});
};
const getFileSize = (item: any, index: number) => {
const getFileSize = (item: any, index: number, arr:any) => {
let path = item.path.slice(12);
const lastIndex = path.lastIndexOf("/");
if (lastIndex === -1) {
......@@ -293,7 +301,7 @@ const ProjectSubmitWork = observer(() => {
randerOutputs[index].size = `${
item1.size ? storageUnitFromB(Number(item1.size)) : "-"
}`;
setRanderOutputs([...randerOutputs]);
setRenderOutputs(randerOutputs);
}
});
}
......@@ -324,7 +332,8 @@ const ProjectSubmitWork = observer(() => {
const setExternalSelectedNodeId = (id: string) => {
setActiveFlowIndex(id);
workFlowJobInfo?.tasks &&
if(id) {
workFlowJobInfo?.tasks &&
workFlowJobInfo?.tasks?.forEach((item) => {
if (item.id === id) {
getworkFlowTaskInfoRun({
......@@ -333,6 +342,11 @@ const ProjectSubmitWork = observer(() => {
});
}
});
} else {
/** 未选中算子初始化为 整体的任务结果 */
getOutputs(workFlowJobInfo?.outputs)
}
};
const selectedParameter = useCallback(
......@@ -466,7 +480,7 @@ const ProjectSubmitWork = observer(() => {
{!activeFlowIndex && (
<TaskInfo
workFlowJobInfo={workFlowJobInfo as ITaskInfo}
randerOutputs1={randerOutputs1}
randerOutputs1={renderOutputs1}
handleDownLoadOutput={handleDownLoadOutput}
handleShowPopper={handleShowPopper}
setGoToProjectDataPath={setGoToProjectDataPath}
......@@ -547,6 +561,54 @@ const ProjectSubmitWork = observer(() => {
{statusMap[overviewInfo?.status as IStatus]}
</div>
</div>
{ renderOutputs1?.length ?
<>
<div className={styles.title}>
算子结果
<span className={styles.taskResultsNum}>{renderOutputs1.length}</span>
</div>
<div className={styles.taskResults}>
{renderOutputs1.map((item, index) => {
return (
<div key={index} className={styles.outputLi}>
<div className={styles.outputLiLeft}>
<img
className={classNames({
[styles.outputLiLeftImg]: true,
[styles.outputLiLeftImgBoxShadow2]:
item.type === "file",
})}
src={
item.type === "file"
? taskResultsFileIcon
: taskResultsDatasetIcon
}
alt=""
/>
<div className={styles.outputLiLeftContent}>
<div className={styles.outputItemName}>{item.name}</div>
<div className={styles.outputLiSize}>{item.size}</div>
</div>
</div>
<div
onClick={(e: any) => {
handleDownLoadOutput(item);
}}
className={classNames({
[styles.outputLiRight]: true,
[styles.seeDataset]: item.type !== "file",
[styles.downloadFile]: item.type === "file",
})}
></div>
</div>
);
})}
</div>
</> :
null}
</div>
)}
{!overviewActive && (
......
......@@ -2,7 +2,7 @@
* @Author: 吴永生 15770852798@163.com
* @Date: 2022-08-15 14:44:24
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-15 14:46:02
* @LastEditTime: 2022-12-12 18:05:01
* @FilePath: /bkunyun/src/views/Project/ProjectJobDetail/interface.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -10,5 +10,6 @@ export interface IFlowNodeTransmissionNum {
target: string,
value: number,
batchId: string,
source: string
source: string,
outputs: any
}
\ No newline at end of file
......@@ -53,8 +53,9 @@ const TaskCard = observer((props: TaskCardProps) => {
if (outputs[item].indexOf("dataset") !== -1) {
type = "dataset";
}
const nameArr = outputs[item]?.split('/') || []
return {
name: item,
name: nameArr.length ? nameArr[nameArr.length - 1] : '',
type,
path: outputs[item],
};
......
......@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-05-31 10:18:13
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-10-17 15:36:29
* @LastEditTime: 2022-12-13 16:12:00
* @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -58,7 +58,7 @@ const ProjectSetting = observer(() => {
<Box sx={{ width: "100%", typography: "body1" }}>
<Tabs
tabList={tabList}
defaultValue={location?.state?.type || "projectMember"}
defaultValue={location?.state?.type || undefined}
/>
</Box>
</div>
......
......@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-05-31 10:18:13
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-10-27 14:04:32
* @LastEditTime: 2022-12-13 14:22:05
* @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -58,7 +58,7 @@ const ProjectMembers = observer(() => {
// 获取模板列表
const { run: getTemplateInfo } = useMyRequest(getWorkbenchTemplate, {
onSuccess: (result: any) => {
setTemplateList(result.data);
setTemplateList(result.data.content);
},
});
......@@ -67,6 +67,8 @@ const ProjectMembers = observer(() => {
onSuccess: (result: any) => {
setOpenDialog(false);
getTemplateInfo({
page: 0,
size: 999,
projectId: currentProjectStore.currentProjectInfo.id as string,
title: templateName,
});
......@@ -75,6 +77,8 @@ const ProjectMembers = observer(() => {
useEffect(() => {
getTemplateInfo({
page: 0,
size: 999,
projectId: currentProjectStore.currentProjectInfo.id as string,
});
}, [currentProjectStore.currentProjectInfo.id, getTemplateInfo]);
......@@ -106,6 +110,8 @@ const ProjectMembers = observer(() => {
useEffect(() => {
setTimeout(() => {
getTemplateInfo({
page: 0,
size: 999,
projectId: projectIdData as string,
title: templateName,
});
......@@ -264,6 +270,8 @@ const ProjectMembers = observer(() => {
setShowAddTemplate={() => {
setShowAddTemplate(false);
getTemplateInfo({
page: 0,
size: 999,
projectId: projectIdData as string,
title: templateName,
});
......
......@@ -270,18 +270,18 @@ const Flow = (props: IProps) => {
return a - b;
});
const initialHeight = isFlowNode(value.id) ? 66 : 12;
let width = 176,
let minWidth = 176,
height = initialHeight
if (positionXArr?.length) {
const val = positionXArr[positionXArr.length - 1] + 144;
width = val > 176 ? val : width;
minWidth = val > 176 ? val : minWidth;
}
if (positionYArr?.length) {
const val = positionYArr[positionYArr.length - 1] + 74;
height = val > initialHeight ? val : height;
}
return {
width,
minWidth,
height,
};
},
......
......@@ -16,6 +16,8 @@ import TemplateDetail from "./TemplateDetail";
import style from "./index.module.css";
import TemplateItem from "./TemplateItem";
import NoData from "@/components/BusinessComponents/NoData";
// import VrituallyCardTable from "@/components/CommonComponents/VrituallyCardTable";
const UserResourcesTemplate = observer(() => {
const [title, setTitle] = useState("");
......@@ -81,13 +83,15 @@ const UserResourcesTemplate = observer(() => {
// 获取模板列表
const { run } = useMyRequest(getWorkflowspecList, {
onSuccess: (result: any) => {
setList(result.data);
setList(result.data.content);
},
});
useEffect(() => {
if (!showAddTemplate) {
run({
page:0,
size: 999,
productId: product === "all" ? "" : product,
title,
});
......@@ -99,6 +103,8 @@ const UserResourcesTemplate = observer(() => {
Message.success("删除成功");
setShowDeleteDialog(false);
run({
page: 0,
size: 999,
productId: product === "all" ? "" : product,
title,
});
......@@ -146,7 +152,13 @@ const UserResourcesTemplate = observer(() => {
data={list}
renderItem={renderItem}
itemMinWidth={377}
></CardTable>
/>
{/* <VrituallyCardTable
data={list}
renderItem={renderItem}
itemMinWidth={377}
rowHeight={220}
></VrituallyCardTable> */}
</div>
{showAddTemplate && (
<WorkFlowEdit
......
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