@devops-flow/devops-flow-pipeline-detail 0.0.52 → 0.0.54
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/PipelineFlowDetail.js +1 -1
- package/es/components/common/teambition/flow-job-btn/cardsMap.js +4 -2
- package/es/components/common/teambition/flow-job-btn/execute-button/index.js +4 -4
- package/es/components/common/teambition/flow-job-btn/link/index.js +4 -2
- package/es/components/common/teambition/flow-job-btn/log-btn/index.js +5 -5
- package/es/components/common/teambition/flow-job-btn/replaceHost.d.ts +1 -0
- package/es/components/common/teambition/flow-job-btn/replaceHost.js +7 -0
- package/es/components/common/teambition/flow-job-new/index.js +2 -2
- package/es/components/detailMain/current/index.js +2 -2
- package/es/components/detailMain/recent/index.js +3 -3
- package/es/contexts/config.d.ts +3 -0
- package/es/contexts/config.js +7 -2
- package/es/index.js +10 -2
- package/es/utils/api/index.d.ts +20 -19
- package/es/utils/api/index.js +74 -46
- package/package.json +1 -1
|
@@ -36,7 +36,8 @@ export var buildButtonComponentWrapper = function buildButtonComponentWrapper(_r
|
|
|
36
36
|
var globalConfig = useContext(ConfigContext);
|
|
37
37
|
var _globalConfig$replace = globalConfig.replaceLinks,
|
|
38
38
|
reportLinkHost = _globalConfig$replace.report,
|
|
39
|
-
scanLinkHost = _globalConfig$replace.scan
|
|
39
|
+
scanLinkHost = _globalConfig$replace.scan,
|
|
40
|
+
appStackHost = _globalConfig$replace.appstack;
|
|
40
41
|
|
|
41
42
|
// 独立组件的后端返回数据格式,和 Flow 不一致,需要要type类型判断,返回结果一样
|
|
42
43
|
if (type === 'LINK') {
|
|
@@ -45,7 +46,8 @@ export var buildButtonComponentWrapper = function buildButtonComponentWrapper(_r
|
|
|
45
46
|
return Button ? /*#__PURE__*/React.createElement(Button, _extends({}, props, restProps, {
|
|
46
47
|
text: true,
|
|
47
48
|
id: restProps.key,
|
|
48
|
-
reportLinkHost: reportLinkHost
|
|
49
|
+
reportLinkHost: reportLinkHost,
|
|
50
|
+
appStackHost: appStackHost
|
|
49
51
|
})) : null;
|
|
50
52
|
};
|
|
51
53
|
}
|
|
@@ -35,7 +35,7 @@ var ExecuteButton = function ExecuteButton(_ref) {
|
|
|
35
35
|
disabled = _useState2[0],
|
|
36
36
|
setDisabled = _useState2[1];
|
|
37
37
|
var globalConfig = useContext(ConfigContext);
|
|
38
|
-
var
|
|
38
|
+
var apiHeaderFn = globalConfig.apiHeaderFn;
|
|
39
39
|
var doCallApiAndRefresh = function doCallApiAndRefresh(apiFunc, params) {
|
|
40
40
|
return callApiAndRefresh(apiFunc, params, onRefresh, setLoading, setDisabled, name);
|
|
41
41
|
};
|
|
@@ -51,7 +51,7 @@ var ExecuteButton = function ExecuteButton(_ref) {
|
|
|
51
51
|
pipelineId: pipelineId,
|
|
52
52
|
pipelineRunId: pipelineRunId,
|
|
53
53
|
jobId: job.id,
|
|
54
|
-
|
|
54
|
+
apiHeaderFn: apiHeaderFn
|
|
55
55
|
});
|
|
56
56
|
break;
|
|
57
57
|
}
|
|
@@ -61,7 +61,7 @@ var ExecuteButton = function ExecuteButton(_ref) {
|
|
|
61
61
|
pipelineId: pipelineId,
|
|
62
62
|
pipelineRunId: pipelineRunId,
|
|
63
63
|
jobId: job.id,
|
|
64
|
-
|
|
64
|
+
apiHeaderFn: apiHeaderFn
|
|
65
65
|
});
|
|
66
66
|
break;
|
|
67
67
|
}
|
|
@@ -71,7 +71,7 @@ var ExecuteButton = function ExecuteButton(_ref) {
|
|
|
71
71
|
pipelineId: pipelineId,
|
|
72
72
|
pipelineRunId: pipelineRunId,
|
|
73
73
|
jobId: job.id,
|
|
74
|
-
|
|
74
|
+
apiHeaderFn: apiHeaderFn
|
|
75
75
|
});
|
|
76
76
|
break;
|
|
77
77
|
}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Button } from '@teamix/ui';
|
|
3
3
|
import { BaiscIconFont as Icon } from "../../icon-font";
|
|
4
|
-
import { replaceHostWithBase } from "../replaceHost";
|
|
4
|
+
import { replaceAppstack, replaceHostWithBase } from "../replaceHost";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* 按钮实现模板
|
|
8
8
|
*/
|
|
9
9
|
var LinkButton = function LinkButton(props) {
|
|
10
10
|
var url = props.params.url;
|
|
11
|
-
if (props.
|
|
11
|
+
if (props.name === '部署单详情') {
|
|
12
|
+
url = replaceAppstack(props.params.url, props.appStackHost);
|
|
13
|
+
} else if (props.reportLinkHost) {
|
|
12
14
|
url = replaceHostWithBase(props.params.url, props.reportLinkHost);
|
|
13
15
|
}
|
|
14
16
|
return /*#__PURE__*/React.createElement(Button, {
|
|
@@ -71,7 +71,7 @@ var SubTree = function SubTree(props) {
|
|
|
71
71
|
job = props.job,
|
|
72
72
|
setBuildId = props.setBuildId;
|
|
73
73
|
var globalConfig = useContext(ConfigContext);
|
|
74
|
-
var
|
|
74
|
+
var apiHeaderFn = globalConfig.apiHeaderFn;
|
|
75
75
|
var _useState = useState([]),
|
|
76
76
|
tree = _useState[0],
|
|
77
77
|
setTree = _useState[1];
|
|
@@ -87,7 +87,7 @@ var SubTree = function SubTree(props) {
|
|
|
87
87
|
var getPipelineJobSteps = function getPipelineJobSteps() {
|
|
88
88
|
var pipelineRunId = instance.pipelineRunId,
|
|
89
89
|
pipelineId = instance.pipelineId;
|
|
90
|
-
GetPipelineJobSteps(pipelineId, pipelineRunId, job.id,
|
|
90
|
+
GetPipelineJobSteps(pipelineId, pipelineRunId, job.id, apiHeaderFn).then(function (jobSteps) {
|
|
91
91
|
setLoading(false);
|
|
92
92
|
if (jobSteps && jobSteps[0]) {
|
|
93
93
|
setTree(jobSteps);
|
|
@@ -208,7 +208,7 @@ var LogButton = function LogButton(_ref) {
|
|
|
208
208
|
buildId = _useState14[0],
|
|
209
209
|
setBuildId = _useState14[1];
|
|
210
210
|
var globalConfig = useContext(ConfigContext);
|
|
211
|
-
var
|
|
211
|
+
var apiHeaderFn = globalConfig.apiHeaderFn;
|
|
212
212
|
var isFinishStatus = function isFinishStatus(status) {
|
|
213
213
|
return ['success', 'fail'].includes(status);
|
|
214
214
|
};
|
|
@@ -256,7 +256,7 @@ var LogButton = function LogButton(_ref) {
|
|
|
256
256
|
buildId: buildId,
|
|
257
257
|
offset: offset,
|
|
258
258
|
stepIndex: selectNode.nodeIndex,
|
|
259
|
-
|
|
259
|
+
apiHeaderFn: apiHeaderFn
|
|
260
260
|
}).then(function (res) {
|
|
261
261
|
var logs = res.logs,
|
|
262
262
|
last = res.last;
|
|
@@ -455,7 +455,7 @@ var LogButton = function LogButton(_ref) {
|
|
|
455
455
|
jobId: job.id,
|
|
456
456
|
stepIndex: context.selectNode.stepIndex,
|
|
457
457
|
buildId: buildId
|
|
458
|
-
},
|
|
458
|
+
}, apiHeaderFn).then(function (res) {
|
|
459
459
|
setViewLogAction(res);
|
|
460
460
|
})["catch"](function () {
|
|
461
461
|
setViewLogAction('');
|
|
@@ -14,4 +14,11 @@ export var replaceHostWithBase = function replaceHostWithBase(url, newHost) {
|
|
|
14
14
|
return newHost + '/devops/getReport?reportPath=' + urlObj.pathname;
|
|
15
15
|
}
|
|
16
16
|
return url;
|
|
17
|
+
};
|
|
18
|
+
export var replaceAppstack = function replaceAppstack(url, newHost) {
|
|
19
|
+
var urlObj = new URL(url);
|
|
20
|
+
if (newHost) {
|
|
21
|
+
return newHost + urlObj.pathname;
|
|
22
|
+
}
|
|
23
|
+
return url;
|
|
17
24
|
};
|
|
@@ -94,7 +94,7 @@ var FlowSwitch = function FlowSwitch(_ref) {
|
|
|
94
94
|
requesting = _useState[0],
|
|
95
95
|
setRequesting = _useState[1];
|
|
96
96
|
var globalConfig = useContext(ConfigContext);
|
|
97
|
-
var
|
|
97
|
+
var apiHeaderFn = globalConfig.apiHeaderFn;
|
|
98
98
|
var manualSwitch = function manualSwitch() {
|
|
99
99
|
if (requesting || status === 'SUCCESS' && !isOld) return;
|
|
100
100
|
setRequesting(true);
|
|
@@ -102,7 +102,7 @@ var FlowSwitch = function FlowSwitch(_ref) {
|
|
|
102
102
|
pipelineId: pipelineId,
|
|
103
103
|
pipelineRunId: pipelineRunId,
|
|
104
104
|
jobId: pipelineJobId,
|
|
105
|
-
|
|
105
|
+
apiHeaderFn: apiHeaderFn
|
|
106
106
|
}).then(function (res) {
|
|
107
107
|
setRequesting(false);
|
|
108
108
|
if (res) {
|
|
@@ -45,7 +45,7 @@ var Current = function Current(_ref) {
|
|
|
45
45
|
canEditPipeline = _useState4[0],
|
|
46
46
|
setCanEditPipeline = _useState4[1];
|
|
47
47
|
var globalConfig = useContext(ConfigContext);
|
|
48
|
-
var
|
|
48
|
+
var apiHeaderFn = globalConfig.apiHeaderFn;
|
|
49
49
|
var checkPipelinePermission = function checkPipelinePermission() {
|
|
50
50
|
permissionUtil.checkPermissionList([PERMISSION_PIPELINE_EXECUTE, PERMISSION_PIPELINE_EDIT], props.pipelineId, 'pipeline', window.AK_GLOBAL.currentUser.workid).then(function (data) {
|
|
51
51
|
setCanExecutePipeline(data[PERMISSION_PIPELINE_EXECUTE]);
|
|
@@ -53,7 +53,7 @@ var Current = function Current(_ref) {
|
|
|
53
53
|
});
|
|
54
54
|
};
|
|
55
55
|
var getLatestPipeline = function getLatestPipeline() {
|
|
56
|
-
GetLatestPipelineRun(pipelineId,
|
|
56
|
+
GetLatestPipelineRun(pipelineId, apiHeaderFn).then(function (res) {
|
|
57
57
|
setLoading(false);
|
|
58
58
|
if (res.successful) {
|
|
59
59
|
var _res$object;
|
|
@@ -42,12 +42,12 @@ var Current = function Current(_ref) {
|
|
|
42
42
|
}, []);
|
|
43
43
|
var getLatestPipeline = /*#__PURE__*/function () {
|
|
44
44
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
45
|
-
var
|
|
45
|
+
var apiHeaderFn, api;
|
|
46
46
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
47
47
|
while (1) switch (_context.prev = _context.next) {
|
|
48
48
|
case 0:
|
|
49
|
-
|
|
50
|
-
api = pipelineRunId ? GetPipelineRun(pipelineId, pipelineRunId,
|
|
49
|
+
apiHeaderFn = globalConfig.apiHeaderFn;
|
|
50
|
+
api = pipelineRunId ? GetPipelineRun(pipelineId, pipelineRunId, apiHeaderFn) : GetLatestPipelineRun(pipelineId, apiHeaderFn);
|
|
51
51
|
api.then(function (res) {
|
|
52
52
|
setLoading(false);
|
|
53
53
|
setInstance(res);
|
package/es/contexts/config.d.ts
CHANGED
package/es/contexts/config.js
CHANGED
|
@@ -5,7 +5,12 @@ var ConfigContext = /*#__PURE__*/createContext({
|
|
|
5
5
|
// api接口
|
|
6
6
|
report: '',
|
|
7
7
|
// 报告链接
|
|
8
|
-
scan: ''
|
|
9
|
-
|
|
8
|
+
scan: '',
|
|
9
|
+
// 扫描报告
|
|
10
|
+
appstack: '' // 部署单链接
|
|
11
|
+
},
|
|
12
|
+
headers: {},
|
|
13
|
+
// private
|
|
14
|
+
apiHeaderFn: function apiHeaderFn() {}
|
|
10
15
|
});
|
|
11
16
|
export default ConfigContext;
|
package/es/index.js
CHANGED
|
@@ -24,6 +24,7 @@ import { locale } from "./utils";
|
|
|
24
24
|
import enUS from '@teamix/ui/locale/en-us';
|
|
25
25
|
import zhCN from '@teamix/ui/locale/zh-cn';
|
|
26
26
|
import AsyncDetail from "./pages/detailSwitch";
|
|
27
|
+
import { flowCurryApi, getFlowDataApi } from "./utils/api";
|
|
27
28
|
moment.locale('zh-cn');
|
|
28
29
|
dayjs.locale(['en', 'en_US'].includes(intl.getLang()) ? 'en' : 'zh-cn');
|
|
29
30
|
|
|
@@ -85,12 +86,19 @@ var App = function App(props) {
|
|
|
85
86
|
pipelineRunId = props.pipelineRunId,
|
|
86
87
|
displayConfig = props.displayConfig,
|
|
87
88
|
_props$replaceLinks = props.replaceLinks,
|
|
88
|
-
replaceLinks = _props$replaceLinks === void 0 ? {} : _props$replaceLinks
|
|
89
|
+
replaceLinks = _props$replaceLinks === void 0 ? {} : _props$replaceLinks,
|
|
90
|
+
headers = props.headers;
|
|
91
|
+
var apiHeaderFn = getFlowDataApi;
|
|
92
|
+
if (replaceLinks.api && headers) {
|
|
93
|
+
apiHeaderFn = flowCurryApi(replaceLinks.api, headers);
|
|
94
|
+
}
|
|
89
95
|
return /*#__PURE__*/React.createElement(ConfigProvider, {
|
|
90
96
|
locale: isEn ? enUS : zhCN
|
|
91
97
|
}, /*#__PURE__*/React.createElement(ConfigContext.Provider, {
|
|
92
98
|
value: {
|
|
93
|
-
replaceLinks: replaceLinks
|
|
99
|
+
replaceLinks: replaceLinks,
|
|
100
|
+
headers: headers,
|
|
101
|
+
apiHeaderFn: apiHeaderFn
|
|
94
102
|
}
|
|
95
103
|
}, /*#__PURE__*/React.createElement("div", {
|
|
96
104
|
className: "container"
|
package/es/utils/api/index.d.ts
CHANGED
|
@@ -1,45 +1,46 @@
|
|
|
1
1
|
export declare const getFlowDataApi: (data: any, host?: string) => Promise<any>;
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
2
|
+
export declare const flowCurryApi: (host?: string, headers?: Record<string, any>) => (data: any) => Promise<any>;
|
|
3
|
+
export declare const GetLatestPipelineRun: (pipelineId: any, apiHeaderFn: any) => any;
|
|
4
|
+
export declare const GetPipelineRun: (pipelineId: any, pipelineRunId: any, apiHeaderFn: any) => any;
|
|
4
5
|
export declare const GetPipelineLogOrigin: ({ pipelineId, pipelineRunId, jobId, stepIndex, buildId }: {
|
|
5
6
|
pipelineId: any;
|
|
6
7
|
pipelineRunId: any;
|
|
7
8
|
jobId: any;
|
|
8
9
|
stepIndex: any;
|
|
9
10
|
buildId: any;
|
|
10
|
-
},
|
|
11
|
-
export declare const GetPipelineJobSteps: (pipelineId: any, pipelineRunId: any, jobId: any,
|
|
12
|
-
export declare const GetPipelineJobStepLog: ({ pipelineId, pipelineRunId, jobId, buildId, stepIndex, offset,
|
|
11
|
+
}, apiHeaderFn: any) => any;
|
|
12
|
+
export declare const GetPipelineJobSteps: (pipelineId: any, pipelineRunId: any, jobId: any, dataApi: any) => any;
|
|
13
|
+
export declare const GetPipelineJobStepLog: ({ pipelineId, pipelineRunId, jobId, buildId, stepIndex, offset, apiHeaderFn, }: {
|
|
13
14
|
pipelineId: any;
|
|
14
15
|
pipelineRunId: any;
|
|
15
16
|
jobId: any;
|
|
16
17
|
buildId: any;
|
|
17
18
|
stepIndex: any;
|
|
18
19
|
offset: any;
|
|
19
|
-
|
|
20
|
-
}) =>
|
|
21
|
-
export declare const RetryPipelineJobRun: ({ pipelineId, pipelineRunId, jobId,
|
|
20
|
+
apiHeaderFn: any;
|
|
21
|
+
}) => any;
|
|
22
|
+
export declare const RetryPipelineJobRun: ({ pipelineId, pipelineRunId, jobId, apiHeaderFn, }: {
|
|
22
23
|
pipelineId: any;
|
|
23
24
|
pipelineRunId: any;
|
|
24
25
|
jobId: any;
|
|
25
|
-
|
|
26
|
-
}) =>
|
|
27
|
-
export declare const SkipPipelineJobRun: ({ pipelineId, pipelineRunId, jobId,
|
|
26
|
+
apiHeaderFn: any;
|
|
27
|
+
}) => any;
|
|
28
|
+
export declare const SkipPipelineJobRun: ({ pipelineId, pipelineRunId, jobId, apiHeaderFn, }: {
|
|
28
29
|
pipelineId: any;
|
|
29
30
|
pipelineRunId: any;
|
|
30
31
|
jobId: any;
|
|
31
|
-
|
|
32
|
-
}) =>
|
|
33
|
-
export declare const StopPipelineJobRun: ({ pipelineId, pipelineRunId, jobId,
|
|
32
|
+
apiHeaderFn: any;
|
|
33
|
+
}) => any;
|
|
34
|
+
export declare const StopPipelineJobRun: ({ pipelineId, pipelineRunId, jobId, apiHeaderFn, }: {
|
|
34
35
|
pipelineId: any;
|
|
35
36
|
pipelineRunId: any;
|
|
36
37
|
jobId: any;
|
|
37
|
-
|
|
38
|
-
}) =>
|
|
39
|
-
export declare const StartPipelineJobRun: ({ pipelineId, pipelineRunId, jobId,
|
|
38
|
+
apiHeaderFn: any;
|
|
39
|
+
}) => any;
|
|
40
|
+
export declare const StartPipelineJobRun: ({ pipelineId, pipelineRunId, jobId, apiHeaderFn, }: {
|
|
40
41
|
pipelineId: any;
|
|
41
42
|
pipelineRunId: any;
|
|
42
43
|
jobId: any;
|
|
43
|
-
|
|
44
|
-
}) =>
|
|
44
|
+
apiHeaderFn: any;
|
|
45
|
+
}) => any;
|
|
45
46
|
export declare const callApiAndRefresh: (apiFunc: any, params: any, onRefresh: any, setLoading: any, setDisabled: any, name: any) => void;
|
package/es/utils/api/index.js
CHANGED
|
@@ -32,9 +32,37 @@ export var getFlowDataApi = /*#__PURE__*/function () {
|
|
|
32
32
|
return _ref.apply(this, arguments);
|
|
33
33
|
};
|
|
34
34
|
}();
|
|
35
|
+
export var flowCurryApi = function flowCurryApi(host, headers) {
|
|
36
|
+
return /*#__PURE__*/function () {
|
|
37
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(data) {
|
|
38
|
+
var res;
|
|
39
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
40
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
41
|
+
case 0:
|
|
42
|
+
_context2.next = 2;
|
|
43
|
+
return request({
|
|
44
|
+
method: 'POST',
|
|
45
|
+
url: host ? "" + host + apiHost : apiHost,
|
|
46
|
+
data: data,
|
|
47
|
+
headers: headers
|
|
48
|
+
});
|
|
49
|
+
case 2:
|
|
50
|
+
res = _context2.sent;
|
|
51
|
+
return _context2.abrupt("return", res.data);
|
|
52
|
+
case 4:
|
|
53
|
+
case "end":
|
|
54
|
+
return _context2.stop();
|
|
55
|
+
}
|
|
56
|
+
}, _callee2);
|
|
57
|
+
}));
|
|
58
|
+
return function (_x3) {
|
|
59
|
+
return _ref2.apply(this, arguments);
|
|
60
|
+
};
|
|
61
|
+
}();
|
|
62
|
+
};
|
|
35
63
|
|
|
36
64
|
// 查询流水线最新运行
|
|
37
|
-
export var GetLatestPipelineRun = function GetLatestPipelineRun(pipelineId,
|
|
65
|
+
export var GetLatestPipelineRun = function GetLatestPipelineRun(pipelineId, apiHeaderFn) {
|
|
38
66
|
var data = {
|
|
39
67
|
action: 'GetLatestPipelineRun',
|
|
40
68
|
method: 'GET',
|
|
@@ -43,11 +71,11 @@ export var GetLatestPipelineRun = function GetLatestPipelineRun(pipelineId, host
|
|
|
43
71
|
pipelineId: pipelineId
|
|
44
72
|
}
|
|
45
73
|
};
|
|
46
|
-
return
|
|
74
|
+
return apiHeaderFn(data);
|
|
47
75
|
};
|
|
48
76
|
|
|
49
77
|
// 查询流水线运行历史
|
|
50
|
-
export var GetPipelineRun = function GetPipelineRun(pipelineId, pipelineRunId,
|
|
78
|
+
export var GetPipelineRun = function GetPipelineRun(pipelineId, pipelineRunId, apiHeaderFn) {
|
|
51
79
|
var data = {
|
|
52
80
|
action: 'GetPipelineRun',
|
|
53
81
|
method: 'GET',
|
|
@@ -57,16 +85,16 @@ export var GetPipelineRun = function GetPipelineRun(pipelineId, pipelineRunId, h
|
|
|
57
85
|
pipelineRunId: pipelineRunId
|
|
58
86
|
}
|
|
59
87
|
};
|
|
60
|
-
return
|
|
88
|
+
return apiHeaderFn(data);
|
|
61
89
|
};
|
|
62
90
|
|
|
63
91
|
// 查看原始日志
|
|
64
|
-
export var GetPipelineLogOrigin = function GetPipelineLogOrigin(
|
|
65
|
-
var pipelineId =
|
|
66
|
-
pipelineRunId =
|
|
67
|
-
jobId =
|
|
68
|
-
stepIndex =
|
|
69
|
-
buildId =
|
|
92
|
+
export var GetPipelineLogOrigin = function GetPipelineLogOrigin(_ref3, apiHeaderFn) {
|
|
93
|
+
var pipelineId = _ref3.pipelineId,
|
|
94
|
+
pipelineRunId = _ref3.pipelineRunId,
|
|
95
|
+
jobId = _ref3.jobId,
|
|
96
|
+
stepIndex = _ref3.stepIndex,
|
|
97
|
+
buildId = _ref3.buildId;
|
|
70
98
|
var data = {
|
|
71
99
|
action: 'GetPipelineJobStepLogUrl',
|
|
72
100
|
method: 'GET',
|
|
@@ -81,12 +109,12 @@ export var GetPipelineLogOrigin = function GetPipelineLogOrigin(_ref2, host) {
|
|
|
81
109
|
buildId: buildId
|
|
82
110
|
}
|
|
83
111
|
};
|
|
84
|
-
return
|
|
112
|
+
return apiHeaderFn(data);
|
|
85
113
|
};
|
|
86
114
|
|
|
87
115
|
// 查询任务步骤列表
|
|
88
116
|
|
|
89
|
-
export var GetPipelineJobSteps = function GetPipelineJobSteps(pipelineId, pipelineRunId, jobId,
|
|
117
|
+
export var GetPipelineJobSteps = function GetPipelineJobSteps(pipelineId, pipelineRunId, jobId, dataApi) {
|
|
90
118
|
var data = {
|
|
91
119
|
action: 'GetPipelineJobSteps',
|
|
92
120
|
method: 'GET',
|
|
@@ -97,19 +125,19 @@ export var GetPipelineJobSteps = function GetPipelineJobSteps(pipelineId, pipeli
|
|
|
97
125
|
jobId: jobId
|
|
98
126
|
}
|
|
99
127
|
};
|
|
100
|
-
return
|
|
128
|
+
return dataApi(data);
|
|
101
129
|
};
|
|
102
130
|
|
|
103
131
|
// 查询任务步骤日志
|
|
104
132
|
|
|
105
|
-
export var GetPipelineJobStepLog = function GetPipelineJobStepLog(
|
|
106
|
-
var pipelineId =
|
|
107
|
-
pipelineRunId =
|
|
108
|
-
jobId =
|
|
109
|
-
buildId =
|
|
110
|
-
stepIndex =
|
|
111
|
-
offset =
|
|
112
|
-
|
|
133
|
+
export var GetPipelineJobStepLog = function GetPipelineJobStepLog(_ref4) {
|
|
134
|
+
var pipelineId = _ref4.pipelineId,
|
|
135
|
+
pipelineRunId = _ref4.pipelineRunId,
|
|
136
|
+
jobId = _ref4.jobId,
|
|
137
|
+
buildId = _ref4.buildId,
|
|
138
|
+
stepIndex = _ref4.stepIndex,
|
|
139
|
+
offset = _ref4.offset,
|
|
140
|
+
apiHeaderFn = _ref4.apiHeaderFn;
|
|
113
141
|
var data = {
|
|
114
142
|
action: 'GetPipelineJobStepLog',
|
|
115
143
|
method: 'GET',
|
|
@@ -130,15 +158,15 @@ export var GetPipelineJobStepLog = function GetPipelineJobStepLog(_ref3) {
|
|
|
130
158
|
buildId: buildId
|
|
131
159
|
}
|
|
132
160
|
};
|
|
133
|
-
return
|
|
161
|
+
return apiHeaderFn(data);
|
|
134
162
|
};
|
|
135
163
|
|
|
136
164
|
// 重试任务
|
|
137
|
-
export var RetryPipelineJobRun = function RetryPipelineJobRun(
|
|
138
|
-
var pipelineId =
|
|
139
|
-
pipelineRunId =
|
|
140
|
-
jobId =
|
|
141
|
-
|
|
165
|
+
export var RetryPipelineJobRun = function RetryPipelineJobRun(_ref5) {
|
|
166
|
+
var pipelineId = _ref5.pipelineId,
|
|
167
|
+
pipelineRunId = _ref5.pipelineRunId,
|
|
168
|
+
jobId = _ref5.jobId,
|
|
169
|
+
apiHeaderFn = _ref5.apiHeaderFn;
|
|
142
170
|
var data = {
|
|
143
171
|
action: 'RetryPipelineJobRun',
|
|
144
172
|
method: 'PUT',
|
|
@@ -149,15 +177,15 @@ export var RetryPipelineJobRun = function RetryPipelineJobRun(_ref4) {
|
|
|
149
177
|
jobId: jobId
|
|
150
178
|
}
|
|
151
179
|
};
|
|
152
|
-
return
|
|
180
|
+
return apiHeaderFn(data);
|
|
153
181
|
};
|
|
154
182
|
|
|
155
183
|
// 跳过任务
|
|
156
|
-
export var SkipPipelineJobRun = function SkipPipelineJobRun(
|
|
157
|
-
var pipelineId =
|
|
158
|
-
pipelineRunId =
|
|
159
|
-
jobId =
|
|
160
|
-
|
|
184
|
+
export var SkipPipelineJobRun = function SkipPipelineJobRun(_ref6) {
|
|
185
|
+
var pipelineId = _ref6.pipelineId,
|
|
186
|
+
pipelineRunId = _ref6.pipelineRunId,
|
|
187
|
+
jobId = _ref6.jobId,
|
|
188
|
+
apiHeaderFn = _ref6.apiHeaderFn;
|
|
161
189
|
var data = {
|
|
162
190
|
action: 'SkipPipelineJobRun',
|
|
163
191
|
method: 'PUT',
|
|
@@ -168,15 +196,15 @@ export var SkipPipelineJobRun = function SkipPipelineJobRun(_ref5) {
|
|
|
168
196
|
jobId: jobId
|
|
169
197
|
}
|
|
170
198
|
};
|
|
171
|
-
return
|
|
199
|
+
return apiHeaderFn(data);
|
|
172
200
|
};
|
|
173
201
|
|
|
174
202
|
// 取消任务
|
|
175
|
-
export var StopPipelineJobRun = function StopPipelineJobRun(
|
|
176
|
-
var pipelineId =
|
|
177
|
-
pipelineRunId =
|
|
178
|
-
jobId =
|
|
179
|
-
|
|
203
|
+
export var StopPipelineJobRun = function StopPipelineJobRun(_ref7) {
|
|
204
|
+
var pipelineId = _ref7.pipelineId,
|
|
205
|
+
pipelineRunId = _ref7.pipelineRunId,
|
|
206
|
+
jobId = _ref7.jobId,
|
|
207
|
+
apiHeaderFn = _ref7.apiHeaderFn;
|
|
180
208
|
var data = {
|
|
181
209
|
action: 'StopPipelineJobRun',
|
|
182
210
|
method: 'PUT',
|
|
@@ -187,15 +215,15 @@ export var StopPipelineJobRun = function StopPipelineJobRun(_ref6) {
|
|
|
187
215
|
jobId: jobId
|
|
188
216
|
}
|
|
189
217
|
};
|
|
190
|
-
return
|
|
218
|
+
return apiHeaderFn(data);
|
|
191
219
|
};
|
|
192
220
|
|
|
193
221
|
// 运行任务
|
|
194
|
-
export var StartPipelineJobRun = function StartPipelineJobRun(
|
|
195
|
-
var pipelineId =
|
|
196
|
-
pipelineRunId =
|
|
197
|
-
jobId =
|
|
198
|
-
|
|
222
|
+
export var StartPipelineJobRun = function StartPipelineJobRun(_ref8) {
|
|
223
|
+
var pipelineId = _ref8.pipelineId,
|
|
224
|
+
pipelineRunId = _ref8.pipelineRunId,
|
|
225
|
+
jobId = _ref8.jobId,
|
|
226
|
+
apiHeaderFn = _ref8.apiHeaderFn;
|
|
199
227
|
var data = {
|
|
200
228
|
action: 'ExecutePipelineJobRun',
|
|
201
229
|
method: 'POST',
|
|
@@ -206,7 +234,7 @@ export var StartPipelineJobRun = function StartPipelineJobRun(_ref7) {
|
|
|
206
234
|
jobId: jobId
|
|
207
235
|
}
|
|
208
236
|
};
|
|
209
|
-
return
|
|
237
|
+
return apiHeaderFn(data);
|
|
210
238
|
};
|
|
211
239
|
export var callApiAndRefresh = function callApiAndRefresh(apiFunc, params, onRefresh, setLoading, setDisabled, name) {
|
|
212
240
|
apiFunc(params).then(function (success) {
|