Commit 11d05219 authored by wuyongsheng's avatar wuyongsheng

feat: 增加启动状态

parent 1d6dd4f4
......@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-06-21 20:03:56
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-08-15 17:18:49
* @LastEditTime: 2022-08-22 15:41:06
* @FilePath: /bkunyun/src/views/Project/ProjectSubmitWork/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -47,6 +47,7 @@ import { getConnectionArr, getDatasetName, getDatasetPath, getSameBatch } from "
import styles from "./index.module.css";
const stateMap = {
SUBMITTED:"正在启动",
RUNNING: "正在运行",
ABORTED: "运行终止",
FAILED: "运行失败",
......@@ -348,18 +349,7 @@ const ProjectSubmitWork = observer(() => {
setOverviewActive(false);
setShowOptions(!showOptions);
};
const handleDownLoad = (path: string) => {
if (path.indexOf("/ProjectData") !== -1) {
path = path.slice(12);
}
CloudEController.JobFileDownload(
path,
fileToken as string,
projectId as string
);
};
/** 终止任务 */
const onStopJob = useCallback(() => {
cancelWorkJob({
......@@ -375,7 +365,7 @@ const ProjectSubmitWork = observer(() => {
}, [deleteWorkJob, workFlowJobInfo?.id]);
const returnPermission = useMemo(() => {
if (state === "RUNNING") {
if (['SUBMITTED', 'RUNNING'].includes(state || '')) {
return isPass("PROJECT_WORKBENCH_JOBS_STOP", "USER");
} else {
return isPass("PROJECT_WORKBENCH_JOBS_DELETE", "MANAGER");
......@@ -446,13 +436,13 @@ const ProjectSubmitWork = observer(() => {
}}
> */}
<MyButton
text={state === "RUNNING" ? "终止" : "删除"}
text={['SUBMITTED', 'RUNNING'].includes(state || '') ? "终止" : "删除"}
variant="outlined"
color="secondary"
onClick={(e: any) =>
handleShowPopper(
e,
state === "RUNNING"
['SUBMITTED', 'RUNNING'].includes(state || '')
? "正在运行的任务终止后将无法重新运行,确认继续吗?"
: "任务被删除后将无法恢复,确认继续吗?"
)
......@@ -551,7 +541,7 @@ const ProjectSubmitWork = observer(() => {
alt=""
/>
)}
{state === "RUNNING" && (
{['SUBMITTED', 'RUNNING'].includes(state || '') && (
<img
className={styles.taskInfoValueIcon}
src={jobRun}
......
......@@ -87,6 +87,8 @@ const TaskCard = (props: TaskCardProps) => {
// 渲染状态
const renderStatusText = (data: string) => {
switch (data) {
case "SUBMITTED":
return "正在启动";
case "RUNNING":
return '正在运行'
case "ABORTED":
......
......@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-05-31 10:18:13
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-07-28 19:02:19
* @LastEditTime: 2022-08-22 15:33:02
* @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -48,6 +48,10 @@ const currencies = [
value: "ALL",
label: "全部",
},
{
value: "SUBMITTED",
label: "正在启动",
},
{
value: "RUNNING",
label: "正在运行",
......
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