@devops-flow/devops-flow-pipeline-detail 0.0.52 → 0.0.53
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/link/index.js +4 -2
- 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/contexts/config.d.ts +1 -0
- package/es/contexts/config.js +3 -1
- 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
|
}
|
|
@@ -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, {
|
|
@@ -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
|
};
|
package/es/contexts/config.d.ts
CHANGED
package/es/contexts/config.js
CHANGED