File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 123123 initialValue: authMethod
124124 }]"
125125 buttonStyle =" solid"
126- :defaultValue =" authMethod"
127126 @change =" selected => { handleAuthMethodChange(selected.target.value) }" >
128127 <a-radio-button value =" password" >
129128 {{ $t('label.password') }}
@@ -321,22 +320,24 @@ export default {
321320 this .loading = true
322321 api (' listZones' , { showicon: true }).then (response => {
323322 this .zonesList = response .listzonesresponse .zone || []
324- this .zoneId = this .zonesList [0 ].id || null
325- this .fetchPods ()
323+ this .zoneId = this .zonesList [0 ]? .id || null
324+ this .fetchPods (this . zoneId )
326325 }).catch (error => {
327326 this .$notifyError (error)
328327 }).finally (() => {
329328 this .loading = false
330329 })
331330 },
332- fetchPods () {
331+ fetchPods (zoneId ) {
332+ this .zoneId = zoneId
333333 this .loading = true
334334 api (' listPods' , {
335335 zoneid: this .zoneId
336336 }).then (response => {
337337 this .podsList = response .listpodsresponse .pod || []
338- this .podId = this .podsList [0 ].id || null
339- this .fetchClusters ()
338+ this .podId = this .podsList [0 ]? .id || null
339+ this .form .setFieldsValue ({ podid: this .podId })
340+ this .fetchClusters (this .podId )
340341 }).catch (error => {
341342 this .$notifyError (error)
342343 this .podsList = []
@@ -345,13 +346,19 @@ export default {
345346 this .loading = false
346347 })
347348 },
348- fetchClusters () {
349+ fetchClusters (podId ) {
350+ this .form .clearField (' clusterid' )
351+ this .clusterId = null
352+ this .clustersList = []
353+ if (! podId) return
354+ this .podId = podId
349355 this .loading = true
350356 api (' listClusters' , {
351357 podid: this .podId
352358 }).then (response => {
353359 this .clustersList = response .listclustersresponse .cluster || []
354- this .clusterId = this .clustersList [0 ].id || null
360+ this .clusterId = this .clustersList [0 ]? .id || null
361+ this .form .setFieldsValue ({ clusterid: this .clusterId })
355362 if (this .clusterId ) {
356363 this .handleChangeCluster (this .clusterId )
357364 }
You can’t perform that action at this time.
0 commit comments