@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.
@@ -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.reportLinkHost) {
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, {
@@ -1,2 +1,3 @@
1
1
  export declare const replaceHost: (url: any) => any;
2
2
  export declare const replaceHostWithBase: (url: string, newHost: string) => string;
3
+ export declare const replaceAppstack: (url: string, newHost: string) => string;
@@ -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
  };
@@ -4,6 +4,7 @@ declare const ConfigContext: import("react").Context<{
4
4
  api: string;
5
5
  report: string;
6
6
  scan: string;
7
+ appstack: string;
7
8
  };
8
9
  }>;
9
10
  export default ConfigContext;
@@ -5,7 +5,9 @@ var ConfigContext = /*#__PURE__*/createContext({
5
5
  // api接口
6
6
  report: '',
7
7
  // 报告链接
8
- scan: '' // 扫描报告
8
+ scan: '',
9
+ // 扫描报告
10
+ appstack: '' // 部署单链接
9
11
  }
10
12
  });
11
13
  export default ConfigContext;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devops-flow/devops-flow-pipeline-detail",
3
- "version": "0.0.52",
3
+ "version": "0.0.53",
4
4
  "description": "flow 流水线详情",
5
5
  "medusaName": "rdc-tb-cd-assets",
6
6
  "main": "dist/PipelineFlowDetail.js",