Merge branch 'develop' into educoder

dev_bj
cxt 6 years ago
commit 2d8f82e36a

@ -346,19 +346,19 @@ class ManagementsController < ApplicationController
if mirror.blank? if mirror.blank?
raise("choose_update_mirror exception") raise("choose_update_mirror exception")
end end
shixun_tomcat = Redmine::Configuration['shixun_tomcat'] #shixun_tomcat = Redmine::Configuration['shixun_tomcat']
params = {imageName: mirror.name, imageID: old_id, flag: flag} #params = {imageName: mirror.name, imageID: old_id, flag: flag}
uri = "#{shixun_tomcat}/bridge/docker/updateImage" #uri = "#{shixun_tomcat}/bridge/docker/updateImage"
res = uri_exec uri, params #res = uri_exec uri, params
if (res && res['code'] != 0) # if (res && res['code'] != 0)
raise("choose_update_mirror exception") #raise("choose_update_mirror exception")
end #end
if flag == 0 if flag == 0
mirror.update_attributes(:mirrorID => change_id, :status => 0) mirror.update_attributes(:mirrorID => change_id, :status => 1)
# 用户操作的的行为需要记录 user_id 中间层操作的行为user_id = -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) 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 else
mirror.update_attribute(:status, 0) mirror.update_attribute(:status, 1)
end end
respond_to do |format| respond_to do |format|
format.js{ redirect_to mirror_repository_managements_path(:reaction => "choose_update_mirror")} 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'] shixun_tomcat = Redmine::Configuration['shixun_tomcat']
params = {imageName: @mirror.name} params = {imageName: @mirror.name}
# 主从节点同步镜像 # 主从节点同步镜像
uri = "#{shixun_tomcat}/bridge/docker/syncImage" #uri = "#{shixun_tomcat}/bridge/docker/syncImage"
res = uri_exec uri, params #res = uri_exec uri, params
if (res && res['code'] != 0) #if (res && res['code'] != 0)
raise("Synchronize Mirror exception") # raise("Synchronize Mirror exception")
end #end
end end
if @_params[:type_name] != @mirror.type_name 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 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 end
@mirror.update_attributes(:description => @_params[:description], :status => @_params[:status], :main_type => @_params[:mirror_type], @mirror.update_attributes(:description => @_params[:description], :status => @_params[:status],
:type_name => @_params[:type_name], :resource_limit => @_params[:mirror_resource_limit], :cpu_limit => @_params[:mirror_cpu_limit], :main_type => @_params[:mirror_type], :type_name => @_params[:type_name],
:memory_limit => @_params[:mirror_memory_limit], :time_limit => @_params[:mirror_time_limit]) :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) @index = MirrorRepository.order("created_at desc").map(&:id).index(@mirror.id)
respond_to do |format| respond_to do |format|
format.js format.js

@ -51,6 +51,7 @@
<%= link_to('修改资料', enroll_training_path(id: @friendly_id, disable_redirect: true), class: 'info_updateBtn') %> <%= link_to('修改资料', enroll_training_path(id: @friendly_id, disable_redirect: true), class: 'info_updateBtn') %>
<% if @training.training_payinfo.blank? || @training.training_payinfo.not_payed? %> <% if @training.training_payinfo.blank? || @training.training_payinfo.not_payed? %>
<p class="notice_pay">温馨提示:支持现场缴费</p>
<div class="bottomBtn"> <div class="bottomBtn">
<%= link_to '转账支付', pay_training_path(id: @friendly_id, pay_type: 3), class: 'leftbtn' %> <%= link_to '转账支付', pay_training_path(id: @friendly_id, pay_type: 3), class: 'leftbtn' %>
<%= link_to '微信支付', pay_training_path(id: @friendly_id, pay_type: 1), class: 'rightbtn' %> <%= link_to '微信支付', pay_training_path(id: @friendly_id, pay_type: 1), class: 'rightbtn' %>

@ -174,6 +174,7 @@ input[type='text'].right_input{
.showPanel p > span{ .showPanel p > span{
float: right;color: #333; float: right;color: #333;
} }
.bottomBtn{ .bottomBtn{
position: fixed;bottom: 0px;left: 0px;width: 100%;height: 44px;line-height: 44px;font-size: 1.6rem;text-align: center;z-index: 20; position: fixed;bottom: 0px;left: 0px;width: 100%;height: 44px;line-height: 44px;font-size: 1.6rem;text-align: center;z-index: 20;
} }
@ -300,3 +301,11 @@ input[type='text'].right_input{
.Infos_btn a:last-child{ .Infos_btn a:last-child{
background: #4CACFF!important;color: #fff!important; background: #4CACFF!important;color: #fff!important;
} }
.notice_pay{
position: absolute;
bottom: 44px;
padding: 1rem;
box-sizing: border-box;
font-size: 1.4rem;
color: #c6c5c5;
}
Loading…
Cancel
Save