You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/12/29 04:17:18 UTC

[GitHub] [cloudstack] utchoang opened a new pull request #5812: fix new UI missing 4 parameters when adding a BareMetal host

utchoang opened a new pull request #5812:
URL: https://github.com/apache/cloudstack/pull/5812


   ### Description
   
   This PR fixes https://github.com/apache/cloudstack/issues/5772
   <!--- Describe your changes in DETAIL - And how has behaviour functionally changed. -->
   
   <!-- For new features, provide link to FS, dev ML discussion etc. -->
   <!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. -->
   
   <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged -->
   <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
   <!-- Fixes: # -->
   
   <!--- ********************************************************************************* -->
   <!--- NOTE: AUTOMATATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. -->
   <!--- PLEASE PUT AN 'X' in only **ONE** box -->
   <!--- ********************************************************************************* -->
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [ ] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [ ] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [ ] Minor
   - [ ] Trivial
   
   
   ### Screenshots (if appropriate):
   ![image](https://user-images.githubusercontent.com/13766648/147626972-d96df56b-689b-4d81-a57a-c13ea1cd1cb3.png)
   
   
   ### How Has This Been Tested?
   <!-- Please describe in detail how you tested your changes. -->
   <!-- Include details of your testing environment, and the tests you ran to -->
   <!-- see how your change affects other areas of the code, etc. -->
   
   
   <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document -->
   


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on pull request #5812: UI: Fix new UI missing 4 parameters when adding a BareMetal host

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on pull request #5812:
URL: https://github.com/apache/cloudstack/pull/5812#issuecomment-1004573047


   Hi @utchoang noticed error message: "_Username and Password need to be provided._" after submitting the details (including username and password) in 'Add Host' form. Please check.


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] utchoang commented on pull request #5812: UI: Fix new UI missing 4 parameters when adding a BareMetal host

Posted by GitBox <gi...@apache.org>.
utchoang commented on pull request #5812:
URL: https://github.com/apache/cloudstack/pull/5812#issuecomment-1002887020


   @blueorangutan ui


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on pull request #5812: UI: Fix new UI missing 4 parameters when adding a BareMetal host

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on pull request #5812:
URL: https://github.com/apache/cloudstack/pull/5812#issuecomment-1004561290


   @blueorangutan ui


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5812: UI: Fix new UI missing 4 parameters when adding a BareMetal host

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5812:
URL: https://github.com/apache/cloudstack/pull/5812#issuecomment-1004564963


   UI build: :heavy_check_mark:
   Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/5812 (SL-JID-971)


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti edited a comment on pull request #5812: UI: Fix new UI missing 4 parameters when adding a BareMetal host

Posted by GitBox <gi...@apache.org>.
sureshanaparti edited a comment on pull request #5812:
URL: https://github.com/apache/cloudstack/pull/5812#issuecomment-1004573047


   Hi @utchoang noticed error message: "_Username and Password need to be provided._" after submitting the details (including username and password) in 'Add Host' form. Please check.
   
   <img width="811" alt="PR5812_UI_ErrorMessage" src="https://user-images.githubusercontent.com/12028987/148022510-9ce362f7-1cae-4fcf-bc6f-23ce5eb35cbf.png">
   


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] utchoang commented on pull request #5812: UI: Fix new UI missing 4 parameters when adding a BareMetal host

Posted by GitBox <gi...@apache.org>.
utchoang commented on pull request #5812:
URL: https://github.com/apache/cloudstack/pull/5812#issuecomment-1004545626


   @blueorangutan ui


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5812: UI: Fix new UI missing 4 parameters when adding a BareMetal host

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5812:
URL: https://github.com/apache/cloudstack/pull/5812#issuecomment-1004593979


   @utchoang a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti merged pull request #5812: UI: Fix new UI missing 4 parameters when adding a BareMetal host

Posted by GitBox <gi...@apache.org>.
sureshanaparti merged pull request #5812:
URL: https://github.com/apache/cloudstack/pull/5812


   


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #5812: UI: Fix new UI missing 4 parameters when adding a BareMetal host

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #5812:
URL: https://github.com/apache/cloudstack/pull/5812#discussion_r777873680



##########
File path: ui/src/views/infra/HostAdd.vue
##########
@@ -309,66 +398,54 @@ export default {
     },
     handleSubmitForm () {
       if (this.loading) return
-      const requiredFields = document.querySelectorAll('.required-field')
+      this.form.validateFieldsAndScroll((err, values) => {
+        if (err) return
 
-      requiredFields.forEach(field => {
-        const input = field.querySelector('.ant-input')
-        if (!input.value) {
-          input.parentNode.querySelector('.required-label').classList.add('required-label--error')
+        if (values.hostname.indexOf('http://') === -1) {
+          this.url = `http://${values.hostname}`
         } else {
-          input.parentNode.querySelector('.required-label').classList.remove('required-label--error')
+          this.url = values.hostname
         }
-      })
-
-      if (this.$el.querySelectorAll('.required-label--error').length > 0) return
-
-      if (this.selectedClusterHyperVisorType === 'VMware') {
-        this.username = ''
-        this.password = ''
-      }
-
-      if (this.hostname.indexOf('http://') === -1) {
-        this.url = `http://${this.hostname}`
-      } else {
-        this.url = this.hostname
-      }
-
-      if (this.authMethod !== 'password') {
-        this.password = ''
-      }
-
-      const args = {
-        zoneid: this.zoneId,
-        podid: this.podId,
-        clusterid: this.clusterId,
-        hypervisor: this.selectedClusterHyperVisorType,
-        clustertype: this.selectedCluster.clustertype,
-        hosttags: this.selectedTags.join(),
-        username: this.username,
-        password: this.password,
-        url: this.url,
-        agentusername: this.agentusername,
-        agentpassword: this.agentpassword,
-        agentport: this.agentport
-      }
-      Object.keys(args).forEach((key) => (args[key] == null) && delete args[key])
 
-      this.loading = true
-      api('addHost', {}, 'POST', args).then(response => {
-        const host = response.addhostresponse.host[0] || {}
-        if (host.id && this.showDedicated) {
-          this.dedicateHost(host.id)
+        const args = {
+          zoneid: values.zoneid,
+          podid: values.podid,
+          clusterid: values.clusterid,
+          hypervisor: this.selectedClusterHyperVisorType,
+          clustertype: this.selectedCluster.clustertype,
+          hosttags: values.hosttags ? values.hosttags.join() : null,
+          username: values.username,
+          password: this.authMethod !== 'password' ? '' : values.password,
+          url: this.url,
+          agentusername: values.agentusername,
+          agentpassword: values.agentpassword,
+          agentport: values.agentport
         }
-        this.parentFetchData()
-        this.$parent.$parent.close()
-      }).catch(error => {
-        this.$notification.error({
-          message: `${this.$t('label.error')} ${error.response.status}`,
-          description: error.response.data.addhostresponse.errortext,
-          duration: 0
-        })
-      }).finally(() => {
-        this.loading = false
+        if (this.selectedClusterHyperVisorType === 'BareMetal') {
+          args.cpunumber = values.baremetalcpucores
+          args.cpuspeed = values.baremetalcpu
+          args.memory = values.baremetalmemory
+          args.hostmac = values.baremetalmac
+        }
+        Object.keys(args).forEach((key) => (args[key] == null) && delete args[key])
+        this.loading = true
+        console.log(args)
+        // api('addHost', {}, 'POST', args).then(response => {

Review comment:
       @utchoang can you remove the code in comments pls




-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on a change in pull request #5812: UI: Fix new UI missing 4 parameters when adding a BareMetal host

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on a change in pull request #5812:
URL: https://github.com/apache/cloudstack/pull/5812#discussion_r776564333



##########
File path: ui/src/views/infra/HostAdd.vue
##########
@@ -17,139 +17,197 @@
 
 <template>
   <a-spin :spinning="loading">
-    <div class="form" v-ctrl-enter="handleSubmitForm">
+    <div class="form-layout" v-ctrl-enter="handleSubmitForm">
+      <div class="form">
+        <a-form
+          :form="form"
+          layout="vertical"
+          @submit="handleSubmitForm">
+          <a-form-item>
+            <tooltip-label slot="label" :title="$t('label.zonenamelabel')" :tooltip="placeholder.zoneid"/>
+            <a-select
+              v-decorator="['zoneid', {
+                initialValue: this.zoneId,
+                rules: [{ required: true, message: $t('message.error.select') }]
+              }]"
+              :placeholder="placeholder.zoneid"
+              autoFocus
+              showSearch
+              optionFilterProp="children"
+              :filterOption="(input, option) => {
+                return option.componentOptions.propsData.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
+              }"
+              @change="fetchPods">
+              <a-select-option
+                v-for="zone in zonesList"
+                :value="zone.id"
+                :key="zone.id"
+                :label="zone.name">
+                <span>
+                  <resource-icon v-if="zone.icon" :image="zone.icon.base64image" size="1x" style="margin-right: 5px"/>
+                  <a-icon v-else type="global" style="margin-right: 5px" />
+                  {{ zone.name }}
+                </span>
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+          <a-form-item>
+            <tooltip-label slot="label" :title="$t('label.podname')" :tooltip="placeholder.podid"/>
+            <a-select
+              v-decorator="['podid', {
+                initialValue: podId,
+                rules: [{ required: true, message: $t('message.error.select') }]
+              }]"
+              :placeholder="placeholder.podid"
+              showSearch
+              optionFilterProp="children"
+              :filterOption="(input, option) => {
+                return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+              }"
+              @change="fetchClusters">
+              <a-select-option
+                v-for="pod in podsList"
+                :value="pod.id"
+                :key="pod.id">
+                {{ pod.name }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+          <a-form-item>
+            <tooltip-label slot="label" :title="$t('label.clustername')" :tooltip="placeholder.clusterid"/>
+            <a-select
+              v-decorator="['clusterid', {
+                initialValue: clusterId,
+                rules: [{ required: true, message: $t('message.error.select') }]
+              }]"
+              :placeholder="placeholder.clusterid"
+              showSearch
+              optionFilterProp="children"
+              :filterOption="(input, option) => {
+                return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+              }"
+              @change="handleChangeCluster">
+              <a-select-option
+                v-for="cluster in clustersList"
+                :value="cluster.id"
+                :key="cluster.id">
+                {{ cluster.name }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+          <a-form-item>
+            <tooltip-label
+              slot="label"
+              :title="selectedClusterHyperVisorType === 'VMware' ? $t('label.esx.host') : $t('label.hostnamelabel')"
+              :tooltip="placeholder.url"/>
+            <a-input
+              v-decorator="['hostname', {
+                initialValue: hostname,
+                rules: [{ required: true, message: $t('message.error.required.input') }]
+              }]"
+              :placeholder="placeholder.url"></a-input>
+          </a-form-item>
+          <a-form-item v-if="selectedClusterHyperVisorType !== 'VMware'">
+            <tooltip-label slot="label" :title="$t('label.username')" :tooltip="placeholder.username"/>
+            <a-input
+              v-decorator="['username', {
+                initialValue: username,
+                rules: [{ required: true, message: $t('message.error.required.input') }]
+              }]"
+              :placeholder="placeholder.username"></a-input>
+          </a-form-item>
+          <a-form-item v-if="selectedClusterHyperVisorType !== 'VMware'">
+            <tooltip-label slot="label" :title="$t('label.password')" :tooltip="placeholder.password"/>
+            <a-input-password
+              v-decorator="['password', {
+                initialValue: password,
+                rules: [{ required: true, message: $t('message.error.required.input') }]
+              }]"
+              :placeholder="placeholder.password"></a-input-password>
+          </a-form-item>
+          <a-form-item v-if="selectedClusterHyperVisorType === 'Ovm3'">
+            <tooltip-label slot="label" :title="$t('label.agent.username')" :tooltip="$t('label.agent.username')"/>
+            <a-input
+              v-decorator="['agentusername', { initialValue: agentusername }]"
+              :placeholder="$t('label.agent.username')"></a-input>
+          </a-form-item>
+          <a-form-item v-if="selectedClusterHyperVisorType === 'Ovm3'">
+            <tooltip-label slot="label" :title="$t('label.agent.password')" :tooltip="$t('label.agent.password')"/>
+            <a-input
+              v-decorator="['agentpassword', { initialValue: agentpassword }]"
+              :placeholder="$t('label.agent.password')"></a-input>
+          </a-form-item>
+          <a-form-item v-if="selectedClusterHyperVisorType === 'Ovm3'">
+            <tooltip-label slot="label" :title="$t('label.agentport')" :tooltip="$t('label.agentport')"/>
+            <a-input
+              v-decorator="['agentport', { initialValue: agentport }]"
+              :placeholder="$t('label.agentport')"></a-input>
+          </a-form-item>
+          <a-form-item>
+            <tooltip-label slot="label" :title="$t('label.hosttags')" :tooltip="placeholder.hosttags"/>

Review comment:
       This is to keep all host related details at one place, otherwise it is looking like this 
   
   ![image](https://user-images.githubusercontent.com/3348673/147721779-f0273510-3764-48bc-8816-f4a6d0cd28e8.png)
   




-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] utchoang commented on pull request #5812: UI: Fix new UI missing 4 parameters when adding a BareMetal host

Posted by GitBox <gi...@apache.org>.
utchoang commented on pull request #5812:
URL: https://github.com/apache/cloudstack/pull/5812#issuecomment-1004577825


   @blueorangutan ui


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on pull request #5812: UI: Fix new UI missing 4 parameters when adding a BareMetal host

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on pull request #5812:
URL: https://github.com/apache/cloudstack/pull/5812#issuecomment-1002422206


   Hi @utchoang, Is this good to go in 4.16.1? If so, please rebase with 4.16. Thanks.


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5812: UI: Fix new UI missing 4 parameters when adding a BareMetal host

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5812:
URL: https://github.com/apache/cloudstack/pull/5812#issuecomment-1002871147


   UI build: :heavy_check_mark:
   Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/5812 (SL-JID-950)


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on pull request #5812: UI: Fix new UI missing 4 parameters when adding a BareMetal host

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on pull request #5812:
URL: https://github.com/apache/cloudstack/pull/5812#issuecomment-1004625014


   Verified the missing parameters (CPU cores, CPU MHz, Memory, Host Mac) in  'Add Host' UI form for BareMetal host, and the API fired from the UI with dummy values.
   


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5812: UI: Fix new UI missing 4 parameters when adding a BareMetal host

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5812:
URL: https://github.com/apache/cloudstack/pull/5812#issuecomment-1004608590


   UI build: :heavy_check_mark:
   Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/5812 (SL-JID-972)


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5812: UI: Fix new UI missing 4 parameters when adding a BareMetal host

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5812:
URL: https://github.com/apache/cloudstack/pull/5812#issuecomment-1002392102


   UI build: :heavy_check_mark:
   Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/5812 (SL-JID-946)


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5812: UI: Fix new UI missing 4 parameters when adding a BareMetal host

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5812:
URL: https://github.com/apache/cloudstack/pull/5812#issuecomment-1002888294


   UI build: :heavy_check_mark:
   Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/5812 (SL-JID-951)


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on pull request #5812: UI: Fix new UI missing 4 parameters when adding a BareMetal host

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on pull request #5812:
URL: https://github.com/apache/cloudstack/pull/5812#issuecomment-1003900451


   Hi @utchoang Can you resolve the conflicts in this PR branch. Thanks.


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5812: UI: Fix new UI missing 4 parameters when adding a BareMetal host

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5812:
URL: https://github.com/apache/cloudstack/pull/5812#issuecomment-1004561551


   @sureshanaparti a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] harikrishna-patnala commented on a change in pull request #5812: UI: Fix new UI missing 4 parameters when adding a BareMetal host

Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on a change in pull request #5812:
URL: https://github.com/apache/cloudstack/pull/5812#discussion_r776564158



##########
File path: ui/src/views/infra/HostAdd.vue
##########
@@ -17,139 +17,197 @@
 
 <template>
   <a-spin :spinning="loading">
-    <div class="form" v-ctrl-enter="handleSubmitForm">
+    <div class="form-layout" v-ctrl-enter="handleSubmitForm">
+      <div class="form">
+        <a-form
+          :form="form"
+          layout="vertical"
+          @submit="handleSubmitForm">
+          <a-form-item>
+            <tooltip-label slot="label" :title="$t('label.zonenamelabel')" :tooltip="placeholder.zoneid"/>
+            <a-select
+              v-decorator="['zoneid', {
+                initialValue: this.zoneId,
+                rules: [{ required: true, message: $t('message.error.select') }]
+              }]"
+              :placeholder="placeholder.zoneid"
+              autoFocus
+              showSearch
+              optionFilterProp="children"
+              :filterOption="(input, option) => {
+                return option.componentOptions.propsData.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
+              }"
+              @change="fetchPods">
+              <a-select-option
+                v-for="zone in zonesList"
+                :value="zone.id"
+                :key="zone.id"
+                :label="zone.name">
+                <span>
+                  <resource-icon v-if="zone.icon" :image="zone.icon.base64image" size="1x" style="margin-right: 5px"/>
+                  <a-icon v-else type="global" style="margin-right: 5px" />
+                  {{ zone.name }}
+                </span>
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+          <a-form-item>
+            <tooltip-label slot="label" :title="$t('label.podname')" :tooltip="placeholder.podid"/>
+            <a-select
+              v-decorator="['podid', {
+                initialValue: podId,
+                rules: [{ required: true, message: $t('message.error.select') }]
+              }]"
+              :placeholder="placeholder.podid"
+              showSearch
+              optionFilterProp="children"
+              :filterOption="(input, option) => {
+                return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+              }"
+              @change="fetchClusters">
+              <a-select-option
+                v-for="pod in podsList"
+                :value="pod.id"
+                :key="pod.id">
+                {{ pod.name }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+          <a-form-item>
+            <tooltip-label slot="label" :title="$t('label.clustername')" :tooltip="placeholder.clusterid"/>
+            <a-select
+              v-decorator="['clusterid', {
+                initialValue: clusterId,
+                rules: [{ required: true, message: $t('message.error.select') }]
+              }]"
+              :placeholder="placeholder.clusterid"
+              showSearch
+              optionFilterProp="children"
+              :filterOption="(input, option) => {
+                return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+              }"
+              @change="handleChangeCluster">
+              <a-select-option
+                v-for="cluster in clustersList"
+                :value="cluster.id"
+                :key="cluster.id">
+                {{ cluster.name }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+          <a-form-item>
+            <tooltip-label
+              slot="label"
+              :title="selectedClusterHyperVisorType === 'VMware' ? $t('label.esx.host') : $t('label.hostnamelabel')"
+              :tooltip="placeholder.url"/>
+            <a-input
+              v-decorator="['hostname', {
+                initialValue: hostname,
+                rules: [{ required: true, message: $t('message.error.required.input') }]
+              }]"
+              :placeholder="placeholder.url"></a-input>
+          </a-form-item>
+          <a-form-item v-if="selectedClusterHyperVisorType !== 'VMware'">
+            <tooltip-label slot="label" :title="$t('label.username')" :tooltip="placeholder.username"/>
+            <a-input
+              v-decorator="['username', {
+                initialValue: username,
+                rules: [{ required: true, message: $t('message.error.required.input') }]
+              }]"
+              :placeholder="placeholder.username"></a-input>
+          </a-form-item>
+          <a-form-item v-if="selectedClusterHyperVisorType !== 'VMware'">
+            <tooltip-label slot="label" :title="$t('label.password')" :tooltip="placeholder.password"/>
+            <a-input-password
+              v-decorator="['password', {
+                initialValue: password,
+                rules: [{ required: true, message: $t('message.error.required.input') }]
+              }]"
+              :placeholder="placeholder.password"></a-input-password>
+          </a-form-item>
+          <a-form-item v-if="selectedClusterHyperVisorType === 'Ovm3'">
+            <tooltip-label slot="label" :title="$t('label.agent.username')" :tooltip="$t('label.agent.username')"/>
+            <a-input
+              v-decorator="['agentusername', { initialValue: agentusername }]"
+              :placeholder="$t('label.agent.username')"></a-input>
+          </a-form-item>
+          <a-form-item v-if="selectedClusterHyperVisorType === 'Ovm3'">
+            <tooltip-label slot="label" :title="$t('label.agent.password')" :tooltip="$t('label.agent.password')"/>
+            <a-input
+              v-decorator="['agentpassword', { initialValue: agentpassword }]"
+              :placeholder="$t('label.agent.password')"></a-input>
+          </a-form-item>
+          <a-form-item v-if="selectedClusterHyperVisorType === 'Ovm3'">
+            <tooltip-label slot="label" :title="$t('label.agentport')" :tooltip="$t('label.agentport')"/>
+            <a-input
+              v-decorator="['agentport', { initialValue: agentport }]"
+              :placeholder="$t('label.agentport')"></a-input>
+          </a-form-item>
+          <a-form-item>
+            <tooltip-label slot="label" :title="$t('label.hosttags')" :tooltip="placeholder.hosttags"/>

Review comment:
       @utchoang can you please move the host tags and dedicated checkbox to the end of the form.




-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] utchoang removed a comment on pull request #5812: UI: Fix new UI missing 4 parameters when adding a BareMetal host

Posted by GitBox <gi...@apache.org>.
utchoang removed a comment on pull request #5812:
URL: https://github.com/apache/cloudstack/pull/5812#issuecomment-1004577825


   @blueorangutan ui


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] utchoang commented on pull request #5812: UI: Fix new UI missing 4 parameters when adding a BareMetal host

Posted by GitBox <gi...@apache.org>.
utchoang commented on pull request #5812:
URL: https://github.com/apache/cloudstack/pull/5812#issuecomment-1002390391


   @blueorangutan ui


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5812: UI: Fix new UI missing 4 parameters when adding a BareMetal host

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5812:
URL: https://github.com/apache/cloudstack/pull/5812#issuecomment-1002870147


   @utchoang a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5812: UI: Fix new UI missing 4 parameters when adding a BareMetal host

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5812:
URL: https://github.com/apache/cloudstack/pull/5812#issuecomment-1002887075


   @utchoang a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5812: UI: Fix new UI missing 4 parameters when adding a BareMetal host

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5812:
URL: https://github.com/apache/cloudstack/pull/5812#issuecomment-1002390613


   @utchoang a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] utchoang commented on pull request #5812: UI: Fix new UI missing 4 parameters when adding a BareMetal host

Posted by GitBox <gi...@apache.org>.
utchoang commented on pull request #5812:
URL: https://github.com/apache/cloudstack/pull/5812#issuecomment-1002870048


   @blueorangutan ui


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] utchoang commented on a change in pull request #5812: UI: Fix new UI missing 4 parameters when adding a BareMetal host

Posted by GitBox <gi...@apache.org>.
utchoang commented on a change in pull request #5812:
URL: https://github.com/apache/cloudstack/pull/5812#discussion_r777878138



##########
File path: ui/src/views/infra/HostAdd.vue
##########
@@ -309,66 +398,54 @@ export default {
     },
     handleSubmitForm () {
       if (this.loading) return
-      const requiredFields = document.querySelectorAll('.required-field')
+      this.form.validateFieldsAndScroll((err, values) => {
+        if (err) return
 
-      requiredFields.forEach(field => {
-        const input = field.querySelector('.ant-input')
-        if (!input.value) {
-          input.parentNode.querySelector('.required-label').classList.add('required-label--error')
+        if (values.hostname.indexOf('http://') === -1) {
+          this.url = `http://${values.hostname}`
         } else {
-          input.parentNode.querySelector('.required-label').classList.remove('required-label--error')
+          this.url = values.hostname
         }
-      })
-
-      if (this.$el.querySelectorAll('.required-label--error').length > 0) return
-
-      if (this.selectedClusterHyperVisorType === 'VMware') {
-        this.username = ''
-        this.password = ''
-      }
-
-      if (this.hostname.indexOf('http://') === -1) {
-        this.url = `http://${this.hostname}`
-      } else {
-        this.url = this.hostname
-      }
-
-      if (this.authMethod !== 'password') {
-        this.password = ''
-      }
-
-      const args = {
-        zoneid: this.zoneId,
-        podid: this.podId,
-        clusterid: this.clusterId,
-        hypervisor: this.selectedClusterHyperVisorType,
-        clustertype: this.selectedCluster.clustertype,
-        hosttags: this.selectedTags.join(),
-        username: this.username,
-        password: this.password,
-        url: this.url,
-        agentusername: this.agentusername,
-        agentpassword: this.agentpassword,
-        agentport: this.agentport
-      }
-      Object.keys(args).forEach((key) => (args[key] == null) && delete args[key])
 
-      this.loading = true
-      api('addHost', {}, 'POST', args).then(response => {
-        const host = response.addhostresponse.host[0] || {}
-        if (host.id && this.showDedicated) {
-          this.dedicateHost(host.id)
+        const args = {
+          zoneid: values.zoneid,
+          podid: values.podid,
+          clusterid: values.clusterid,
+          hypervisor: this.selectedClusterHyperVisorType,
+          clustertype: this.selectedCluster.clustertype,
+          hosttags: values.hosttags ? values.hosttags.join() : null,
+          username: values.username,
+          password: this.authMethod !== 'password' ? '' : values.password,
+          url: this.url,
+          agentusername: values.agentusername,
+          agentpassword: values.agentpassword,
+          agentport: values.agentport
         }
-        this.parentFetchData()
-        this.$parent.$parent.close()
-      }).catch(error => {
-        this.$notification.error({
-          message: `${this.$t('label.error')} ${error.response.status}`,
-          description: error.response.data.addhostresponse.errortext,
-          duration: 0
-        })
-      }).finally(() => {
-        this.loading = false
+        if (this.selectedClusterHyperVisorType === 'BareMetal') {
+          args.cpunumber = values.baremetalcpucores
+          args.cpuspeed = values.baremetalcpu
+          args.memory = values.baremetalmemory
+          args.hostmac = values.baremetalmac
+        }
+        Object.keys(args).forEach((key) => (args[key] == null) && delete args[key])
+        this.loading = true
+        console.log(args)
+        // api('addHost', {}, 'POST', args).then(response => {

Review comment:
       Sorry for this, I removed it




-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] utchoang commented on pull request #5812: UI: Fix new UI missing 4 parameters when adding a BareMetal host

Posted by GitBox <gi...@apache.org>.
utchoang commented on pull request #5812:
URL: https://github.com/apache/cloudstack/pull/5812#issuecomment-1004593562


   @blueorangutan ui


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org