Skip to content

Use MB/GB/TB suffix for VM memory input #8437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hagbarddenstore opened this issue Jan 23, 2022 · 8 comments
Closed

Use MB/GB/TB suffix for VM memory input #8437

hagbarddenstore opened this issue Jan 23, 2022 · 8 comments
Labels
pending closure Requires immediate attention to avoid being closed for inactivity status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation type: feature Introduction of new functionality to the application

Comments

@hagbarddenstore
Copy link
Contributor

NetBox version

v3.1.6

Feature type

Change to existing functionality

Proposed functionality

Allow inputting memory with a MB/GB/TB suffix instead of defaulting to MB.

Use case

The use case is to make it easier for users to input the correct amount of memory for the virtual machine.

It is far more common today to input GBs of memory rather than MBs of memory and having to memorize or calculate the correct amount of MBs the wanted GB represent is tedious.

Database changes

None

External dependencies

One method of solving it is by changing the form input field to this https://pypi.org/project/django-sizefield/.

@hagbarddenstore hagbarddenstore added the type: feature Introduction of new functionality to the application label Jan 23, 2022
@jeremystretch jeremystretch added the status: under review Further discussion is needed to determine this issue's scope and/or implementation label Jan 24, 2022
@jeremystretch
Copy link
Member

To clarify, the intent here is to enable the user to enter a value such as "8gb"in the form field and have NetBox automatically convert that to a value of 8192, correct?

@hagbarddenstore
Copy link
Contributor Author

@jeremystretch Yes exactly, so just a frontend change.

@jeremystretch jeremystretch added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation and removed status: under review Further discussion is needed to determine this issue's scope and/or implementation labels Jan 26, 2022
@jeremystretch
Copy link
Member

Another option would be to keep the integer field and add a separate unit selection dropdown (similar to what we do with circuit speeds). Django's MultiValueField might be useful for this approach, though I haven't experimented with it myself.

@hagbarddenstore
Copy link
Contributor Author

hagbarddenstore commented Jan 28, 2022 via email

@minitriga
Copy link
Contributor

Managed to get something working without altering the model, the user can select what unit they want to enter the value in and it will convert it on the backend to MB. when you go to edit the form again it will then present you with the value so if you entered 9GB it will show 9216 MB as shown in the picture below.

image

This implements MultiValueField just got to work on formatting the html properly.

@juliusrickert
Copy link

@minitriga useful addition :)

I'd like to suggest inlining the <select> with the <input>.

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels Mar 18, 2022
@jeremystretch jeremystretch added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation and removed status: accepted This issue has been accepted for implementation labels Jan 5, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Apr 6, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions github-actions bot added the pending closure Requires immediate attention to avoid being closed for inactivity label Apr 6, 2023
@github-actions
Copy link
Contributor

github-actions bot commented May 7, 2023

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 7, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pending closure Requires immediate attention to avoid being closed for inactivity status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants