Commit 34250724 authored by wuyongsheng's avatar wuyongsheng

feat: 日志loading

parent 32d3e94d
...@@ -11,6 +11,7 @@ import FullScreenDrawer from "@/components/CommonComponents/FullScreenDrawer"; ...@@ -11,6 +11,7 @@ import FullScreenDrawer from "@/components/CommonComponents/FullScreenDrawer";
import ChevronLeftIcon from "@mui/icons-material/ChevronLeft"; import ChevronLeftIcon from "@mui/icons-material/ChevronLeft";
import ChevronRightIcon from "@mui/icons-material/ChevronRight"; import ChevronRightIcon from "@mui/icons-material/ChevronRight";
import useWindowSize from "@/hooks/useWindowSize"; import useWindowSize from "@/hooks/useWindowSize";
import MyCircularProgress from "@/components/mui/MyCircularProgress";
type LogViewProps = { type LogViewProps = {
logs: any[]; logs: any[];
...@@ -37,6 +38,8 @@ const LogView = (props: LogViewProps) => { ...@@ -37,6 +38,8 @@ const LogView = (props: LogViewProps) => {
const [leftButtonColor, setLeftButtonColor] = useState("#585D62"); const [leftButtonColor, setLeftButtonColor] = useState("#585D62");
const [rightButtonColor, setRightButtonColor] = useState("#585D62"); const [rightButtonColor, setRightButtonColor] = useState("#585D62");
const [logLoading, setLogLoading] = useState<boolean>(true)
useEffect(() => { useEffect(() => {
setLogPath(logs[logCurrent]?.logPath); setLogPath(logs[logCurrent]?.logPath);
...@@ -45,6 +48,7 @@ const LogView = (props: LogViewProps) => { ...@@ -45,6 +48,7 @@ const LogView = (props: LogViewProps) => {
// 请求日志文本 // 请求日志文本
useEffect(() => { useEffect(() => {
if (logPath) { if (logPath) {
setLogLoading(true)
const path = logPath.slice(12); const path = logPath.slice(12);
CloudEController.JobFileDownloadText( CloudEController.JobFileDownloadText(
path, path,
...@@ -52,6 +56,8 @@ const LogView = (props: LogViewProps) => { ...@@ -52,6 +56,8 @@ const LogView = (props: LogViewProps) => {
projectId as string projectId as string
)?.then((res) => { )?.then((res) => {
setLogText(res.data); setLogText(res.data);
}).finally(()=>{
// setLogLoading(false)
}); });
} else { } else {
setLogText(""); setLogText("");
...@@ -179,10 +185,12 @@ const LogView = (props: LogViewProps) => { ...@@ -179,10 +185,12 @@ const LogView = (props: LogViewProps) => {
<ChevronRightIcon /> <ChevronRightIcon />
</div> </div>
</div> </div>
<MyCircularProgress loading={logLoading} >
<div className={style.logViewContent}>{logText}</div> <div className={style.logViewContent}>{logText}</div>
<div className={style.logViewBottom}> <div className={style.logViewBottom}>
<MyButton text="下载当前日志" onClick={handleDownLoad} /> <MyButton text="下载当前日志" onClick={handleDownLoad} />
</div> </div>
</MyCircularProgress>
</div> </div>
</FullScreenDrawer> </FullScreenDrawer>
); );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com * @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-06-21 20:03:56 * @Date: 2022-06-21 20:03:56
* @LastEditors: 吴永生 15770852798@163.com * @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-12-13 14:12:44 * @LastEditTime: 2022-12-13 19:15:57
* @FilePath: /bkunyun/src/views/Project/ProjectSubmitWork/index.tsx * @FilePath: /bkunyun/src/views/Project/ProjectSubmitWork/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -251,6 +251,7 @@ const ProjectSubmitWork = observer(() => { ...@@ -251,6 +251,7 @@ const ProjectSubmitWork = observer(() => {
await getFileSize(item, index); await getFileSize(item, index);
} }
}); });
renderOutputs = arr; renderOutputs = arr;
setRenderOutputs(renderOutputs); setRenderOutputs(renderOutputs);
} else { } else {
...@@ -328,6 +329,7 @@ const ProjectSubmitWork = observer(() => { ...@@ -328,6 +329,7 @@ const ProjectSubmitWork = observer(() => {
const setExternalSelectedNodeId = (id: string) => { const setExternalSelectedNodeId = (id: string) => {
setActiveFlowIndex(id); setActiveFlowIndex(id);
if(id) {
workFlowJobInfo?.tasks && workFlowJobInfo?.tasks &&
workFlowJobInfo?.tasks?.forEach((item) => { workFlowJobInfo?.tasks?.forEach((item) => {
if (item.id === id) { if (item.id === id) {
...@@ -337,6 +339,10 @@ const ProjectSubmitWork = observer(() => { ...@@ -337,6 +339,10 @@ const ProjectSubmitWork = observer(() => {
}); });
} }
}); });
} else {
getOutputs(workFlowJobInfo?.outputs)
}
}; };
const selectedParameter = useCallback( const selectedParameter = useCallback(
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com * @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-05-31 10:18:13 * @Date: 2022-05-31 10:18:13
* @LastEditors: 吴永生 15770852798@163.com * @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 * @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -58,7 +58,7 @@ const ProjectSetting = observer(() => { ...@@ -58,7 +58,7 @@ const ProjectSetting = observer(() => {
<Box sx={{ width: "100%", typography: "body1" }}> <Box sx={{ width: "100%", typography: "body1" }}>
<Tabs <Tabs
tabList={tabList} tabList={tabList}
defaultValue={location?.state?.type || "projectMember"} defaultValue={location?.state?.type || undefined}
/> />
</Box> </Box>
</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