@orsetra/shared-ui 1.1.18 → 1.1.20
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/api/addon.ts +85 -0
- package/api/application.ts +478 -0
- package/api/cluster.ts +29 -0
- package/api/component.ts +9 -0
- package/api/configs.ts +79 -0
- package/api/definitions.ts +29 -0
- package/api/env.ts +29 -0
- package/api/index.ts +16 -0
- package/api/kubernetes.ts +9 -0
- package/api/observation.ts +241 -0
- package/api/pipeline.ts +172 -0
- package/api/project.ts +86 -0
- package/api/repository.ts +77 -0
- package/api/roles.ts +15 -0
- package/api/system.ts +41 -0
- package/api/target.ts +20 -0
- package/api/user.ts +48 -0
- package/components/ui/index.ts +1 -1
- package/context/index.tsx +39 -0
- package/i18n.tsx +39 -0
- package/index.ts +7 -1
- package/locals/En/en.json +1 -0
- package/locals/Zh/zh.json +657 -0
- package/package.json +13 -6
- package/types/application.ts +6 -0
- package/types/data.ts +9 -0
- package/types/index.ts +5 -0
- package/types/layout.ts +7 -0
- package/types/menus.ts +32 -0
- package/types/permission.ts +4 -0
- package/utils/_test/permission.test.ts +26 -0
- package/utils/cache.ts +9 -0
- package/utils/common.ts +314 -0
- package/utils/errors.ts +31 -0
- package/utils/i18n.tsx +28 -0
- package/utils/icon.tsx +42 -0
- package/utils/locale.tsx +190 -0
- package/utils/locals/En/en.json +1 -0
- package/utils/locals/Zh/zh.json +657 -0
- package/utils/permission.ts +136 -0
- package/utils/resetLogin.ts +35 -0
- package/utils/storage.ts +21 -0
- package/utils/utils.ts +216 -0
package/api/addon.ts
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { ApplicationStatus, UIParam } from './application';
|
|
2
|
+
import type { NameAlias } from './env';
|
|
3
|
+
import { KeyValue } from "../types";
|
|
4
|
+
|
|
5
|
+
export interface Addon {
|
|
6
|
+
name: string;
|
|
7
|
+
version?: string;
|
|
8
|
+
icon?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
detail?: string;
|
|
11
|
+
tags?: string[];
|
|
12
|
+
createTime?: string;
|
|
13
|
+
deployTo?: { controlPlane: boolean; runtimeCluster: boolean };
|
|
14
|
+
dependencies?: Array<{ name: string }>;
|
|
15
|
+
definitions?: Definition[];
|
|
16
|
+
uiSchema?: UIParam[];
|
|
17
|
+
registryName?: string;
|
|
18
|
+
availableVersions?: string[];
|
|
19
|
+
url?: string;
|
|
20
|
+
system?: {
|
|
21
|
+
vela?: string;
|
|
22
|
+
kubernetes?: string;
|
|
23
|
+
};
|
|
24
|
+
uxPlugins?: KeyValue<string>
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface AddonStatus {
|
|
28
|
+
args: any;
|
|
29
|
+
phase: 'disabled' | 'enabled' | 'enabling' | 'suspend' | 'disabling' | '';
|
|
30
|
+
name: string;
|
|
31
|
+
appStatus: ApplicationStatus;
|
|
32
|
+
clusters?: Record<string, AddonClusterInfo>;
|
|
33
|
+
installedVersion: string;
|
|
34
|
+
allClusters?: NameAlias[];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface AddonClusterInfo {
|
|
38
|
+
domain: string;
|
|
39
|
+
access: string;
|
|
40
|
+
loadBalancerIP: string;
|
|
41
|
+
serviceExternalIP: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface Definition {
|
|
45
|
+
name: string;
|
|
46
|
+
type: string;
|
|
47
|
+
description: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface RegistryGitSource {
|
|
51
|
+
url: string;
|
|
52
|
+
path: string;
|
|
53
|
+
token: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface RegistryOssSource {
|
|
57
|
+
end_point: string;
|
|
58
|
+
bucket: string;
|
|
59
|
+
path: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface RegistryHelmSource {
|
|
63
|
+
url: string;
|
|
64
|
+
}
|
|
65
|
+
export interface AddonRegistry {
|
|
66
|
+
name: string;
|
|
67
|
+
git: RegistryGitSource;
|
|
68
|
+
gitee: RegistryGitSource;
|
|
69
|
+
gitlab: RegistryGitSource & { repo: string };
|
|
70
|
+
oss: RegistryOssSource;
|
|
71
|
+
helm: RegistryHelmSource;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface AddonBaseStatus {
|
|
75
|
+
name: string;
|
|
76
|
+
phase: 'disabled' | 'enabled' | 'enabling' | 'suspend' | 'disabling';
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface EnableAddonRequest {
|
|
80
|
+
name: string;
|
|
81
|
+
version: string;
|
|
82
|
+
properties: Record<string, any>;
|
|
83
|
+
clusters?: string[];
|
|
84
|
+
registry?: string;
|
|
85
|
+
}
|
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
import type { NameAlias } from './env';
|
|
2
|
+
import type { ObjectReference } from './kubernetes';
|
|
3
|
+
import type { Resource } from './observation';
|
|
4
|
+
import type { RunPhase, WorkflowStep } from './pipeline';
|
|
5
|
+
import type { Project } from './project';
|
|
6
|
+
import type { Target } from './target';
|
|
7
|
+
|
|
8
|
+
export interface ApplicationDetail extends ApplicationBase {
|
|
9
|
+
resourceInfo: {
|
|
10
|
+
componentNum: number;
|
|
11
|
+
};
|
|
12
|
+
envBindings: string[];
|
|
13
|
+
policies: string[];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface EnvBinding {
|
|
17
|
+
name: string;
|
|
18
|
+
alias?: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
targetNames: string[];
|
|
21
|
+
targets?: Target[];
|
|
22
|
+
createTime?: string;
|
|
23
|
+
updateTime?: string;
|
|
24
|
+
appDeployName: string;
|
|
25
|
+
appDeployNamespace: string;
|
|
26
|
+
workflow: NameAlias;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface ApplicationBase {
|
|
30
|
+
name: string;
|
|
31
|
+
alias: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
project?: Project;
|
|
34
|
+
createTime?: string;
|
|
35
|
+
updateTime?: string;
|
|
36
|
+
readOnly?: boolean;
|
|
37
|
+
icon?: string;
|
|
38
|
+
labels?: Record<string, string>;
|
|
39
|
+
annotations?: Record<string, string>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface DefinitionDetail {
|
|
43
|
+
name: string;
|
|
44
|
+
description: string;
|
|
45
|
+
uiSchema: UIParam[];
|
|
46
|
+
labels: Record<string, string>;
|
|
47
|
+
status: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface UIParam {
|
|
51
|
+
description?: string;
|
|
52
|
+
jsonKey: string;
|
|
53
|
+
label: string;
|
|
54
|
+
sort: number;
|
|
55
|
+
uiType: string;
|
|
56
|
+
style?: {
|
|
57
|
+
colSpan: number;
|
|
58
|
+
};
|
|
59
|
+
disable?: boolean;
|
|
60
|
+
conditions?: ParamCondition[];
|
|
61
|
+
subParameterGroupOption?: GroupOption[];
|
|
62
|
+
additional?: boolean;
|
|
63
|
+
additionalParameter?: UIParam;
|
|
64
|
+
subParameters?: UIParam[];
|
|
65
|
+
validate?: UIParamValidate;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface ParamCondition {
|
|
69
|
+
jsonKey: string;
|
|
70
|
+
op?: '==' | 'in' | '!=';
|
|
71
|
+
value: any;
|
|
72
|
+
action?: 'disable' | 'enable';
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface GroupOption {
|
|
76
|
+
label: string;
|
|
77
|
+
keys: string[];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface UIParamValidate {
|
|
81
|
+
required?: boolean;
|
|
82
|
+
min?: number;
|
|
83
|
+
max?: number;
|
|
84
|
+
maxLength?: number;
|
|
85
|
+
minLength?: number;
|
|
86
|
+
pattern?: string;
|
|
87
|
+
defaultValue?: any;
|
|
88
|
+
options?: Array<{ label: string; value: string }>;
|
|
89
|
+
immutable?: boolean;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface ApplicationDeployRequest {
|
|
93
|
+
appName: string;
|
|
94
|
+
workflowName?: string;
|
|
95
|
+
note?: string;
|
|
96
|
+
triggerType: 'web';
|
|
97
|
+
force: boolean;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface ApplicationDeployResponse extends ApplicationRevision {
|
|
101
|
+
record?: WorkflowRecordBase;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface ApplicationRollbackResponse {
|
|
105
|
+
record: WorkflowRecordBase;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface ApplicationEnvStatus {
|
|
109
|
+
envName: string;
|
|
110
|
+
status: ApplicationStatus;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface ApplicationStatus {
|
|
114
|
+
conditions: Condition[];
|
|
115
|
+
status:
|
|
116
|
+
| 'starting'
|
|
117
|
+
| 'rendering'
|
|
118
|
+
| 'runningWorkflow'
|
|
119
|
+
| 'workflowSuspending'
|
|
120
|
+
| 'workflowTerminated'
|
|
121
|
+
| 'workflowFailed'
|
|
122
|
+
| 'running'
|
|
123
|
+
| 'deleting'
|
|
124
|
+
| string;
|
|
125
|
+
workflow?: WorkflowStatus;
|
|
126
|
+
latestRevision: {
|
|
127
|
+
name: string;
|
|
128
|
+
revision: number;
|
|
129
|
+
revisionHash: string;
|
|
130
|
+
};
|
|
131
|
+
services?: ComponentStatus[];
|
|
132
|
+
appliedResources: Resource[];
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface ComponentStatus {
|
|
136
|
+
name: string;
|
|
137
|
+
namespace: string;
|
|
138
|
+
healthy: boolean;
|
|
139
|
+
message: string;
|
|
140
|
+
traits?: TraitStatus[];
|
|
141
|
+
cluster: string;
|
|
142
|
+
workloadDefinition: {
|
|
143
|
+
apiVersion: string;
|
|
144
|
+
kind: string;
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export interface Condition {
|
|
149
|
+
type: string;
|
|
150
|
+
status: 'True' | 'False';
|
|
151
|
+
lastTransitionTime?: string;
|
|
152
|
+
reason?: string;
|
|
153
|
+
message?: string;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export interface WorkflowStatus {
|
|
157
|
+
appRevision: string;
|
|
158
|
+
mode: string;
|
|
159
|
+
status: RunPhase;
|
|
160
|
+
message: string;
|
|
161
|
+
|
|
162
|
+
suspend: boolean;
|
|
163
|
+
suspendState: string;
|
|
164
|
+
terminated: boolean;
|
|
165
|
+
finished: boolean;
|
|
166
|
+
|
|
167
|
+
contextBackend?: ObjectReference;
|
|
168
|
+
steps?: WorkflowStepStatus[];
|
|
169
|
+
|
|
170
|
+
startTime?: string;
|
|
171
|
+
endTime?: string;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
interface StepStatus {
|
|
175
|
+
id: string;
|
|
176
|
+
name: string;
|
|
177
|
+
alias: string;
|
|
178
|
+
type: string;
|
|
179
|
+
phase: 'succeeded' | 'failed' | 'skipped' | 'stopped' | 'running' | 'pending';
|
|
180
|
+
message?: string;
|
|
181
|
+
reason?: string;
|
|
182
|
+
firstExecuteTime?: string;
|
|
183
|
+
lastExecuteTime?: string;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export interface WorkflowStepStatus extends StepStatus {
|
|
187
|
+
subSteps?: StepStatus[];
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export type WorkflowMode = 'StepByStep' | 'DAG';
|
|
191
|
+
|
|
192
|
+
export interface UpdateWorkflowRequest {
|
|
193
|
+
alias?: string;
|
|
194
|
+
description?: string;
|
|
195
|
+
mode: WorkflowMode;
|
|
196
|
+
subMode: WorkflowMode;
|
|
197
|
+
steps: WorkflowStep[];
|
|
198
|
+
default?: boolean;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export interface CreateWorkflowRequest {
|
|
202
|
+
name: string;
|
|
203
|
+
envName: string;
|
|
204
|
+
alias?: string;
|
|
205
|
+
description?: string;
|
|
206
|
+
mode: WorkflowMode;
|
|
207
|
+
subMode: WorkflowMode;
|
|
208
|
+
steps: WorkflowStep[];
|
|
209
|
+
default?: boolean;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export interface Trait {
|
|
213
|
+
alias?: string;
|
|
214
|
+
description?: string;
|
|
215
|
+
properties?: any;
|
|
216
|
+
type: string;
|
|
217
|
+
createTime?: string;
|
|
218
|
+
updateTime?: string;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export interface TraitStatus {
|
|
222
|
+
type: string;
|
|
223
|
+
healthy: string;
|
|
224
|
+
message: string;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export interface ApplicationComponentBase {
|
|
228
|
+
name: string;
|
|
229
|
+
alias?: string;
|
|
230
|
+
description?: string;
|
|
231
|
+
labels?: Record<string, string>;
|
|
232
|
+
componentType: string;
|
|
233
|
+
creator?: string;
|
|
234
|
+
main: boolean;
|
|
235
|
+
dependsOn?: string[];
|
|
236
|
+
createTime?: string;
|
|
237
|
+
updateTime?: string;
|
|
238
|
+
input?: InputItem[];
|
|
239
|
+
output?: OutputItem[];
|
|
240
|
+
traits?: Trait[];
|
|
241
|
+
workloadType?: {
|
|
242
|
+
definition?: {
|
|
243
|
+
apiVersion: string;
|
|
244
|
+
kind: string;
|
|
245
|
+
};
|
|
246
|
+
type: string;
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export interface InputItem {
|
|
251
|
+
parameterKey: string;
|
|
252
|
+
from: string;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export interface OutputItem {
|
|
256
|
+
valueFrom: string;
|
|
257
|
+
name: string;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export interface ApplicationComponent extends ApplicationComponentBase {
|
|
261
|
+
properties?: any;
|
|
262
|
+
type: string;
|
|
263
|
+
definition: {
|
|
264
|
+
workload: {
|
|
265
|
+
definition?: {
|
|
266
|
+
apiVersion: string;
|
|
267
|
+
kind: string;
|
|
268
|
+
};
|
|
269
|
+
type: string;
|
|
270
|
+
};
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export interface ApplicationRevision {
|
|
275
|
+
createTime?: string;
|
|
276
|
+
deployUser?:
|
|
277
|
+
| string
|
|
278
|
+
| {
|
|
279
|
+
name: string;
|
|
280
|
+
alias: string;
|
|
281
|
+
};
|
|
282
|
+
envName?: string;
|
|
283
|
+
note?: string;
|
|
284
|
+
reason?: string;
|
|
285
|
+
status?: string;
|
|
286
|
+
triggerType?: string;
|
|
287
|
+
version: string;
|
|
288
|
+
codeInfo?: {
|
|
289
|
+
commit?: string;
|
|
290
|
+
branch?: string;
|
|
291
|
+
user?: string;
|
|
292
|
+
};
|
|
293
|
+
imageInfo?: {
|
|
294
|
+
type: string;
|
|
295
|
+
resource?: {
|
|
296
|
+
digest: string;
|
|
297
|
+
tag: string;
|
|
298
|
+
url: string;
|
|
299
|
+
createTime: string;
|
|
300
|
+
};
|
|
301
|
+
repository?: {
|
|
302
|
+
name: string;
|
|
303
|
+
namespace: string;
|
|
304
|
+
fullName: string;
|
|
305
|
+
region: string;
|
|
306
|
+
type: string;
|
|
307
|
+
createTime: string;
|
|
308
|
+
};
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export interface ApplicationRevisionDetail extends ApplicationRevision {
|
|
313
|
+
applyAppConfig: string;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
export interface ApplicationStatistics {
|
|
317
|
+
envCount: number;
|
|
318
|
+
targetCount: number;
|
|
319
|
+
revisionCount: number;
|
|
320
|
+
workflowCount: number;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
export interface Workflow {
|
|
324
|
+
alias?: string;
|
|
325
|
+
name: string;
|
|
326
|
+
envName: string;
|
|
327
|
+
description?: string;
|
|
328
|
+
default: boolean;
|
|
329
|
+
createTime?: string;
|
|
330
|
+
enable: boolean;
|
|
331
|
+
mode: WorkflowMode;
|
|
332
|
+
subMode: WorkflowMode;
|
|
333
|
+
steps: WorkflowStep[];
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
export interface UpdateComponentProperties {
|
|
337
|
+
appName?: string;
|
|
338
|
+
componentName?: string;
|
|
339
|
+
properties: string;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
export interface WorkflowRecordBase {
|
|
343
|
+
name: string;
|
|
344
|
+
namespace: string;
|
|
345
|
+
workflowAlias?: string;
|
|
346
|
+
workflowName: string;
|
|
347
|
+
startTime?: string;
|
|
348
|
+
endTime?: string;
|
|
349
|
+
status?: RunPhase;
|
|
350
|
+
mode?: string;
|
|
351
|
+
message?: string;
|
|
352
|
+
applicationRevision?: string;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
export interface WorkflowRecord extends WorkflowRecordBase {
|
|
356
|
+
steps?: WorkflowStepStatus[];
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
export interface Trigger {
|
|
360
|
+
name: string;
|
|
361
|
+
alias?: string;
|
|
362
|
+
description?: string;
|
|
363
|
+
workflowName: string;
|
|
364
|
+
type: 'webhook';
|
|
365
|
+
payloadType?: 'custom' | 'dockerHub' | 'ACR' | 'harbor' | 'artifactory';
|
|
366
|
+
registry?: string;
|
|
367
|
+
token: string;
|
|
368
|
+
createTime?: string;
|
|
369
|
+
updateTime?: string;
|
|
370
|
+
componentName?: string;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
export interface CreateTriggerRequest {
|
|
374
|
+
name: string;
|
|
375
|
+
alias?: string;
|
|
376
|
+
description?: string;
|
|
377
|
+
workflowName: string;
|
|
378
|
+
type: 'webhook';
|
|
379
|
+
payloadType?: 'custom' | 'dockerHub' | 'ACR' | 'harbor' | 'artifactory';
|
|
380
|
+
registry?: string;
|
|
381
|
+
componentName?: string;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
export interface UpdateTriggerRequest {
|
|
385
|
+
alias?: string;
|
|
386
|
+
description?: string;
|
|
387
|
+
workflowName: string;
|
|
388
|
+
payloadType?: 'custom' | 'dockerHub' | 'ACR' | 'harbor' | 'artifactory';
|
|
389
|
+
registry?: string;
|
|
390
|
+
componentName?: string;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
export interface ApplicationComponentConfig {
|
|
394
|
+
name: string;
|
|
395
|
+
alias: string;
|
|
396
|
+
description: string;
|
|
397
|
+
componentType?: string;
|
|
398
|
+
properties: any;
|
|
399
|
+
traits?: Trait[];
|
|
400
|
+
dependsOn?: string[];
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
export interface TraitDefinitionSpec {
|
|
404
|
+
podDisruptive?: boolean;
|
|
405
|
+
appliesToWorkloads?: string[];
|
|
406
|
+
}
|
|
407
|
+
export interface ApplicationQuery {
|
|
408
|
+
query?: string;
|
|
409
|
+
project?: string;
|
|
410
|
+
env?: string;
|
|
411
|
+
targetName?: string;
|
|
412
|
+
labels?: string;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
export interface ComponentDefinitionsBase {
|
|
416
|
+
name: string;
|
|
417
|
+
workloadType?: string;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
export interface ApplicationPolicyBase {
|
|
421
|
+
createTime: string;
|
|
422
|
+
creator: string;
|
|
423
|
+
description: string;
|
|
424
|
+
name: string;
|
|
425
|
+
alias?: string;
|
|
426
|
+
properties: {};
|
|
427
|
+
type: string;
|
|
428
|
+
updateTime: string;
|
|
429
|
+
envName?: string;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
export interface ApplicationPolicyDetail extends ApplicationPolicyBase {
|
|
433
|
+
workflowPolicyBind?: WorkflowPolicyBinding[];
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
export interface ApplicationCompareResponse {
|
|
437
|
+
isDiff: boolean;
|
|
438
|
+
diffReport: string;
|
|
439
|
+
baseAppYAML: string;
|
|
440
|
+
targetAppYAML: string;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
export interface ApplicationCompareRequest {
|
|
444
|
+
compareRevisionWithRunning?: { revision?: string };
|
|
445
|
+
compareRevisionWithLatest?: { revision?: string };
|
|
446
|
+
compareLatestWithRunning?: { env: string };
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
export interface ApplicationDryRunRequest {
|
|
450
|
+
dryRunType: 'APP' | 'REVISION';
|
|
451
|
+
env?: string;
|
|
452
|
+
workflow: string;
|
|
453
|
+
version?: string;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
export interface ApplicationDryRunResponse {
|
|
457
|
+
yaml: string;
|
|
458
|
+
success: boolean;
|
|
459
|
+
message?: string;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
export interface UpdatePolicyRequest {
|
|
463
|
+
description?: string;
|
|
464
|
+
alias?: string;
|
|
465
|
+
properties: string;
|
|
466
|
+
envName?: string;
|
|
467
|
+
type: string;
|
|
468
|
+
workflowPolicyBind?: WorkflowPolicyBinding[];
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
export interface CreatePolicyRequest extends UpdatePolicyRequest {
|
|
472
|
+
name: string;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
export interface WorkflowPolicyBinding {
|
|
476
|
+
name: string;
|
|
477
|
+
steps: string[];
|
|
478
|
+
}
|
package/api/cluster.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface Cluster {
|
|
2
|
+
name: string;
|
|
3
|
+
kubeConfig: string;
|
|
4
|
+
alias?: string;
|
|
5
|
+
status?: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
createTime?: string;
|
|
9
|
+
dashboardURL?: string;
|
|
10
|
+
labels?: {};
|
|
11
|
+
providerInfo?: {
|
|
12
|
+
provider: string;
|
|
13
|
+
clusterID: string;
|
|
14
|
+
clusterName?: string;
|
|
15
|
+
regionID?: string;
|
|
16
|
+
vpcID?: string;
|
|
17
|
+
zoneID?: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface CreateCluster {
|
|
22
|
+
name: string;
|
|
23
|
+
alias?: string;
|
|
24
|
+
icon?: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
dashboardURL?: string;
|
|
27
|
+
kubeConfig: string;
|
|
28
|
+
labels?: {};
|
|
29
|
+
}
|
package/api/component.ts
ADDED
package/api/configs.ts
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { UIParam, WorkflowStepStatus } from './application';
|
|
2
|
+
|
|
3
|
+
export interface ConfigTemplate {
|
|
4
|
+
name: string;
|
|
5
|
+
namespace: string;
|
|
6
|
+
alias?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
scope: string;
|
|
9
|
+
sensitive: boolean;
|
|
10
|
+
createTime: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface ConfigTemplateDetail extends ConfigTemplate {
|
|
14
|
+
schema: any;
|
|
15
|
+
uiSchema: UIParam[];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ListTemplateResponse {
|
|
19
|
+
templates?: ConfigTemplate[];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface NamespacedName {
|
|
23
|
+
name: string;
|
|
24
|
+
namespace?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface CreateConfigRequest extends UpdateConfigRequest {
|
|
28
|
+
name: string;
|
|
29
|
+
template: NamespacedName;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface UpdateConfigRequest {
|
|
33
|
+
alias?: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
properties: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface Config {
|
|
39
|
+
name: string;
|
|
40
|
+
alias?: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
createdTime: string;
|
|
43
|
+
template: NamespacedName;
|
|
44
|
+
templateAlias?: string;
|
|
45
|
+
sensitive: boolean;
|
|
46
|
+
properties?: Record<string, any>;
|
|
47
|
+
shared: boolean;
|
|
48
|
+
targets?: TargetClusterStatus[];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface ConfigDistribution {
|
|
52
|
+
name: string;
|
|
53
|
+
createTime: string;
|
|
54
|
+
configs: Array<{ name: string; namespace: string }>;
|
|
55
|
+
targets: TargetCluster[];
|
|
56
|
+
application: { name: string; namespace: string };
|
|
57
|
+
status?: {
|
|
58
|
+
status: string;
|
|
59
|
+
workflow?: {
|
|
60
|
+
steps?: WorkflowStepStatus[];
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface TargetCluster {
|
|
66
|
+
clusterName?: string;
|
|
67
|
+
namespace: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface TargetClusterStatus extends TargetCluster {
|
|
71
|
+
status: string;
|
|
72
|
+
message: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface CreateConfigDistribution {
|
|
76
|
+
name: string;
|
|
77
|
+
targets: TargetCluster[];
|
|
78
|
+
configs: NamespacedName[];
|
|
79
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface DefinitionType {
|
|
2
|
+
type: string;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export interface DefinitionMenuType {
|
|
6
|
+
name: string;
|
|
7
|
+
type: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface DefinitionBase {
|
|
11
|
+
name: string;
|
|
12
|
+
alias?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
icon?: string;
|
|
15
|
+
status: string;
|
|
16
|
+
labels: Record<string, string>;
|
|
17
|
+
ownerAddon: string;
|
|
18
|
+
workloadType: string;
|
|
19
|
+
category?: string;
|
|
20
|
+
|
|
21
|
+
component?: any;
|
|
22
|
+
trait?: {
|
|
23
|
+
definitionRef?: { name: string; version: string };
|
|
24
|
+
podDisruptive: boolean;
|
|
25
|
+
appliesToWorkloads: string[];
|
|
26
|
+
};
|
|
27
|
+
policy?: any;
|
|
28
|
+
workflowStep?: any;
|
|
29
|
+
}
|