Updated.
This commit is contained in:
parent
e0b71cec6d
commit
ace95e8b72
|
@ -7,6 +7,7 @@ en:
|
||||||
upload_cert: Upload Cert
|
upload_cert: Upload Cert
|
||||||
cert_management: Cert Management
|
cert_management: Cert Management
|
||||||
client_management:
|
client_management:
|
||||||
|
get_template: "Get Template"
|
||||||
finished_reload_page: "Finished!\\nReload Page!"
|
finished_reload_page: "Finished!\\nReload Page!"
|
||||||
apply_change: "Apply Change"
|
apply_change: "Apply Change"
|
||||||
are_you_sure_to_delete: "Are you sure to delete?"
|
are_you_sure_to_delete: "Are you sure to delete?"
|
||||||
|
|
|
@ -7,6 +7,7 @@ zh_tw:
|
||||||
upload_cert: 上傳憑證
|
upload_cert: 上傳憑證
|
||||||
cert_management: 憑證管理
|
cert_management: 憑證管理
|
||||||
client_management:
|
client_management:
|
||||||
|
get_template: "獲取版型"
|
||||||
finished_reload_page: "已完成!\\n重新載入頁面!"
|
finished_reload_page: "已完成!\\n重新載入頁面!"
|
||||||
apply_change: "設定生效"
|
apply_change: "設定生效"
|
||||||
are_you_sure_to_delete: "您確定要刪除嗎?"
|
are_you_sure_to_delete: "您確定要刪除嗎?"
|
||||||
|
|
|
@ -35,7 +35,9 @@ namespace :exec_commands do
|
||||||
@command_trans = {}
|
@command_trans = {}
|
||||||
@command_relations = {"upgrade_site"=>'git fetch origin && rails runner "a=Admin::SitesController.new;a.git_reset(%w(origin)[0],%w(update)[0]);while(1) do (Multithread.where(key: %w(update_manager)[0],status: %w(finish)[0]).count!=0 ? break : nil) end;sleep(5)"',
|
@command_relations = {"upgrade_site"=>'git fetch origin && rails runner "a=Admin::SitesController.new;a.git_reset(%w(origin)[0],%w(update)[0]);while(1) do (Multithread.where(key: %w(update_manager)[0],status: %w(finish)[0]).count!=0 ? break : nil) end;sleep(5)"',
|
||||||
"bundle_update"=>"bundle update && kill -s USR2 `cat tmp/pids/unicorn.pid`",
|
"bundle_update"=>"bundle update && kill -s USR2 `cat tmp/pids/unicorn.pid`",
|
||||||
"restart_site"=>"kill -s TERM `fuser tmp/pids/unicorn.sock tmp/sockets/unicorn.sock tmp/unicorn.sock`;bundle exec unicorn_rails -c config/unicorn.rb -D -E {{rails_env}}"}
|
"restart_site"=>"kill -s TERM `fuser tmp/pids/unicorn.sock tmp/sockets/unicorn.sock tmp/unicorn.sock`;bundle exec unicorn_rails -c config/unicorn.rb -D -E {{rails_env}}",
|
||||||
|
"get_template"=>"mongo --eval 'db.sites.find().pretty()[0][\"template\"]' {{db_name}} --quiet"}
|
||||||
|
@preserve_output = ["get_template"]
|
||||||
@command_relations.each do |k,v|
|
@command_relations.each do |k,v|
|
||||||
@command_trans[k] = I18n.t("client_management.#{k}")
|
@command_trans[k] = I18n.t("client_management.#{k}")
|
||||||
end
|
end
|
||||||
|
@ -137,8 +139,12 @@ namespace :exec_commands do
|
||||||
update_flag = 1
|
update_flag = 1
|
||||||
@command_relations.each do |k,v|
|
@command_relations.each do |k,v|
|
||||||
if command.include?("{{#{k}}}")
|
if command.include?("{{#{k}}}")
|
||||||
|
if @preserve_output.include?(k)
|
||||||
|
update_flag = 1
|
||||||
|
else
|
||||||
update_flag = 2 #Not logging commands result
|
update_flag = 2 #Not logging commands result
|
||||||
end
|
end
|
||||||
|
end
|
||||||
command = command.gsub("{{#{k}}}",v)
|
command = command.gsub("{{#{k}}}",v)
|
||||||
@command_i18n = @command_i18n.gsub("{{#{k}}}",@command_trans[k])
|
@command_i18n = @command_i18n.gsub("{{#{k}}}",@command_trans[k])
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue