4
4
<el-form label-position =" top" :model =" form" ref =" form" :rules =" rules" >
5
5
<el-row :gutter =" 20" >
6
6
<el-col :span =" 6" >
7
- <el-form-item :label =" $t('commons.table.name')" required prop =" metadata.name" >
7
+ <el-form-item :label =" $t('commons.table.name')" prop =" metadata.name" >
8
8
<el-input clearable v-model =" form.metadata.name" ></el-input >
9
9
</el-form-item >
10
10
</el-col >
11
11
<el-col :span =" 3" >
12
- <el-form-item :label =" $t('business.namespace.namespace')" required prop =" metadata.namespace" >
12
+ <el-form-item :label =" $t('business.namespace.namespace')" prop =" metadata.namespace" >
13
13
<ko-select :namespace.sync =" form.metadata.namespace" ></ko-select >
14
14
</el-form-item >
15
15
</el-col >
46
46
</table >
47
47
</ko-card >
48
48
</el-tab-pane >
49
- <el-tab-pane name =" Port" label =" ports " >
49
+ <el-tab-pane name =" Port" : label =" $t('business.network.port') " >
50
50
<ko-card :title =" $t('business.network.port')" >
51
51
<table style =" width : 100% ;padding : 0 " class =" tab-table" >
52
52
<tr >
@@ -111,7 +111,6 @@ import Rule from "@/utils/rules"
111
111
import KoCard from " @/components/ko-card"
112
112
import { listNodes } from " @/api/nodes"
113
113
import { checkPermissions } from " @/utils/permission"
114
- // import KoFormItem from "@/components/ko-form-item/index"
115
114
116
115
export default {
117
116
name: " EndpointCreate" ,
@@ -150,8 +149,21 @@ export default {
150
149
this .$router .push ({ name: " Endpoints" })
151
150
},
152
151
onEditYaml () {
153
- this .showYaml = true
154
- this .yaml = this .transformYaml ()
152
+ this .$refs [" form" ].validate ((valid ) => {
153
+ if (! valid) {
154
+ this .$confirm (this .$t (" commons.validate.params_not_complete" ) + this .$t (" commons.confirm_message.open_yaml" ), this .$t (" commons.message_box.prompt" ), {
155
+ confirmButtonText: this .$t (" commons.button.confirm" ),
156
+ cancelButtonText: this .$t (" commons.button.cancel" ),
157
+ type: " warning" ,
158
+ }).then (() => {
159
+ this .showYaml = true
160
+ this .yaml = this .transformYaml ()
161
+ })
162
+ } else {
163
+ this .showYaml = true
164
+ this .yaml = this .transformYaml ()
165
+ }
166
+ })
155
167
},
156
168
backToForm () {
157
169
this .$confirm (this .$t (" commons.confirm_message.back_form" ), this .$t (" commons.message_box.prompt" ), {
@@ -174,7 +186,7 @@ export default {
174
186
})
175
187
},
176
188
handleAdd (subset ) {
177
- const item = {ip: " " }
189
+ const item = { ip: " " }
178
190
subset .addresses .push (item)
179
191
},
180
192
handleDelete (subset , index ) {
@@ -239,4 +251,4 @@ export default {
239
251
</script >
240
252
241
253
<style scoped>
242
- </style >
254
+ </style >
0 commit comments