-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Comments
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 |
@jeremystretch Yes exactly, so just a frontend change. |
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 |
That works as well.
… On 28 Jan 2022, at 15:25, Jeremy Stretch ***@***.***> wrote:
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.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you authored the thread.
|
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. This implements MultiValueField just got to work on formatting the html properly. |
@minitriga useful addition :) I'd like to suggest inlining the |
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. |
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. |
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/.
The text was updated successfully, but these errors were encountered: