/
edge_openapi.go
256 lines (221 loc) · 8.34 KB
/
edge_openapi.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
// Copyright (c) 2021 Terminus, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package apistructs
import "fmt"
const (
EdgeOperationChangePage = "changePage"
EdgeOperationChangeRadio = "changeViewType"
EdgeOperationClick = "click"
EdgeOperationSubmit = "submit"
EdgeOperationCgCluster = "clusterChange"
EdgeOperationDelete = "delete"
EdgeOperationAdd = "add"
EdgeOperationUpdate = "update"
EdgeOperationViewDetail = "viewDetail"
EdgeOperationOffline = "offline"
EdgeOperationRestart = "restart"
EdgeOperationFilter = "filter"
EdgeOperationAddSite = "addSite"
EdgeOperationAddCluster = "addCluster"
EdgeOperationAddApp = "addApp"
EdgeDefaultPageNo = 1
EdgeDefaultPageSize = 20
EdgeListValueTypeID = "id"
EdgeListValueTypeName = "name"
)
const (
EdgeDefaultMatchPattern = "^[a-z0-9-]*$"
EdgeDefaultRegexpError = "可输入小写字母、数字或中划线"
EdgeDefaultNameMaxLength = 50
EdgeDefaultValueMaxLength = 100
EdgeDefaultLagerLength = 2048
)
var (
EdgeDefaultRegexp = fmt.Sprintf("/%v/", EdgeDefaultMatchPattern)
)
type EdgeTableProps struct {
PageSizeOptions []string `json:"pageSizeOptions"`
RowKey string `json:"rowKey"`
Columns []EdgeColumns `json:"columns"`
}
type EdgeKVListProps struct {
Visible bool `json:"visible"`
Pagination bool `json:"pagination"`
RowKey string `json:"rowKey"`
Columns []EdgeKVListColumns `json:"columns"`
}
type EdgeKVListTitleProps struct {
Visible bool `json:"visible"`
Title string `json:"title"`
Level int `json:"level"`
}
type EdgeColumns struct {
Title string `json:"title"`
DataIndex string `json:"dataIndex"`
Width int `json:"width"`
}
type EdgeKVListColumns struct {
EdgeColumns
ColSpan int `json:"colSpan"`
}
type EdgeDrawerProps struct {
Size string `json:"size"`
Title string `json:"title"`
}
type EdgeOperations = map[string]interface{}
type EdgeOperation struct {
Key string `json:"key"`
Reload bool `json:"reload"`
Command EdgeJumpCommand `json:"command,omitempty"`
FillMeta string `json:"fillMeta,omitempty"`
Meta map[string]interface{} `json:"meta,omitempty"`
}
type EdgeItemOperations struct {
RenderType string `json:"renderType"`
Value string `json:"value,omitempty"`
Operations map[string]EdgeItemOperation `json:"operations,omitempty"`
Status string `json:"status,omitempty"`
}
type EdgeTextBadge struct {
RenderType string `json:"renderType"`
Value string `json:"value"`
Status string `json:"status,omitempty"`
}
type EdgeItemOperation struct {
ShowIndex int `json:"showIndex,omitempty"`
Key string `json:"key"`
Text string `json:"text"`
Reload bool `json:"reload"`
Disabled bool `json:"disabled,omitempty"`
DisabledTip string `json:"disabledTip,omitempty"`
Confirm string `json:"confirm,omitempty"`
Meta map[string]interface{} `json:"meta,omitempty"`
Command EdgeJumpCommand `json:"command,omitempty"`
}
type EdgePageState struct {
Total int `json:"total"`
PageSize int `json:"pageSize"`
PageNo int `json:"pageNo"`
}
type EdgeFormModalProps struct {
Title string `json:"title,omitempty"`
Name string `json:"name,omitempty"`
Fields []EdgeFormModalField `json:"fields"`
FooterAlign string `json:"footerAlign,omitempty"`
}
type EdgeFormModalPointProps struct {
Title string `json:"title,omitempty"`
Name string `json:"name,omitempty"`
Fields []*EdgeFormModalField `json:"fields"`
ReadOnly bool `json:"readOnly,omitempty"`
FooterAlign string `json:"footerAlign,omitempty"`
}
type EdgeFormModalField struct {
Key string `json:"key"`
Label string `json:"label"`
LabelTip string `json:"labelTip,omitempty"`
Component string `json:"component"`
Required bool `json:"required"`
Rules []EdgeFormModalFieldRule `json:"rules,omitempty"`
Group string `json:"group,omitempty"`
Disabled bool `json:"disabled"`
InitialValue string `json:"initialValue,omitempty"`
DefaultValue string `json:"defaultValue,omitempty"`
RemoveWhen [][]map[string]interface{} `json:"removeWhen,omitempty"`
ComponentProps map[string]interface{} `json:"componentProps,omitempty"`
Operations EdgeOperations `json:"operations,omitempty"`
IsPassword bool `json:"isPassword,omitempty"`
}
type EdgeFormModalFieldRule struct {
Pattern string `json:"pattern"`
Message string `json:"msg"`
}
type EdgeButtonProps struct {
Type string `json:"type"`
Text string `json:"text"`
}
type EdgeRadioProps struct {
RadioType string `json:"radioType"`
ButtonStyle string `json:"buttonStyle"`
Size string `json:"size"`
Options []EdgeButtonOption `json:"options"`
}
type EdgeButtonOption struct {
Text string `json:"text"`
Status string `json:"status"`
Key string `json:"key"`
}
type EdgeConditions struct {
Fixed bool `json:"fixed"`
EmptyText string `json:"emptyText,omitempty"`
Key string `json:"key"`
Label string `json:"label"`
Type string `json:"type"`
Placeholder string `json:"placeholder"`
ShowIndex int `json:"showIndex,omitempty"`
Options []map[string]interface{} `json:"options,omitempty"`
}
type EdgeEventMeta struct {
Meta map[string]int64 `json:"meta"`
}
type EdgeSiteState struct {
SiteID int64 `json:"siteID"`
PageNo int `json:"pageNo,omitempty"`
PageSize int `json:"pageSize,omitempty"`
Visible bool `json:"visible,omitempty"`
FormClear bool `json:"formClear,omitempty"`
SearchCondition string `json:"searchCondition"`
}
type EdgeCfgSetState struct {
ConfigSetItemID int64 `json:"configSetItemID"`
PageNo int `json:"pageNo,omitempty"`
PageSize int `json:"pageSize,omitempty"`
Visible bool `json:"visible,omitempty"`
FormClear bool `json:"formClear,omitempty"`
}
type EdgeAppState struct {
AppID uint64 `json:"appID"`
PageNo int `json:"pageNo,omitempty"`
PageSize int `json:"pageSize,omitempty"`
Visible bool `json:"visible,omitempty"`
FormClear bool `json:"formClear,omitempty"`
OperationType string `json:"operationType,omitempty"`
}
type EdgeRenderingID struct {
ID int64 `json:"id"`
}
type EdgeViewGroupSelectState struct {
ViewGroupSelected string `json:"viewGroupSelected"`
}
type EdgeSearchState struct {
SearchCondition string `json:"searchCondition"`
}
type EdgeJumpCommand struct {
Key string `json:"key,omitempty"`
Target string `json:"target,omitempty"`
JumpOut bool `json:"jumpOut"`
State EdgeJumpCommandState `json:"state,omitempty"`
}
type EdgeJumpCommandState struct {
Params map[string]interface{} `json:"params,omitempty"`
Query map[string]interface{} `json:"query,omitempty"`
Visible bool `json:"visible"`
FormData map[string]interface{} `json:"formData,omitempty"`
ReadOnly bool `json:"readOnly,omitempty"`
}
type EdgeSearchCondition struct {
Values struct {
Condition string `json:"condition"`
} `json:"values"`
}