On 14-01-2016 08:59, Samuel Henrique De Oliveira Guimaraes wrote:
Hi,
I think this looks great. For the UI, the decrease/increase input we can use the input
type "number":
http://www.w3schools.com/html/tryit.asp?filename=tryhtml_input_number
However we can't change the arrows to + and - signs and in IE and Edge it doesn't
show any arrows at all. By default it only support numbers but if the user paste any other
character it will fill the max character limit (set with the "max" attribute)
with the letter "e". I can validate this on the front-end with the
"pattern" attribute and for older browsers that don't support it I could put
a regex on it.
This table shows the current browser support of it:
http://caniuse.com/#feat=input-number. I think there are some other known issues with
Firefox older than 28 and ESR that are not covered within this list.
Based on the back-end specification I think we can mix some of the html5 native
attributes with JavaScript to perform the form validation on the front-end. This is the
JavaScript spec for this input type:
http://www.w3schools.com/jsref/dom_obj_number.asp
We could get some values from the back-end and set the attributes on the front-end and
change them dynamically. For instance, we have to set the "min" value to the
minimal number of supported vcpus but adjust the "step" when the user clicks in
increase/decrease to make sure it is a value multiple of cores * threads.
Please let me know if the default html5 specification works for you. If you think the +/-
signs are extremely necessary then I will have to create a custom JS widget for this.
Samuel
Hi Samuel, thanks for the feedback. I believe html5 spec is enough. We
just need to keep the same standard for this and for the other RFC from
Rodrigo "[RFC][Kimchi] Guest Max memory setup and update".
I will send a V2 with changes I did during backend implementation.
Regards,
--
Lucio Correia
Software Engineer
IBM LTC Brazil