-
Notifications
You must be signed in to change notification settings - Fork 365
Convert vm snapshot form #9639
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
base: master
Are you sure you want to change the base?
Convert vm snapshot form #9639
Conversation
ca6fa83
to
5d8cc2b
Compare
1f1344f
to
5941f52
Compare
page << "miqScrollTop();" if @flash_array.present? | ||
page.replace("desc_content", :partial => "/vm_common/snapshots_desc", | ||
:locals => {:selected => params[:id]}) | ||
formatted_time = format_timezone(@snap_selected[:create_time].to_time, Time.zone, "view") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be in the users time zone?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or should this be in UTC and we convert on the client side?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line converts it to the user's timezone in the MIQ settings, converting timezones is messy on JS and would be difficult to match the original formatting which is why I kept it on the ruby side
page.replace("desc_content", :partial => "/vm_common/snapshots_desc", | ||
:locals => {:selected => params[:id]}) | ||
formatted_time = format_timezone(@snap_selected[:create_time].to_time, Time.zone, "view") | ||
number_to_human_size(@snap_selected[:total_size], :precision => 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line isn't doing anything on its own. Should this be used below in the formatted bytes section?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just copied the original code for this part. Is the original code wrong here?
= number_to_human_size(selected_id[:total_size], :precision => 2)
= _("(%{number} bytes)") % {:number => number_with_delimiter(selected_id[:total_size], :delimiter => ",", :separator => ".")}
Fixes: #9518. This pr converts the vm snapshot tree page from HAML to React.
Before:

After:
