fix bug
This commit is contained in:
parent
ad3118ec45
commit
197d34a19b
|
@ -37,7 +37,7 @@ class Admin::SitePanelController < OrbitAdminController
|
||||||
redirect_to admin_site_panel_server_manager_path
|
redirect_to admin_site_panel_server_manager_path
|
||||||
elsif params[:type] == 'detect_sites'
|
elsif params[:type] == 'detect_sites'
|
||||||
Thread.new do
|
Thread.new do
|
||||||
system("rake create_site:detect_sites")
|
system("bundle exec rake create_site:detect_sites")
|
||||||
end
|
end
|
||||||
render :json => {"success"=>true}
|
render :json => {"success"=>true}
|
||||||
elsif params[:type] == 'see_infos'
|
elsif params[:type] == 'see_infos'
|
||||||
|
@ -85,11 +85,11 @@ class Admin::SitePanelController < OrbitAdminController
|
||||||
site_construct_id = site_construct.id.to_s
|
site_construct_id = site_construct.id.to_s
|
||||||
if params[:site_construct][:copy_id].blank?
|
if params[:site_construct][:copy_id].blank?
|
||||||
Thread.new do
|
Thread.new do
|
||||||
system("rake create_site:create_site['#{git_template_url}','#{git_extension_url}','#{git_url}','#{ip}','#{user}','#{password}','#{site_name}','#{domain_name}','#{port}','#{db_name}','#{path}','#{site_construct_id}']")
|
system("bundle exec rake create_site:create_site['#{git_template_url}','#{git_extension_url}','#{git_url}','#{ip}','#{user}','#{password}','#{site_name}','#{domain_name}','#{port}','#{db_name}','#{path}','#{site_construct_id}']")
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
Thread.new do
|
Thread.new do
|
||||||
system("rake create_site:copy_site['#{ip}','#{user}','#{password}','#{site_name}','#{domain_name}','#{port}','#{db_name}','#{path}','#{site_construct_id}','#{params[:site_construct][:copy_id]}']")
|
system("bundle exec rake create_site:copy_site['#{ip}','#{user}','#{password}','#{site_name}','#{domain_name}','#{port}','#{db_name}','#{path}','#{site_construct_id}','#{params[:site_construct][:copy_id]}']")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
redirect_to "#{admin_site_panel_sites_list_path}?id=#{site_construct_id}"
|
redirect_to "#{admin_site_panel_sites_list_path}?id=#{site_construct_id}"
|
||||||
|
@ -111,28 +111,28 @@ class Admin::SitePanelController < OrbitAdminController
|
||||||
path = site_construct.path
|
path = site_construct.path
|
||||||
site_construct_id = params[:id]
|
site_construct_id = params[:id]
|
||||||
Thread.new do
|
Thread.new do
|
||||||
system("rake create_site:create_site['#{git_template_url}','#{git_extension_url}','#{git_url}','#{ip}','#{user}','#{password}','#{site_name}','#{domain_name}','#{port}','#{db_name}','#{path}','#{site_construct_id}']")
|
system("bundle exec rake create_site:create_site['#{git_template_url}','#{git_extension_url}','#{git_url}','#{ip}','#{user}','#{password}','#{site_name}','#{domain_name}','#{port}','#{db_name}','#{path}','#{site_construct_id}']")
|
||||||
end
|
end
|
||||||
render :json =>{"success"=>true}
|
render :json =>{"success"=>true}
|
||||||
end
|
end
|
||||||
def edit_site
|
def edit_site
|
||||||
if params[:type] == 'delete'
|
if params[:type] == 'delete'
|
||||||
Thread.new do
|
Thread.new do
|
||||||
system("rake create_site:delete_site[#{params[:id]}]")
|
system("bundle exec rake create_site:delete_site[#{params[:id]}]")
|
||||||
end
|
end
|
||||||
elsif params[:type] == 'close'
|
elsif params[:type] == 'close'
|
||||||
Thread.new do
|
Thread.new do
|
||||||
system("rake exec_commands:exec_commands[#{params[:id]},,close_site]")
|
system("bundle exec rake exec_commands:exec_commands[#{params[:id]},,close_site]")
|
||||||
end
|
end
|
||||||
elsif params[:type] == 'open'
|
elsif params[:type] == 'open'
|
||||||
Thread.new do
|
Thread.new do
|
||||||
system("rake exec_commands:exec_commands[#{params[:id]},,open_site]")
|
system("bundle exec rake exec_commands:exec_commands[#{params[:id]},,open_site]")
|
||||||
end
|
end
|
||||||
elsif params[:type] == 'detail'
|
elsif params[:type] == 'detail'
|
||||||
@site = SiteConstruct.find(params[:id])
|
@site = SiteConstruct.find(params[:id])
|
||||||
render 'see_detail_for_created_site' and return
|
render 'see_detail_for_created_site' and return
|
||||||
elsif params[:type] == 'change_server_name'
|
elsif params[:type] == 'change_server_name'
|
||||||
cmd = "rake create_site:change_site_server_name[#{params[:id]},'#{params[:site_construct][:domain_name]}']"
|
cmd = "bundle exec rake create_site:change_site_server_name[#{params[:id]},'#{params[:site_construct][:domain_name]}']"
|
||||||
system(cmd)
|
system(cmd)
|
||||||
redirect_to :back and return
|
redirect_to :back and return
|
||||||
elsif params[:type] == 'delete_from_list'
|
elsif params[:type] == 'delete_from_list'
|
||||||
|
@ -141,9 +141,9 @@ class Admin::SitePanelController < OrbitAdminController
|
||||||
else
|
else
|
||||||
Thread.new do
|
Thread.new do
|
||||||
if params[:id].blank? && !params[:server_names].blank?
|
if params[:id].blank? && !params[:server_names].blank?
|
||||||
system("rake exec_commands:exec_commands[,'#{params[:commands]}',exec_all,'#{params[:server_names].join('////')}']")
|
system("bundle exec rake exec_commands:exec_commands[,'#{params[:commands]}',exec_all,'#{params[:server_names].join('////')}']")
|
||||||
else
|
else
|
||||||
system("rake exec_commands:exec_commands[#{params[:id]},'#{params[:commands]}',exec_commands]")
|
system("bundle exec rake exec_commands:exec_commands[#{params[:id]},'#{params[:commands]}',exec_commands]")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -77,7 +77,7 @@ namespace :create_site do
|
||||||
status = "closed"
|
status = "closed"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
site_constructs = SiteConstruct.where(:server_type => server_type , :domain_name.in => [server_name,*server_name_list]).all
|
site_constructs = SiteConstruct.where(:server_type => server_type , :domain_name.in => [server_name,*server_name_list]).to_a
|
||||||
site_construct = site_constructs[0]
|
site_construct = site_constructs[0]
|
||||||
Array(site_constructs[1..-1]).each do |s|
|
Array(site_constructs[1..-1]).each do |s|
|
||||||
s.destroy
|
s.destroy
|
||||||
|
|
Loading…
Reference in New Issue