This commit is contained in:
BoHung Chiu 2022-07-22 00:10:04 +08:00
parent 4b12eff642
commit ea3117a941
10 changed files with 10 additions and 10 deletions

View File

@ -146,7 +146,7 @@ class Admin::SitePanelController < OrbitAdminController
elsif params[:type] == 'detect_sites' elsif params[:type] == 'detect_sites'
extra_text = "" extra_text = ""
if params[:key].present? if params[:key].present?
extra_text = "[#{params[:key].gsub(/[\(\)\[\]]/){|ff| "\\"+ff }}]" extra_text = "['#{params[:key].gsub(/[\(\)\[\]]/){|ff| "\\"+ff }}']"
end end
Thread.new do Thread.new do
system("bundle exec rake create_site:detect_sites#{extra_text}") system("bundle exec rake create_site:detect_sites#{extra_text}")

View File

@ -155,7 +155,7 @@ namespace :create_site do
if output.include?("sudo:") && output.include?("command not found") if output.include?("sudo:") && output.include?("command not found")
output = session.exec!(command) output = session.exec!(command)
end end
return output return output.encode!("UTF-8", :invalid => :replace, :undef => :replace, :replace => '')
end end
def auto_update_infos(info) def auto_update_infos(info)
if @is_multithread if @is_multithread

View File

@ -46,6 +46,6 @@ namespace :create_site do
if output.include?("sudo:") && output.include?("command not found") if output.include?("sudo:") && output.include?("command not found")
output = session.exec!(command) output = session.exec!(command)
end end
return output return output.encode!("UTF-8", :invalid => :replace, :undef => :replace, :replace => '')
end end
end end

View File

@ -136,7 +136,7 @@ namespace :create_site do
if output.include?("sudo:") && output.include?("command not found") if output.include?("sudo:") && output.include?("command not found")
output = session.exec!(command) output = session.exec!(command)
end end
return output return output.encode!("UTF-8", :invalid => :replace, :undef => :replace, :replace => '')
end end
def update_thread_infos_for_exec(info,update_last=false) def update_thread_infos_for_exec(info,update_last=false)
if update_last if update_last

View File

@ -88,7 +88,7 @@ namespace :create_site do
if output.include?("sudo:") && output.include?("command not found") if output.include?("sudo:") && output.include?("command not found")
output = session.exec!(command) output = session.exec!(command)
end end
return output return output.encode!("UTF-8", :invalid => :replace, :undef => :replace, :replace => '')
end end
def update_thread_infos_for_exec(info,update_last=false) def update_thread_infos_for_exec(info,update_last=false)
if update_last if update_last

View File

@ -32,7 +32,7 @@ namespace :create_site do
if output.include?("sudo:") && output.include?("command not found") if output.include?("sudo:") && output.include?("command not found")
output = session.exec!(command) output = session.exec!(command)
end end
return output return output.encode!("UTF-8", :invalid => :replace, :undef => :replace, :replace => '')
end end
def update_infos(info) def update_infos(info)
puts info puts info

View File

@ -171,7 +171,7 @@ namespace :create_site do
if output.include?("sudo:") && output.include?("command not found") if output.include?("sudo:") && output.include?("command not found")
output = session.exec!(command) output = session.exec!(command)
end end
return output return output.encode!("UTF-8", :invalid => :replace, :undef => :replace, :replace => '')
end end
def update_thread_infos(info) def update_thread_infos(info)
puts info puts info

View File

@ -154,7 +154,7 @@ namespace :exec_commands do
if output.include?("sudo:") && output.include?("command not found") if output.include?("sudo:") && output.include?("command not found")
output = session.exec!(command) output = session.exec!(command)
end end
return output return output.encode!("UTF-8", :invalid => :replace, :undef => :replace, :replace => '')
end end
def update_infos_for_exec(info,update_last=false,update_array=false) def update_infos_for_exec(info,update_last=false,update_array=false)
return if @site_construct.nil? return if @site_construct.nil?

View File

@ -37,7 +37,7 @@ namespace :create_site do
if output.include?("sudo:") && output.include?("command not found") if output.include?("sudo:") && output.include?("command not found")
output = session.exec!(command) output = session.exec!(command)
end end
return output return output.encode!("UTF-8", :invalid => :replace, :undef => :replace, :replace => '')
end end
def update_thread_infos(info) def update_thread_infos(info)
puts info puts info

View File

@ -57,7 +57,7 @@ namespace :create_site do
if output.include?("sudo:") && output.include?("command not found") if output.include?("sudo:") && output.include?("command not found")
output = session.exec!(command) output = session.exec!(command)
end end
return output return output.encode!("UTF-8", :invalid => :replace, :undef => :replace, :replace => '')
end end
def update_thread_infos(info) def update_thread_infos(info)
puts info puts info