-
-
- #1
- 将分支“221063-improve-buy-ci-minutes-link”合并到“221063-improve-buy-ci-minutes-link"
- {Tags(1)}
-
- 退出
-
-
-
-
-
-
+ let projectId = props.match.params.projectId;
+ let opsId = props.match.params.opsId;
+
+ useEffect(() => {
+ if (opsId && projectId) {
+ Init();
+ }
+ }, [opsId]);
+
+ function Init(){
+ const url = `/dev_ops/builds/${opsId}.json`;
+ axios.get(url, {
+ params: {
+ project_id: projectId,
+ },
+ })
+ .then((result) => {
+ if (result && result.data) {
+ setSpinning(false);
+ setData(result.data);
+ setStages(result.data.stages);
+ }
+ })
+ .catch((error) => {
+ console.log(error);
+ });
+ }
+
+ // 重新构建
+ function repeatSet() {
+ const url = `/dev_ops/builds/${data && data.number}.json`;
+ axios.post(url, { project_id: projectId })
+ .then((result) => {
+ if (result) {
+ Init();
+ }
+ })
+ .catch((error) => {
+ console.log(error);
+ });
+ }
+ return (
+
+
+
+
+ #{data && data.number}
+ {data && data.message}
+ {Tags(`${data && data.status}`)}
+
+
+ 退出
+
+
+
+
+
+
+
+
-
- )
-});
\ No newline at end of file
+
+ );
+};
diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js
index 88f20638..8faaa61b 100644
--- a/src/forge/Main/Detail.js
+++ b/src/forge/Main/Detail.js
@@ -438,12 +438,12 @@ class Detail extends Component {
}
- {/*
-1 ? "active" : ""}>
+ -1 ? "active" : ""}>
工作流
{projectDetail && projectDetail.ops_count ? {projectDetail.ops_count} : ""}
- */}
+
-1 || url.indexOf("meilpost") > -1) ? "active" : ""}>
里程碑
diff --git a/src/forge/Utils/Time.js b/src/forge/Utils/Time.js
index 55d73441..4de4b371 100644
--- a/src/forge/Utils/Time.js
+++ b/src/forge/Utils/Time.js
@@ -26,7 +26,7 @@ export function getDateTime(value, dataformat) {
return date.format(dataformat);
}
-export default function Time(UTCtiem) {
+export function Time(UTCtiem) {
var dateTime = new Date(UTCtiem);
var year = dateTime.getFullYear();
From 940c9c025387cd240467bb24e0b7eecc766487a0 Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Sun, 9 Aug 2020 22:39:58 +0800
Subject: [PATCH 002/164] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/forge/Component/OpsStatus.jsx | 6 +-
src/forge/DevOps/OpsDetailLeftpanel.jsx | 126 +++++++++++++++++------
src/forge/DevOps/OpsDetailRightpanel.jsx | 46 +++++----
src/forge/DevOps/opsDetail.jsx | 67 ++++++------
4 files changed, 162 insertions(+), 83 deletions(-)
diff --git a/src/forge/Component/OpsStatus.jsx b/src/forge/Component/OpsStatus.jsx
index f5db8d72..b6944642 100644
--- a/src/forge/Component/OpsStatus.jsx
+++ b/src/forge/Component/OpsStatus.jsx
@@ -24,15 +24,15 @@ export const Tags = (status)=>{
export const TagsLine = (status)=>{
switch(status){
- case 1:
+ case "running":
return(
运行中
);
- case 2:
+ case "failure":
return (
未通过
);
- case 3:
+ case "success":
return (
已通过
);
diff --git a/src/forge/DevOps/OpsDetailLeftpanel.jsx b/src/forge/DevOps/OpsDetailLeftpanel.jsx
index c92cc096..87343b82 100644
--- a/src/forge/DevOps/OpsDetailLeftpanel.jsx
+++ b/src/forge/DevOps/OpsDetailLeftpanel.jsx
@@ -1,12 +1,11 @@
-import React, { useEffect ,useState } from "react";
+import React, { useEffect, useState } from "react";
import { FlexAJ, Blueline, AlignCenter } from "../Component/layout";
import styled from "styled-components";
-import { Menu , Popconfirm } from "antd";
+import { Menu, Popconfirm } from "antd";
import { TagsLine } from "../Component/OpsStatus";
import { Time } from "../Utils/Time";
import { truncateCommitId } from "../common/util";
-
const SubMenu = Menu.SubMenu;
const Img = styled.img`
{
@@ -16,37 +15,83 @@ const Img = styled.img`
margin-right: 10px;
}
`;
-export default ({ data , repeatSet }) => {
- const [ tamp , setTamp ] = useState(undefined);
- const [ sha , setSha ] = useState(undefined);
- useEffect(()=>{
- if(data && data.started){
+export default ({ data, repeatSet }) => {
+ const [tamp, setTamp] = useState(undefined);
+ const [sha, setSha] = useState(undefined);
+ useEffect(() => {
+ if (data && data.started) {
let t = parseInt(data.started) * 1000;
let time = Time(t);
setTamp(time);
}
- if(data && data.after){
+ if (data && data.after) {
setSha(truncateCommitId(data.after));
}
- },[data])
+ }, [data]);
+
+ function renderMenu() {
+ if (data.stages && data.stages.length > 0) {
+ data.stages.map((item, key) => {
+ return item.steps && item.steps.length > 0 ? (
+
+
+ {item.name}
+
+ }
+ >
+ {item.steps.map((i, k) => {
+ return (
+
- {data && data.started && (
+ {data && data.started ? (
开始时间: {tamp}
+ ) : (
+ ""
)}
- {data && data.timestamp && (
-
- 运行时间:{data && data.timestamp}s
-
- )}
+
+ 运行时间:{data && data.timestamp}s
+
-
+
重新创建
@@ -59,21 +104,38 @@ export default ({ data , repeatSet }) => {