diff --git a/app/admin/ahoy_dashboard.rb b/app/admin/ahoy_dashboard.rb index 71044e4..bb3242f 100644 --- a/app/admin/ahoy_dashboard.rb +++ b/app/admin/ahoy_dashboard.rb @@ -47,6 +47,8 @@ ActiveAdmin.register_page "Ahoy Dashboard" do column("访问量") { |city| city.view_count } column("状态") { |city| status_tag(city.active? ? "活跃" : "停用") } column("所属区域") { |city| city.country.name+"/"+city.country.region.name } + column("图像个数") { |city| city.weather_arts.count } + column("最后更新时间") { |city| city.last_weather_fetch } # column("状态") { |city| status_tag(city.active? ? "活跃" : "停用") } column("操作") { |city| button_to "停用", @@ -67,6 +69,8 @@ ActiveAdmin.register_page "Ahoy Dashboard" do column("访问量") { |city| city.view_count } column("状态") { |city| status_tag(city.active? ? "活跃" : "停用") } column("所属区域") { |city| city.country.name+"/"+city.country.region.name } + column("图像个数") { |city| city.weather_arts.count } + column("最后更新时间") { |city| city.last_weather_fetch } column("操作") { |city| button_to "激活", admin_ahoy_dashboard_toggle_city_status_path(city_id: city.id), diff --git a/app/admin/cities.rb b/app/admin/cities.rb index 53895cc..52019b5 100644 --- a/app/admin/cities.rb +++ b/app/admin/cities.rb @@ -32,6 +32,8 @@ ActiveAdmin.register City do column :latitude column :longitude column :active + column("图像个数") { |city| city.weather_arts.count } + column("最后更新时间") { |city| city.last_weather_fetch } actions end