+<% content_for :right_nav do %>
+ <% if !search_dom_id.nil?%>
+ <% if quick_new %>
+ <%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add), request.original_fullpath + '/new', class: "btn btn-primary pull-left", style: "clear: left;"%>
+ <% end %>
+
style="clear: left;"<% end %>>
+ <% end %>
+ <% fields.keys.each do |field| %>
+ <% org_field = field %>
+ <% field = field.to_s.split(".").last %>
-
-
- -
-
+ <% end %>
-
-
-
+<% end %>
\ No newline at end of file
diff --git a/app/views/admin/site_panel/sites_list.html.erb b/app/views/admin/site_panel/sites_list.html.erb
index 2afd32a..46112c2 100644
--- a/app/views/admin/site_panel/sites_list.html.erb
+++ b/app/views/admin/site_panel/sites_list.html.erb
@@ -19,7 +19,7 @@
<% end %>
-<%= render :partial => "sites_list_filter" %>
+<%= render :partial => "sites_list_filter", :locals =>{:fields => @filter_fields, :search_dom_id=>"index_table", :quick_new=>false} %>
<%=render :partial=>'sites_list_table',:locals=>{:@sites=>@sites}%>
\ No newline at end of file
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 6af4856..1eed249 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1,5 +1,13 @@
en:
+ module_name:
+ client_management: Client Management
+ restful_actions:
+ server_manager: Server Manager
+ site_list: Site List
client_management:
+ development: Development
+ production: Production
+ site_mode: Site mode
only_copy_installed_module: Only copy installed modules
copy_source: Copy Source
see_sites: See sites on the server
diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml
index 7ac4b6f..5059ea1 100644
--- a/config/locales/zh_tw.yml
+++ b/config/locales/zh_tw.yml
@@ -1,5 +1,13 @@
zh_tw:
+ module_name:
+ client_management: 網站管理系統
+ restful_actions:
+ server_manager: 伺服器管理
+ site_list: 網站列表
client_management:
+ development: 開發者模式
+ production: 產品模式
+ site_mode: 網站模式
only_copy_installed_module: 只複製安裝的模組
copy_source: 複製來源
see_sites: 查看主機上的網站
diff --git a/lib/tasks/detect_sites.rake b/lib/tasks/detect_sites.rake
index 89da80e..c694d5e 100644
--- a/lib/tasks/detect_sites.rake
+++ b/lib/tasks/detect_sites.rake
@@ -89,6 +89,20 @@ namespace :create_site do
else
site_construct.update(:server_type=>server_type,:site_name=>site_name,:domain_name=>server_name,:nginx_file=>nginx_file,:db_name=>db_name,:port=>port,:path=>path,:site_type=>site_type,:school_name=>school_name,:user_id=>User.first.id,:status=>status,:cert_ver_added_text=>cert_ver_added_text)
end
+ default_rails_env = 'development'
+ enable_rails_env = ['development','production']
+ rails_env = default_rails_env
+ cmd_output = exec_ssh_command_by_sudo_and_see_output(ssh,"ps -o args= -p `cat #{site_construct.path}/#{site_construct.site_name}/tmp/pids/unicorn.pid`",false) rescue []
+ enable_rails_env.each do |env|
+ if( cmd_output[0].include?(env) rescue false)
+ rails_env = env
+ break
+ elsif( cmd_output[0].include?("No such file or directory") rescue false)
+ site_construct.update(:status => "closed")
+ break
+ end
+ end
+ site_construct.update(:rails_env => rails_env)
end
end
end
diff --git a/lib/tasks/exec_command.rake b/lib/tasks/exec_command.rake
index 482cad5..a086845 100644
--- a/lib/tasks/exec_command.rake
+++ b/lib/tasks/exec_command.rake
@@ -47,10 +47,13 @@ namespace :exec_commands do
default_rails_env = 'development'
enable_rails_env = ['development','production']
rails_env = default_rails_env
- log_files = exec_ssh_command_by_sudo_and_see_output(ssh,"ls -t '#{@site_construct.path}/#{@site_construct.site_name}/log'",false).flat_map{|output| output.split(/(\r\n|\t|\n|\s+)/)}.select{|output| output.present? && /(\r\n|\t|\n|\s+)/.match(output).nil?} rescue []
- log_files.each do |log_file|
- if( enable_rails_env.include?(log_file.sub('.log','')) rescue false)
- rails_env = log_file.sub('.log','')
+ cmd_output = exec_ssh_command_by_sudo_and_see_output(ssh,"ps -o args= -p `cat #{@site_construct.path}/#{@site_construct.site_name}/tmp/pids/unicorn.pid`",false) rescue []
+ enable_rails_env.each do |env|
+ if( cmd_output[0].include?(env) rescue false)
+ rails_env = env
+ break
+ elsif( cmd_output[0].include?("No such file or directory") rescue false)
+ site_construct.update(:status => "closed")
break
end
end