feat: add additional columns to city dashboards
Some checks are pending
Docker / docker (push) Waiting to run
Some checks are pending
Docker / docker (push) Waiting to run
- Add '图像个数' column to show the count of weather arts. - Add '最后更新时间' column to display the last weather fetch time. These additions enhance the information displayed in the Ahoy Dashboard and Cities admin panel, providing more context for each city.
This commit is contained in:
parent
e6550aa86f
commit
9865c18d32
@ -47,6 +47,8 @@ ActiveAdmin.register_page "Ahoy Dashboard" do
|
|||||||
column("访问量") { |city| city.view_count }
|
column("访问量") { |city| city.view_count }
|
||||||
column("状态") { |city| status_tag(city.active? ? "活跃" : "停用") }
|
column("状态") { |city| status_tag(city.active? ? "活跃" : "停用") }
|
||||||
column("所属区域") { |city| city.country.name+"/"+city.country.region.name }
|
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| status_tag(city.active? ? "活跃" : "停用") }
|
||||||
column("操作") { |city|
|
column("操作") { |city|
|
||||||
button_to "停用",
|
button_to "停用",
|
||||||
@ -67,6 +69,8 @@ ActiveAdmin.register_page "Ahoy Dashboard" do
|
|||||||
column("访问量") { |city| city.view_count }
|
column("访问量") { |city| city.view_count }
|
||||||
column("状态") { |city| status_tag(city.active? ? "活跃" : "停用") }
|
column("状态") { |city| status_tag(city.active? ? "活跃" : "停用") }
|
||||||
column("所属区域") { |city| city.country.name+"/"+city.country.region.name }
|
column("所属区域") { |city| city.country.name+"/"+city.country.region.name }
|
||||||
|
column("图像个数") { |city| city.weather_arts.count }
|
||||||
|
column("最后更新时间") { |city| city.last_weather_fetch }
|
||||||
column("操作") { |city|
|
column("操作") { |city|
|
||||||
button_to "激活",
|
button_to "激活",
|
||||||
admin_ahoy_dashboard_toggle_city_status_path(city_id: city.id),
|
admin_ahoy_dashboard_toggle_city_status_path(city_id: city.id),
|
||||||
|
@ -32,6 +32,8 @@ ActiveAdmin.register City do
|
|||||||
column :latitude
|
column :latitude
|
||||||
column :longitude
|
column :longitude
|
||||||
column :active
|
column :active
|
||||||
|
column("图像个数") { |city| city.weather_arts.count }
|
||||||
|
column("最后更新时间") { |city| city.last_weather_fetch }
|
||||||
actions
|
actions
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user