@devops-flow/devops-flow-pipeline-detail 0.0.40 → 0.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/1.js +4 -4
- package/dist/2.js +1 -1
- package/dist/PipelineFlowDetail.css +1 -1
- package/dist/PipelineFlowDetail.js +14 -14
- package/es/components/detailMain/index.d.ts +2 -1
- package/es/components/detailMain/index.js +2 -0
- package/es/components/detailMain/recent/index.js +27 -9
- package/es/index.css +1 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +4 -1
- package/es/style.js +2 -1
- package/es/utils/api/index.d.ts +1 -0
- package/es/utils/api/index.js +15 -1
- package/package.json +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare const TBDetailMain: ({ loading, type, pipelineId, onRunPipeline, onBuildNumberChange, changeConfig, onPipelineStatusChanged, haveHistoryPip, }: {
|
|
2
|
+
declare const TBDetailMain: ({ loading, type, pipelineId, pipelineRunId, onRunPipeline, onBuildNumberChange, changeConfig, onPipelineStatusChanged, haveHistoryPip, }: {
|
|
3
3
|
loading: any;
|
|
4
4
|
type: any;
|
|
5
5
|
pipelineId: any;
|
|
6
|
+
pipelineRunId: any;
|
|
6
7
|
onRunPipeline: any;
|
|
7
8
|
onBuildNumberChange: any;
|
|
8
9
|
changeConfig: any;
|
|
@@ -10,6 +10,7 @@ var TBDetailMain = function TBDetailMain(_ref) {
|
|
|
10
10
|
var loading = _ref.loading,
|
|
11
11
|
type = _ref.type,
|
|
12
12
|
pipelineId = _ref.pipelineId,
|
|
13
|
+
pipelineRunId = _ref.pipelineRunId,
|
|
13
14
|
onRunPipeline = _ref.onRunPipeline,
|
|
14
15
|
onBuildNumberChange = _ref.onBuildNumberChange,
|
|
15
16
|
changeConfig = _ref.changeConfig,
|
|
@@ -21,6 +22,7 @@ var TBDetailMain = function TBDetailMain(_ref) {
|
|
|
21
22
|
loading: loading,
|
|
22
23
|
type: type,
|
|
23
24
|
pipelineId: pipelineId,
|
|
25
|
+
pipelineRunId: pipelineRunId,
|
|
24
26
|
haveHistoryPip: haveHistoryPip,
|
|
25
27
|
onBuildNumberChange: onBuildNumberChange,
|
|
26
28
|
onRunPipeline: onRunPipeline,
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
4
|
var _excluded = ["loading", "onBuildNumberChange", "onPipelineStatusChanged", "haveHistoryPip"];
|
|
5
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
6
|
import React, { useEffect, useState } from 'react';
|
|
5
7
|
import { Loading } from '@teamix/ui';
|
|
6
8
|
import imgSrc from "../../../assets/img-src";
|
|
7
9
|
import intl from "../../../locale";
|
|
8
10
|
import "./index.scss";
|
|
9
|
-
import { GetLatestPipelineRun } from "../../../utils/api";
|
|
11
|
+
import { GetLatestPipelineRun, GetPipelineRunHistory } from "../../../utils/api";
|
|
10
12
|
import PipelineInstance from "../../common/teambition/pipeline-instance-new";
|
|
11
13
|
import RunPipelineButton from "../../common/teambition/run-pipeline-btn";
|
|
12
14
|
import MessagePage from "../../common/teambition/message-page";
|
|
@@ -17,6 +19,7 @@ var Current = function Current(_ref) {
|
|
|
17
19
|
haveHistoryPip = _ref.haveHistoryPip,
|
|
18
20
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
19
21
|
var pipelineId = props.pipelineId,
|
|
22
|
+
pipelineRunId = props.pipelineRunId,
|
|
20
23
|
type = props.type;
|
|
21
24
|
var _useState = useState(),
|
|
22
25
|
instance = _useState[0],
|
|
@@ -35,14 +38,29 @@ var Current = function Current(_ref) {
|
|
|
35
38
|
return onBuildNumberChange === null || onBuildNumberChange === void 0 ? void 0 : onBuildNumberChange(undefined, false);
|
|
36
39
|
};
|
|
37
40
|
}, []);
|
|
38
|
-
var getLatestPipeline = function
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
var getLatestPipeline = /*#__PURE__*/function () {
|
|
42
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
43
|
+
var api;
|
|
44
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
45
|
+
while (1) switch (_context.prev = _context.next) {
|
|
46
|
+
case 0:
|
|
47
|
+
api = pipelineRunId ? GetPipelineRunHistory(pipelineId, pipelineRunId) : GetLatestPipelineRun(pipelineId);
|
|
48
|
+
api.then(function (res) {
|
|
49
|
+
setLoading(false);
|
|
50
|
+
setInstance(res);
|
|
51
|
+
})["catch"](function () {
|
|
52
|
+
setLoading(false);
|
|
53
|
+
});
|
|
54
|
+
case 2:
|
|
55
|
+
case "end":
|
|
56
|
+
return _context.stop();
|
|
57
|
+
}
|
|
58
|
+
}, _callee);
|
|
59
|
+
}));
|
|
60
|
+
return function getLatestPipeline() {
|
|
61
|
+
return _ref2.apply(this, arguments);
|
|
62
|
+
};
|
|
63
|
+
}();
|
|
46
64
|
useEffect(function () {
|
|
47
65
|
getLatestPipeline();
|
|
48
66
|
var intervalId = setInterval(function () {
|
package/es/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import url('https://g.alicdn.com/yunxiao-fe/teamix-ui/1.5.27/style/style/yunxiao-v5.min.css');
|
package/es/index.d.ts
CHANGED
package/es/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
/* eslint-disable import/first */
|
|
3
3
|
import "./utils/initYunxiaoCommon";
|
|
4
4
|
import React from 'react';
|
|
5
|
+
import "./index.css";
|
|
5
6
|
import { ConfigProvider } from '@teamix/ui';
|
|
6
7
|
import "./pages/tbNavigationInit/index";
|
|
7
8
|
import "./components/common/at-design.scss";
|
|
@@ -72,13 +73,15 @@ var enterFlowTrack = function enterFlowTrack() {
|
|
|
72
73
|
var lang = locale || window.FORCE && window.FORCE.locale || 'zh_CN';
|
|
73
74
|
var isEn = lang === 'en_US';
|
|
74
75
|
var App = function App(props) {
|
|
75
|
-
var pipelineId = props.pipelineId
|
|
76
|
+
var pipelineId = props.pipelineId,
|
|
77
|
+
pipelineRunId = props.pipelineRunId;
|
|
76
78
|
return /*#__PURE__*/React.createElement(ConfigProvider, {
|
|
77
79
|
locale: isEn ? enUS : zhCN
|
|
78
80
|
}, /*#__PURE__*/React.createElement("div", {
|
|
79
81
|
className: "container"
|
|
80
82
|
}, /*#__PURE__*/React.createElement(AsyncDetail, {
|
|
81
83
|
pipelineId: pipelineId,
|
|
84
|
+
pipelineRunId: pipelineRunId,
|
|
82
85
|
location: window.location
|
|
83
86
|
})));
|
|
84
87
|
};
|
package/es/style.js
CHANGED
package/es/utils/api/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const getFlowDataApi: (data: any) => Promise<any>;
|
|
2
2
|
export declare const GetLatestPipelineRun: (pipelineId: any) => Promise<any>;
|
|
3
|
+
export declare const GetPipelineRunHistory: (pipelineId: any, pipelineRunId: any) => Promise<any>;
|
|
3
4
|
export declare const GetPipelineJobSteps: (pipelineId: any, pipelineRunId: any, jobId: any) => Promise<any>;
|
|
4
5
|
export declare const GetPipelineJobStepLog: ({ pipelineId, pipelineRunId, jobId, buildId, stepIndex, offset }: {
|
|
5
6
|
pipelineId: any;
|
package/es/utils/api/index.js
CHANGED
|
@@ -33,7 +33,7 @@ export var getFlowDataApi = /*#__PURE__*/function () {
|
|
|
33
33
|
};
|
|
34
34
|
}();
|
|
35
35
|
|
|
36
|
-
//
|
|
36
|
+
// 查询流水线最新运行
|
|
37
37
|
export var GetLatestPipelineRun = function GetLatestPipelineRun(pipelineId) {
|
|
38
38
|
var data = {
|
|
39
39
|
action: 'GetLatestPipelineRun',
|
|
@@ -46,6 +46,20 @@ export var GetLatestPipelineRun = function GetLatestPipelineRun(pipelineId) {
|
|
|
46
46
|
return getFlowDataApi(data);
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
+
// 查询流水线运行历史
|
|
50
|
+
export var GetPipelineRunHistory = function GetPipelineRunHistory(pipelineId, pipelineRunId) {
|
|
51
|
+
var data = {
|
|
52
|
+
action: 'GetLatestPipelineRun',
|
|
53
|
+
method: 'GET',
|
|
54
|
+
actionPath: 'https://{domain}/oapi/v1/flow/organization/{organizationId}/pipelines/{pipelineId}/pipelineRuns/{pipelineRunId}',
|
|
55
|
+
pathParams: {
|
|
56
|
+
pipelineId: pipelineId,
|
|
57
|
+
pipelineRunId: pipelineRunId
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
return getFlowDataApi(data);
|
|
61
|
+
};
|
|
62
|
+
|
|
49
63
|
// 查询任务步骤列表
|
|
50
64
|
|
|
51
65
|
export var GetPipelineJobSteps = function GetPipelineJobSteps(pipelineId, pipelineRunId, jobId) {
|