File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -205,7 +205,7 @@ export default {
205205 virtualmachines: [],
206206 vmColumns: [],
207207 networkLoading: false ,
208- network: {} ,
208+ network: null ,
209209 publicIpAddress: null ,
210210 currentTab: ' details' ,
211211 cksSshStartingPort: 2222 ,
@@ -386,7 +386,27 @@ export default {
386386 this .virtualmachines .map (x => { x .ipaddress = x .nic [0 ].ipaddress })
387387 this .instanceLoading = false
388388 },
389- fetchPublicIpAddress () {
389+ fetchNetwork () {
390+ this .networkLoading = true
391+ return new Promise ((resolve , reject ) => {
392+ api (' listNetworks' , {
393+ listAll: true ,
394+ id: this .resource .networkid
395+ }).then (json => {
396+ const networks = json .listnetworksresponse .network
397+ if (this .arrayHasItems (networks)) {
398+ this .network = networks[0 ]
399+ }
400+ })
401+ this .networkLoading = false
402+ })
403+ },
404+ async fetchPublicIpAddress () {
405+ await this .fetchNetwork ()
406+ if (this .network && this .network .type === ' Shared' ) {
407+ this .publicIpAddress = null
408+ return
409+ }
390410 this .networkLoading = true
391411 var params = {
392412 listAll: true ,
You can’t perform that action at this time.
0 commit comments