feat: add additional columns to city dashboards
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:
songtianlun 2025-02-07 16:41:23 +08:00
parent e6550aa86f
commit 9865c18d32
2 changed files with 6 additions and 0 deletions

View File

@ -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),

View File

@ -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