diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 483a4ff3..5382a025 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -346,19 +346,19 @@ class ManagementsController < ApplicationController if mirror.blank? raise("choose_update_mirror exception") end - shixun_tomcat = Redmine::Configuration['shixun_tomcat'] - params = {imageName: mirror.name, imageID: old_id, flag: flag} - uri = "#{shixun_tomcat}/bridge/docker/updateImage" - res = uri_exec uri, params - if (res && res['code'] != 0) - raise("choose_update_mirror exception") - end + #shixun_tomcat = Redmine::Configuration['shixun_tomcat'] + #params = {imageName: mirror.name, imageID: old_id, flag: flag} + #uri = "#{shixun_tomcat}/bridge/docker/updateImage" + #res = uri_exec uri, params + # if (res && res['code'] != 0) + #raise("choose_update_mirror exception") + #end if flag == 0 - mirror.update_attributes(:mirrorID => change_id, :status => 0) + mirror.update_attributes(:mirrorID => change_id, :status => 1) # 用户操作的的行为需要记录 user_id, 中间层操作的行为user_id = -1 MirrorOperationRecord.create!(:mirror_repository_id => mirror.id, :mirror_id => change_id, :mirror_name => mirror.name, :status => 1, :user_id => User.current.id, :old_tag => old_id, :new_tag => change_id) else - mirror.update_attribute(:status, 0) + mirror.update_attribute(:status, 1) end respond_to do |format| format.js{ redirect_to mirror_repository_managements_path(:reaction => "choose_update_mirror")} @@ -720,20 +720,25 @@ class ManagementsController < ApplicationController shixun_tomcat = Redmine::Configuration['shixun_tomcat'] params = {imageName: @mirror.name} # 主从节点同步镜像 - uri = "#{shixun_tomcat}/bridge/docker/syncImage" - res = uri_exec uri, params - if (res && res['code'] != 0) - raise("Synchronize Mirror exception") - end + #uri = "#{shixun_tomcat}/bridge/docker/syncImage" + #res = uri_exec uri, params + #if (res && res['code'] != 0) + # raise("Synchronize Mirror exception") + #end end if @_params[:type_name] != @mirror.type_name - MirrorOperationRecord.create!(:mirror_repository_id => @mirror.id, :status => 5, :user_id => User.current.id, :old_tag => @mirror.type_name, :new_tag => @_params[:type_name]) + MirrorOperationRecord.create!(:mirror_repository_id => @mirror.id, :status => 5, + :user_id => User.current.id, :old_tag => @mirror.type_name, + :new_tag => @_params[:type_name]) elsif @_params[:status].to_i != @mirror.status - MirrorOperationRecord.create!(:mirror_repository_id => @mirror.id, :status => 6, :user_id => User.current.id, :old_tag => @mirror.status, :new_tag => @_params[:status]) + MirrorOperationRecord.create!(:mirror_repository_id => @mirror.id, :status => 6, + :user_id => User.current.id, :old_tag => @mirror.status, + :new_tag => @_params[:status]) end - @mirror.update_attributes(:description => @_params[:description], :status => @_params[:status], :main_type => @_params[:mirror_type], - :type_name => @_params[:type_name], :resource_limit => @_params[:mirror_resource_limit], :cpu_limit => @_params[:mirror_cpu_limit], - :memory_limit => @_params[:mirror_memory_limit], :time_limit => @_params[:mirror_time_limit]) + @mirror.update_attributes(:description => @_params[:description], :status => @_params[:status], + :main_type => @_params[:mirror_type], :type_name => @_params[:type_name], + :resource_limit => @_params[:mirror_resource_limit], :cpu_limit => @_params[:mirror_cpu_limit], + :memory_limit => @_params[:mirror_memory_limit], :time_limit => @_params[:mirror_time_limit]) @index = MirrorRepository.order("created_at desc").map(&:id).index(@mirror.id) respond_to do |format| format.js diff --git a/app/views/trainings/trainingsInfo.html.erb b/app/views/trainings/trainingsInfo.html.erb index 3ec764ca..4233f05f 100644 --- a/app/views/trainings/trainingsInfo.html.erb +++ b/app/views/trainings/trainingsInfo.html.erb @@ -51,6 +51,7 @@ <%= link_to('修改资料', enroll_training_path(id: @friendly_id, disable_redirect: true), class: 'info_updateBtn') %> <% if @training.training_payinfo.blank? || @training.training_payinfo.not_payed? %> +
温馨提示:支持现场缴费