From f539ed26bcf602d1943ac844bce7133fa4eabe39 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 19 Jul 2019 18:33:22 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...626064125_create_shixun_service_configs.rb | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/db/migrate/20190626064125_create_shixun_service_configs.rb b/db/migrate/20190626064125_create_shixun_service_configs.rb index a15a30f6..bb4a150c 100644 --- a/db/migrate/20190626064125_create_shixun_service_configs.rb +++ b/db/migrate/20190626064125_create_shixun_service_configs.rb @@ -1,14 +1,14 @@ class CreateShixunServiceConfigs < ActiveRecord::Migration def change - create_table :shixun_service_configs do |t| - t.references :shixun - t.integer :cpu_limit, :default => 1 - t.integer :memory_limit, :default => 1024 - t.integer :request_limit, :default => 10 - t.float :lower_cpu_limit, :default => 0.1 - t.integer :resource_limit, :default => 10000 - t.references :mirror_repository - t.timestamps - end + # create_table :shixun_service_configs do |t| + # t.references :shixun + # t.integer :cpu_limit, :default => 1 + # t.integer :memory_limit, :default => 1024 + # t.integer :request_limit, :default => 10 + # t.float :lower_cpu_limit, :default => 0.1 + # t.integer :resource_limit, :default => 10000 + # t.references :mirror_repository + # t.timestamps + # end end end From 291c33df66df37bb897dea2cedb6bd82a57f63e6 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 19 Jul 2019 18:34:55 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190626070641_add_limit_for_shixuns.rb | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/db/migrate/20190626070641_add_limit_for_shixuns.rb b/db/migrate/20190626070641_add_limit_for_shixuns.rb index e403c061..e8ba1679 100644 --- a/db/migrate/20190626070641_add_limit_for_shixuns.rb +++ b/db/migrate/20190626070641_add_limit_for_shixuns.rb @@ -1,19 +1,19 @@ class AddLimitForShixuns < ActiveRecord::Migration def up - if !Challenge.first.has_attribute?(:exec_time) - add_column :challenges, :exec_time, :integer, :default => 120 - end - Shixun.find_each do |shixun| - shixun.challenges.update_all(:exec_time => shixun.exec_time) - shixun.mirror_repositories.each do |mirror| - ShixunServiceConfig.create!(:shixun_id => shixun.id, - :cpu_limit => mirror.cpu_limit, - :memory_limit => mirror.memory_limit, - :request_limit => mirror.memory_limit / 3, - :mirror_repository_id => mirror.id) - end - end - + # if !Challenge.first.has_attribute?(:exec_time) + # add_column :challenges, :exec_time, :integer, :default => 120 + # end + # Shixun.find_each do |shixun| + # shixun.challenges.update_all(:exec_time => shixun.exec_time) + # shixun.mirror_repositories.each do |mirror| + # ShixunServiceConfig.create!(:shixun_id => shixun.id, + # :cpu_limit => mirror.cpu_limit, + # :memory_limit => mirror.memory_limit, + # :request_limit => mirror.memory_limit / 3, + # :mirror_repository_id => mirror.id) + # end + # end + # end From 4fd18b50ed64ea56972719472d31896291bc8128 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 19 Jul 2019 18:36:20 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...fy_request_limit_for_shixun_service_config.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/db/migrate/20190626161150_modify_request_limit_for_shixun_service_config.rb b/db/migrate/20190626161150_modify_request_limit_for_shixun_service_config.rb index 060cad94..3cab9b73 100644 --- a/db/migrate/20190626161150_modify_request_limit_for_shixun_service_config.rb +++ b/db/migrate/20190626161150_modify_request_limit_for_shixun_service_config.rb @@ -1,13 +1,13 @@ class ModifyRequestLimitForShixunServiceConfig < ActiveRecord::Migration def up - ShixunServiceConfig.find_each do |config| - # repertoire_id = 5 代表的是大数据的镜像 - if config.mirror_repository.repertoire_id != 5 - config.update_column(:request_limit, 10) - else - puts("####---#{config.mirror_repository.name}") - end - end + # ShixunServiceConfig.find_each do |config| + # # repertoire_id = 5 代表的是大数据的镜像 + # if config.mirror_repository.repertoire_id != 5 + # config.update_column(:request_limit, 10) + # else + # puts("####---#{config.mirror_repository.name}") + # end + # end end def down From 7766f7bfecd902ab43834078908663616af78dfe Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 19 Jul 2019 18:37:43 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20190716073605_create_user_agents.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/db/migrate/20190716073605_create_user_agents.rb b/db/migrate/20190716073605_create_user_agents.rb index 22bc181e..1b2e6844 100644 --- a/db/migrate/20190716073605_create_user_agents.rb +++ b/db/migrate/20190716073605_create_user_agents.rb @@ -1,12 +1,12 @@ class CreateUserAgents < ActiveRecord::Migration def change - create_table :user_agents do |t| - t.string :type - t.string :key - t.string :ip - - t.timestamps - end - add_index(:user_agents, :ip, :unique => true) + # create_table :user_agents do |t| + # t.string :type + # t.string :key + # t.string :ip + # + # t.timestamps + # end + # add_index(:user_agents, :ip, :unique => true) end end From d5513dff4f95a1030242a3c3be3f63fbf943306a Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 19 Jul 2019 18:38:22 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20190718005920_modify_type_for_user_agents.rb | 2 +- db/migrate/20190719062616_add_ip_for_user_actions.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/db/migrate/20190718005920_modify_type_for_user_agents.rb b/db/migrate/20190718005920_modify_type_for_user_agents.rb index 72d4f99b..4d9587ec 100644 --- a/db/migrate/20190718005920_modify_type_for_user_agents.rb +++ b/db/migrate/20190718005920_modify_type_for_user_agents.rb @@ -1,6 +1,6 @@ class ModifyTypeForUserAgents < ActiveRecord::Migration def up - rename_column :user_agents, :type, :agent_type + # rename_column :user_agents, :type, :agent_type end def down diff --git a/db/migrate/20190719062616_add_ip_for_user_actions.rb b/db/migrate/20190719062616_add_ip_for_user_actions.rb index d1297176..59b41dee 100644 --- a/db/migrate/20190719062616_add_ip_for_user_actions.rb +++ b/db/migrate/20190719062616_add_ip_for_user_actions.rb @@ -1,8 +1,8 @@ class AddIpForUserActions < ActiveRecord::Migration def up - add_column :user_actions, :ip, :string - - UserAgent.where("agent_type is null").update_all(:agent_type => 1) + # add_column :user_actions, :ip, :string + # + # UserAgent.where("agent_type is null").update_all(:agent_type => 1) end def down From be800816238fb764b8d4851a910f818c3db37ec3 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 19 Jul 2019 18:39:17 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20190719062616_add_ip_for_user_actions.rb | 10 ---------- db/migrate/20190719062617_add_ip_for_user_actions.rb | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) delete mode 100644 db/migrate/20190719062616_add_ip_for_user_actions.rb create mode 100644 db/migrate/20190719062617_add_ip_for_user_actions.rb diff --git a/db/migrate/20190719062616_add_ip_for_user_actions.rb b/db/migrate/20190719062616_add_ip_for_user_actions.rb deleted file mode 100644 index 59b41dee..00000000 --- a/db/migrate/20190719062616_add_ip_for_user_actions.rb +++ /dev/null @@ -1,10 +0,0 @@ -class AddIpForUserActions < ActiveRecord::Migration - def up - # add_column :user_actions, :ip, :string - # - # UserAgent.where("agent_type is null").update_all(:agent_type => 1) - end - - def down - end -end diff --git a/db/migrate/20190719062617_add_ip_for_user_actions.rb b/db/migrate/20190719062617_add_ip_for_user_actions.rb new file mode 100644 index 00000000..d1297176 --- /dev/null +++ b/db/migrate/20190719062617_add_ip_for_user_actions.rb @@ -0,0 +1,10 @@ +class AddIpForUserActions < ActiveRecord::Migration + def up + add_column :user_actions, :ip, :string + + UserAgent.where("agent_type is null").update_all(:agent_type => 1) + end + + def down + end +end From 5551a1ae3b74af043fb95b571481b4e537c929ef Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 19 Jul 2019 18:41:09 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...626064125_create_shixun_service_configs.rb | 20 ++++++------- .../20190626070641_add_limit_for_shixuns.rb | 28 +++++++++---------- ...request_limit_for_shixun_service_config.rb | 16 +++++------ .../20190716073605_create_user_agents.rb | 16 +++++------ ...90718005920_modify_type_for_user_agents.rb | 2 +- ...20190719062616_add_ip_for_user_actions.rb} | 0 6 files changed, 41 insertions(+), 41 deletions(-) rename db/migrate/{20190719062617_add_ip_for_user_actions.rb => 20190719062616_add_ip_for_user_actions.rb} (100%) diff --git a/db/migrate/20190626064125_create_shixun_service_configs.rb b/db/migrate/20190626064125_create_shixun_service_configs.rb index bb4a150c..a15a30f6 100644 --- a/db/migrate/20190626064125_create_shixun_service_configs.rb +++ b/db/migrate/20190626064125_create_shixun_service_configs.rb @@ -1,14 +1,14 @@ class CreateShixunServiceConfigs < ActiveRecord::Migration def change - # create_table :shixun_service_configs do |t| - # t.references :shixun - # t.integer :cpu_limit, :default => 1 - # t.integer :memory_limit, :default => 1024 - # t.integer :request_limit, :default => 10 - # t.float :lower_cpu_limit, :default => 0.1 - # t.integer :resource_limit, :default => 10000 - # t.references :mirror_repository - # t.timestamps - # end + create_table :shixun_service_configs do |t| + t.references :shixun + t.integer :cpu_limit, :default => 1 + t.integer :memory_limit, :default => 1024 + t.integer :request_limit, :default => 10 + t.float :lower_cpu_limit, :default => 0.1 + t.integer :resource_limit, :default => 10000 + t.references :mirror_repository + t.timestamps + end end end diff --git a/db/migrate/20190626070641_add_limit_for_shixuns.rb b/db/migrate/20190626070641_add_limit_for_shixuns.rb index e8ba1679..e403c061 100644 --- a/db/migrate/20190626070641_add_limit_for_shixuns.rb +++ b/db/migrate/20190626070641_add_limit_for_shixuns.rb @@ -1,19 +1,19 @@ class AddLimitForShixuns < ActiveRecord::Migration def up - # if !Challenge.first.has_attribute?(:exec_time) - # add_column :challenges, :exec_time, :integer, :default => 120 - # end - # Shixun.find_each do |shixun| - # shixun.challenges.update_all(:exec_time => shixun.exec_time) - # shixun.mirror_repositories.each do |mirror| - # ShixunServiceConfig.create!(:shixun_id => shixun.id, - # :cpu_limit => mirror.cpu_limit, - # :memory_limit => mirror.memory_limit, - # :request_limit => mirror.memory_limit / 3, - # :mirror_repository_id => mirror.id) - # end - # end - # + if !Challenge.first.has_attribute?(:exec_time) + add_column :challenges, :exec_time, :integer, :default => 120 + end + Shixun.find_each do |shixun| + shixun.challenges.update_all(:exec_time => shixun.exec_time) + shixun.mirror_repositories.each do |mirror| + ShixunServiceConfig.create!(:shixun_id => shixun.id, + :cpu_limit => mirror.cpu_limit, + :memory_limit => mirror.memory_limit, + :request_limit => mirror.memory_limit / 3, + :mirror_repository_id => mirror.id) + end + end + end diff --git a/db/migrate/20190626161150_modify_request_limit_for_shixun_service_config.rb b/db/migrate/20190626161150_modify_request_limit_for_shixun_service_config.rb index 3cab9b73..060cad94 100644 --- a/db/migrate/20190626161150_modify_request_limit_for_shixun_service_config.rb +++ b/db/migrate/20190626161150_modify_request_limit_for_shixun_service_config.rb @@ -1,13 +1,13 @@ class ModifyRequestLimitForShixunServiceConfig < ActiveRecord::Migration def up - # ShixunServiceConfig.find_each do |config| - # # repertoire_id = 5 代表的是大数据的镜像 - # if config.mirror_repository.repertoire_id != 5 - # config.update_column(:request_limit, 10) - # else - # puts("####---#{config.mirror_repository.name}") - # end - # end + ShixunServiceConfig.find_each do |config| + # repertoire_id = 5 代表的是大数据的镜像 + if config.mirror_repository.repertoire_id != 5 + config.update_column(:request_limit, 10) + else + puts("####---#{config.mirror_repository.name}") + end + end end def down diff --git a/db/migrate/20190716073605_create_user_agents.rb b/db/migrate/20190716073605_create_user_agents.rb index 1b2e6844..22bc181e 100644 --- a/db/migrate/20190716073605_create_user_agents.rb +++ b/db/migrate/20190716073605_create_user_agents.rb @@ -1,12 +1,12 @@ class CreateUserAgents < ActiveRecord::Migration def change - # create_table :user_agents do |t| - # t.string :type - # t.string :key - # t.string :ip - # - # t.timestamps - # end - # add_index(:user_agents, :ip, :unique => true) + create_table :user_agents do |t| + t.string :type + t.string :key + t.string :ip + + t.timestamps + end + add_index(:user_agents, :ip, :unique => true) end end diff --git a/db/migrate/20190718005920_modify_type_for_user_agents.rb b/db/migrate/20190718005920_modify_type_for_user_agents.rb index 4d9587ec..72d4f99b 100644 --- a/db/migrate/20190718005920_modify_type_for_user_agents.rb +++ b/db/migrate/20190718005920_modify_type_for_user_agents.rb @@ -1,6 +1,6 @@ class ModifyTypeForUserAgents < ActiveRecord::Migration def up - # rename_column :user_agents, :type, :agent_type + rename_column :user_agents, :type, :agent_type end def down diff --git a/db/migrate/20190719062617_add_ip_for_user_actions.rb b/db/migrate/20190719062616_add_ip_for_user_actions.rb similarity index 100% rename from db/migrate/20190719062617_add_ip_for_user_actions.rb rename to db/migrate/20190719062616_add_ip_for_user_actions.rb From 4174d2b296d05e402bf1598a2f28278c68e3b2e9 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 20 Jul 2019 18:52:04 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E6=B6=88=E6=81=AF500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/tiding.rb | 2 +- public/update.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/tiding.rb b/app/models/tiding.rb index 177946d8..0cc335a5 100644 --- a/app/models/tiding.rb +++ b/app/models/tiding.rb @@ -254,7 +254,7 @@ class Tiding < ActiveRecord::Base elsif self.tiding_type == "Comment" container.present? ? ("评论了你" + (container.parent.present? ? "的回复:" : "发布的项目issue:") + message_content(container.notes)) : "" else - "更新了Issue:#{container.issue.subject}" + "更新了Issue:#{container.try(:issue).try(:subject)}" end when 'Issue' "指派了Issue给你:" + container.subject diff --git a/public/update.html b/public/update.html index e609e7aa..cdb8533b 100644 --- a/public/update.html +++ b/public/update.html @@ -58,6 +58,6 @@ If you continue to experience problems please contact your Trustie administrator
平台拟于2019年4月27日17:00--18:30进行全面升级,带来不便,敬请谅解!
- + user_tidings.html.erb