File tree Expand file tree Collapse file tree 1 file changed +9
-14
lines changed
Expand file tree Collapse file tree 1 file changed +9
-14
lines changed Original file line number Diff line number Diff line change @@ -259,18 +259,12 @@ export default {
259259 this .apiParams = this .$getApiParams (' createKubernetesCluster' )
260260 },
261261 created () {
262- this .networks = [
263- {
264- id: null ,
265- name: ' '
266- }
267- ]
268- this .keyPairs = [
269- {
270- id: null ,
271- name: ' '
272- }
273- ]
262+ this .emptyEntry = {
263+ id: null ,
264+ name: ' '
265+ }
266+ this .networks = [this .emptyEntry ]
267+ this .keyPairs = [this .emptyEntry ]
274268 this .initForm ()
275269 this .fetchData ()
276270 },
@@ -322,7 +316,6 @@ export default {
322316 },
323317 fetchData () {
324318 this .fetchZoneData ()
325- this .fetchNetworkData ()
326319 this .fetchKeyPairData ()
327320 },
328321 isValidValueForKey (obj , key ) {
@@ -417,14 +410,16 @@ export default {
417410 params .zoneid = this .selectedZone .id
418411 }
419412 this .networkLoading = true
413+ this .networks = []
420414 api (' listNetworks' , params).then (json => {
421415 var listNetworks = json .listnetworksresponse .network
422416 if (this .arrayHasItems (listNetworks)) {
423417 listNetworks = listNetworks .filter (n => n .type !== ' L2' )
424- this .networks = this . networks . concat ( listNetworks)
418+ this .networks = listNetworks
425419 }
426420 }).finally (() => {
427421 this .networkLoading = false
422+ this .networks = [this .emptyEntry ].concat (this .networks )
428423 if (this .arrayHasItems (this .networks )) {
429424 this .form .networkid = 0
430425 }
You can’t perform that action at this time.
0 commit comments