Fix bug.
This commit is contained in:
parent
039b3cd591
commit
2779a3bf52
|
@ -2,7 +2,7 @@
|
||||||
class Admin::RegisteredSitesController < OrbitAdminController
|
class Admin::RegisteredSitesController < OrbitAdminController
|
||||||
before_action ->(module_app = @app_title) { set_variables module_app }
|
before_action ->(module_app = @app_title) { set_variables module_app }
|
||||||
def index
|
def index
|
||||||
@registeredsites = RegisteredSite.all.order_by(sort)
|
@registeredsites = RegisteredSite.where(:not_viewed.ne=>true).order_by(sort)
|
||||||
.with_categories(filters("category"))
|
.with_categories(filters("category"))
|
||||||
.with_tags(filters("tag")).desc(:created_at)
|
.with_tags(filters("tag")).desc(:created_at)
|
||||||
@table_fields = table_fields
|
@table_fields = table_fields
|
||||||
|
@ -47,7 +47,7 @@ class Admin::RegisteredSitesController < OrbitAdminController
|
||||||
def get_select_box
|
def get_select_box
|
||||||
tags = @module_app.tags.map{|v| v}
|
tags = @module_app.tags.map{|v| v}
|
||||||
categories = @module_app.categories.enabled.map{|v| v}
|
categories = @module_app.categories.enabled.map{|v| v}
|
||||||
sites = RegisteredSite.all.collect{|v1| [v1,v1.tags,v1.category]}
|
sites = RegisteredSite.where(:not_viewed.ne=>true).collect{|v1| [v1,v1.tags,v1.category]}
|
||||||
@sites_order_by_tags = tags.map{|v| {v=>sites.select{|v1| v1[1].include? v}.map{|v2| v2[0]}}}
|
@sites_order_by_tags = tags.map{|v| {v=>sites.select{|v1| v1[1].include? v}.map{|v2| v2[0]}}}
|
||||||
@sites_order_by_tags << {'no_tag'=>sites.select{|v1| v1[1]== []}.map{|v2| v2[0]}}
|
@sites_order_by_tags << {'no_tag'=>sites.select{|v1| v1[1]== []}.map{|v2| v2[0]}}
|
||||||
@sites_order_by_cats = categories.map{|v| {v=>sites.select{|v1| v1[2]== v}.map{|v2| v2[0]}}}
|
@sites_order_by_cats = categories.map{|v| {v=>sites.select{|v1| v1[2]== v}.map{|v2| v2[0]}}}
|
||||||
|
@ -160,10 +160,10 @@ class Admin::RegisteredSitesController < OrbitAdminController
|
||||||
tp.status = 'running'
|
tp.status = 'running'
|
||||||
tp.save
|
tp.save
|
||||||
Thread.new do
|
Thread.new do
|
||||||
count = RegisteredSite.where(:is_hidden.ne=>true).count
|
count = RegisteredSite.where(:is_hidden.ne=>true, :not_viewed.ne=>true).count
|
||||||
batch_l = (count/50.0).ceil
|
batch_l = (count/50.0).ceil
|
||||||
(1..batch_l).each do |v|
|
(1..batch_l).each do |v|
|
||||||
sites = RegisteredSite.where(:is_hidden.ne=>true).sort_by{|v| v.id}[(v-1)*50..(v*50)]
|
sites = RegisteredSite.where(:is_hidden.ne=>true, :not_viewed.ne=>true).sort_by{|v| v.id}[(v-1)*50..(v*50)]
|
||||||
sites.each do |site|
|
sites.each do |site|
|
||||||
begin
|
begin
|
||||||
update_status(site)
|
update_status(site)
|
||||||
|
@ -442,7 +442,7 @@ class Admin::RegisteredSitesController < OrbitAdminController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
def bundle_update_remote_show
|
def bundle_update_remote_show
|
||||||
@registeredsites = RegisteredSite.all.order_by(sort)
|
@registeredsites = RegisteredSite.where(:not_viewed.ne=>true).order_by(sort)
|
||||||
.with_categories(filters("category"))
|
.with_categories(filters("category"))
|
||||||
.with_tags(filters("tag")).desc(:created_at)
|
.with_tags(filters("tag")).desc(:created_at)
|
||||||
@table_fields = table_fields_for_bundle_update
|
@table_fields = table_fields_for_bundle_update
|
||||||
|
@ -504,7 +504,7 @@ class Admin::RegisteredSitesController < OrbitAdminController
|
||||||
end
|
end
|
||||||
@table_fields = table_fields
|
@table_fields = table_fields
|
||||||
|
|
||||||
@registeredsites = RegisteredSite.all.order_by(sort)
|
@registeredsites = RegisteredSite.where(:not_viewed.ne=>true).order_by(sort)
|
||||||
.with_categories(filters("category"))
|
.with_categories(filters("category"))
|
||||||
.with_tags(filters("tag")).desc(:created_at)
|
.with_tags(filters("tag")).desc(:created_at)
|
||||||
@registeredsites = search_data(@registeredsites,[:title,:site_domain]).page(params[:page]).per(10)
|
@registeredsites = search_data(@registeredsites,[:title,:site_domain]).page(params[:page]).per(10)
|
||||||
|
|
|
@ -14,6 +14,7 @@ class RegisteredSite
|
||||||
field :site_confirmed, type: Boolean, :default => false
|
field :site_confirmed, type: Boolean, :default => false
|
||||||
field :confirmation_token
|
field :confirmation_token
|
||||||
field :is_hidden,type: Boolean,:default => false
|
field :is_hidden,type: Boolean,:default => false
|
||||||
|
field :not_viewed,type: Boolean,:default => false
|
||||||
has_many :bundle_update_logs
|
has_many :bundle_update_logs
|
||||||
has_many :site_logs
|
has_many :site_logs
|
||||||
has_many :installed_modules
|
has_many :installed_modules
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% @registeredsites.each_with_index do |site,index1| %>
|
<% @registeredsites.each_with_index do |site,index1| %>
|
||||||
<% status = site.is_hidden == true ? 'is_hidden' : site.bundle_update_logs.first.status
|
<% status = site.is_hidden == true ? 'is_hidden' : site.bundle_update_logs.first.status rescue ''
|
||||||
if status == 'failed'
|
if status == 'failed'
|
||||||
status = 'error'
|
status = 'error'
|
||||||
elsif status == 'finish'
|
elsif status == 'finish'
|
||||||
|
|
Loading…
Reference in New Issue