From bf8e88c39396931b0c2cc9cfc012403ecde67ea6 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 2 Jul 2019 15:28:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=82=E6=95=B0=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 65d671856..3a4592b2f 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -405,11 +405,7 @@ class ShixunsController < ApplicationController # 超级管理员和运营人员才能保存 中间层服务器pod信息的配置 if current_user.admin? || current_user.business? @shixun.shixun_service_configs.destroy_all - ActionController::Parameters.permit_all_parameters = true - logger.info("##--;;;;---#{params[:shixun_service_configs]}") - params[:shixun_service_configs].each do |config| - @shixun.shixun_service_configs.create!(config) - end + @shixun.shixun_service_configs.create!(service_config_params[:shixun_service_configs]) end rescue Exception => e uid_logger_error(e.message) @@ -745,6 +741,11 @@ private params.require(:shixun_info).permit(:description, :evaluate_script) end + + def service_config_params + params.permit(shixun_service_configs: [:cpu_limit, :lower_cpu_limit, :memory_limit, :request_limit, :mirror_repository_id]) + end + def find_shixun @shixun = Shixun.find_by_identifier(params[:identifier]) if @shixun.blank?