diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 744dd683..f0a9bc48 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -877,6 +877,16 @@ class ShixunsController < ApplicationController ShixunTagRepertoire.create!(:tag_repertoire_id => str.tag_repertoire_id, :shixun_id => new_shixun.id) end + # 同步配置 + @shixun.shixun_service_configs.each do |config| + ShixunServiceConfig.create!(:shixun_id => new_shixun.id, + :cpu_limit => config.cpu_limit, + :lower_cpu_limit => config.lower_cpu_limit, + :memory_limit => config.memory_limit, + :request_limit => config.request_limit, + :mirror_repository_id => config.mirror_repository_id) + end + # 同步复制版本库,先fork再修改版本库名 # eduforge用户作为版本库的创建者 repository = Repository.new diff --git a/app/views/shixuns/_settings_edit.html.erb b/app/views/shixuns/_settings_edit.html.erb index 6e6fff64..5001bd6c 100644 --- a/app/views/shixuns/_settings_edit.html.erb +++ b/app/views/shixuns/_settings_edit.html.erb @@ -294,7 +294,7 @@ <% end %> - <% if User.current.admin? || User.cuurent.business? %> + <% if User.current.admin? || User.current.business? %>

服务配置

<% @shixun.shixun_service_configs.each do |config| %>