You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "saurabhkushwaha438 (via GitHub)" <gi...@apache.org> on 2026/10/16 05:08:55 UTC

[PR] UI: allow memory setting in flex compute offering in GiB with unit selector (#14082) [cloudstack]

saurabhkushwaha438 opened a new pull request, #14413:
URL: https://github.com/apache/cloudstack/pull/14413

   ### Description
   Fixes #14082
   
   #### 1. Conversion from MiB to GiB (Display & Rounding)
   - Binary conversion is used (`1 GiB = 1024 MiB`).
   - When offerings with predefined constraints or initial values are loaded in MiB, or when switching from MiB to GiB:
     $$\text{displayValue} = \text{parseFloat}\left(\left(\frac{\text{rawMemory}}{1024}\right)\text{.toFixed(2)}\right)$$
   - The display value is rounded to **2 decimal places** to keep the UI clean, readable, and intuitive for users.
   - Slider step dynamically adjusts:
     - In **GiB** mode: step is set to `0.01` (or smaller for sub-GiB offerings) with precision `2`.
     - In **MiB** mode: step is set to `1` with integer precision `0`.
     
   #### 2. Conversion from GiB to MiB (Backend Value Emission)
   - CloudStack APIs and backend services expect memory allocations in integer **MiB**.
   - When the user selects or inputs memory in **GiB**:
     $$\text{memoryInMiB} = \text{Math.round}(\text{displayValue} \times 1024)$$
   - **Exact Boundary Protection**: If a compute offering has minimum/maximum memory constraints (`minMemory` / `maxMemory`), selecting the exact minimum or maximum bound in GiB directly maps to the exact integer `minMemory` or `maxMemory` in MiB to eliminate any potential off-by-one rounding discrepancies.
   
   ### 💬 Feedback Needed: Fractional GiB to Integer MiB Rounding
   - **Observation:** Converting decimal GiB values to MiB often produces fractional values (e.g., `1.51 GiB × 1024 = 1546.24 MiB`).
   - **Current Behavior:** The UI rounds this to the nearest integer (`1546 MiB`), which is then emitted in the API payload and consumed by backend hypervisor managers.
   - **Reviewer Input:** Looking for maintainer feedback on whether standard nearest-integer rounding (`Math.round`) is acceptable, or if we should apply ceiling (`Math.ceil`) to guarantee the VM always receives at least the requested GiB amount.
   
   https://github.com/user-attachments/assets/74c9276d-83be-4389-b676-950bfbb9cf1f
   
   
   
   


-- 
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


Re: [PR] UI: allow memory setting in flex compute offering in GiB with unit selector (#14082) [cloudstack]

Posted by "saurabhkushwaha438 (via GitHub)" <gi...@apache.org>.
saurabhkushwaha438 commented on code in PR #14413:
URL: https://github.com/apache/cloudstack/pull/14413#discussion_r4414243656


##########
ui/src/views/compute/wizard/ComputeSelection.vue:
##########
@@ -226,10 +274,28 @@ export default {
       }
       if (this.preFillContent.memory) {
         this.memoryInputValue = this.preFillContent.memory
+        this.memoryDisplayValue = parseFloat((this.memoryInputValue / 1024).toFixed(2))
       }
       this.updateComputeCpuNumber(this.preFillContent.cpunumber || this.cpuNumberInputValue)
       this.updateComputeCpuSpeed(this.preFillContent.cpuspeed || this.cpuSpeedInputValue)
-      this.updateComputeMemory(this.preFillContent.memory || this.memoryInputValue)
+      this.updateComputeMemory(this.memoryDisplayValue)

Review Comment:
   > bandicam.2026-10-17.21-08-51-749.mp4 
   > how about this , is this better direction
   
   and i havent commited those change yet



-- 
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


Re: [PR] UI: allow memory setting in flex compute offering in GiB with unit selector (#14082) [cloudstack]

Posted by "JoaoJandre (via GitHub)" <gi...@apache.org>.
JoaoJandre commented on code in PR #14413:
URL: https://github.com/apache/cloudstack/pull/14413#discussion_r4413926450


##########
ui/src/views/compute/wizard/ComputeSelection.vue:
##########
@@ -226,10 +274,28 @@ export default {
       }
       if (this.preFillContent.memory) {
         this.memoryInputValue = this.preFillContent.memory
+        this.memoryDisplayValue = parseFloat((this.memoryInputValue / 1024).toFixed(2))
       }
       this.updateComputeCpuNumber(this.preFillContent.cpunumber || this.cpuNumberInputValue)
       this.updateComputeCpuSpeed(this.preFillContent.cpuspeed || this.cpuSpeedInputValue)
-      this.updateComputeMemory(this.preFillContent.memory || this.memoryInputValue)
+      this.updateComputeMemory(this.memoryDisplayValue)

Review Comment:
   @saurabhkushwaha438 This looks better. But IMHO I think that having a slider for GiB that goes in increments of 0.01 is not a very interesting design. I think both the GiB and MiB increments should be of 1 (of their respective unit of mesurement).
   If you want to have a VM with 1.6 GiB for some reason, you can just use the MiB slider. I believe most users will use whole GiB numbers, not fractions.



-- 
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


Re: [PR] UI: allow memory setting in flex compute offering in GiB with unit selector (#14082) [cloudstack]

Posted by "saurabhkushwaha438 (via GitHub)" <gi...@apache.org>.
saurabhkushwaha438 commented on code in PR #14413:
URL: https://github.com/apache/cloudstack/pull/14413#discussion_r4297040804


##########
ui/src/views/compute/wizard/ComputeSelection.vue:
##########
@@ -226,10 +274,28 @@ export default {
       }
       if (this.preFillContent.memory) {
         this.memoryInputValue = this.preFillContent.memory
+        this.memoryDisplayValue = parseFloat((this.memoryInputValue / 1024).toFixed(2))
       }
       this.updateComputeCpuNumber(this.preFillContent.cpunumber || this.cpuNumberInputValue)
       this.updateComputeCpuSpeed(this.preFillContent.cpuspeed || this.cpuSpeedInputValue)
-      this.updateComputeMemory(this.preFillContent.memory || this.memoryInputValue)
+      this.updateComputeMemory(this.memoryDisplayValue)

Review Comment:
   nice catch , now i am confuse and would be great to get suggestion from you and others



-- 
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


Re: [PR] UI: allow memory setting in flex compute offering in GiB with unit selector (#14082) [cloudstack]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #14413:
URL: https://github.com/apache/cloudstack/pull/14413#issuecomment-6502637828

   ## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/14413?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 3.70%. Comparing base ([`7ed0cec`](https://app.codecov.io/gh/apache/cloudstack/commit/7ed0cec53dc5113a475808d6dbc221491ff4ae4f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`db7c8a0`](https://app.codecov.io/gh/apache/cloudstack/commit/db7c8a0f58868595a405c4f7a5f464d0e6b533bb?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 78 commits behind head on main.
   > :exclamation:  There is a different number of reports uploaded between BASE (7ed0cec) and HEAD (db7c8a0). Click for more details.
   > 
   > <details><summary>HEAD has 1 upload less than BASE</summary>
   >
   >| Flag | BASE (7ed0cec) | HEAD (db7c8a0) |
   >|------|------|------|
   >|unittests|1|0|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@              Coverage Diff              @@
   ##               main   #14413       +/-   ##
   =============================================
   - Coverage     19.91%    3.70%   -16.21%     
   =============================================
     Files          6373      493     -5880     
     Lines        577230    42588   -534642     
     Branches      70696     8081    -62615     
   =============================================
   - Hits         114936     1577   -113359     
   + Misses       449736    40785   -408951     
   + Partials      12558      226    -12332     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/14413/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/14413/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `3.70% <ø> (-0.01%)` | :arrow_down: |
   | [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/14413/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/cloudstack/pull/14413?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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


Re: [PR] UI: allow memory setting in flex compute offering in GiB with unit selector (#14082) [cloudstack]

Posted by "Damans227 (via GitHub)" <gi...@apache.org>.
Damans227 commented on code in PR #14413:
URL: https://github.com/apache/cloudstack/pull/14413#discussion_r4297225127


##########
ui/src/views/compute/wizard/ComputeSelection.vue:
##########
@@ -226,10 +274,28 @@ export default {
       }
       if (this.preFillContent.memory) {
         this.memoryInputValue = this.preFillContent.memory
+        this.memoryDisplayValue = parseFloat((this.memoryInputValue / 1024).toFixed(2))
       }
       this.updateComputeCpuNumber(this.preFillContent.cpunumber || this.cpuNumberInputValue)
       this.updateComputeCpuSpeed(this.preFillContent.cpuspeed || this.cpuSpeedInputValue)
-      this.updateComputeMemory(this.preFillContent.memory || this.memoryInputValue)
+      this.updateComputeMemory(this.memoryDisplayValue)

Review Comment:
   can we make sure 1500 goes back as 1500 unless the user changes the number?



-- 
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


Re: [PR] UI: allow memory setting in flex compute offering in GiB with unit selector (#14082) [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #14413:
URL: https://github.com/apache/cloudstack/pull/14413#issuecomment-6529193617

   UI build: :heavy_check_mark:
   Live QA URL: https://qa.cloudstack.cloud/simulator/pr/14413 (QA-JID-1004)


-- 
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


Re: [PR] UI: allow memory setting in flex compute offering in GiB with unit selector (#14082) [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #14413:
URL: https://github.com/apache/cloudstack/pull/14413#issuecomment-6513050607

   UI build: :heavy_check_mark:
   Live QA URL: https://qa.cloudstack.cloud/simulator/pr/14413 (QA-JID-1003)


-- 
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


Re: [PR] UI: allow memory setting in flex compute offering in GiB with unit selector (#14082) [cloudstack]

Posted by "Damans227 (via GitHub)" <gi...@apache.org>.
Damans227 commented on PR #14413:
URL: https://github.com/apache/cloudstack/pull/14413#issuecomment-6528723404

   @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


Re: [PR] UI: allow memory setting in flex compute offering in GiB with unit selector (#14082) [cloudstack]

Posted by "saurabhkushwaha438 (via GitHub)" <gi...@apache.org>.
saurabhkushwaha438 commented on code in PR #14413:
URL: https://github.com/apache/cloudstack/pull/14413#discussion_r4297175630


##########
ui/src/views/compute/wizard/ComputeSelection.vue:
##########
@@ -226,10 +274,28 @@ export default {
       }
       if (this.preFillContent.memory) {
         this.memoryInputValue = this.preFillContent.memory
+        this.memoryDisplayValue = parseFloat((this.memoryInputValue / 1024).toFixed(2))
       }
       this.updateComputeCpuNumber(this.preFillContent.cpunumber || this.cpuNumberInputValue)
       this.updateComputeCpuSpeed(this.preFillContent.cpuspeed || this.cpuSpeedInputValue)
-      this.updateComputeMemory(this.preFillContent.memory || this.memoryInputValue)
+      this.updateComputeMemory(this.memoryDisplayValue)

Review Comment:
   another option could be use GIB for display only because MIB is only state and single source of truth so in backend we will use actual MIB value



-- 
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


Re: [PR] UI: allow memory setting in flex compute offering in GiB with unit selector (#14082) [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #14413:
URL: https://github.com/apache/cloudstack/pull/14413#issuecomment-6512762437

   @nvazquez 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


Re: [PR] UI: allow memory setting in flex compute offering in GiB with unit selector (#14082) [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #14413:
URL: https://github.com/apache/cloudstack/pull/14413#issuecomment-6528748720

   @Damans227 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


Re: [PR] UI: allow memory setting in flex compute offering in GiB with unit selector (#14082) [cloudstack]

Posted by "Damans227 (via GitHub)" <gi...@apache.org>.
Damans227 commented on code in PR #14413:
URL: https://github.com/apache/cloudstack/pull/14413#discussion_r4295432487


##########
ui/src/views/compute/wizard/ComputeSelection.vue:
##########
@@ -226,10 +274,28 @@ export default {
       }
       if (this.preFillContent.memory) {
         this.memoryInputValue = this.preFillContent.memory
+        this.memoryDisplayValue = parseFloat((this.memoryInputValue / 1024).toFixed(2))
       }
       this.updateComputeCpuNumber(this.preFillContent.cpunumber || this.cpuNumberInputValue)
       this.updateComputeCpuSpeed(this.preFillContent.cpuspeed || this.cpuSpeedInputValue)
-      this.updateComputeMemory(this.preFillContent.memory || this.memoryInputValue)
+      this.updateComputeMemory(this.memoryDisplayValue)

Review Comment:
   what happens when the memory isnt a round GiB value? an imported vm with 1500 MB shows as 1.46 GiB and gets sent back as 1495 without the user touching 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


Re: [PR] UI: allow memory setting in flex compute offering in GiB with unit selector (#14082) [cloudstack]

Posted by "Damans227 (via GitHub)" <gi...@apache.org>.
Damans227 commented on code in PR #14413:
URL: https://github.com/apache/cloudstack/pull/14413#discussion_r4297146733


##########
ui/src/views/compute/wizard/ComputeSelection.vue:
##########
@@ -226,10 +274,28 @@ export default {
       }
       if (this.preFillContent.memory) {
         this.memoryInputValue = this.preFillContent.memory
+        this.memoryDisplayValue = parseFloat((this.memoryInputValue / 1024).toFixed(2))
       }
       this.updateComputeCpuNumber(this.preFillContent.cpunumber || this.cpuNumberInputValue)
       this.updateComputeCpuSpeed(this.preFillContent.cpuspeed || this.cpuSpeedInputValue)
-      this.updateComputeMemory(this.preFillContent.memory || this.memoryInputValue)
+      this.updateComputeMemory(this.memoryDisplayValue)

Review Comment:
   np. maybe, we can open it in MiB when the value isnt a whole number of GiB? then 1500 stays 1500. on load and on a unit switch, send the saved MiB value as is and only convert when the user changes the number.



-- 
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


Re: [PR] UI: allow memory setting in flex compute offering in GiB with unit selector (#14082) [cloudstack]

Posted by "Damans227 (via GitHub)" <gi...@apache.org>.
Damans227 commented on code in PR #14413:
URL: https://github.com/apache/cloudstack/pull/14413#discussion_r4297208911


##########
ui/src/views/compute/wizard/ComputeSelection.vue:
##########
@@ -226,10 +274,28 @@ export default {
       }
       if (this.preFillContent.memory) {
         this.memoryInputValue = this.preFillContent.memory
+        this.memoryDisplayValue = parseFloat((this.memoryInputValue / 1024).toFixed(2))
       }
       this.updateComputeCpuNumber(this.preFillContent.cpunumber || this.cpuNumberInputValue)
       this.updateComputeCpuSpeed(this.preFillContent.cpuspeed || this.cpuSpeedInputValue)
-      this.updateComputeMemory(this.preFillContent.memory || this.memoryInputValue)
+      this.updateComputeMemory(this.memoryDisplayValue)

Review Comment:
   that only works if the saved MiB is what gets sent.



-- 
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


Re: [PR] UI: allow memory setting in flex compute offering in GiB with unit selector (#14082) [cloudstack]

Posted by "saurabhkushwaha438 (via GitHub)" <gi...@apache.org>.
saurabhkushwaha438 commented on code in PR #14413:
URL: https://github.com/apache/cloudstack/pull/14413#discussion_r4303290668


##########
ui/src/views/compute/wizard/ComputeSelection.vue:
##########
@@ -226,10 +274,28 @@ export default {
       }
       if (this.preFillContent.memory) {
         this.memoryInputValue = this.preFillContent.memory
+        this.memoryDisplayValue = parseFloat((this.memoryInputValue / 1024).toFixed(2))
       }
       this.updateComputeCpuNumber(this.preFillContent.cpunumber || this.cpuNumberInputValue)
       this.updateComputeCpuSpeed(this.preFillContent.cpuspeed || this.cpuSpeedInputValue)
-      this.updateComputeMemory(this.preFillContent.memory || this.memoryInputValue)
+      this.updateComputeMemory(this.memoryDisplayValue)

Review Comment:
   
   https://github.com/user-attachments/assets/c32b30dd-7323-4a6a-953b-85bd5924892f
   
   how about this , is this better direction



-- 
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


Re: [PR] UI: allow memory setting in flex compute offering in GiB with unit selector (#14082) [cloudstack]

Posted by "saurabhkushwaha438 (via GitHub)" <gi...@apache.org>.
saurabhkushwaha438 commented on code in PR #14413:
URL: https://github.com/apache/cloudstack/pull/14413#discussion_r4414223680


##########
ui/src/views/compute/wizard/ComputeSelection.vue:
##########
@@ -226,10 +274,28 @@ export default {
       }
       if (this.preFillContent.memory) {
         this.memoryInputValue = this.preFillContent.memory
+        this.memoryDisplayValue = parseFloat((this.memoryInputValue / 1024).toFixed(2))
       }
       this.updateComputeCpuNumber(this.preFillContent.cpunumber || this.cpuNumberInputValue)
       this.updateComputeCpuSpeed(this.preFillContent.cpuspeed || this.cpuSpeedInputValue)
-      this.updateComputeMemory(this.preFillContent.memory || this.memoryInputValue)
+      this.updateComputeMemory(this.memoryDisplayValue)

Review Comment:
   ok i will this "GiB and MiB increments should be of 1"



-- 
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


Re: [PR] UI: allow memory setting in flex compute offering in GiB with unit selector (#14082) [cloudstack]

Posted by "nvazquez (via GitHub)" <gi...@apache.org>.
nvazquez commented on PR #14413:
URL: https://github.com/apache/cloudstack/pull/14413#issuecomment-6512745912

   @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


Re: [PR] UI: allow memory setting in flex compute offering in GiB with unit selector (#14082) [cloudstack]

Posted by "Damans227 (via GitHub)" <gi...@apache.org>.
Damans227 commented on code in PR #14413:
URL: https://github.com/apache/cloudstack/pull/14413#discussion_r4426370297


##########
ui/src/views/compute/wizard/ComputeSelection.vue:
##########
@@ -226,10 +274,28 @@ export default {
       }
       if (this.preFillContent.memory) {
         this.memoryInputValue = this.preFillContent.memory
+        this.memoryDisplayValue = parseFloat((this.memoryInputValue / 1024).toFixed(2))
       }
       this.updateComputeCpuNumber(this.preFillContent.cpunumber || this.cpuNumberInputValue)
       this.updateComputeCpuSpeed(this.preFillContent.cpuspeed || this.cpuSpeedInputValue)
-      this.updateComputeMemory(this.preFillContent.memory || this.memoryInputValue)
+      this.updateComputeMemory(this.memoryDisplayValue)

Review Comment:
   @saurabhkushwaha438 yes this is a better direction, 1500 stays 1500 now unless the user changes it. any reason for 0.25 GiB steps? you agreed with joao on steps of 1 for GiB and MiB.



##########
ui/src/views/compute/wizard/ComputeSelection.vue:
##########
@@ -241,12 +315,31 @@ export default {
     updateComputeCpuSpeed (value) {
       this.$emit('update-compute-cpuspeed', this.cpuSpeedInputDecorator, value)
     },
-    updateComputeMemory (value) {
-      if (!value) this.memoryInputValue = 0
-      if (!this.validateInput('memory', value)) {
+    updateComputeMemory (displayValue) {
+      if (displayValue === null || displayValue === undefined) {
+        this.memoryDisplayValue = 0
+        displayValue = 0

Review Comment:
   @saurabhkushwaha438 can we keep the required error when the box is cleared? on an offering with no limits this now sends 0 instead.



-- 
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