From 034312aec4a3c9b6e370fb71156d12a84e45a6da Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Sat, 18 May 2019 21:41:35 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E7=95=A5=E7=89=88=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/managements_controller.rb | 9 +++ .../managements/evaluate_simple.html.erb | 76 +++++++++++++++++++ config/routes.rb | 1 + 3 files changed, 86 insertions(+) create mode 100644 app/views/managements/evaluate_simple.html.erb diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index b4e5b0b4..83637277 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -851,6 +851,15 @@ class ManagementsController < ApplicationController @front_js = eva.front_js end + def evaluate_simple + page = params[:page] + @recodes = EvaluateRecord.where("created_at > ?", Time.now - 1.days).order("consume_time desc") + @recodes_count = @recodes.size + @record_pages = Paginator.new @recodes_count, 20, page || 1 + @offset ||= @record_pages.offset + @recodes = paginateHelper @recodes, 20 + end + # 评测时间列表 def evaluate_records shixun_tomcat = Redmine::Configuration['shixun_tomcat'] diff --git a/app/views/managements/evaluate_simple.html.erb b/app/views/managements/evaluate_simple.html.erb new file mode 100644 index 00000000..a8174770 --- /dev/null +++ b/app/views/managements/evaluate_simple.html.erb @@ -0,0 +1,76 @@ +<% if false %> + +
+
+

耗时详情

+ +
+
+
    +
  1. 总耗时:<%= @consume_time %>
  2. +
  3. 作品更新:<%= @student_work %>
  4. +
  5. 文件更新:<%= @file_update %>
  6. +
  7. 中间层总耗时:<%= @brige %>
  8. +
  9. pull代码:<%= @git_pull %>
  10. +
  11. pod启动:<%= @create_pod %>
  12. +
  13. pod执行:<%= @pod_execute %>
  14. +
  15. 中间层回传:<%= @return_back %>--(中间层出结果传Educoder)
  16. +
  17. 前端轮询:<%= @front_js %>--(局部数据查询,Js轮询)
  18. +
  19. 回调结果存储:<%= @test_cases %>
  20. +
+
+
+<% end %> + +<% if @recodes.present? %> +
+ + + + + + + + + + + + + + + + + + + + <% @recodes.each_with_index do |record, index| %> + + + + + + + + + + + + + + + <% end %> + +
序号总耗时作品更新文件更新中间层总耗时pull代码pod启动pod执行中间层回传前端轮询回调结果存储实训详情
<%= index %><%= record.consume_time %><%= record.student_work %><%= record.file_update %><%= record.brige %><%= record.git_pull %><%= record.create_pod %><%= record.pod_execute %><%= record.return_back %><%= record.front_js %><%= record.test_cases %><%= link_to record.game.try(:identifier), task_path(record.game), :target => "_blank" %>
+
+
+
    + <%= pagination_links_full @record_pages, @recodes_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true %> +
+
+
+
+ +
+<% end %> diff --git a/config/routes.rb b/config/routes.rb index 082a1d99..92a7ce31 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -523,6 +523,7 @@ RedmineApp::Application.routes.draw do ## oauth相关 resources :managements do collection do + get 'evaluate_simple' get 'hidden_course' match 'training_2018',:via=>[:get,:post] get 'update_pay_status'