From 293c92c5940f8ab47c3c71c0458070b797521a11 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 28 Apr 2017 09:13:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A4=84=E7=90=86jenkins=E4=B8=AD=E9=97=B4?= =?UTF-8?q?=E5=B1=82=E8=BF=94=E5=9B=9E=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E4=B8=AD=E5=B8=A6=20=E2=80=9C+=E2=80=9D=20=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/myshixuns_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index 567250cdb..a1d8d6820 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -14,7 +14,7 @@ class MyshixunsController < ApplicationController jsonTestDetails = JSON.parse(params[:jsonTestDetails]) status = jsonTestDetails['status'] game_id = jsonTestDetails['buildID'] - outPut = Base64.urlsafe_decode64(jsonTestDetails['outPut']) unless jsonTestDetails['outPut'].blank? + outPut = Base64.urlsafe_decode64(jsonTestDetails['outPut'].gsub(" ", "+")) unless jsonTestDetails['outPut'].blank? jenkins_testsets = jsonTestDetails['msg'] # message = Base64.decode64(params[:msg]) unless params[:msg].blank? game = Game.find(game_id) From 02547f54fa8e7ede4223a955064b80f6f062f3d0 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 28 Apr 2017 09:51:18 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=80=97=E6=97=B6=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E6=98=AF=E5=AE=9E=E6=97=B6=E6=9B=B4=E6=96=B0=E7=9A=84?= =?UTF-8?q?=EF=BC=8C=E5=8F=AA=E6=9C=89=E7=82=B9=E5=87=BB=E8=AF=84=E6=B5=8B?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=90=8E=E8=80=97=E6=97=B6=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=89=8D=E4=BC=9A=E5=8F=91=E7=94=9F=E6=94=B9=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 4 ++++ app/views/games/_code_actions.html.erb | 30 +++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6fe2a5180..e84eb0343 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -131,6 +131,10 @@ module ApplicationHelper return time end + def consume_time time + time.strftime('%Y/%m/%d %H:%M:%S') + end + def avg_spend_time shixun_id, position Game.find_by_sql("SELECT avg(g.updated_at - g.created_at) as avg_time FROM `games` g, `challenges` c where c.id=g.challenge_id and g.status =2 and c.position = #{position} and g.myshixun_id in (SELECT id FROM `myshixuns` where shixun_id= #{shixun_id});").first.try(:avg_time).to_i end diff --git a/app/views/games/_code_actions.html.erb b/app/views/games/_code_actions.html.erb index 890f11dd2..2d5f4bcf8 100644 --- a/app/views/games/_code_actions.html.erb +++ b/app/views/games/_code_actions.html.erb @@ -1,4 +1,4 @@ -耗时:<%= @consume_time %> +
<% if @game.status == 0 %> 评测 @@ -17,6 +17,34 @@ <% end %>