|
|
|
@ -1060,6 +1060,7 @@ class ShixunsController < ApplicationController
|
|
|
|
|
mirror_ids = (@shixun.shixun_mirror_repositories.blank? ? [] : @shixun.shixun_mirror_repositories.map(&:id))
|
|
|
|
|
update_miiror_id = []
|
|
|
|
|
@shixun.shixun_mirror_repositories.destroy_all
|
|
|
|
|
|
|
|
|
|
if params[:main_type].present?
|
|
|
|
|
update_miiror_id << params[:main_type].to_i
|
|
|
|
|
ShixunMirrorRepository.create(:shixun_id => @shixun.id, :mirror_repository_id => params[:main_type])
|
|
|
|
@ -1071,21 +1072,18 @@ class ShixunsController < ApplicationController
|
|
|
|
|
ShixunMirrorRepository.create(:shixun_id => @shixun.id, :mirror_repository_id => mirror)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 超级管理员才能保存 中间层服务器pod信息的配置
|
|
|
|
|
if User.current.admin? || User.current.business?
|
|
|
|
|
@shixun.shixun_service_configs.each_with_index do |config, index|
|
|
|
|
|
config.update_attributes(:cpu_limit => params[:cpu_limit][index],
|
|
|
|
|
@shixun.shixun_service_configs.destroy_all
|
|
|
|
|
params[:mirror_id].each_with_index do |mirror_id, index|
|
|
|
|
|
ShixunServiceConfig.create!(:shixun_id => @shixun.id,
|
|
|
|
|
:cpu_limit => params[:cpu_limit][index],
|
|
|
|
|
:lower_cpu_limit => params[:lower_cpu_limit][index],
|
|
|
|
|
:memory_limit => params[:memory_limit][index],
|
|
|
|
|
# :resource_limit => params[:resource_limit][index],
|
|
|
|
|
:request_limit => params[:request_limit][index],
|
|
|
|
|
:mirror_repository_id => params[:mirror_id][index])
|
|
|
|
|
end
|
|
|
|
|
:mirror_repository_id => mirror_id)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
|
begin
|
|
|
|
|
@shixun.save!
|
|
|
|
|