weizhouapache commented on code in PR #9731:
URL: https://github.com/apache/cloudstack/pull/9731#discussion_r1776561171


##########
ui/src/views/compute/EditVM.vue:
##########
@@ -289,15 +290,35 @@ export default {
       return decodedData.toString('utf-8')
     },
     fetchUserData () {
-      const params = {
-        id: this.resource.id,
-        userdata: true
+      let networkId
+      this.resource.nic.forEach(nic => {
+        if (nic.isdefault) {
+          networkId = nic.networkid
+        }
+      })
+      if (!networkId) {
+        return
+      }
+      const listNetworkParams = {
+        id: networkId

Review Comment:
   Listall : true ?



##########
ui/src/views/compute/EditVM.vue:
##########
@@ -289,15 +290,35 @@ export default {
       return decodedData.toString('utf-8')
     },
     fetchUserData () {
-      const params = {
-        id: this.resource.id,
-        userdata: true
+      let networkId
+      this.resource.nic.forEach(nic => {
+        if (nic.isdefault) {
+          networkId = nic.networkid
+        }
+      })
+      if (!networkId) {
+        return
+      }
+      const listNetworkParams = {
+        id: networkId
       }
+      api(`listNetworks`, listNetworkParams).then(json => {
+        json.listnetworksresponse.network[0].service.forEach(service => {
+          if (service.name === 'UserData') {
+            this.userDataEnabled = true
 
-      api('listVirtualMachines', params).then(json => {
-        this.form.userdata = 
this.decodeUserData(json.listvirtualmachinesresponse.virtualmachine[0].userdata 
|| '')
+            const listVmParams = {
+              id: this.resource.id,
+              userdata: true

Review Comment:
   listall: true as well ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to