@devops-flow/devops-flow-pipeline-detail 0.0.49 → 0.0.51

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.
Files changed (29) hide show
  1. package/dist/PipelineFlowDetail.css +1 -1
  2. package/dist/PipelineFlowDetail.js +14 -14
  3. package/es/components/common/teambition/flow-job-btn/cardsMap.d.ts +2 -1
  4. package/es/components/common/teambition/flow-job-btn/cardsMap.js +21 -1
  5. package/es/components/common/teambition/flow-job-btn/execute-button/index.js +10 -4
  6. package/es/components/common/teambition/flow-job-btn/link/index.d.ts +1 -1
  7. package/es/components/common/teambition/flow-job-btn/link/index.js +7 -3
  8. package/es/components/common/teambition/flow-job-btn/log-btn/index.js +90 -128
  9. package/es/components/common/teambition/flow-job-btn/replaceHost.d.ts +1 -0
  10. package/es/components/common/teambition/flow-job-btn/replaceHost.js +4 -0
  11. package/es/components/common/teambition/flow-job-btn/stat-info-s-common/common.js +8 -2
  12. package/es/components/common/teambition/flow-job-btn/state-info/index.js +3 -12
  13. package/es/components/common/teambition/flow-job-new/index.js +10 -4
  14. package/es/components/common/teambition/flow-job-runtime-menu/index.scss +1 -0
  15. package/es/components/common/teambition/pipeline-instance-new/SourceElement.js +1 -1
  16. package/es/components/common/teambition/pipeline-instance-new/source.js +4 -2
  17. package/es/components/detailMain/recent/index.js +1 -1
  18. package/es/contexts/config.d.ts +5 -1
  19. package/es/contexts/config.js +7 -1
  20. package/es/index.js +5 -4
  21. package/es/style.js +0 -1
  22. package/es/utils/api/index.d.ts +18 -6
  23. package/es/utils/api/index.js +59 -30
  24. package/es/utils/index.js +10 -8
  25. package/package.json +1 -1
  26. package/dist/1.css +0 -1
  27. package/dist/1.js +0 -24
  28. package/dist/2.css +0 -1
  29. package/dist/2.js +0 -1
@@ -1,5 +1,11 @@
1
1
  import { createContext } from 'react';
2
2
  var ConfigContext = /*#__PURE__*/createContext({
3
- apiHost: null
3
+ replaceLinks: {
4
+ api: '',
5
+ // api接口
6
+ report: '',
7
+ // 报告链接
8
+ scan: '' // 扫描报告
9
+ }
4
10
  });
5
11
  export default ConfigContext;
package/es/index.js CHANGED
@@ -76,20 +76,21 @@ var isEn = lang === 'en_US';
76
76
  var setConfigDefault = function setConfigDefault(config) {
77
77
  var keys = ['number', 'triggerMsg']; // 编号,触发信息
78
78
  return keys.reduce(function (pre, cur) {
79
- pre[cur] = typeof config[cur] === 'boolean' ? config[cur] : true;
79
+ pre[cur] = config && typeof config[cur] === 'boolean' ? config[cur] : true;
80
80
  return pre;
81
81
  }, {});
82
82
  };
83
83
  var App = function App(props) {
84
84
  var pipelineId = props.pipelineId,
85
85
  pipelineRunId = props.pipelineRunId,
86
- apiHost = props.apiHost,
87
- displayConfig = props.displayConfig;
86
+ displayConfig = props.displayConfig,
87
+ _props$replaceLinks = props.replaceLinks,
88
+ replaceLinks = _props$replaceLinks === void 0 ? {} : _props$replaceLinks;
88
89
  return /*#__PURE__*/React.createElement(ConfigProvider, {
89
90
  locale: isEn ? enUS : zhCN
90
91
  }, /*#__PURE__*/React.createElement(ConfigContext.Provider, {
91
92
  value: {
92
- apiHost: apiHost
93
+ replaceLinks: replaceLinks
93
94
  }
94
95
  }, /*#__PURE__*/React.createElement("div", {
95
96
  className: "container"
package/es/style.js CHANGED
@@ -5,7 +5,6 @@ import '@alife/yunxiao-error-message/es/style';
5
5
  import '@alife/devops-ui/es/style';
6
6
  import '@alife/teamix-text-avatar/es/style';
7
7
  import '@alife/yunxiao-icon/es/style';
8
- import '@alife/yunxiao-ai-panel/es/style';
9
8
 
10
9
  import '@alife/yunxiao-avatar/es/style';
11
10
  import '@alife/teamix-step-dialog/es/style';
@@ -1,33 +1,45 @@
1
1
  export declare const getFlowDataApi: (data: any, host?: string) => Promise<any>;
2
2
  export declare const GetLatestPipelineRun: (pipelineId: any, host: any) => Promise<any>;
3
3
  export declare const GetPipelineRun: (pipelineId: any, pipelineRunId: any, host: any) => Promise<any>;
4
- export declare const GetPipelineJobSteps: (pipelineId: any, pipelineRunId: any, jobId: any) => Promise<any>;
5
- export declare const GetPipelineJobStepLog: ({ pipelineId, pipelineRunId, jobId, buildId, stepIndex, offset }: {
4
+ export declare const GetPipelineLogOrigin: ({ pipelineId, pipelineRunId, jobId, stepIndex, buildId }: {
5
+ pipelineId: any;
6
+ pipelineRunId: any;
7
+ jobId: any;
8
+ stepIndex: any;
9
+ buildId: any;
10
+ }, host: any) => Promise<any>;
11
+ export declare const GetPipelineJobSteps: (pipelineId: any, pipelineRunId: any, jobId: any, host: any) => Promise<any>;
12
+ export declare const GetPipelineJobStepLog: ({ pipelineId, pipelineRunId, jobId, buildId, stepIndex, offset, host, }: {
6
13
  pipelineId: any;
7
14
  pipelineRunId: any;
8
15
  jobId: any;
9
16
  buildId: any;
10
17
  stepIndex: any;
11
18
  offset: any;
19
+ host: any;
12
20
  }) => Promise<any>;
13
- export declare const RetryPipelineJobRun: ({ pipelineId, pipelineRunId, jobId }: {
21
+ export declare const RetryPipelineJobRun: ({ pipelineId, pipelineRunId, jobId, host }: {
14
22
  pipelineId: any;
15
23
  pipelineRunId: any;
16
24
  jobId: any;
25
+ host: any;
17
26
  }) => Promise<any>;
18
- export declare const SkipPipelineJobRun: ({ pipelineId, pipelineRunId, jobId }: {
27
+ export declare const SkipPipelineJobRun: ({ pipelineId, pipelineRunId, jobId, host }: {
19
28
  pipelineId: any;
20
29
  pipelineRunId: any;
21
30
  jobId: any;
31
+ host: any;
22
32
  }) => Promise<any>;
23
- export declare const StopPipelineJobRun: ({ pipelineId, pipelineRunId, jobId }: {
33
+ export declare const StopPipelineJobRun: ({ pipelineId, pipelineRunId, jobId, host }: {
24
34
  pipelineId: any;
25
35
  pipelineRunId: any;
26
36
  jobId: any;
37
+ host: any;
27
38
  }) => Promise<any>;
28
- export declare const StartPipelineJobRun: ({ pipelineId, pipelineRunId, jobId }: {
39
+ export declare const StartPipelineJobRun: ({ pipelineId, pipelineRunId, jobId, host }: {
29
40
  pipelineId: any;
30
41
  pipelineRunId: any;
31
42
  jobId: any;
43
+ host: any;
32
44
  }) => Promise<any>;
33
45
  export declare const callApiAndRefresh: (apiFunc: any, params: any, onRefresh: any, setLoading: any, setDisabled: any, name: any) => void;
@@ -60,9 +60,33 @@ export var GetPipelineRun = function GetPipelineRun(pipelineId, pipelineRunId, h
60
60
  return getFlowDataApi(data, host);
61
61
  };
62
62
 
63
+ // 查看原始日志
64
+ export var GetPipelineLogOrigin = function GetPipelineLogOrigin(_ref2, host) {
65
+ var pipelineId = _ref2.pipelineId,
66
+ pipelineRunId = _ref2.pipelineRunId,
67
+ jobId = _ref2.jobId,
68
+ stepIndex = _ref2.stepIndex,
69
+ buildId = _ref2.buildId;
70
+ var data = {
71
+ action: 'GetPipelineJobStepLogUrl',
72
+ method: 'GET',
73
+ actionPath: 'https://{domain}/oapi/v1/flow/organizations/{organizationId}/pipelines/{pipelineId}/pipelineRuns/{pipelineRunId}/jobs/{jobId}/step/log/url',
74
+ pathParams: {
75
+ pipelineId: pipelineId,
76
+ pipelineRunId: pipelineRunId,
77
+ jobId: jobId
78
+ },
79
+ queryParams: {
80
+ stepIndex: stepIndex,
81
+ buildId: buildId
82
+ }
83
+ };
84
+ return getFlowDataApi(data, host);
85
+ };
86
+
63
87
  // 查询任务步骤列表
64
88
 
65
- export var GetPipelineJobSteps = function GetPipelineJobSteps(pipelineId, pipelineRunId, jobId) {
89
+ export var GetPipelineJobSteps = function GetPipelineJobSteps(pipelineId, pipelineRunId, jobId, host) {
66
90
  var data = {
67
91
  action: 'GetPipelineJobSteps',
68
92
  method: 'GET',
@@ -73,18 +97,19 @@ export var GetPipelineJobSteps = function GetPipelineJobSteps(pipelineId, pipeli
73
97
  jobId: jobId
74
98
  }
75
99
  };
76
- return getFlowDataApi(data);
100
+ return getFlowDataApi(data, host);
77
101
  };
78
102
 
79
103
  // 查询任务步骤日志
80
104
 
81
- export var GetPipelineJobStepLog = function GetPipelineJobStepLog(_ref2) {
82
- var pipelineId = _ref2.pipelineId,
83
- pipelineRunId = _ref2.pipelineRunId,
84
- jobId = _ref2.jobId,
85
- buildId = _ref2.buildId,
86
- stepIndex = _ref2.stepIndex,
87
- offset = _ref2.offset;
105
+ export var GetPipelineJobStepLog = function GetPipelineJobStepLog(_ref3) {
106
+ var pipelineId = _ref3.pipelineId,
107
+ pipelineRunId = _ref3.pipelineRunId,
108
+ jobId = _ref3.jobId,
109
+ buildId = _ref3.buildId,
110
+ stepIndex = _ref3.stepIndex,
111
+ offset = _ref3.offset,
112
+ host = _ref3.host;
88
113
  var data = {
89
114
  action: 'GetPipelineJobStepLog',
90
115
  method: 'GET',
@@ -105,14 +130,15 @@ export var GetPipelineJobStepLog = function GetPipelineJobStepLog(_ref2) {
105
130
  buildId: buildId
106
131
  }
107
132
  };
108
- return getFlowDataApi(data);
133
+ return getFlowDataApi(data, host);
109
134
  };
110
135
 
111
136
  // 重试任务
112
- export var RetryPipelineJobRun = function RetryPipelineJobRun(_ref3) {
113
- var pipelineId = _ref3.pipelineId,
114
- pipelineRunId = _ref3.pipelineRunId,
115
- jobId = _ref3.jobId;
137
+ export var RetryPipelineJobRun = function RetryPipelineJobRun(_ref4) {
138
+ var pipelineId = _ref4.pipelineId,
139
+ pipelineRunId = _ref4.pipelineRunId,
140
+ jobId = _ref4.jobId,
141
+ host = _ref4.host;
116
142
  var data = {
117
143
  action: 'RetryPipelineJobRun',
118
144
  method: 'PUT',
@@ -123,14 +149,15 @@ export var RetryPipelineJobRun = function RetryPipelineJobRun(_ref3) {
123
149
  jobId: jobId
124
150
  }
125
151
  };
126
- return getFlowDataApi(data);
152
+ return getFlowDataApi(data, host);
127
153
  };
128
154
 
129
155
  // 跳过任务
130
- export var SkipPipelineJobRun = function SkipPipelineJobRun(_ref4) {
131
- var pipelineId = _ref4.pipelineId,
132
- pipelineRunId = _ref4.pipelineRunId,
133
- jobId = _ref4.jobId;
156
+ export var SkipPipelineJobRun = function SkipPipelineJobRun(_ref5) {
157
+ var pipelineId = _ref5.pipelineId,
158
+ pipelineRunId = _ref5.pipelineRunId,
159
+ jobId = _ref5.jobId,
160
+ host = _ref5.host;
134
161
  var data = {
135
162
  action: 'SkipPipelineJobRun',
136
163
  method: 'PUT',
@@ -141,14 +168,15 @@ export var SkipPipelineJobRun = function SkipPipelineJobRun(_ref4) {
141
168
  jobId: jobId
142
169
  }
143
170
  };
144
- return getFlowDataApi(data);
171
+ return getFlowDataApi(data, host);
145
172
  };
146
173
 
147
174
  // 取消任务
148
- export var StopPipelineJobRun = function StopPipelineJobRun(_ref5) {
149
- var pipelineId = _ref5.pipelineId,
150
- pipelineRunId = _ref5.pipelineRunId,
151
- jobId = _ref5.jobId;
175
+ export var StopPipelineJobRun = function StopPipelineJobRun(_ref6) {
176
+ var pipelineId = _ref6.pipelineId,
177
+ pipelineRunId = _ref6.pipelineRunId,
178
+ jobId = _ref6.jobId,
179
+ host = _ref6.host;
152
180
  var data = {
153
181
  action: 'StopPipelineJobRun',
154
182
  method: 'PUT',
@@ -159,14 +187,15 @@ export var StopPipelineJobRun = function StopPipelineJobRun(_ref5) {
159
187
  jobId: jobId
160
188
  }
161
189
  };
162
- return getFlowDataApi(data);
190
+ return getFlowDataApi(data, host);
163
191
  };
164
192
 
165
193
  // 运行任务
166
- export var StartPipelineJobRun = function StartPipelineJobRun(_ref6) {
167
- var pipelineId = _ref6.pipelineId,
168
- pipelineRunId = _ref6.pipelineRunId,
169
- jobId = _ref6.jobId;
194
+ export var StartPipelineJobRun = function StartPipelineJobRun(_ref7) {
195
+ var pipelineId = _ref7.pipelineId,
196
+ pipelineRunId = _ref7.pipelineRunId,
197
+ jobId = _ref7.jobId,
198
+ host = _ref7.host;
170
199
  var data = {
171
200
  action: 'ExecutePipelineJobRun',
172
201
  method: 'POST',
@@ -177,7 +206,7 @@ export var StartPipelineJobRun = function StartPipelineJobRun(_ref6) {
177
206
  jobId: jobId
178
207
  }
179
208
  };
180
- return getFlowDataApi(data);
209
+ return getFlowDataApi(data, host);
181
210
  };
182
211
  export var callApiAndRefresh = function callApiAndRefresh(apiFunc, params, onRefresh, setLoading, setDisabled, name) {
183
212
  apiFunc(params).then(function (success) {
package/es/utils/index.js CHANGED
@@ -512,16 +512,18 @@ export function appStackGetLocale() {
512
512
  return locales[(intl.getLang() || 'zh_CN').toLocaleLowerCase().replace('_', '-')];
513
513
  }
514
514
  export function JsonParseWithCatch(string, defaultValue) {
515
- try {
516
- return JSON.parse(string);
517
- } catch (e) {
518
- // eslint-disable-next-line eqeqeq
519
- if (string != undefined) {
520
- console.error('json parse failed: ', string);
521
- console.error(e);
515
+ if (string) {
516
+ try {
517
+ return JSON.parse(string);
518
+ } catch (e) {
519
+ // eslint-disable-next-line eqeqeq
520
+ if (string != undefined) {
521
+ console.error('json parse failed: ', string);
522
+ console.error(e);
523
+ }
522
524
  }
523
- return defaultValue;
524
525
  }
526
+ return defaultValue;
525
527
  }
526
528
 
527
529
  /** 特定的 appstack 步骤 APP_NAME 有特殊处理,需要自动填充且disable */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devops-flow/devops-flow-pipeline-detail",
3
- "version": "0.0.49",
3
+ "version": "0.0.51",
4
4
  "description": "flow 流水线详情",
5
5
  "medusaName": "rdc-tb-cd-assets",
6
6
  "main": "dist/PipelineFlowDetail.js",
package/dist/1.css DELETED
@@ -1 +0,0 @@
1
- .panel-content{width:100%;padding:0 20px;word-break:break-word;line-height:20px;max-height:376px;overflow:auto;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.panel-content::-webkit-scrollbar{width:6px;height:6px}.panel-content::-webkit-scrollbar-thumb{border-radius:3px;background:#cecece;background:var(--color-line1-3,#cecece)}.panel-content .content-cursor{display:inline-block;width:1.5px;height:16px;-webkit-animation:van-cursor-flicker .6s infinite;animation:van-cursor-flicker .6s infinite;background-color:#292929;background-color:var(--color-text1-4,#292929)}@-webkit-keyframes van-cursor-flicker{0%{opacity:0}50%{opacity:1}to{opacity:0}}@keyframes van-cursor-flicker{0%{opacity:0}50%{opacity:1}to{opacity:0}}@-webkit-keyframes typing{0%{width:0}}@keyframes typing{0%{width:0}}.panel-footer{height:48px;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;padding:0 20px}.panel-footer .panel-footer-state-btn.next-btn-secondary{background:rgba(221,241,255,.5);margin-right:8px}.panel-footer .panel-content-copy-btn.next-btn-text.next-btn-normal{color:#6e6e6e;color:var(--color-text1-2,#6e6e6e)}.panel-footer .panel-content-copy-btn.next-btn-text.next-btn-normal:hover{color:#006ad4;color:var(--btn-text-normal-color-hover,#006ad4)}.panel-footer .panel-content-copy-btn .next-btn-helper{font-size:12px;line-height:18px}.panel-footer .content-like{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;grid-gap:8px;gap:8px}.panel-footer .content-like .isOnlyIcon.next-btn-text.next-btn-normal{color:#adadad;color:var(--color-line1-5,#adadad)}.panel-footer .content-like .isOnlyIcon.next-btn-text.next-btn-normal:hover{color:#006ad4;color:var(--btn-text-normal-color-hover,#006ad4)}.personal-info-card-left-avatar .next-upload-list-item-wrapper{border:0!important;width:64px!important;height:64px!important}.yunxiao-ai-panel{width:400px;min-height:240px;border:1px solid #e9edf0;border:1px solid var(--color-brand3-2,#e9edf0);border-radius:4px;position:relative;background-color:#fff;background-color:var(--color-white,#fff);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);-webkit-box-shadow:0 5px 15px 0 rgba(0,0,0,.15);box-shadow:0 5px 15px 0 rgba(0,0,0,.15);overflow:auto;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;z-index:1002}.yunxiao-ai-panel-bg{z-index:-1}.yunxiao-ai-panel-bg-s{width:140px;height:140px;background:#aed5ff}.yunxiao-ai-panel-bg-l,.yunxiao-ai-panel-bg-s{position:absolute;top:-70px;left:-70px;-webkit-filter:blur(136px);filter:blur(136px)}.yunxiao-ai-panel-bg-l{width:170px;height:170px;background:#d6e9ff}.yunxiao-ai-panel .panel-title{width:100%;height:56px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;padding:0 20px;color:#292929;color:var(--color-text1-4,#292929);font-weight:500;font-size:14px}.yunxiao-ai-panel .panel-title i{color:#6e6e6e;color:var(--color-text1-2,#6e6e6e)}.yunxiao-ai-panel .panel-footer{margin-top:auto}