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 @@ -204,7 +204,7 @@ export default {
204204 virtualmachines: [],
205205 vmColumns: [],
206206 networkLoading: false ,
207- network: {} ,
207+ network: null ,
208208 publicIpAddress: null ,
209209 currentTab: ' details' ,
210210 cksSshStartingPort: 2222 ,
@@ -382,7 +382,27 @@ export default {
382382 this .virtualmachines .map (x => { x .ipaddress = x .nic [0 ].ipaddress })
383383 this .instanceLoading = false
384384 },
385- fetchPublicIpAddress () {
385+ fetchNetwork () {
386+ this .networkLoading = true
387+ return new Promise ((resolve , reject ) => {
388+ api (' listNetworks' , {
389+ listAll: true ,
390+ id: this .resource .networkid
391+ }).then (json => {
392+ const networks = json .listnetworksresponse .network
393+ if (this .arrayHasItems (networks)) {
394+ this .network = networks[0 ]
395+ }
396+ })
397+ this .networkLoading = false
398+ })
399+ },
400+ async fetchPublicIpAddress () {
401+ await this .fetchNetwork ()
402+ if (this .network && this .network .type === ' Shared' ) {
403+ this .publicIpAddress = null
404+ return
405+ }
386406 this .networkLoading = true
387407 var params = {
388408 listAll: true ,
You can’t perform that action at this time.
0 commit comments