diff --git a/i18n/en.ts b/i18n/en.ts index d78a255..2818adc 100644 --- a/i18n/en.ts +++ b/i18n/en.ts @@ -85,6 +85,13 @@ sync + + refresh + + refresh + refresh + + delete @@ -267,6 +274,13 @@ manage + + clear_progress + + clear_progress + clear + + diff --git a/public/css/fonts.css b/public/css/fonts.css index ab6b3df..36d0362 100644 --- a/public/css/fonts.css +++ b/public/css/fonts.css @@ -2,11 +2,11 @@ font-family: 'Source Code Pro'; font-style: normal; font-weight: 300; - src: local('Source Code Pro Light'), local('SourceCodePro-Light'), url(/ttf/SourceCodePro-Light.ttf) format('truetype'); + src: url(/ttf/SourceCodePro-Light.ttf) format('truetype'); } @font-face { font-family: 'Source Sans Pro'; font-style: normal; font-weight: 300; - src: local('Source Sans Pro Light'), local('SourceSansPro-Light'), url(/ttf/SourceSansPro-Light.ttf) format('truetype'); + src: url(/ttf/SourceSansPro-Light.ttf) format('truetype'); } diff --git a/sdk_helper.rb b/sdk_helper.rb index 61f0144..149f3ee 100755 --- a/sdk_helper.rb +++ b/sdk_helper.rb @@ -70,6 +70,13 @@ class SdkHelper < Sinatra::Base redirect to('/'+params[:locale]+'/') end + #clear the operation progress output + post '/actions/clear_output' do + $status_out.clear + process_tail_update + redirect to(request.referer) + end + #add target post '/:locale/targets/add' do targets_available_update @@ -272,6 +279,9 @@ def sdk_upgrade # -------------------------------- Process def process_tail_update + # progress background color + @process_result_class = "process_result_ok" + if $process @refresh_time = 10 $process_tail += $process.stdout_read(timeout: 0) + $process.stderr_read(timeout: 0) @@ -279,12 +289,18 @@ def process_tail_update $process_tail = (split[(-[10,split.size].min)..-1] or []).join("\n") $status_out = $process_tail.split("\n").join("
\n").gsub(" "," ") if $process.status[0] == "Z" - $process_exit = (_ :finished) + ": " + $process_description + " - " + (_ :exited_with_status) + " " + $process.reap.exitstatus.to_s + $process_exitstatus = $process.reap.exitstatus + + $process_exit = (_ :finished) + ": " + $process_description + " - " + (_ :exited_with_status) + " " + $process_exitstatus.to_s @refresh_time = $process = nil + if $process_exitstatus != 0 + @process_result_class = "process_result_fail" + end elsif $process.runtime > $process_timeout $process.reap $process_exit = (_ :timeout) + ": " + $process_description + " - " + (_ :process_killed) @refresh_time = $process = nil + @process_result_class = "process_result_fail" end if $process $status_out = "" + "-"*40 + " " + $process_description + "
\n
\n" + $status_out diff --git a/views/default.sass b/views/default.sass index 85f4a24..260daf7 100644 --- a/views/default.sass +++ b/views/default.sass @@ -60,13 +60,22 @@ html, body margin-left: 230px padding-bottom: 180px -.progress - height: 180px - position: absolute - bottom: 0 +.progress_blocker + position: fixed + top: 0 left: 0 + height: 100% width: 100% + z-index: 99 + background-color: rgba(45, 91, 112, 0.6) +.progress + position: relative + top: 50% + left: 0 + height: 100% + width: 100% + z-index: 100 /* style */ /*-------------------------------------------------------------------------------------------*/ @@ -140,8 +149,8 @@ body color: #e3ebed .progress_background - background-color: rgba(45, 91, 112, 0.2) - height: 180px + background-color: rgba(45, 91, 112, 0) + height: 100% margin-left: 230px padding-top: 30px padding-left: 30px @@ -155,6 +164,20 @@ body padding-bottom: 20px font-size: 18px +.progress_table + padding: 10px 10px 10px 10px + border-spacing: 4px + box-shadow: 3px 3px 5px rgba(0,0,0,0.2) + min-width: 100% + max-width: 100% + +.process_result_ok + background-color: #3D819B + +.process_result_fail + background-color: #FF0000 + + .clear clear: both diff --git a/views/layout.haml b/views/layout.haml index 4d57b0f..2075dcb 100644 --- a/views/layout.haml +++ b/views/layout.haml @@ -31,13 +31,23 @@ .content_wrap =yield - if @status_out and @status_out.size > 0 - .progress - .progress_background - #progress_view - .progress_header - = _ :operation_progress - .monospace - #{@status_out} + .progress_blocker + .progress + .progress_background + #progress_view + %table(class="progress_table #{@process_result_class}") + %tbody + %tr + %td + %form{:action => "/actions/clear_output", :method => "post"} + %input{:type => "submit", :value => (_ :clear_progress), :class => "button"} + .progress_header + = _ :operation_progress + %tr + %td + .monospace + #{@status_out} + diff --git a/views/packages.haml b/views/packages.haml index 38b8cda..5a86ff7 100644 --- a/views/packages.haml +++ b/views/packages.haml @@ -4,11 +4,11 @@ #manage %div.sync_button %form{:action => "/#{@language}/targets/#{@target}/sync", :method => :post} - %input{:type => 'submit', :value => "sync", :class => "button", :name => "_method"} + %input{:type => 'submit', :value => (_ :sync), :class => "button", :name => "_method"} = _(:explain_sync) %div.sync_button %form{:action => "/#{@language}/targets/#{@target}/refresh", :method => :post} - %input{:type => 'submit', :value => "refresh", :class => "button", :name => "_method"} + %input{:type => 'submit', :value => (_ :refresh), :class => "button", :name => "_method"} = _(:explain_refresh) #packages_table %form{:action => "/#{@language}/targets/add", :method => 'post'} diff --git a/views/toolchains.haml b/views/toolchains.haml index 89b6221..9a3c9b2 100644 --- a/views/toolchains.haml +++ b/views/toolchains.haml @@ -13,9 +13,9 @@ %td.delete_button - if installed %form{:action => "/toolchains/#{toolchain}", :method => "post"} - %input{:type => "submit", :value => "delete", :class => "button", :name=> "_method"} + %input{:type => "submit", :value => (_ :delete), :class => "button", :name=> "_method"} - else - %input{:type => "button", :value => "delete", :disabled => "true", :class => "button disabled", :name=> "_method"} + %input{:type => "button", :value => (_ :delete), :disabled => "true", :class => "button disabled", :name=> "_method"} %td.install_button - if not installed %form{:action => "/#{@language}/toolchains/#{toolchain}", :method => "post"}