diff --git a/app/controllers/admin/site_panel_controller.rb b/app/controllers/admin/site_panel_controller.rb
index e645d1b..cbc022d 100644
--- a/app/controllers/admin/site_panel_controller.rb
+++ b/app/controllers/admin/site_panel_controller.rb
@@ -174,11 +174,21 @@ class Admin::SitePanelController < OrbitAdminController
def sites_list
@module_app = ModuleApp.where(:title=>@app_title).first
@categories = @module_app.categories
+ @filter_fields = filter_fields(@categories, [])
+ site_modes = ["development","production"]
+ @filter_fields["client_management.site_mode"] = site_modes.map{|mode| {:title=>I18n.t("client_management.#{mode}"), :id=>mode}}
@sites = SiteConstruct.any_in(:hidden=>[false,nil]).desc(:id)
@site_servers = SiteServer.all.with_categories(filters("category"))
@sites = (params[:server_name].blank? ? @sites : @sites.where(:server_type=>params[:server_name]))
@sites = @sites.any_in(:server_type => @site_servers.map{|s| s.server_name})
@sites = search_data(@sites,[:domain_name,:site_name,:school_name,:status]).page(params[:page].to_i).per(10)
+ if (params[:filters][:site_mode].present? rescue false)
+ site_modes = params[:filters][:site_mode]
+ if site_modes.include?("development")
+ site_modes << nil
+ end
+ @sites = @sites.where(:rails_env.in=>site_modes,:status=>"finish")
+ end
if request.xhr?
render :partial => "sites_list_table"
end
diff --git a/app/models/site_construct.rb b/app/models/site_construct.rb
index 82f5d50..ccb1ec3 100644
--- a/app/models/site_construct.rb
+++ b/app/models/site_construct.rb
@@ -5,7 +5,7 @@ class SiteConstruct
SiteServer.all.map{|s| s.server_name}
end
SITE_TYPES = ["School","Gravity"]
-
+ field :rails_env, type: String, :default => "development"
field :server_type
field :site_name
field :domain_name
diff --git a/app/views/admin/site_panel/_server_manager_index.html.erb b/app/views/admin/site_panel/_server_manager_index.html.erb
index 736a045..794775b 100644
--- a/app/views/admin/site_panel/_server_manager_index.html.erb
+++ b/app/views/admin/site_panel/_server_manager_index.html.erb
@@ -15,6 +15,8 @@
Active: <%=SiteConstruct.where(:server_type => site_server.server_name,:status=>"finish").count %>
Closed: <%=SiteConstruct.where(:server_type => site_server.server_name,:status=>"closed").count %>
Not yet installed: <%=SiteConstruct.where(:server_type => site_server.server_name,:status=>"").count %>
+ Production: <%=SiteConstruct.where(:server_type => site_server.server_name,:rails_env=>"production",:status=>"finish").count %>
+ Development: <%=SiteConstruct.where(:server_type => site_server.server_name,:rails_env.in=>["development",nil],:status=>"finish").count %>