Skip to content

Commit

Permalink
fixed confirmation and done page crash
Browse files Browse the repository at this point in the history
  • Loading branch information
sukhbir-singh committed Aug 3, 2019
1 parent 8cd1576 commit a2da8d4
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 22 deletions.
5 changes: 5 additions & 0 deletions app/controllers/disk_wizard_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,9 @@ def clear_mode
CommandExecutor.debug_mode = nil
end

def progress
debug_mode = params[:debug]
self.user_selections = {debug: debug_mode}
end

end
10 changes: 5 additions & 5 deletions app/views/disk_wizard/manage_disk.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ javascript:
li.list-group-item.list-group-item-success
h6
| What would you like to do?
li.list-group-item
li.list-group-item style="min-width: 320px;"
.checkbox
= check_box_tag('option[]', 1, !!((user_selections['option'].include? '1') rescue false), class: 'mount_check')
.alert.alert-info
label for="option_"
= check_box_tag('option[]', 1, !!((user_selections['option'].include? '1') rescue false), class: 'mount_check')
label for="option_" style="position: relative;top: -3px;"
| Mount this drive automatically.
#label_input.input-group.input-group-sm style=("#{!!((user_selections['option'].include? '1') rescue false) ? nil : 'display: none'}")
span.input-group-addon
#label_input.input-group.input-group-sm.mt-2 style=("#{!!((user_selections['option'].include? '1') rescue false) ? nil : 'display: none'}")
span.input-group-addon.mr-2 style="position: relative;top: 3px;"
| Enter a label
input#label.form-control name="label" placeholder="Label" style=("margin: auto;") type="text" value=("#{user_selections['label'] || nil}") /
.row.mt-2
Expand Down
24 changes: 8 additions & 16 deletions app/views/disk_wizard/progress.html.slim
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
- javascript_include_tag "progress"
- user_selections = {debug: @debug_mode}

javascript:
$(document).ready(function () {
start_processing();
setInterval(ajaxd, 2000);
// start_processing();
// setInterval(ajaxd, 2000);
});
function ajaxd() {
Expand Down Expand Up @@ -38,16 +37,9 @@ javascript:
}
.panel-body
- "***************#{user_selections}"
.row
.col-md-5.col-md-offset-3.well
/ - image_tag("disk_wizard/loading_2.GIF")
.progress.progress-striped.active
.progress-bar.progress-bar-success aria-valuemax="100" aria-valuemin="0" aria-valuenow="100" role="progressbar" style=("width: 100%")
span.sr-only
| 100%
p.text-primary
/ = image_tag "disk_wizard/progress.gif"
/* <span class="glyphicon glyphicon-time"></span */
span#progress_message wait....
.row.mt-4.mb-2 style="display: inline-block;"
.progress.active style="width: 500px; display: inline-block;"
.progress-bar.progress-bar-striped.bg-info.progress-bar-animated aria-valuemax="100" aria-valuemin="0" aria-valuenow="100" role="progressbar" style=("width: 100%")
| 0%
p.text-primary
span#progress_message Please wait...
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
get "get_all_devices" => 'disk_service#get_all_devices'
get "check_label" => 'disk_service#check_label'
get 'debug_info' => 'disk_service#debug_info'
post 'process' => 'disk_service#progress'
post 'process' => 'disk_wizard#progress'
get 'get_progress' => 'disk_service#operations_progress'

match 'select' => 'disk_wizard#select_device',via: [:get,:post]
Expand Down

0 comments on commit a2da8d4

Please sign in to comment.