44 <el-form label-position =" top" :model =" form" ref =" form" :rules =" rules" >
55 <el-row :gutter =" 20" >
66 <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" >
88 <el-input clearable v-model =" form.metadata.name" ></el-input >
99 </el-form-item >
1010 </el-col >
1111 <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" >
1313 <ko-select :namespace.sync =" form.metadata.namespace" ></ko-select >
1414 </el-form-item >
1515 </el-col >
4646 </table >
4747 </ko-card >
4848 </el-tab-pane >
49- <el-tab-pane name =" Port" label =" ports " >
49+ <el-tab-pane name =" Port" : label =" $t('business.network.port') " >
5050 <ko-card :title =" $t('business.network.port')" >
5151 <table style =" width : 100% ;padding : 0 " class =" tab-table" >
5252 <tr >
@@ -111,7 +111,6 @@ import Rule from "@/utils/rules"
111111import KoCard from " @/components/ko-card"
112112import { listNodes } from " @/api/nodes"
113113import { checkPermissions } from " @/utils/permission"
114- // import KoFormItem from "@/components/ko-form-item/index"
115114
116115export default {
117116 name: " EndpointCreate" ,
@@ -150,8 +149,21 @@ export default {
150149 this .$router .push ({ name: " Endpoints" })
151150 },
152151 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+ })
155167 },
156168 backToForm () {
157169 this .$confirm (this .$t (" commons.confirm_message.back_form" ), this .$t (" commons.message_box.prompt" ), {
@@ -174,7 +186,7 @@ export default {
174186 })
175187 },
176188 handleAdd (subset ) {
177- const item = {ip: " " }
189+ const item = { ip: " " }
178190 subset .addresses .push (item)
179191 },
180192 handleDelete (subset , index ) {
@@ -239,4 +251,4 @@ export default {
239251 </script >
240252
241253<style scoped>
242- </style >
254+ </style >
0 commit comments