Compare commits
1 Commits
fdbde69445
...
51f0491110
Author | SHA1 | Date | |
---|---|---|---|
|
51f0491110 |
2
.gitignore
vendored
2
.gitignore
vendored
@ -38,5 +38,3 @@
|
|||||||
|
|
||||||
/node_modules
|
/node_modules
|
||||||
.idea
|
.idea
|
||||||
|
|
||||||
public/sitemap.xml.gz
|
|
||||||
|
@ -75,7 +75,7 @@ COPY --from=build /rails /rails
|
|||||||
# Run and own only the runtime files as a non-root user for security
|
# Run and own only the runtime files as a non-root user for security
|
||||||
RUN groupadd --system --gid 1000 rails && \
|
RUN groupadd --system --gid 1000 rails && \
|
||||||
useradd rails --uid 1000 --gid 1000 --create-home --shell /bin/bash && \
|
useradd rails --uid 1000 --gid 1000 --create-home --shell /bin/bash && \
|
||||||
chown -R rails:rails db log storage tmp public
|
chown -R rails:rails db log storage tmp
|
||||||
USER 1000:1000
|
USER 1000:1000
|
||||||
|
|
||||||
# Entrypoint prepares the database.
|
# Entrypoint prepares the database.
|
||||||
|
7
Gemfile
7
Gemfile
@ -45,12 +45,7 @@ gem "devise", "~> 4.9"
|
|||||||
gem "activeadmin", "~> 3.2"
|
gem "activeadmin", "~> 3.2"
|
||||||
gem "friendly_id", "~> 5.5"
|
gem "friendly_id", "~> 5.5"
|
||||||
|
|
||||||
gem "kaminari", "~> 1.2"
|
gem 'kaminari', '~> 1.2'
|
||||||
|
|
||||||
gem "meta-tags", "~> 2.22"
|
|
||||||
gem "sitemap_generator", "~> 6.3"
|
|
||||||
|
|
||||||
gem "ahoy_matey", "~> 5.2"
|
|
||||||
|
|
||||||
# gem "whenever", "~> 1.0"
|
# gem "whenever", "~> 1.0"
|
||||||
gem "ruby-openai", "~> 7.3"
|
gem "ruby-openai", "~> 7.3"
|
||||||
|
15
Gemfile.lock
15
Gemfile.lock
@ -84,17 +84,13 @@ GEM
|
|||||||
uri (>= 0.13.1)
|
uri (>= 0.13.1)
|
||||||
addressable (2.8.7)
|
addressable (2.8.7)
|
||||||
public_suffix (>= 2.0.2, < 7.0)
|
public_suffix (>= 2.0.2, < 7.0)
|
||||||
ahoy_matey (5.2.1)
|
|
||||||
activesupport (>= 6.1)
|
|
||||||
device_detector (>= 1)
|
|
||||||
safely_block (>= 0.4)
|
|
||||||
arbre (1.7.0)
|
arbre (1.7.0)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
ruby2_keywords (>= 0.0.2)
|
ruby2_keywords (>= 0.0.2)
|
||||||
ast (2.4.2)
|
ast (2.4.2)
|
||||||
aws-eventstream (1.3.0)
|
aws-eventstream (1.3.0)
|
||||||
aws-partitions (1.1042.0)
|
aws-partitions (1.1042.0)
|
||||||
aws-sdk-core (3.217.0)
|
aws-sdk-core (3.216.1)
|
||||||
aws-eventstream (~> 1, >= 1.3.0)
|
aws-eventstream (~> 1, >= 1.3.0)
|
||||||
aws-partitions (~> 1, >= 1.992.0)
|
aws-partitions (~> 1, >= 1.992.0)
|
||||||
aws-sigv4 (~> 1.9)
|
aws-sigv4 (~> 1.9)
|
||||||
@ -140,7 +136,6 @@ GEM
|
|||||||
debug (1.10.0)
|
debug (1.10.0)
|
||||||
irb (~> 1.10)
|
irb (~> 1.10)
|
||||||
reline (>= 0.3.8)
|
reline (>= 0.3.8)
|
||||||
device_detector (1.1.3)
|
|
||||||
devise (4.9.4)
|
devise (4.9.4)
|
||||||
bcrypt (~> 3.0)
|
bcrypt (~> 3.0)
|
||||||
orm_adapter (~> 0.1)
|
orm_adapter (~> 0.1)
|
||||||
@ -238,8 +233,6 @@ GEM
|
|||||||
net-smtp
|
net-smtp
|
||||||
marcel (1.0.4)
|
marcel (1.0.4)
|
||||||
matrix (0.4.2)
|
matrix (0.4.2)
|
||||||
meta-tags (2.22.1)
|
|
||||||
actionpack (>= 6.0.0, < 8.1)
|
|
||||||
mini_mime (1.1.5)
|
mini_mime (1.1.5)
|
||||||
minitest (5.25.4)
|
minitest (5.25.4)
|
||||||
msgpack (1.7.5)
|
msgpack (1.7.5)
|
||||||
@ -390,7 +383,6 @@ GEM
|
|||||||
rubyzip (2.4.1)
|
rubyzip (2.4.1)
|
||||||
rufus-scheduler (3.9.2)
|
rufus-scheduler (3.9.2)
|
||||||
fugit (~> 1.1, >= 1.11.1)
|
fugit (~> 1.1, >= 1.11.1)
|
||||||
safely_block (0.4.1)
|
|
||||||
securerandom (0.4.1)
|
securerandom (0.4.1)
|
||||||
selenium-webdriver (4.28.0)
|
selenium-webdriver (4.28.0)
|
||||||
base64 (~> 0.2)
|
base64 (~> 0.2)
|
||||||
@ -408,8 +400,6 @@ GEM
|
|||||||
rufus-scheduler (~> 3.2)
|
rufus-scheduler (~> 3.2)
|
||||||
sidekiq (>= 6, < 8)
|
sidekiq (>= 6, < 8)
|
||||||
tilt (>= 1.4.0, < 3)
|
tilt (>= 1.4.0, < 3)
|
||||||
sitemap_generator (6.3.0)
|
|
||||||
builder (~> 3.0)
|
|
||||||
solid_cable (3.0.5)
|
solid_cable (3.0.5)
|
||||||
actioncable (>= 7.2)
|
actioncable (>= 7.2)
|
||||||
activejob (>= 7.2)
|
activejob (>= 7.2)
|
||||||
@ -491,7 +481,6 @@ PLATFORMS
|
|||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
activeadmin (~> 3.2)
|
activeadmin (~> 3.2)
|
||||||
ahoy_matey (~> 5.2)
|
|
||||||
aws-sdk-s3 (~> 1.178)
|
aws-sdk-s3 (~> 1.178)
|
||||||
bootsnap
|
bootsnap
|
||||||
brakeman
|
brakeman
|
||||||
@ -506,7 +495,6 @@ DEPENDENCIES
|
|||||||
jsbundling-rails
|
jsbundling-rails
|
||||||
kamal
|
kamal
|
||||||
kaminari (~> 1.2)
|
kaminari (~> 1.2)
|
||||||
meta-tags (~> 2.22)
|
|
||||||
pg (~> 1.5)
|
pg (~> 1.5)
|
||||||
propshaft
|
propshaft
|
||||||
puma (>= 5.0)
|
puma (>= 5.0)
|
||||||
@ -516,7 +504,6 @@ DEPENDENCIES
|
|||||||
selenium-webdriver
|
selenium-webdriver
|
||||||
sidekiq (~> 7.3)
|
sidekiq (~> 7.3)
|
||||||
sidekiq-scheduler (~> 5.0)
|
sidekiq-scheduler (~> 5.0)
|
||||||
sitemap_generator (~> 6.3)
|
|
||||||
solid_cable
|
solid_cable
|
||||||
solid_cache
|
solid_cache
|
||||||
solid_queue
|
solid_queue
|
||||||
|
@ -1,31 +0,0 @@
|
|||||||
ActiveAdmin.register Ahoy::Event do
|
|
||||||
# See permitted parameters documentation:
|
|
||||||
# https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters
|
|
||||||
#
|
|
||||||
# Uncomment all parameters which should be permitted for assignment
|
|
||||||
#
|
|
||||||
# permit_params :visit_id, :user_id, :name, :properties, :time
|
|
||||||
#
|
|
||||||
# or
|
|
||||||
#
|
|
||||||
# permit_params do
|
|
||||||
# permitted = [:visit_id, :user_id, :name, :properties, :time]
|
|
||||||
# permitted << :other if params[:action] == 'create' && current_user.admin?
|
|
||||||
# permitted
|
|
||||||
# end
|
|
||||||
menu priority: 101, label: "事件统计"
|
|
||||||
|
|
||||||
actions :index
|
|
||||||
|
|
||||||
index do
|
|
||||||
column :id
|
|
||||||
column :name
|
|
||||||
column :time
|
|
||||||
column :properties
|
|
||||||
column :user_id
|
|
||||||
end
|
|
||||||
|
|
||||||
filter :name
|
|
||||||
filter :time
|
|
||||||
filter :properties
|
|
||||||
end
|
|
@ -1,34 +0,0 @@
|
|||||||
# app/admin/ahoy_management.rb
|
|
||||||
ActiveAdmin.register_page "Ahoy Management" do
|
|
||||||
menu label: "访问数据管理", parent: "系统管理"
|
|
||||||
|
|
||||||
content title: "访问数据管理" do
|
|
||||||
columns do
|
|
||||||
column do
|
|
||||||
panel "数据统计" do
|
|
||||||
attributes_table_for :ahoy do
|
|
||||||
row("总事件数") { Ahoy::Event.count }
|
|
||||||
row("总访问数") { Ahoy::Visit.count }
|
|
||||||
row("最早事件") { Ahoy::Event.minimum(:time)&.strftime("%Y-%m-%d %H:%M:%S") }
|
|
||||||
row("最早访问") { Ahoy::Visit.minimum(:started_at)&.strftime("%Y-%m-%d %H:%M:%S") }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
column do
|
|
||||||
panel "操作" do
|
|
||||||
div class: "buttons" do
|
|
||||||
button_to "立即清理旧数据", admin_ahoy_management_cleanup_path, method: :post,
|
|
||||||
data: { confirm: "确定要清理3个月前的数据吗?" },
|
|
||||||
class: "button"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
page_action :cleanup, method: :post do
|
|
||||||
CleanAhoyDataWorker.perform_async
|
|
||||||
redirect_to admin_ahoy_management_path, notice: "清理任务已加入队列"
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,35 +0,0 @@
|
|||||||
ActiveAdmin.register Ahoy::Visit do
|
|
||||||
# See permitted parameters documentation:
|
|
||||||
# https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters
|
|
||||||
#
|
|
||||||
# Uncomment all parameters which should be permitted for assignment
|
|
||||||
#
|
|
||||||
# permit_params :visit_token, :visitor_token, :user_id, :ip, :user_agent, :referrer, :referring_domain, :landing_page, :browser, :os, :device_type, :country, :region, :city, :latitude, :longitude, :utm_source, :utm_medium, :utm_term, :utm_content, :utm_campaign, :app_version, :os_version, :platform, :started_at
|
|
||||||
#
|
|
||||||
# or
|
|
||||||
#
|
|
||||||
# permit_params do
|
|
||||||
# permitted = [:visit_token, :visitor_token, :user_id, :ip, :user_agent, :referrer, :referring_domain, :landing_page, :browser, :os, :device_type, :country, :region, :city, :latitude, :longitude, :utm_source, :utm_medium, :utm_term, :utm_content, :utm_campaign, :app_version, :os_version, :platform, :started_at]
|
|
||||||
# permitted << :other if params[:action] == 'create' && current_user.admin?
|
|
||||||
# permitted
|
|
||||||
# end
|
|
||||||
|
|
||||||
menu priority: 100, label: "访问统计"
|
|
||||||
|
|
||||||
actions :index
|
|
||||||
|
|
||||||
index do
|
|
||||||
column :id
|
|
||||||
column :visitor_token
|
|
||||||
column :ip
|
|
||||||
column :user_agent
|
|
||||||
column :started_at
|
|
||||||
column :city
|
|
||||||
column :country
|
|
||||||
column :region
|
|
||||||
end
|
|
||||||
|
|
||||||
filter :started_at
|
|
||||||
filter :city
|
|
||||||
filter :country
|
|
||||||
end
|
|
@ -36,17 +36,18 @@ ActiveAdmin.register City do
|
|||||||
|
|
||||||
filter :name
|
filter :name
|
||||||
filter :active
|
filter :active
|
||||||
filter :country, as: :select
|
|
||||||
|
|
||||||
form do |f|
|
form do |f|
|
||||||
f.inputs do
|
f.inputs do
|
||||||
f.input :active
|
f.input :active
|
||||||
f.input :name
|
f.input :name
|
||||||
f.input :country
|
|
||||||
f.input :latitude
|
f.input :latitude
|
||||||
f.input :longitude
|
f.input :longitude
|
||||||
f.input :priority
|
f.input :priority
|
||||||
f.input :timezone
|
f.input :timezone
|
||||||
|
f.input :region
|
||||||
|
f.input :last_weather_fetch
|
||||||
|
f.input :last_image_generation
|
||||||
end
|
end
|
||||||
f.actions
|
f.actions
|
||||||
end
|
end
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
ActiveAdmin.register Country do
|
ActiveAdmin.register Country do
|
||||||
controller do
|
|
||||||
def find_resource
|
|
||||||
scoped_collection.friendly.find(params[:id])
|
|
||||||
end
|
|
||||||
end
|
|
||||||
# See permitted parameters documentation:
|
# See permitted parameters documentation:
|
||||||
# https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters
|
# https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters
|
||||||
#
|
#
|
||||||
|
@ -11,53 +11,6 @@ ActiveAdmin.register_page "Dashboard" do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
columns do
|
|
||||||
column do
|
|
||||||
panel "访问统计" do
|
|
||||||
para "总访问量: #{Ahoy::Visit.count}"
|
|
||||||
para "总事件数: #{Ahoy::Event.count}"
|
|
||||||
para "独立访客数: #{Ahoy::Visit.distinct.count(:visitor_token)}"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
column do
|
|
||||||
panel "热门城市" do
|
|
||||||
table_for City.by_popularity.limit(10) do
|
|
||||||
column("城市") { |city| link_to(city.name, admin_city_path(city)) }
|
|
||||||
column("访问量") { |city| city.view_count }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
column do
|
|
||||||
panel "热门天气艺术" do
|
|
||||||
table_for WeatherArt.by_popularity.limit(10) do
|
|
||||||
column("作品") { |art| link_to(art.to_s, admin_weather_art_path(art)) }
|
|
||||||
column("访问量") { |art| art.view_count }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
column do
|
|
||||||
panel "冷门活跃城市" do
|
|
||||||
table_for City.least_popular_active.limit(10) do
|
|
||||||
column("城市") { |city| link_to(city.name, admin_city_path(city)) }
|
|
||||||
column("访问量") { |city| city.view_count }
|
|
||||||
# column("状态") { |city| status_tag(city.active? ? "活跃" : "停用") }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# 添加一个事件列表面板
|
|
||||||
panel "最近事件" do
|
|
||||||
table_for Ahoy::Event.order(time: :desc).limit(10) do
|
|
||||||
column :time
|
|
||||||
column :name
|
|
||||||
column :properties
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Here is an example of a simple dashboard with columns and panels.
|
# Here is an example of a simple dashboard with columns and panels.
|
||||||
#
|
#
|
||||||
# columns do
|
# columns do
|
||||||
|
2
app/assets/javascripts/active_admin.js
Normal file
2
app/assets/javascripts/active_admin.js
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
//= require active_admin/base
|
||||||
|
import "@activeadmin/activeadmin";
|
@ -1,24 +0,0 @@
|
|||||||
# app/concerns/seo_concern.rb
|
|
||||||
module SeoConcern
|
|
||||||
extend ActiveSupport::Concern
|
|
||||||
|
|
||||||
included do
|
|
||||||
before_action :prepare_meta_tags
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def prepare_meta_tags
|
|
||||||
set_meta_tags(
|
|
||||||
site: "TodayAIWeather",
|
|
||||||
description: "Discover AI-generated weather art from cities around the world. Real-time weather visualization through artificial intelligence.",
|
|
||||||
keywords: "weather, AI art, weather visualization, city weather, artificial intelligence",
|
|
||||||
og: {
|
|
||||||
title: :title,
|
|
||||||
description: :description,
|
|
||||||
type: "website",
|
|
||||||
url: request.original_url
|
|
||||||
}
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,15 +1,7 @@
|
|||||||
class ApplicationController < ActionController::Base
|
class ApplicationController < ActionController::Base
|
||||||
include SeoConcern
|
|
||||||
# Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has.
|
# Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has.
|
||||||
allow_browser versions: :modern
|
allow_browser versions: :modern
|
||||||
before_action :set_locale
|
before_action :set_locale
|
||||||
after_action :track_action
|
|
||||||
|
|
||||||
protected
|
|
||||||
|
|
||||||
def track_action
|
|
||||||
ahoy.track "Viewed Application", request.path_parameters
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
@ -3,18 +3,18 @@ class ArtsController < ApplicationController
|
|||||||
@regions = Region.all
|
@regions = Region.all
|
||||||
@current_region = Region.find(params[:region]) if params[:region].present?
|
@current_region = Region.find(params[:region]) if params[:region].present?
|
||||||
|
|
||||||
@weather_arts = WeatherArt.includes(city: [ :country, { country: :region } ])
|
@weather_arts = WeatherArt.includes(city: [:country, { country: :region }])
|
||||||
|
|
||||||
if @current_region
|
if @current_region
|
||||||
@weather_arts = @weather_arts.joins(city: :country)
|
@weather_arts = @weather_arts.joins(city: :country)
|
||||||
.where(countries: { region_id: @current_region.id })
|
.where(countries: { region_id: @current_region.id })
|
||||||
end
|
end
|
||||||
|
|
||||||
@weather_arts = if params[:sort] == "oldest"
|
@weather_arts = if params[:sort] == 'oldest'
|
||||||
@weather_arts.order(created_at: :asc)
|
@weather_arts.order(created_at: :asc)
|
||||||
else
|
else
|
||||||
@weather_arts.order(created_at: :desc)
|
@weather_arts.order(created_at: :desc)
|
||||||
end
|
end
|
||||||
|
|
||||||
@weather_arts = @weather_arts.page(params[:page]).per(10)
|
@weather_arts = @weather_arts.page(params[:page]).per(10)
|
||||||
end
|
end
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
class CitiesController < ApplicationController
|
class CitiesController < ApplicationController
|
||||||
def index
|
def index
|
||||||
|
@cities = City.all.order(:name)
|
||||||
@regions = Region.includes(:countries).order(:name)
|
@regions = Region.includes(:countries).order(:name)
|
||||||
@cities = City.includes(:country, country: :region).order(:name)
|
@cities = City.includes(:country, country: :region).active.order(:name)
|
||||||
|
|
||||||
if params[:region]
|
if params[:region]
|
||||||
@current_region = Region.friendly.find(params[:region])
|
@current_region = Region.friendly.find(params[:region])
|
||||||
@ -12,31 +13,9 @@ class CitiesController < ApplicationController
|
|||||||
@current_country = Country.friendly.find(params[:country])
|
@current_country = Country.friendly.find(params[:country])
|
||||||
@cities = @cities.by_country(@current_country.id)
|
@cities = @cities.by_country(@current_country.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
@cities = @cities.page(params[:page]).per(10)
|
|
||||||
|
|
||||||
set_meta_tags(
|
|
||||||
title: @current_region ? "Cities in #{@current_region.name}" : "Explore Cities",
|
|
||||||
description: "Discover weather art for cities #{@current_region ? "in #{@current_region.name}" : 'worldwide'}. Real-time AI-generated weather visualization.",
|
|
||||||
keywords: "#{@current_region&.name}, cities, weather art, AI visualization"
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@city = City.friendly.find(params[:id])
|
@city = City.friendly.find(params[:id])
|
||||||
ahoy.track "View City", {
|
|
||||||
city_id: @city.id,
|
|
||||||
name: @city.name,
|
|
||||||
event_type: "city_view"
|
|
||||||
}
|
|
||||||
|
|
||||||
set_meta_tags(
|
|
||||||
title: @city.name,
|
|
||||||
description: "Experience #{@city.name}'s weather through AI-generated art. Daily updates of weather conditions visualized through artificial intelligence.",
|
|
||||||
keywords: "#{@city.name}, #{@city.country.name}, weather art, AI visualization",
|
|
||||||
og: {
|
|
||||||
image: @city.latest_weather_art&.image&.attached? ? url_for(@city.latest_weather_art.image) : nil
|
|
||||||
}
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -2,10 +2,5 @@ class HomeController < ApplicationController
|
|||||||
def index
|
def index
|
||||||
@latest_arts = WeatherArt.includes(:city).order(created_at: :desc).limit(6)
|
@latest_arts = WeatherArt.includes(:city).order(created_at: :desc).limit(6)
|
||||||
@featured_arts = WeatherArt.includes(:city).order(created_at: :desc).limit(5)
|
@featured_arts = WeatherArt.includes(:city).order(created_at: :desc).limit(5)
|
||||||
set_meta_tags(
|
|
||||||
title: "AI-Generated Weather Art",
|
|
||||||
description: "Experience weather through artistic AI visualization. Daily updated weather art for cities worldwide.",
|
|
||||||
keywords: "AI weather art, weather visualization, city weather, artificial intelligence"
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,33 +0,0 @@
|
|||||||
class SitemapsController < ApplicationController
|
|
||||||
def show
|
|
||||||
path = params[:path]
|
|
||||||
bucket_name =
|
|
||||||
Rails.env.production? ?
|
|
||||||
ENV.fetch("AWS_BUCKET", Rails.application.credentials.dig(:aws, :bucket)) :
|
|
||||||
ENV.fetch("AWS_DEV_BUCKET", Rails.application.credentials.dig(:aws_dev, :bucket))
|
|
||||||
Rails.logger.info "Sitemap: #{path}"
|
|
||||||
|
|
||||||
begin
|
|
||||||
s3_client = Aws::S3::Client.new
|
|
||||||
response = s3_client.get_object(
|
|
||||||
bucket: bucket_name,
|
|
||||||
key: "sitemaps/#{path}"
|
|
||||||
)
|
|
||||||
|
|
||||||
expires_in 12.hours, public: true
|
|
||||||
content_type = response.content_type || "application/xml"
|
|
||||||
|
|
||||||
send_data(
|
|
||||||
response.body.read,
|
|
||||||
filename: path,
|
|
||||||
type: content_type,
|
|
||||||
disposition: "inline"
|
|
||||||
)
|
|
||||||
rescue Aws::S3::Errors::NoSuchKey
|
|
||||||
render status: :not_found
|
|
||||||
rescue Aws::S3::Errors::ServiceError => e
|
|
||||||
Rails.logger.error "S3 Error: #{e.message}"
|
|
||||||
render status: :internal_server_error
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -2,25 +2,5 @@ class WeatherArtsController < ApplicationController
|
|||||||
def show
|
def show
|
||||||
@city = City.friendly.find(params[:city_id])
|
@city = City.friendly.find(params[:city_id])
|
||||||
@weather_art = @city.weather_arts.friendly.find(params[:slug])
|
@weather_art = @city.weather_arts.friendly.find(params[:slug])
|
||||||
|
|
||||||
ahoy.track "View Weather Art", {
|
|
||||||
weather_art_id: @weather_art.id,
|
|
||||||
city_id: @weather_art.city_id,
|
|
||||||
event_type: "weather_art_view"
|
|
||||||
}
|
|
||||||
ahoy.track "View City", {
|
|
||||||
city_id: @city.id,
|
|
||||||
name: @city.name,
|
|
||||||
event_type: "city_view"
|
|
||||||
}
|
|
||||||
|
|
||||||
set_meta_tags(
|
|
||||||
title: "#{@city.name} Weather Art - #{@weather_art.weather_date.strftime('%B %d, %Y')}",
|
|
||||||
description: "#{@city.name}'s weather visualized through AI art. #{@weather_art.description} at #{@weather_art.temperature}°C.",
|
|
||||||
keywords: "#{@city.name}, weather art, #{@weather_art.description}, AI visualization",
|
|
||||||
og: {
|
|
||||||
image: @weather_art.image.attached? ? url_for(@weather_art.image) : nil
|
|
||||||
}
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,24 +1,2 @@
|
|||||||
module ApplicationHelper
|
module ApplicationHelper
|
||||||
def weather_art_schema(weather_art)
|
|
||||||
{
|
|
||||||
"@context": "https://schema.org",
|
|
||||||
"@type": "ImageObject",
|
|
||||||
"name": "#{weather_art.city.name} Weather Art",
|
|
||||||
"description": weather_art.description,
|
|
||||||
"datePublished": weather_art.created_at.iso8601,
|
|
||||||
"contentUrl": url_for(weather_art.image),
|
|
||||||
"author": {
|
|
||||||
"@type": "Organization",
|
|
||||||
"name": "TodayAIWeather"
|
|
||||||
},
|
|
||||||
"locationCreated": {
|
|
||||||
"@type": "Place",
|
|
||||||
"name": weather_art.city.name,
|
|
||||||
"address": {
|
|
||||||
"@type": "PostalAddress",
|
|
||||||
"addressCountry": weather_art.city.country.name
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.to_json.html_safe if weather_art.image.attached?
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
module SitemapsHelper
|
|
||||||
end
|
|
@ -1,51 +1,2 @@
|
|||||||
module WeatherArtsHelper
|
module WeatherArtsHelper
|
||||||
def weather_description_icon(description)
|
|
||||||
case description&.downcase
|
|
||||||
when /rain/
|
|
||||||
'<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 14l-7 7m0 0l-7-7m7 7V3" />
|
|
||||||
</svg>'.html_safe
|
|
||||||
when /cloud/
|
|
||||||
'<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z" />
|
|
||||||
</svg>'.html_safe
|
|
||||||
when /sun|clear/
|
|
||||||
'<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z" />
|
|
||||||
</svg>'.html_safe
|
|
||||||
else
|
|
||||||
'<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
|
|
||||||
</svg>'.html_safe
|
|
||||||
end
|
|
||||||
end
|
|
||||||
def weather_stat_icon(type)
|
|
||||||
case type
|
|
||||||
when "temperature"
|
|
||||||
'<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z" />
|
|
||||||
</svg>'.html_safe
|
|
||||||
when "wind"
|
|
||||||
'<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 5l7 7m0 0l-7 7m7-7H3" />
|
|
||||||
</svg>'.html_safe
|
|
||||||
when "humidity"
|
|
||||||
'<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z" />
|
|
||||||
</svg>'.html_safe
|
|
||||||
when "visibility"
|
|
||||||
'<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
|
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />
|
|
||||||
</svg>'.html_safe
|
|
||||||
when "pressure"
|
|
||||||
'<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 8v8m-4-5v5m-4-2v2m-2 4h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" />
|
|
||||||
</svg>'.html_safe
|
|
||||||
when "cloud"
|
|
||||||
'<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z" />
|
|
||||||
</svg>'.html_safe
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
|
|
||||||
import './add_jquery'
|
|
||||||
import "jquery/dist/jquery"
|
|
||||||
import "jquery-ui/dist/jquery-ui"
|
|
||||||
import "jquery-ujs"
|
|
||||||
import "@activeadmin/activeadmin"
|
|
@ -1,4 +0,0 @@
|
|||||||
import jquery from 'jquery'
|
|
||||||
import $ from 'jquery'
|
|
||||||
window.jQuery = jquery
|
|
||||||
window.$ = $
|
|
@ -6,4 +6,3 @@ import "@fontsource/raleway/400.css";
|
|||||||
import "@fontsource/raleway/600.css";
|
import "@fontsource/raleway/600.css";
|
||||||
|
|
||||||
import "./controllers"
|
import "./controllers"
|
||||||
import "./active_admin"
|
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
class Ahoy::Event < ApplicationRecord
|
|
||||||
# include Ahoy::QueryMethods
|
|
||||||
|
|
||||||
self.table_name = "ahoy_events"
|
|
||||||
|
|
||||||
belongs_to :visit
|
|
||||||
belongs_to :user, optional: true
|
|
||||||
|
|
||||||
serialize :properties, coder: JSON
|
|
||||||
|
|
||||||
def self.ransackable_attributes(auth_object = nil)
|
|
||||||
[ "id", "id_value", "name", "properties", "time", "user_id", "visit_id" ]
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,10 +0,0 @@
|
|||||||
class Ahoy::Visit < ApplicationRecord
|
|
||||||
self.table_name = "ahoy_visits"
|
|
||||||
|
|
||||||
has_many :events, class_name: "Ahoy::Event"
|
|
||||||
belongs_to :user, optional: true
|
|
||||||
|
|
||||||
def self.ransackable_attributes(auth_object = nil)
|
|
||||||
[ "app_version", "browser", "city", "country", "device_type", "id", "ip", "landing_page", "latitude", "longitude", "os", "os_version", "platform", "referrer", "referring_domain", "region", "started_at", "user_agent", "user_id", "utm_campaign", "utm_content", "utm_medium", "utm_source", "utm_term", "visit_token", "visitor_token" ]
|
|
||||||
end
|
|
||||||
end
|
|
@ -5,9 +5,6 @@ class City < ApplicationRecord
|
|||||||
|
|
||||||
has_many :weather_arts, dependent: :destroy
|
has_many :weather_arts, dependent: :destroy
|
||||||
|
|
||||||
has_many :visits, class_name: "Ahoy::Visit", foreign_key: :city_id
|
|
||||||
has_many :events, class_name: "Ahoy::Event", foreign_key: :city_id
|
|
||||||
|
|
||||||
delegate :region, to: :country
|
delegate :region, to: :country
|
||||||
|
|
||||||
validates :name, presence: true
|
validates :name, presence: true
|
||||||
@ -20,41 +17,6 @@ class City < ApplicationRecord
|
|||||||
scope :by_country, ->(country_id) { where(country_id: country_id) }
|
scope :by_country, ->(country_id) { where(country_id: country_id) }
|
||||||
scope :active, -> { where(active: true) }
|
scope :active, -> { where(active: true) }
|
||||||
|
|
||||||
|
|
||||||
scope :by_popularity, -> {
|
|
||||||
if ActiveRecord::Base.connection.adapter_name.downcase == "sqlite"
|
|
||||||
joins("LEFT JOIN ahoy_events ON json_extract(ahoy_events.properties, '$.city_id') = cities.id
|
|
||||||
AND json_extract(ahoy_events.properties, '$.event_type') = 'city_view'")
|
|
||||||
.group("cities.id")
|
|
||||||
.select("cities.*, COUNT(ahoy_events.id) as visit_count")
|
|
||||||
.order("visit_count DESC")
|
|
||||||
else
|
|
||||||
joins("LEFT JOIN ahoy_events ON (ahoy_events.properties->>'city_id')::integer = cities.id
|
|
||||||
AND ahoy_events.properties->>'event_type' = 'city_view'")
|
|
||||||
.group("cities.id")
|
|
||||||
.select("cities.*, COUNT(ahoy_events.id) as visit_count")
|
|
||||||
.order("visit_count DESC")
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
scope :least_popular_active, -> {
|
|
||||||
if ActiveRecord::Base.connection.adapter_name.downcase == "sqlite"
|
|
||||||
active
|
|
||||||
.joins("LEFT JOIN ahoy_events ON json_extract(ahoy_events.properties, '$.city_id') = cities.id
|
|
||||||
AND json_extract(ahoy_events.properties, '$.event_type') = 'city_view'")
|
|
||||||
.group("cities.id")
|
|
||||||
.select("cities.*, COUNT(ahoy_events.id) as visit_count")
|
|
||||||
.order("visit_count ASC, cities.name ASC")
|
|
||||||
else
|
|
||||||
active
|
|
||||||
.joins("LEFT JOIN ahoy_events ON (ahoy_events.properties->>'city_id')::integer = cities.id
|
|
||||||
AND ahoy_events.properties->>'event_type' = 'city_view'")
|
|
||||||
.group("cities.id")
|
|
||||||
.select("cities.*, COUNT(ahoy_events.id) as visit_count")
|
|
||||||
.order("visit_count ASC, cities.name ASC")
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
def to_s
|
def to_s
|
||||||
name
|
name
|
||||||
end
|
end
|
||||||
@ -83,32 +45,10 @@ class City < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.ransackable_attributes(auth_object = nil)
|
def self.ransackable_attributes(auth_object = nil)
|
||||||
[ "active", "country_id", "created_at", "id", "id_value", "last_image_generation", "last_weather_fetch", "latitude", "longitude", "name", "priority", "region", "slug", "timezone", "updated_at" ]
|
[ "active", "country", "created_at", "id", "id_value", "last_image_generation", "last_weather_fetch", "latitude", "longitude", "name", "priority", "region", "slug", "timezone", "updated_at" ]
|
||||||
end
|
|
||||||
|
|
||||||
def last_weather_fetch
|
|
||||||
# latest_weather_art&.created_at
|
|
||||||
Rails.cache.fetch("city/#{id}/last_weather_fetch", expires_in: 1.hour) do
|
|
||||||
latest_weather_art&.created_at
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def last_image_generation
|
|
||||||
# latest_weather_art&.image&.created_at
|
|
||||||
Rails.cache.fetch("city/#{id}/last_image_generation", expires_in: 1.hour) do
|
|
||||||
latest_weather_art&.image&.created_at
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def latest_weather_art
|
def latest_weather_art
|
||||||
weather_arts.order(weather_date: :desc).first
|
weather_arts.order(weather_date: :desc).first
|
||||||
end
|
end
|
||||||
|
|
||||||
def view_count
|
|
||||||
if ActiveRecord::Base.connection.adapter_name.downcase == "sqlite"
|
|
||||||
Ahoy::Event.where("json_extract(properties, '$.event_type') = 'city_view' AND json_extract(properties, '$.city_id') = ?", self.id).count
|
|
||||||
else
|
|
||||||
Ahoy::Event.where("properties->>'event_type' = 'city_view' AND (properties->>'city_id')::integer = ?", self.id).count
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
@ -5,28 +5,9 @@ class WeatherArt < ApplicationRecord
|
|||||||
belongs_to :city
|
belongs_to :city
|
||||||
has_one_attached :image
|
has_one_attached :image
|
||||||
|
|
||||||
has_many :visits, class_name: "Ahoy::Visit", foreign_key: :weather_art_id
|
|
||||||
has_many :events, class_name: "Ahoy::Event", foreign_key: :weather_art_id
|
|
||||||
|
|
||||||
validates :weather_date, presence: true
|
validates :weather_date, presence: true
|
||||||
validates :city_id, presence: true
|
validates :city_id, presence: true
|
||||||
|
|
||||||
scope :by_popularity, -> {
|
|
||||||
if ActiveRecord::Base.connection.adapter_name.downcase == "sqlite"
|
|
||||||
joins("LEFT JOIN ahoy_events ON json_extract(ahoy_events.properties, '$.weather_art_id') = weather_arts.id
|
|
||||||
AND json_extract(ahoy_events.properties, '$.event_type') = 'weather_art_view'")
|
|
||||||
.group("weather_arts.id")
|
|
||||||
.select("weather_arts.*, COUNT(ahoy_events.id) as visit_count")
|
|
||||||
.order("visit_count DESC")
|
|
||||||
else
|
|
||||||
joins("LEFT JOIN ahoy_events ON (ahoy_events.properties->>'weather_art_id')::integer = weather_arts.id
|
|
||||||
AND ahoy_events.properties->>'event_type' = 'weather_art_view'")
|
|
||||||
.group("weather_arts.id")
|
|
||||||
.select("weather_arts.*, COUNT(ahoy_events.id) as visit_count")
|
|
||||||
.order("visit_count DESC")
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
def should_generate_new_friendly_id?
|
def should_generate_new_friendly_id?
|
||||||
weather_date_changed? || city_id_changed? || super
|
weather_date_changed? || city_id_changed? || super
|
||||||
end
|
end
|
||||||
@ -42,12 +23,4 @@ class WeatherArt < ApplicationRecord
|
|||||||
def self.ransackable_attributes(auth_object = nil)
|
def self.ransackable_attributes(auth_object = nil)
|
||||||
[ "city_id", "cloud", "created_at", "description", "feeling_temp", "humidity", "id", "id_value", "precipitation", "pressure", "prompt", "temperature", "updated_at", "visibility", "weather_date", "wind_scale", "wind_speed" ]
|
[ "city_id", "cloud", "created_at", "description", "feeling_temp", "humidity", "id", "id_value", "precipitation", "pressure", "prompt", "temperature", "updated_at", "visibility", "weather_date", "wind_scale", "wind_speed" ]
|
||||||
end
|
end
|
||||||
|
|
||||||
def view_count
|
|
||||||
if ActiveRecord::Base.connection.adapter_name.downcase == "sqlite"
|
|
||||||
Ahoy::Event.where("json_extract(properties, '$.event_type') = 'weather_art_view' AND json_extract(properties, '$.weather_art_id') = ?", self.id).count
|
|
||||||
else
|
|
||||||
Ahoy::Event.where("properties->>'event_type' = 'weather_art_view' AND (properties->>'weather_art_id')::integer = ?", self.id).count
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
@ -101,72 +101,87 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container mx-auto px-4 pb-16">
|
<!-- 图片网格 -->
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6">
|
<div class="container mx-auto px-4 pb-16">
|
||||||
<% @weather_arts.each do |art| %>
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6">
|
||||||
<div class="card bg-base-100 shadow-xl hover:shadow-2xl transition-all duration-300 group overflow-hidden">
|
<% @weather_arts.each do |art| %>
|
||||||
<figure class="relative aspect-square overflow-hidden">
|
<div class="card bg-base-100 shadow-xl hover:shadow-2xl transition-all duration-300 group overflow-hidden">
|
||||||
<% if art.image.attached? %>
|
<!-- 图片部分 -->
|
||||||
<%= image_tag art.image,
|
<figure class="relative aspect-square overflow-hidden">
|
||||||
class: "w-full h-full object-cover transform group-hover:scale-105 transition-transform duration-500" %>
|
<% if art.image.attached? %>
|
||||||
|
<%= image_tag art.image,
|
||||||
|
class: "w-full h-full object-cover transform group-hover:scale-105 transition-transform duration-500" %>
|
||||||
|
|
||||||
<div class="absolute inset-0 bg-gradient-to-t from-black via-black/50 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300"></div>
|
<!-- 渐变遮罩 -->
|
||||||
|
<div class="absolute inset-0 bg-gradient-to-t from-black via-black/50 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300"></div>
|
||||||
|
|
||||||
<div class="absolute inset-0 p-6 flex flex-col justify-end translate-y-4 opacity-0 group-hover:translate-y-0 group-hover:opacity-100 transition-all duration-300">
|
<!-- 悬停信息 -->
|
||||||
<div class="text-white space-y-2">
|
<div class="absolute inset-0 p-6 flex flex-col justify-end translate-y-4 opacity-0 group-hover:translate-y-0 group-hover:opacity-100 transition-all duration-300">
|
||||||
<h3 class="text-xl font-display font-bold">
|
<div class="text-white space-y-2">
|
||||||
<%= art.city.name %>
|
<h3 class="text-xl font-display font-bold">
|
||||||
</h3>
|
|
||||||
<p class="text-sm text-white/80">
|
|
||||||
<%= art.city.country.name %>
|
|
||||||
</p>
|
|
||||||
<div class="flex items-center gap-2 text-white/90">
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z" />
|
|
||||||
</svg>
|
|
||||||
<%= art.description %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
</figure>
|
|
||||||
|
|
||||||
<!-- 信息部分 -->
|
|
||||||
<div class="card-body p-4">
|
|
||||||
<div class="flex justify-between items-start mb-3">
|
|
||||||
<div>
|
|
||||||
<h3 class="font-display font-bold leading-tight">
|
|
||||||
<%= art.city.name %>
|
<%= art.city.name %>
|
||||||
</h3>
|
</h3>
|
||||||
<p class="text-sm text-base-content/70">
|
<p class="text-sm text-white/80">
|
||||||
<%= art.weather_date.strftime("%B %d, %Y") %>
|
<%= art.city.country.name %>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
<div class="flex items-center gap-2 text-white/90">
|
||||||
<div class="text-right">
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||||
<div class="text-2xl font-bold text-primary">
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z" />
|
||||||
<%= art.temperature %>°C
|
</svg>
|
||||||
</div>
|
<%= art.description %>
|
||||||
<div class="text-sm text-base-content/70">
|
|
||||||
<%= art.humidity %>% humidity
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</figure>
|
||||||
|
|
||||||
<%= link_to city_weather_art_path(art.city, art),
|
<!-- 信息部分 -->
|
||||||
class: "btn btn-primary btn-sm w-full" do %>
|
<div class="card-body p-4">
|
||||||
View Details
|
<div class="flex justify-between items-start mb-3">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
<div>
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 5l7 7m0 0l-7 7m7-7H3" />
|
<h3 class="font-display font-bold leading-tight">
|
||||||
</svg>
|
<%= art.city.name %>
|
||||||
<% end %>
|
</h3>
|
||||||
|
<p class="text-sm text-base-content/70">
|
||||||
|
<%= art.weather_date.strftime("%B %d, %Y") %>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="text-right">
|
||||||
|
<div class="text-2xl font-bold text-primary">
|
||||||
|
<%= art.temperature %>°C
|
||||||
|
</div>
|
||||||
|
<div class="text-sm text-base-content/70">
|
||||||
|
<%= art.humidity %>% humidity
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<%= render 'shared/pagination',
|
<%= link_to city_weather_art_path(art.city, art),
|
||||||
collection: @weather_arts,
|
class: "btn btn-primary btn-sm w-full" do %>
|
||||||
collection_name: 'weather arts' %>
|
View Details
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 5l7 7m0 0l-7 7m7-7H3" />
|
||||||
|
</svg>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 分页 -->
|
||||||
|
<% if @weather_arts.total_pages > 1 %>
|
||||||
|
<div class="flex justify-center mt-12">
|
||||||
|
<div class="btn-group">
|
||||||
|
<%= link_to_prev_page @weather_arts, "Previous",
|
||||||
|
class: "btn btn-outline #{'btn-disabled' unless @weather_arts.prev_page}" %>
|
||||||
|
<% @weather_arts.total_pages.times do |i| %>
|
||||||
|
<%= link_to i + 1, arts_path(page: i + 1, region: params[:region], sort: params[:sort]),
|
||||||
|
class: "btn btn-outline #{'btn-active' if @weather_arts.current_page == i + 1}" %>
|
||||||
|
<% end %>
|
||||||
|
<%= link_to_next_page @weather_arts, "Next",
|
||||||
|
class: "btn btn-outline #{'btn-disabled' unless @weather_arts.next_page}" %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
@ -12,6 +12,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
<!-- 标题内容 -->
|
||||||
<div class="relative pt-24 pb-32">
|
<div class="relative pt-24 pb-32">
|
||||||
<div class="container mx-auto px-4">
|
<div class="container mx-auto px-4">
|
||||||
<div class="max-w-3xl mx-auto text-center space-y-6">
|
<div class="max-w-3xl mx-auto text-center space-y-6">
|
||||||
@ -37,10 +38,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 筛选导航 - 使用下拉菜单 -->
|
||||||
<div class="sticky top-16 z-20 bg-base-100/95 backdrop-blur-sm border-b border-base-200">
|
<div class="sticky top-16 z-20 bg-base-100/95 backdrop-blur-sm border-b border-base-200">
|
||||||
<div class="container mx-auto px-4">
|
<div class="container mx-auto px-4">
|
||||||
<div class="py-3 flex items-center justify-between gap-4">
|
<div class="py-3 flex items-center justify-between gap-4">
|
||||||
|
<!-- 左侧筛选器 -->
|
||||||
<div class="flex items-center gap-4">
|
<div class="flex items-center gap-4">
|
||||||
|
<!-- 区域选择下拉框 -->
|
||||||
<div class="dropdown">
|
<div class="dropdown">
|
||||||
<button class="btn btn-ghost gap-2">
|
<button class="btn btn-ghost gap-2">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||||
@ -69,6 +73,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 国家选择下拉框 (如果选择了区域) -->
|
||||||
<% if @current_region %>
|
<% if @current_region %>
|
||||||
<div class="dropdown">
|
<div class="dropdown">
|
||||||
<button class="btn btn-ghost gap-2">
|
<button class="btn btn-ghost gap-2">
|
||||||
@ -99,6 +104,7 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 右侧结果统计 -->
|
||||||
<div class="text-sm text-base-content/70">
|
<div class="text-sm text-base-content/70">
|
||||||
<%= @cities.count %> <%= 'city'.pluralize(@cities.count) %>
|
<%= @cities.count %> <%= 'city'.pluralize(@cities.count) %>
|
||||||
<% if @current_country %>
|
<% if @current_country %>
|
||||||
@ -111,16 +117,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 城市网格 -->
|
||||||
<div class="container mx-auto px-4 py-8">
|
<div class="container mx-auto px-4 py-8">
|
||||||
<div class="container mx-auto px-4 pb-16">
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
|
<%= render partial: 'city', collection: @cities %>
|
||||||
<%= render partial: 'city', collection: @cities %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<%= render 'shared/pagination',
|
|
||||||
collection: @cities,
|
|
||||||
collection_name: 'cities' %>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
@ -1,149 +1,91 @@
|
|||||||
<div class="relative min-h-screen bg-base-200">
|
<div class="min-h-screen">
|
||||||
<!-- 背景效果 -->
|
<!-- 城市头部信息 -->
|
||||||
<% if @city.latest_weather_art&.image&.attached? %>
|
<section class="relative h-[40vh] overflow-hidden">
|
||||||
<div class="fixed inset-0 -z-10">
|
<% if @city.latest_weather_art&.image&.attached? %>
|
||||||
<%= image_tag @city.latest_weather_art.image,
|
<%= image_tag @city.latest_weather_art.image,
|
||||||
class: "absolute w-full h-full object-cover scale-110 filter blur-2xl opacity-25" %>
|
class: "w-full h-full object-cover" %>
|
||||||
<div class="absolute inset-0 bg-gradient-to-b from-base-200/90 to-base-200/70 backdrop-blur-md"></div>
|
<div class="absolute inset-0 bg-gradient-to-t from-base-100 via-base-100/50 to-transparent"></div>
|
||||||
</div>
|
<% end %>
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<!-- 主要内容 -->
|
<div class="absolute inset-0 flex items-center">
|
||||||
<div class="relative z-10">
|
<div class="container mx-auto px-4">
|
||||||
<!-- 返回导航 -->
|
<div class="max-w-4xl">
|
||||||
<div class="container mx-auto px-4 py-6">
|
<div class="flex items-center space-x-4 mb-4">
|
||||||
<%= link_to cities_path,
|
<%= link_to cities_path,
|
||||||
class: "btn btn-ghost btn-lg gap-2 bg-base-100/50 backdrop-blur-sm hover:bg-base-100/70 transition-all duration-300" do %>
|
class: "btn btn-ghost btn-circle" do %>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
|
||||||
</svg>
|
</svg>
|
||||||
Back to Cities
|
<% end %>
|
||||||
<% end %>
|
<h1 class="text-4xl md:text-5xl font-display font-bold"><%= @city.localized_name %></h1>
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 城市信息头部 -->
|
|
||||||
<div class="container mx-auto px-4 mb-12">
|
|
||||||
<div class="max-w-4xl mx-auto text-center space-y-6">
|
|
||||||
<h1 class="text-4xl md:text-6xl font-display font-bold">
|
|
||||||
<span class="bg-gradient-to-r from-primary to-secondary bg-clip-text text-transparent">
|
|
||||||
<%= @city.localized_name %>
|
|
||||||
</span>
|
|
||||||
</h1>
|
|
||||||
|
|
||||||
<div class="flex flex-wrap justify-center items-center gap-3">
|
|
||||||
<div class="badge badge-lg badge-primary gap-2">
|
|
||||||
<%= @city.country.name %>, <%= @city.region %>
|
|
||||||
</div>
|
|
||||||
<div class="badge badge-lg badge-secondary gap-2">
|
|
||||||
<%= Time.current.in_time_zone(@city.timezone).strftime("%Y-%m-%d %H:%M") %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 主要统计信息 -->
|
|
||||||
<div class="grid grid-cols-1 sm:grid-cols-3 gap-4 mt-8">
|
|
||||||
<div class="stat bg-base-100/80 backdrop-blur-sm shadow-lg rounded-box hover:bg-base-100/90 transition-all duration-300">
|
|
||||||
<div class="flex items-center gap-2 mb-2">
|
|
||||||
<%= weather_stat_icon("temperature") %>
|
|
||||||
<div class="stat-title font-medium">Latest Weather</div>
|
|
||||||
</div>
|
|
||||||
<div class="stat-value text-2xl"><%= @city.latest_weather_art&.temperature %>°C</div>
|
|
||||||
<div class="stat-desc mt-1"><%= @city.latest_weather_art&.description %></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="stat bg-base-100/80 backdrop-blur-sm shadow-lg rounded-box hover:bg-base-100/90 transition-all duration-300">
|
<div class="stats bg-base-100/80 backdrop-blur-sm shadow">
|
||||||
<div class="flex items-center gap-2 mb-2">
|
<div class="stat">
|
||||||
<%= weather_stat_icon("location") %>
|
<div class="stat-title">Latitude</div>
|
||||||
<div class="stat-title font-medium">Coordinates</div>
|
<div class="stat-value text-2xl"><%= @city.latitude %></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="stat-value text-xl">
|
<div class="stat">
|
||||||
<%= @city.latitude %>°N,
|
<div class="stat-title">Longitude</div>
|
||||||
<%= @city.longitude %>°E
|
<div class="stat-value text-2xl"><%= @city.longitude %></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="stat-desc mt-1">Geographical Location</div>
|
<div class="stat">
|
||||||
</div>
|
<div class="stat-title">Weather Arts</div>
|
||||||
|
<div class="stat-value text-2xl"><%= @city.weather_arts.count %></div>
|
||||||
<div class="stat bg-base-100/80 backdrop-blur-sm shadow-lg rounded-box hover:bg-base-100/90 transition-all duration-300">
|
|
||||||
<div class="flex items-center gap-2 mb-2">
|
|
||||||
<%= weather_stat_icon("history") %>
|
|
||||||
<div class="stat-title font-medium">Records</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="stat-value text-2xl"><%= @city.weather_arts.count %></div>
|
|
||||||
<div class="stat-desc mt-1">Total Weather Arts</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
<!-- 天气艺术历史记录 -->
|
<!-- 天气艺术历史记录 -->
|
||||||
<div class="container mx-auto px-4 pb-16">
|
<section class="container mx-auto px-4 py-16">
|
||||||
<div class="max-w-7xl mx-auto space-y-8">
|
<div class="space-y-8">
|
||||||
<!-- 标题和更新时间 -->
|
<h2 class="text-3xl font-display font-bold">Weather Art History</h2>
|
||||||
<div class="flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4">
|
|
||||||
<h2 class="text-3xl font-display font-bold bg-gradient-to-r from-primary to-secondary bg-clip-text text-transparent">
|
|
||||||
Weather Art History
|
|
||||||
</h2>
|
|
||||||
<div class="card bg-base-100/80 backdrop-blur-sm shadow-lg p-4">
|
|
||||||
<div class="flex items-center gap-2">
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-primary" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" />
|
|
||||||
</svg>
|
|
||||||
<span class="font-medium">Last Updated:</span>
|
|
||||||
<span class="text-base-content/70">
|
|
||||||
<%= time_ago_in_words(@city.last_weather_fetch) if @city.last_weather_fetch %>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 天气艺术卡片网格 -->
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
<% @city.weather_arts.order(weather_date: :desc).each do |art| %>
|
||||||
<% @city.weather_arts.order(weather_date: :desc).each do |art| %>
|
<div class="card bg-base-100 shadow-xl hover:shadow-2xl transition-all duration-300">
|
||||||
<div class="card bg-base-100/80 backdrop-blur-sm shadow-xl hover:shadow-2xl transition-all duration-300 hover:-translate-y-1">
|
<figure class="relative aspect-[4/3] overflow-hidden">
|
||||||
<figure class="relative aspect-video overflow-hidden">
|
<% if art.image.attached? %>
|
||||||
<% if art.image.attached? %>
|
<%= image_tag art.image,
|
||||||
<%= image_tag art.image,
|
class: "w-full h-full object-cover transform hover:scale-105 transition-transform duration-500" %>
|
||||||
class: "w-full h-full object-cover transform hover:scale-105 transition-transform duration-500" %>
|
<% end %>
|
||||||
<div class="absolute bottom-0 left-0 right-0 p-4 bg-gradient-to-t from-black/70 to-transparent">
|
<div class="absolute bottom-0 left-0 right-0 p-4 bg-gradient-to-t from-black/60 to-transparent">
|
||||||
<div class="flex items-center justify-between text-white">
|
<div class="text-white">
|
||||||
<div class="text-2xl font-bold"><%= art.temperature %>°C</div>
|
<div class="text-2xl font-bold"><%= art.temperature %>°C</div>
|
||||||
<div class="text-right">
|
<div class="text-sm opacity-90"><%= art.weather_date.strftime("%B %d, %Y") %></div>
|
||||||
<div class="font-medium"><%= art.weather_date.strftime("%H:%M") %></div>
|
|
||||||
<div class="text-sm opacity-80"><%= art.weather_date.strftime("%B %d, %Y") %></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
</figure>
|
|
||||||
|
|
||||||
<div class="card-body">
|
|
||||||
<h3 class="card-title font-display">
|
|
||||||
<%= weather_description_icon(art.description) %>
|
|
||||||
<%= art.description %>
|
|
||||||
</h3>
|
|
||||||
|
|
||||||
<div class="grid grid-cols-2 gap-4 my-4">
|
|
||||||
<div class="flex items-center gap-2 text-sm">
|
|
||||||
<%= weather_stat_icon("humidity") %>
|
|
||||||
<span>Humidity: <%= art.humidity %>%</span>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-center gap-2 text-sm">
|
|
||||||
<%= weather_stat_icon("wind") %>
|
|
||||||
<span>Wind: <%= art.wind_scale %></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</figure>
|
||||||
|
|
||||||
<%= link_to city_weather_art_path(@city, art),
|
<div class="card-body">
|
||||||
class: "btn btn-primary btn-block" do %>
|
<h3 class="card-title font-display"><%= art.description %></h3>
|
||||||
View Details
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 ml-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
<div class="grid grid-cols-2 gap-4 my-4 text-sm">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
|
<div class="flex items-center gap-2">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 opacity-70" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z" />
|
||||||
</svg>
|
</svg>
|
||||||
<% end %>
|
<span>Humidity: <%= art.humidity %>%</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 opacity-70" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 5l7 7m0 0l-7 7m7-7H3" />
|
||||||
|
</svg>
|
||||||
|
<span>Wind: <%= art.wind_scale %></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card-actions justify-end">
|
||||||
|
<%= link_to "View Details", city_weather_art_path(@city, art),
|
||||||
|
class: "btn btn-primary btn-outline" %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
</div>
|
||||||
</div>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</section>
|
||||||
</div>
|
</div>
|
@ -58,7 +58,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-center mt-12 mb-12">
|
<div class="text-center mt-12">
|
||||||
<%= link_to arts_path, class: "btn btn-primary btn-lg gap-2" do %>
|
<%= link_to arts_path, class: "btn btn-primary btn-lg gap-2" do %>
|
||||||
View All Weather Arts
|
View All Weather Arts
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||||
|
@ -1,23 +1,10 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title><%= content_for(:title) || "Today Ai Weather" %></title>
|
<title><%= content_for(:title) || "Today Ai Weather" %></title>
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
<meta name="mobile-web-app-capable" content="yes">
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
<%= display_meta_tags(
|
|
||||||
site: 'TodayAIWeather',
|
|
||||||
reverse: true,
|
|
||||||
og: {
|
|
||||||
site_name: 'TodayAIWeather',
|
|
||||||
type: 'website',
|
|
||||||
url: request.original_url
|
|
||||||
},
|
|
||||||
alternate: {
|
|
||||||
"zh-CN" => url_for(locale: 'zh-CN'),
|
|
||||||
"en" => url_for(locale: 'en')
|
|
||||||
}
|
|
||||||
) %>
|
|
||||||
<%= csrf_meta_tags %>
|
<%= csrf_meta_tags %>
|
||||||
<%= csp_meta_tag %>
|
<%= csp_meta_tag %>
|
||||||
|
|
||||||
@ -33,23 +20,6 @@
|
|||||||
<%# Includes all stylesheet files in app/assets/stylesheets %>
|
<%# Includes all stylesheet files in app/assets/stylesheets %>
|
||||||
<%= javascript_include_tag "application", "data-turbo-track": "reload", type: "module" %>
|
<%= javascript_include_tag "application", "data-turbo-track": "reload", type: "module" %>
|
||||||
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
|
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
|
||||||
<script defer data-domain="todayaiweather.com" src="https://plausible.frytea.com/js/script.js"></script>
|
|
||||||
|
|
||||||
<script defer src="https://busuanzi.frytea.com/js"></script>
|
|
||||||
|
|
||||||
<!-- Google tag (gtag.js) -->
|
|
||||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PX1C92V5L7"></script>
|
|
||||||
<script>
|
|
||||||
window.dataLayer = window.dataLayer || [];
|
|
||||||
function gtag(){dataLayer.push(arguments);}
|
|
||||||
gtag('js', new Date());
|
|
||||||
|
|
||||||
gtag('config', 'G-PX1C92V5L7');
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-7296634171837358"
|
|
||||||
crossorigin="anonymous"></script>
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="min-h-screen bg-base-100 font-sans">
|
<body class="min-h-screen bg-base-100 font-sans">
|
||||||
@ -58,7 +28,7 @@
|
|||||||
<div class="container mx-auto">
|
<div class="container mx-auto">
|
||||||
<div class="flex-1">
|
<div class="flex-1">
|
||||||
<%= link_to root_path, class: "text-2xl font-display font-bold hover:text-primary transition-colors" do %>
|
<%= link_to root_path, class: "text-2xl font-display font-bold hover:text-primary transition-colors" do %>
|
||||||
Today AI Weather
|
AI Weather Art
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-none">
|
<div class="flex-none">
|
||||||
@ -74,25 +44,10 @@
|
|||||||
</main>
|
</main>
|
||||||
|
|
||||||
<!-- 页脚 -->
|
<!-- 页脚 -->
|
||||||
<footer class="footer footer-center p-8 bg-base-200 text-base-content">
|
<footer class="footer footer-center p-8 bg-base-200 text-base-content mt-16">
|
||||||
<div class="container mx-auto flex flex-col gap-2">
|
<div>
|
||||||
<div id="busuanzi_container" class="text-xs opacity-70">
|
<p class="font-display">Copyright © 2024 - All rights reserved by AI Weather Art</p>
|
||||||
<div class="space-x-2">
|
|
||||||
<span>Page Views: <span id="busuanzi_page_pv"></span></span>
|
|
||||||
<span>|</span>
|
|
||||||
<span>Page Visitors: <span id="busuanzi_page_uv"></span></span>
|
|
||||||
<span>|</span>
|
|
||||||
<span>Total Views: <span id="busuanzi_site_pv"></span></span>
|
|
||||||
<span>|</span>
|
|
||||||
<span>Total Visitors: <span id="busuanzi_site_uv"></span></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p class="font-display opacity-80">
|
|
||||||
Copyright © 2024 - All rights reserved by AI Weather Art
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -1,86 +0,0 @@
|
|||||||
<%# app/views/shared/_pagination.html.erb %>
|
|
||||||
<% if collection.total_pages > 1 %>
|
|
||||||
<div class="flex flex-col items-center mt-16 gap-6">
|
|
||||||
<!-- 页码信息 -->
|
|
||||||
<div class="text-base-content/70 font-light">
|
|
||||||
<span class="px-4 py-2 bg-base-200/50 rounded-full">
|
|
||||||
Page <%= collection.current_page %> of <%= collection.total_pages %>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 分页控件 -->
|
|
||||||
<div class="join shadow-lg">
|
|
||||||
<!-- 首页 -->
|
|
||||||
<%= link_to url_for(page: 1, region: params[:region], country: params[:country], sort: params[:sort]),
|
|
||||||
class: "join-item btn #{collection.first_page? ? 'btn-disabled' : 'btn-ghost'}" do %>
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 19l-7-7 7-7m8 14l-7-7 7-7" />
|
|
||||||
</svg>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<!-- 上一页 -->
|
|
||||||
<%= link_to url_for(page: collection.prev_page || 1, region: params[:region], country: params[:country], sort: params[:sort]),
|
|
||||||
class: "join-item btn #{collection.first_page? ? 'btn-disabled' : 'btn-ghost'}" do %>
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
|
|
||||||
</svg>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<!-- 页码 -->
|
|
||||||
<% page_window = 2 # 当前页面前后显示的页码数 %>
|
|
||||||
<% start_page = [1, collection.current_page - page_window].max %>
|
|
||||||
<% end_page = [collection.total_pages, collection.current_page + page_window].min %>
|
|
||||||
|
|
||||||
<% if start_page > 1 %>
|
|
||||||
<%= link_to 1, url_for(page: 1, region: params[:region], country: params[:country], sort: params[:sort]),
|
|
||||||
class: "join-item btn btn-ghost hover:bg-primary/5" %>
|
|
||||||
<% if start_page > 2 %>
|
|
||||||
<button class="join-item btn btn-ghost btn-disabled">...</button>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% (start_page..end_page).each do |page| %>
|
|
||||||
<% if page == collection.current_page %>
|
|
||||||
<button class="join-item btn btn-ghost bg-primary/10 font-medium">
|
|
||||||
<%= page %>
|
|
||||||
</button>
|
|
||||||
<% else %>
|
|
||||||
<%= link_to page, url_for(page: page, region: params[:region], country: params[:country], sort: params[:sort]),
|
|
||||||
class: "join-item btn btn-ghost hover:bg-primary/5" %>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if end_page < collection.total_pages %>
|
|
||||||
<% if end_page < collection.total_pages - 1 %>
|
|
||||||
<button class="join-item btn btn-ghost btn-disabled">...</button>
|
|
||||||
<% end %>
|
|
||||||
<%= link_to collection.total_pages,
|
|
||||||
url_for(page: collection.total_pages, region: params[:region], country: params[:country], sort: params[:sort]),
|
|
||||||
class: "join-item btn btn-ghost hover:bg-primary/5" %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<!-- 下一页 -->
|
|
||||||
<%= link_to url_for(page: collection.next_page || collection.total_pages, region: params[:region], country: params[:country], sort: params[:sort]),
|
|
||||||
class: "join-item btn #{collection.last_page? ? 'btn-disabled' : 'btn-ghost'}" do %>
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
|
|
||||||
</svg>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<!-- 末页 -->
|
|
||||||
<%= link_to url_for(page: collection.total_pages, region: params[:region], country: params[:country], sort: params[:sort]),
|
|
||||||
class: "join-item btn #{collection.last_page? ? 'btn-disabled' : 'btn-ghost'}" do %>
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 5l7 7-7 7M5 5l7 7-7 7" />
|
|
||||||
</svg>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 结果统计 -->
|
|
||||||
<div class="text-sm text-base-content/60 font-light">
|
|
||||||
Showing <%= collection.offset_value + 1 %> to
|
|
||||||
<%= collection.last_page? ? collection.total_count : collection.offset_value + collection.limit_value %>
|
|
||||||
of <%= collection.total_count %> <%= collection_name || 'items' %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
@ -1,11 +0,0 @@
|
|||||||
<!-- app/views/weather_arts/_weather_stat.html.erb -->
|
|
||||||
<div class="stat bg-base-200/50 backdrop-blur-sm rounded-box hover:bg-base-300/50 transition-all duration-300">
|
|
||||||
<div class="flex items-center gap-2 mb-2">
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-primary" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="<%= icon %>" />
|
|
||||||
</svg>
|
|
||||||
<div class="stat-title font-medium"><%= title %></div>
|
|
||||||
</div>
|
|
||||||
<div class="stat-value text-2xl"><%= value %></div>
|
|
||||||
<div class="stat-desc mt-1"><%= desc %></div>
|
|
||||||
</div>
|
|
@ -1,155 +1,81 @@
|
|||||||
<% content_for :head do %>
|
<div class="min-h-screen">
|
||||||
<script type="application/ld+json">
|
<!-- 返回导航 -->
|
||||||
<%= weather_art_schema(@weather_art) %>
|
<div class="container mx-auto px-4 py-8">
|
||||||
</script>
|
<%= link_to city_path(@weather_art.city),
|
||||||
<% end %>
|
class: "btn btn-ghost gap-2" do %>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||||
<div class="relative min-h-screen bg-base-200">
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
|
||||||
<!-- 背景图片 -->
|
</svg>
|
||||||
<% if @weather_art.image.attached? %>
|
Back to <%= @weather_art.city.name %>
|
||||||
<div class="fixed inset-0 -z-10">
|
<% end %>
|
||||||
<%= image_tag @weather_art.image,
|
</div>
|
||||||
class: "absolute w-full h-full object-cover scale-110 filter blur-2xl opacity-25" %>
|
|
||||||
<div class="absolute inset-0 bg-gradient-to-b from-base-200/90 to-base-200/70 backdrop-blur-md"></div>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<!-- 主要内容 -->
|
<!-- 主要内容 -->
|
||||||
<div class="relative z-10">
|
<div class="container mx-auto px-4 pb-16">
|
||||||
<!-- 返回导航 -->
|
<div class="max-w-6xl mx-auto">
|
||||||
<div class="container mx-auto px-4 py-6">
|
<!-- 头部信息 -->
|
||||||
<%= link_to city_path(@weather_art.city),
|
<div class="text-center space-y-4 mb-12">
|
||||||
class: "btn btn-ghost btn-lg gap-2 bg-base-100/50 backdrop-blur-sm hover:bg-base-100/70 transition-all duration-300" do %>
|
<h1 class="text-4xl md:text-5xl font-display font-bold">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
<%= @weather_art.city.name %>
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
|
</h1>
|
||||||
</svg>
|
<p class="text-xl text-base-content/70">
|
||||||
Back to <%= @weather_art.city.name %>
|
<%= @weather_art.weather_date.strftime("%B %d, %Y") %>
|
||||||
<% end %>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container mx-auto px-4 pb-16">
|
<!-- 主要卡片 -->
|
||||||
<div class="max-w-6xl mx-auto">
|
<div class="card lg:card-side bg-base-100 shadow-2xl">
|
||||||
<!-- 头部信息 -->
|
<figure class="lg:w-1/2 relative aspect-square lg:aspect-auto">
|
||||||
<div class="text-center space-y-4 mb-12">
|
<% if @weather_art.image.attached? %>
|
||||||
<div class="inline-flex items-center gap-2 text-sm font-medium px-4 py-2 rounded-full bg-base-100/50 backdrop-blur-sm">
|
<%= image_tag @weather_art.image,
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
class: "w-full h-full object-cover" %>
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" />
|
<% end %>
|
||||||
</svg>
|
</figure>
|
||||||
<%= @weather_art.city.full_name %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h1 class="text-4xl md:text-6xl font-display font-bold">
|
<div class="card-body lg:w-1/2">
|
||||||
<span class="bg-gradient-to-r from-primary to-secondary bg-clip-text text-transparent">
|
<h2 class="card-title font-display text-2xl mb-6">
|
||||||
Weather Art
|
<%= @weather_art.description %>
|
||||||
</span>
|
</h2>
|
||||||
</h1>
|
|
||||||
|
|
||||||
<div class="flex flex-wrap justify-center items-center gap-3">
|
<!-- 天气数据网格 -->
|
||||||
<div class="badge badge-lg badge-primary gap-2">
|
<div class="grid grid-cols-2 gap-6">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
<div class="stat bg-base-200 rounded-box">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" />
|
<div class="stat-title">Temperature</div>
|
||||||
</svg>
|
<div class="stat-value"><%= @weather_art.temperature %>°C</div>
|
||||||
<%= @weather_art.weather_date.strftime("%B %d, %Y") %>
|
<div class="stat-desc">Feels like <%= @weather_art.feeling_temp %>°C</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="badge badge-lg badge-secondary gap-2">
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
<div class="stat bg-base-200 rounded-box">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" />
|
<div class="stat-title">Wind</div>
|
||||||
</svg>
|
<div class="stat-value"><%= @weather_art.wind_scale %></div>
|
||||||
<%= @weather_art.weather_date.strftime("%H:%M") %>
|
<div class="stat-desc"><%= @weather_art.wind_speed %> km/h</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="stat bg-base-200 rounded-box">
|
||||||
|
<div class="stat-title">Humidity</div>
|
||||||
|
<div class="stat-value"><%= @weather_art.humidity %>%</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="stat bg-base-200 rounded-box">
|
||||||
|
<div class="stat-title">Visibility</div>
|
||||||
|
<div class="stat-value"><%= @weather_art.visibility %> km</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="stat bg-base-200 rounded-box">
|
||||||
|
<div class="stat-title">Pressure</div>
|
||||||
|
<div class="stat-value"><%= @weather_art.pressure %> hPa</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="stat bg-base-200 rounded-box">
|
||||||
|
<div class="stat-title">Cloud Cover</div>
|
||||||
|
<div class="stat-value"><%= @weather_art.cloud %>%</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 主要卡片 -->
|
<!-- AI Prompt -->
|
||||||
<div class="card lg:card-side bg-base-100/80 backdrop-blur-md shadow-2xl">
|
<div class="mt-8 bg-base-200 p-6 rounded-box">
|
||||||
<figure class="lg:w-1/2 relative aspect-square lg:aspect-auto group">
|
<h3 class="font-display font-bold text-lg mb-3">AI Prompt</h3>
|
||||||
<% if @weather_art.image.attached? %>
|
<p class="text-base-content/70"><%= @weather_art.prompt %></p>
|
||||||
<%= image_tag @weather_art.image,
|
|
||||||
class: "w-full h-full object-cover transition-transform duration-500 group-hover:scale-105" %>
|
|
||||||
<div class="absolute inset-0 bg-gradient-to-t from-base-100/50 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300"></div>
|
|
||||||
<% end %>
|
|
||||||
</figure>
|
|
||||||
|
|
||||||
<div class="card-body lg:w-1/2">
|
|
||||||
<div class="prose max-w-none mb-8">
|
|
||||||
<h2 class="card-title font-display text-3xl mb-4 flex items-center gap-3">
|
|
||||||
<%= weather_description_icon(@weather_art.description) %>
|
|
||||||
<%= @weather_art.description %>
|
|
||||||
</h2>
|
|
||||||
<div class="divider"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 天气数据网格 -->
|
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
||||||
<div class="stat bg-base-200/50 backdrop-blur-sm rounded-box hover:bg-base-300/50 transition-all duration-300">
|
|
||||||
<div class="flex items-center gap-2 mb-2">
|
|
||||||
<%= weather_stat_icon("temperature") %>
|
|
||||||
<div class="stat-title font-medium">Temperature</div>
|
|
||||||
</div>
|
|
||||||
<div class="stat-value text-2xl"><%= @weather_art.temperature %>°C</div>
|
|
||||||
<div class="stat-desc mt-1">Feels like <%= @weather_art.feeling_temp %>°C</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="stat bg-base-200/50 backdrop-blur-sm rounded-box hover:bg-base-300/50 transition-all duration-300">
|
|
||||||
<div class="flex items-center gap-2 mb-2">
|
|
||||||
<%= weather_stat_icon("wind") %>
|
|
||||||
<div class="stat-title font-medium">Wind</div>
|
|
||||||
</div>
|
|
||||||
<div class="stat-value text-2xl"><%= @weather_art.wind_scale %></div>
|
|
||||||
<div class="stat-desc mt-1"><%= @weather_art.wind_speed %> km/h</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="stat bg-base-200/50 backdrop-blur-sm rounded-box hover:bg-base-300/50 transition-all duration-300">
|
|
||||||
<div class="flex items-center gap-2 mb-2">
|
|
||||||
<%= weather_stat_icon("humidity") %>
|
|
||||||
<div class="stat-title font-medium">Humidity</div>
|
|
||||||
</div>
|
|
||||||
<div class="stat-value text-2xl"><%= @weather_art.humidity %>%</div>
|
|
||||||
<div class="stat-desc mt-1">Relative humidity</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="stat bg-base-200/50 backdrop-blur-sm rounded-box hover:bg-base-300/50 transition-all duration-300">
|
|
||||||
<div class="flex items-center gap-2 mb-2">
|
|
||||||
<%= weather_stat_icon("visibility") %>
|
|
||||||
<div class="stat-title font-medium">Visibility</div>
|
|
||||||
</div>
|
|
||||||
<div class="stat-value text-2xl"><%= @weather_art.visibility %> km</div>
|
|
||||||
<div class="stat-desc mt-1">Clear view distance</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="stat bg-base-200/50 backdrop-blur-sm rounded-box hover:bg-base-300/50 transition-all duration-300">
|
|
||||||
<div class="flex items-center gap-2 mb-2">
|
|
||||||
<%= weather_stat_icon("pressure") %>
|
|
||||||
<div class="stat-title font-medium">Pressure</div>
|
|
||||||
</div>
|
|
||||||
<div class="stat-value text-2xl"><%= @weather_art.pressure %> hPa</div>
|
|
||||||
<div class="stat-desc mt-1">Atmospheric pressure</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="stat bg-base-200/50 backdrop-blur-sm rounded-box hover:bg-base-300/50 transition-all duration-300">
|
|
||||||
<div class="flex items-center gap-2 mb-2">
|
|
||||||
<%= weather_stat_icon("cloud") %>
|
|
||||||
<div class="stat-title font-medium">Cloud Cover</div>
|
|
||||||
</div>
|
|
||||||
<div class="stat-value text-2xl"><%= @weather_art.cloud %>%</div>
|
|
||||||
<div class="stat-desc mt-1">Sky coverage</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- AI Prompt -->
|
|
||||||
<div class="mt-8">
|
|
||||||
<div class="bg-base-200/50 backdrop-blur-sm p-6 rounded-box border border-base-300">
|
|
||||||
<div class="flex items-center gap-3 mb-4">
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 text-primary" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z" />
|
|
||||||
</svg>
|
|
||||||
<h3 class="font-display font-bold text-lg">AI Prompt</h3>
|
|
||||||
</div>
|
|
||||||
<p class="text-base-content/70 leading-relaxed">
|
|
||||||
<%= @weather_art.prompt %>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,36 +1,34 @@
|
|||||||
class BatchGenerateWeatherArtsWorker
|
class BatchGenerateWeatherArtsWorker
|
||||||
include Sidekiq::Worker
|
include Sidekiq::Worker
|
||||||
|
|
||||||
GENERATION_INTERVAL = 24.hours
|
|
||||||
MAX_DURATION = 50.minutes
|
|
||||||
SLEEP_DURATION = 120.seconds
|
|
||||||
|
|
||||||
def perform(*args)
|
def perform(*args)
|
||||||
start_time = Time.current
|
start_time = Time.current
|
||||||
|
max_duration = 50.minutes
|
||||||
|
|
||||||
cities_to_process = get_eligible_cities
|
cities_to_process = get_eligible_cities
|
||||||
|
|
||||||
cities_to_process.each do |city|
|
cities_to_process.each do |city|
|
||||||
break if Time.current - start_time > MAX_DURATION
|
break if Time.current - start_time > max_duration
|
||||||
Rails.logger.info "Generating weather art for #{city.name}"
|
|
||||||
|
|
||||||
|
# GenerateWeatherArtJob.perform_now(city)
|
||||||
GenerateWeatherArtWorker.perform_async(city.id)
|
GenerateWeatherArtWorker.perform_async(city.id)
|
||||||
sleep SLEEP_DURATION
|
sleep 10.seconds
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def get_eligible_cities
|
def get_eligible_cities
|
||||||
cutoff_time = Time.current - GENERATION_INTERVAL
|
|
||||||
|
|
||||||
City.active
|
City.active
|
||||||
.joins("LEFT JOIN (
|
.where(active: true)
|
||||||
SELECT city_id, MAX(created_at) as last_generation_time
|
.where("last_weather_fetch IS NULL OR last_weather_fetch < ?", Date.today)
|
||||||
FROM weather_arts
|
# .select { |city| early_morning_in_timezone?(city.timezone) }
|
||||||
GROUP BY city_id
|
|
||||||
) latest_arts ON cities.id = latest_arts.city_id")
|
|
||||||
.where("latest_arts.last_generation_time IS NULL OR latest_arts.last_generation_time < ?", cutoff_time)
|
|
||||||
.order(:priority)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# def early_morning_in_timezone?(timezone)
|
||||||
|
# return false if timezone.blank?
|
||||||
|
|
||||||
|
# time = Time.current.in_time_zone(timezone)
|
||||||
|
# time.hour == 2
|
||||||
|
# end
|
||||||
end
|
end
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
# app/workers/clean_ahoy_data_worker.rb
|
|
||||||
class CleanAhoyDataWorker
|
|
||||||
include Sidekiq::Worker
|
|
||||||
|
|
||||||
sidekiq_options queue: :default, retry: false
|
|
||||||
|
|
||||||
def perform
|
|
||||||
cleanup_old_events
|
|
||||||
cleanup_old_visits
|
|
||||||
log_cleanup_results
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def cleanup_old_events
|
|
||||||
cutoff_date = 3.months.ago
|
|
||||||
deleted_events_count = Ahoy::Event.where("time < ?", cutoff_date).delete_all
|
|
||||||
Rails.logger.info "Deleted #{deleted_events_count} old Ahoy events"
|
|
||||||
end
|
|
||||||
|
|
||||||
def cleanup_old_visits
|
|
||||||
cutoff_date = 3.months.ago
|
|
||||||
deleted_visits_count = Ahoy::Visit.where("started_at < ?", cutoff_date).delete_all
|
|
||||||
Rails.logger.info "Deleted #{deleted_visits_count} old Ahoy visits"
|
|
||||||
end
|
|
||||||
|
|
||||||
def log_cleanup_results
|
|
||||||
Rails.logger.info "Ahoy cleanup completed at #{Time.current}"
|
|
||||||
Rails.logger.info "Remaining events: #{Ahoy::Event.count}"
|
|
||||||
Rails.logger.info "Remaining visits: #{Ahoy::Visit.count}"
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,68 +1,46 @@
|
|||||||
class GenerateWeatherArtWorker
|
class GenerateWeatherArtWorker
|
||||||
include Sidekiq::Worker
|
include Sidekiq::Worker
|
||||||
|
|
||||||
def perform(city_id)
|
def perform(*args)
|
||||||
@city = City.find(city_id)
|
city_id = args[0]
|
||||||
|
city = City.find(city_id)
|
||||||
|
return if city.last_weather_fetch&.today?
|
||||||
|
|
||||||
weather_data = fetch_weather_data
|
weather_service = WeatherService.new
|
||||||
|
ai_service = AiService.new
|
||||||
|
|
||||||
|
# 获取天气数据
|
||||||
|
weather_data = weather_service.get_weather(city.latitude, city.longitude)
|
||||||
return unless weather_data
|
return unless weather_data
|
||||||
|
|
||||||
prompt = generate_prompt(weather_data)
|
# 生成提示词
|
||||||
|
prompt = ai_service.generate_prompt(city, weather_data)
|
||||||
return unless prompt
|
return unless prompt
|
||||||
|
|
||||||
image_url = generate_image(prompt)
|
# 生成图像
|
||||||
|
image_url = ai_service.generate_image(prompt)
|
||||||
return unless image_url
|
return unless image_url
|
||||||
|
|
||||||
create_weather_art(weather_data, prompt, image_url)
|
# 创建天气艺术记录
|
||||||
rescue StandardError => e
|
weather_art = city.weather_arts.create!(
|
||||||
Rails.logger.error "Error generating weather art for city #{city_id}: #{e.message}"
|
weather_date: Date.today,
|
||||||
Rails.logger.error e.backtrace.join("\n")
|
**weather_data,
|
||||||
end
|
prompt: prompt
|
||||||
|
)
|
||||||
|
|
||||||
private
|
# 下载并附加图像
|
||||||
|
tempfile = Down.download(image_url)
|
||||||
|
weather_art.image.attach(
|
||||||
|
io: tempfile,
|
||||||
|
filename: "#{city.country.name}-#{city.name.parameterize}-#{Time.current.strftime('%Y%m%d-%H%M%S')}.png"
|
||||||
|
)
|
||||||
|
|
||||||
attr_reader :city
|
# 更新城市状态
|
||||||
|
city.update!(
|
||||||
def fetch_weather_data
|
last_weather_fetch: Time.current,
|
||||||
WeatherService.new.get_weather(city.latitude, city.longitude)
|
last_image_generation: Time.current
|
||||||
end
|
)
|
||||||
|
rescue => e
|
||||||
def generate_prompt(weather_data)
|
Rails.logger.error "Error generating weather art for #{city.name}: #{e.message}"
|
||||||
AiService.new.generate_prompt(city, weather_data)
|
|
||||||
end
|
|
||||||
|
|
||||||
def generate_image(prompt)
|
|
||||||
AiService.new.generate_image(prompt)
|
|
||||||
end
|
|
||||||
|
|
||||||
def create_weather_art(weather_data, prompt, image_url)
|
|
||||||
tempfile = nil
|
|
||||||
|
|
||||||
ActiveRecord::Base.transaction do
|
|
||||||
weather_art = city.weather_arts.create!(
|
|
||||||
weather_date: Date.today,
|
|
||||||
prompt: prompt,
|
|
||||||
**weather_data
|
|
||||||
)
|
|
||||||
|
|
||||||
tempfile = Down.download(image_url)
|
|
||||||
|
|
||||||
weather_art.image.attach(
|
|
||||||
io: File.open(tempfile.path),
|
|
||||||
filename: generate_filename,
|
|
||||||
content_type: "image/png"
|
|
||||||
)
|
|
||||||
|
|
||||||
weather_art
|
|
||||||
end
|
|
||||||
ensure
|
|
||||||
if tempfile
|
|
||||||
tempfile.close
|
|
||||||
tempfile.unlink
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def generate_filename
|
|
||||||
"#{city.country.name}-#{city.name.parameterize}-#{Time.current.strftime('%Y%m%d-%H%M%S')}.png"
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,58 +0,0 @@
|
|||||||
class RefreshSitemapWorker
|
|
||||||
include Sidekiq::Worker
|
|
||||||
|
|
||||||
def perform
|
|
||||||
host = Rails.env.production? ? "https://todayaiweather.com" : "http://127.0.0.1:3000"
|
|
||||||
Rails.application.routes.default_url_options[:host] = host
|
|
||||||
SitemapGenerator::Sitemap.default_host = host
|
|
||||||
if Rails.env.production?
|
|
||||||
SitemapGenerator::Sitemap.adapter = SitemapGenerator::AwsSdkAdapter.new(
|
|
||||||
ENV.fetch("AWS_BUCKET", Rails.application.credentials.dig(:aws, :bucket)),
|
|
||||||
aws_access_key_id: ENV.fetch("AWS_ACCESS_KEY_ID", Rails.application.credentials.dig(:aws, :access_key_id)),
|
|
||||||
aws_secret_access_key: ENV.fetch("AWS_SECRET_ACCESS_KEY_ID", Rails.application.credentials.dig(:aws, :secret_access_key)),
|
|
||||||
aws_region: ENV.fetch("AWS_REGION", "wnam"),
|
|
||||||
endpoint: ENV.fetch("AWS_ENDPOINT", Rails.application.credentials.dig(:aws, :endpoint)),
|
|
||||||
)
|
|
||||||
else
|
|
||||||
SitemapGenerator::Sitemap.adapter = SitemapGenerator::AwsSdkAdapter.new(
|
|
||||||
ENV.fetch("AWS_DEV_BUCKET", Rails.application.credentials.dig(:aws_dev, :bucket)),
|
|
||||||
aws_access_key_id: ENV.fetch("AWS_DEV_ACCESS_KEY_ID", Rails.application.credentials.dig(:aws_dev, :access_key_id)),
|
|
||||||
aws_secret_access_key: ENV.fetch("AWS_DEV_SECRET_ACCESS_KEY_ID", Rails.application.credentials.dig(:aws_dev, :secret_access_key)),
|
|
||||||
aws_region: ENV.fetch("AWS_DEV_REGION", "wnam"),
|
|
||||||
endpoint: ENV.fetch("AWS_DEV_ENDPOINT", Rails.application.credentials.dig(:aws_dev, :endpoint)),
|
|
||||||
)
|
|
||||||
end
|
|
||||||
SitemapGenerator::Sitemap.sitemaps_path = "sitemaps/"
|
|
||||||
|
|
||||||
SitemapGenerator::Sitemap.create do
|
|
||||||
add root_path, changefreq: "daily", priority: 1.0
|
|
||||||
add cities_path, changefreq: "daily", priority: 0.9
|
|
||||||
add arts_path, changefreq: "daily", priority: 0.9
|
|
||||||
|
|
||||||
City.find_each do |city|
|
|
||||||
add city_path(city),
|
|
||||||
changefreq: "daily",
|
|
||||||
priority: 0.8,
|
|
||||||
lastmod: city.updated_at
|
|
||||||
end
|
|
||||||
|
|
||||||
WeatherArt.includes(:city).find_each do |art|
|
|
||||||
if art.image.attached?
|
|
||||||
add city_weather_art_path(art.city, art),
|
|
||||||
changefreq: "daily",
|
|
||||||
priority: 0.7,
|
|
||||||
lastmod: art.updated_at,
|
|
||||||
images: [ {
|
|
||||||
loc: url_for(art.image),
|
|
||||||
title: "#{art.city.name} Weather Art - #{art.weather_date.strftime('%B %d, %Y')}"
|
|
||||||
} ]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# SitemapGenerator::Sitemap.ping_search_engines if Rails.env.production?
|
|
||||||
Rails.logger.info "Sitemap has been generated and uploaded to S3 successfully"
|
|
||||||
rescue => e
|
|
||||||
Rails.logger.error "Error refreshing sitemap: #{e.message}"
|
|
||||||
end
|
|
||||||
end
|
|
@ -3,7 +3,6 @@ services:
|
|||||||
image: songtianlun/today_ai_weather:latest
|
image: songtianlun/today_ai_weather:latest
|
||||||
#ports:
|
#ports:
|
||||||
# - "3000:3000"
|
# - "3000:3000"
|
||||||
pull_policy: always
|
|
||||||
environment:
|
environment:
|
||||||
- RAILS_ENV=production
|
- RAILS_ENV=production
|
||||||
- DATABASE_URL=postgresql://postgres:${PG_PASSWORD}@db:5432/db
|
- DATABASE_URL=postgresql://postgres:${PG_PASSWORD}@db:5432/db
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
class Ahoy::Store < Ahoy::DatabaseStore
|
|
||||||
end
|
|
||||||
|
|
||||||
# set to true for JavaScript tracking
|
|
||||||
Ahoy.api = true
|
|
||||||
|
|
||||||
# set to true for geocoding (and add the geocoder gem to your Gemfile)
|
|
||||||
# we recommend configuring local geocoding as well
|
|
||||||
# see https://github.com/ankane/ahoy#geocoding
|
|
||||||
Ahoy.geocode = false
|
|
||||||
|
|
||||||
Ahoy.visit_duration = 30.minutes
|
|
||||||
Ahoy.server_side_visits = :when_needed
|
|
||||||
RETENTION_PERIOD = 3.months
|
|
@ -1,19 +0,0 @@
|
|||||||
if Rails.env.production?
|
|
||||||
Aws.config.update({
|
|
||||||
region: ENV.fetch("AWS_REGION", "wnam"),
|
|
||||||
credentials: Aws::Credentials.new(
|
|
||||||
ENV.fetch("AWS_ACCESS_KEY_ID", Rails.application.credentials.dig(:aws, :access_key_id)),
|
|
||||||
ENV.fetch("AWS_SECRET_ACCESS_KEY_ID", Rails.application.credentials.dig(:aws, :secret_access_key))
|
|
||||||
),
|
|
||||||
endpoint: ENV.fetch("AWS_ENDPOINT", Rails.application.credentials.dig(:aws, :endpoint))
|
|
||||||
})
|
|
||||||
else
|
|
||||||
Aws.config.update({
|
|
||||||
region: ENV.fetch("AWS_DEV_REGION", "wnam"),
|
|
||||||
credentials: Aws::Credentials.new(
|
|
||||||
ENV.fetch("AWS_DEV_ACCESS_KEY_ID", Rails.application.credentials.dig(:aws_dev, :access_key_id)),
|
|
||||||
ENV.fetch("AWS_DEV_SECRET_ACCESS_KEY_ID", Rails.application.credentials.dig(:aws_dev, :secret_access_key))
|
|
||||||
),
|
|
||||||
endpoint: ENV.fetch("AWS_DEV_ENDPOINT", Rails.application.credentials.dig(:aws_dev, :endpoint))
|
|
||||||
})
|
|
||||||
end
|
|
@ -1,52 +0,0 @@
|
|||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
# Use this setup block to configure all options available in MetaTags.
|
|
||||||
MetaTags.configure do |config|
|
|
||||||
config.title_limit = 70
|
|
||||||
config.description_limit = 160
|
|
||||||
config.keywords_limit = 255
|
|
||||||
# How many characters should the title meta tag have at most. Default is 70.
|
|
||||||
# Set to nil or 0 to remove limits.
|
|
||||||
# config.title_limit = 70
|
|
||||||
|
|
||||||
# When true, site title will be truncated instead of title. Default is false.
|
|
||||||
# config.truncate_site_title_first = false
|
|
||||||
|
|
||||||
# Add HTML attributes to the <title> HTML tag. Default is {}.
|
|
||||||
# config.title_tag_attributes = {}
|
|
||||||
|
|
||||||
# Natural separator when truncating. Default is " " (space character).
|
|
||||||
# Set to nil to disable natural separator.
|
|
||||||
# This also allows you to use a whitespace regular expression (/\s/) or
|
|
||||||
# a Unicode space (/\p{Space}/).
|
|
||||||
# config.truncate_on_natural_separator = " "
|
|
||||||
|
|
||||||
# Maximum length of the page description. Default is 300.
|
|
||||||
# Set to nil or 0 to remove limits.
|
|
||||||
# config.description_limit = 300
|
|
||||||
|
|
||||||
# Maximum length of the keywords meta tag. Default is 255.
|
|
||||||
# config.keywords_limit = 255
|
|
||||||
|
|
||||||
# Default separator for keywords meta tag (used when an Array passed with
|
|
||||||
# the list of keywords). Default is ", ".
|
|
||||||
# config.keywords_separator = ', '
|
|
||||||
|
|
||||||
# When true, keywords will be converted to lowercase, otherwise they will
|
|
||||||
# appear on the page as is. Default is true.
|
|
||||||
# config.keywords_lowercase = true
|
|
||||||
|
|
||||||
# When true, the output will not include new line characters between meta tags.
|
|
||||||
# Default is false.
|
|
||||||
# config.minify_output = false
|
|
||||||
|
|
||||||
# When false, generated meta tags will be self-closing (<meta ... />) instead
|
|
||||||
# of open (`<meta ...>`). Default is true.
|
|
||||||
# config.open_meta_tags = true
|
|
||||||
|
|
||||||
# List of additional meta tags that should use "property" attribute instead
|
|
||||||
# of "name" attribute in <meta> tags.
|
|
||||||
# config.property_tags.push(
|
|
||||||
# 'x-hearthstone:deck',
|
|
||||||
# )
|
|
||||||
end
|
|
@ -1,9 +0,0 @@
|
|||||||
# config/initializers/schedule_tasks.rb
|
|
||||||
Rails.application.config.after_initialize do
|
|
||||||
begin
|
|
||||||
RefreshSitemapWorker.perform_async
|
|
||||||
Rails.logger.info "Startup task (RefreshSitemapWorker) scheduled successfully"
|
|
||||||
rescue => e
|
|
||||||
Rails.logger.error "Error scheduling startup task: #{e.message}"
|
|
||||||
end
|
|
||||||
end
|
|
@ -5,7 +5,7 @@ Sidekiq.configure_server do |config|
|
|||||||
config.redis = { url: ENV.fetch("REDIS_URL", "redis://localhost:6379/1") }
|
config.redis = { url: ENV.fetch("REDIS_URL", "redis://localhost:6379/1") }
|
||||||
config.logger.level = Logger::INFO
|
config.logger.level = Logger::INFO
|
||||||
config.on(:startup) do
|
config.on(:startup) do
|
||||||
schedule_file = "config/sidekiq_scheduler.yml"
|
schedule_file = "config/sidekiq.yml"
|
||||||
if File.exist?(schedule_file)
|
if File.exist?(schedule_file)
|
||||||
Sidekiq::Scheduler.enabled = true
|
Sidekiq::Scheduler.enabled = true
|
||||||
Sidekiq::Scheduler.dynamic = true
|
Sidekiq::Scheduler.dynamic = true
|
||||||
|
@ -6,7 +6,7 @@ Rails.application.routes.draw do
|
|||||||
resources :cities, only: [ :index, :show ] do
|
resources :cities, only: [ :index, :show ] do
|
||||||
resources :weather_arts, path: "weather", only: [ :show ], param: :slug
|
resources :weather_arts, path: "weather", only: [ :show ], param: :slug
|
||||||
end
|
end
|
||||||
resources :arts, only: [ :index ]
|
resources :arts, only: [:index]
|
||||||
|
|
||||||
# namespace :admin do
|
# namespace :admin do
|
||||||
# resources :cities
|
# resources :cities
|
||||||
@ -18,14 +18,12 @@ Rails.application.routes.draw do
|
|||||||
get "cities/index"
|
get "cities/index"
|
||||||
get "cities/show"
|
get "cities/show"
|
||||||
get "home/index"
|
get "home/index"
|
||||||
get "sitemaps/*path", to: "sitemaps#show", format: false
|
|
||||||
|
|
||||||
devise_for :admin_users, ActiveAdmin::Devise.config
|
devise_for :admin_users, ActiveAdmin::Devise.config
|
||||||
ActiveAdmin.routes(self)
|
ActiveAdmin.routes(self)
|
||||||
|
|
||||||
# mount Sidekiq::Web => '/sidekiq'
|
# mount Sidekiq::Web => '/sidekiq'
|
||||||
authenticate :admin_user do
|
authenticate :admin_user do
|
||||||
mount Sidekiq::Web => "/admin/tasks"
|
mount Sidekiq::Web => "/sidekiq"
|
||||||
end
|
end
|
||||||
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
|
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
|
||||||
|
|
||||||
|
5
config/sidekiq.yml
Normal file
5
config/sidekiq.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
batch_generate_weather:
|
||||||
|
cron: '0 */1 * * *'
|
||||||
|
class: BatchGenerateWeatherArtsWorker
|
||||||
|
description: "Generate weather arts every 2 hours"
|
||||||
|
enabled: true
|
@ -1,18 +0,0 @@
|
|||||||
batch_generate_weather:
|
|
||||||
cron: '0 */1 * * *'
|
|
||||||
class: BatchGenerateWeatherArtsWorker
|
|
||||||
description: "Generate weather arts every 2 hours"
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
refresh_sitemap:
|
|
||||||
cron: '0 5 * * *'
|
|
||||||
class: RefreshSitemapWorker
|
|
||||||
queue: default
|
|
||||||
description: "Refresh sitemap daily"
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
clean_ahoy_data:
|
|
||||||
cron: '0 0 * * 0'
|
|
||||||
class: CleanAhoyDataWorker
|
|
||||||
queue: default
|
|
||||||
enabled: true
|
|
@ -1,58 +0,0 @@
|
|||||||
# Set the host name for URL creation
|
|
||||||
host = Rails.env.production? ? "https://todayaiweather.com" : "http://127.0.0.1:3000"
|
|
||||||
Rails.application.routes.default_url_options[:host] = host
|
|
||||||
SitemapGenerator::Sitemap.adapter = SitemapGenerator::AwsSdkAdapter.new(
|
|
||||||
Rails.application.credentials.dig(:aws, :bucket),
|
|
||||||
aws_access_key_id: Rails.application.credentials.dig(:aws, :access_key_id),
|
|
||||||
aws_secret_access_key: Rails.application.credentials.dig(:aws, :secret_access_key),
|
|
||||||
aws_region: Rails.application.credentials.dig(:aws, :region)
|
|
||||||
)
|
|
||||||
SitemapGenerator::Sitemap.sitemaps_path = "sitemaps/"
|
|
||||||
|
|
||||||
SitemapGenerator::Sitemap.default_host = host
|
|
||||||
|
|
||||||
SitemapGenerator::Sitemap.create do
|
|
||||||
add root_path, changefreq: "daily", priority: 1.0
|
|
||||||
add cities_path, changefreq: "daily", priority: 0.9
|
|
||||||
add arts_path, changefreq: "daily", priority: 0.9
|
|
||||||
|
|
||||||
City.find_each do |city|
|
|
||||||
add city_path(city),
|
|
||||||
changefreq: "daily",
|
|
||||||
priority: 0.8,
|
|
||||||
lastmod: city.updated_at
|
|
||||||
end
|
|
||||||
|
|
||||||
WeatherArt.includes(:city).find_each do |art|
|
|
||||||
add city_weather_art_path(art.city, art),
|
|
||||||
changefreq: "daily",
|
|
||||||
priority: 0.7,
|
|
||||||
lastmod: art.updated_at,
|
|
||||||
images: [ {
|
|
||||||
loc: url_for(art.image),
|
|
||||||
title: "#{art.city.name} Weather Art - #{art.weather_date.strftime('%B %d, %Y')}"
|
|
||||||
} ] if art.image.attached?
|
|
||||||
end
|
|
||||||
# Put links creation logic here.
|
|
||||||
#
|
|
||||||
# The root path '/' and sitemap index file are added automatically for you.
|
|
||||||
# Links are added to the Sitemap in the order they are specified.
|
|
||||||
#
|
|
||||||
# Usage: add(path, options={})
|
|
||||||
# (default options are used if you don't specify)
|
|
||||||
#
|
|
||||||
# Defaults: :priority => 0.5, :changefreq => 'weekly',
|
|
||||||
# :lastmod => Time.now, :host => default_host
|
|
||||||
#
|
|
||||||
# Examples:
|
|
||||||
#
|
|
||||||
# Add '/articles'
|
|
||||||
#
|
|
||||||
# add articles_path, :priority => 0.7, :changefreq => 'daily'
|
|
||||||
#
|
|
||||||
# Add all articles:
|
|
||||||
#
|
|
||||||
# Article.find_each do |article|
|
|
||||||
# add article_path(article), :lastmod => article.updated_at
|
|
||||||
# end
|
|
||||||
end
|
|
@ -19,11 +19,11 @@ build:
|
|||||||
# bucket: your_own_bucket-<%= Rails.env %>
|
# bucket: your_own_bucket-<%= Rails.env %>
|
||||||
amazon_dev:
|
amazon_dev:
|
||||||
service: S3
|
service: S3
|
||||||
access_key_id: <%= ENV.fetch("AWS_DEV_ACCESS_KEY_ID", Rails.application.credentials.dig(:aws_dev, :access_key_id)) %>
|
access_key_id: <%= ENV.fetch("AWS_ACCESS_KEY_ID", Rails.application.credentials.dig(:aws_dev, :access_key_id)) %>
|
||||||
secret_access_key: <%= ENV.fetch("AWS_DEV_SECRET_ACCESS_KEY_ID", Rails.application.credentials.dig(:aws_dev, :secret_access_key)) %>
|
secret_access_key: <%= ENV.fetch("AWS_SECRET_ACCESS_KEY_ID", Rails.application.credentials.dig(:aws_dev, :secret_access_key)) %>
|
||||||
region: <%= ENV.fetch("AWS_DEV_REGION", "wnam") %>
|
region: <%= ENV.fetch("AWS_REGION", "wnam") %>
|
||||||
bucket: <%= ENV.fetch("AWS_DEV_BUCKET", Rails.application.credentials.dig(:aws_dev, :bucket)) %>
|
bucket: <%= ENV.fetch("AWS_BUCKET", Rails.application.credentials.dig(:aws_dev, :bucket)) %>
|
||||||
endpoint: <%= ENV.fetch("AWS_DEV_ENDPOINT", Rails.application.credentials.dig(:aws_dev, :endpoint)) %>
|
endpoint: <%= ENV.fetch("AWS_ENDPOINT", Rails.application.credentials.dig(:aws_dev, :endpoint)) %>
|
||||||
|
|
||||||
amazon:
|
amazon:
|
||||||
service: S3
|
service: S3
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
class RemoveLastFetchFieldsFromCities < ActiveRecord::Migration[8.0]
|
|
||||||
def change
|
|
||||||
remove_column :cities, :last_weather_fetch
|
|
||||||
remove_column :cities, :last_image_generation
|
|
||||||
|
|
||||||
add_index :weather_arts, [ :city_id, :weather_date ]
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,61 +0,0 @@
|
|||||||
class CreateAhoyVisitsAndEvents < ActiveRecord::Migration[8.0]
|
|
||||||
def change
|
|
||||||
create_table :ahoy_visits do |t|
|
|
||||||
t.string :visit_token
|
|
||||||
t.string :visitor_token
|
|
||||||
|
|
||||||
# the rest are recommended but optional
|
|
||||||
# simply remove any you don't want
|
|
||||||
|
|
||||||
# user
|
|
||||||
t.references :user
|
|
||||||
|
|
||||||
# standard
|
|
||||||
t.string :ip
|
|
||||||
t.text :user_agent
|
|
||||||
t.text :referrer
|
|
||||||
t.string :referring_domain
|
|
||||||
t.text :landing_page
|
|
||||||
|
|
||||||
# technology
|
|
||||||
t.string :browser
|
|
||||||
t.string :os
|
|
||||||
t.string :device_type
|
|
||||||
|
|
||||||
# location
|
|
||||||
t.string :country
|
|
||||||
t.string :region
|
|
||||||
t.string :city
|
|
||||||
t.float :latitude
|
|
||||||
t.float :longitude
|
|
||||||
|
|
||||||
# utm parameters
|
|
||||||
t.string :utm_source
|
|
||||||
t.string :utm_medium
|
|
||||||
t.string :utm_term
|
|
||||||
t.string :utm_content
|
|
||||||
t.string :utm_campaign
|
|
||||||
|
|
||||||
# native apps
|
|
||||||
t.string :app_version
|
|
||||||
t.string :os_version
|
|
||||||
t.string :platform
|
|
||||||
|
|
||||||
t.datetime :started_at
|
|
||||||
end
|
|
||||||
|
|
||||||
add_index :ahoy_visits, :visit_token, unique: true
|
|
||||||
add_index :ahoy_visits, [ :visitor_token, :started_at ]
|
|
||||||
|
|
||||||
create_table :ahoy_events do |t|
|
|
||||||
t.references :visit
|
|
||||||
t.references :user
|
|
||||||
|
|
||||||
t.string :name
|
|
||||||
t.text :properties
|
|
||||||
t.datetime :time
|
|
||||||
end
|
|
||||||
|
|
||||||
add_index :ahoy_events, [ :name, :time ]
|
|
||||||
end
|
|
||||||
end
|
|
47
db/schema.rb
generated
47
db/schema.rb
generated
@ -10,7 +10,7 @@
|
|||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema[8.0].define(version: 2025_01_26_155239) do
|
ActiveRecord::Schema[8.0].define(version: 2025_01_22_053220) do
|
||||||
create_table "active_admin_comments", force: :cascade do |t|
|
create_table "active_admin_comments", force: :cascade do |t|
|
||||||
t.string "namespace"
|
t.string "namespace"
|
||||||
t.text "body"
|
t.text "body"
|
||||||
@ -65,48 +65,6 @@ ActiveRecord::Schema[8.0].define(version: 2025_01_26_155239) do
|
|||||||
t.index ["reset_password_token"], name: "index_admin_users_on_reset_password_token", unique: true
|
t.index ["reset_password_token"], name: "index_admin_users_on_reset_password_token", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "ahoy_events", force: :cascade do |t|
|
|
||||||
t.integer "visit_id"
|
|
||||||
t.integer "user_id"
|
|
||||||
t.string "name"
|
|
||||||
t.text "properties"
|
|
||||||
t.datetime "time"
|
|
||||||
t.index ["name", "time"], name: "index_ahoy_events_on_name_and_time"
|
|
||||||
t.index ["user_id"], name: "index_ahoy_events_on_user_id"
|
|
||||||
t.index ["visit_id"], name: "index_ahoy_events_on_visit_id"
|
|
||||||
end
|
|
||||||
|
|
||||||
create_table "ahoy_visits", force: :cascade do |t|
|
|
||||||
t.string "visit_token"
|
|
||||||
t.string "visitor_token"
|
|
||||||
t.integer "user_id"
|
|
||||||
t.string "ip"
|
|
||||||
t.text "user_agent"
|
|
||||||
t.text "referrer"
|
|
||||||
t.string "referring_domain"
|
|
||||||
t.text "landing_page"
|
|
||||||
t.string "browser"
|
|
||||||
t.string "os"
|
|
||||||
t.string "device_type"
|
|
||||||
t.string "country"
|
|
||||||
t.string "region"
|
|
||||||
t.string "city"
|
|
||||||
t.float "latitude"
|
|
||||||
t.float "longitude"
|
|
||||||
t.string "utm_source"
|
|
||||||
t.string "utm_medium"
|
|
||||||
t.string "utm_term"
|
|
||||||
t.string "utm_content"
|
|
||||||
t.string "utm_campaign"
|
|
||||||
t.string "app_version"
|
|
||||||
t.string "os_version"
|
|
||||||
t.string "platform"
|
|
||||||
t.datetime "started_at"
|
|
||||||
t.index ["user_id"], name: "index_ahoy_visits_on_user_id"
|
|
||||||
t.index ["visit_token"], name: "index_ahoy_visits_on_visit_token", unique: true
|
|
||||||
t.index ["visitor_token", "started_at"], name: "index_ahoy_visits_on_visitor_token_and_started_at"
|
|
||||||
end
|
|
||||||
|
|
||||||
create_table "cities", force: :cascade do |t|
|
create_table "cities", force: :cascade do |t|
|
||||||
t.string "name"
|
t.string "name"
|
||||||
t.float "latitude"
|
t.float "latitude"
|
||||||
@ -114,6 +72,8 @@ ActiveRecord::Schema[8.0].define(version: 2025_01_26_155239) do
|
|||||||
t.boolean "active"
|
t.boolean "active"
|
||||||
t.integer "priority"
|
t.integer "priority"
|
||||||
t.string "timezone"
|
t.string "timezone"
|
||||||
|
t.datetime "last_weather_fetch"
|
||||||
|
t.datetime "last_image_generation"
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
t.datetime "updated_at", null: false
|
t.datetime "updated_at", null: false
|
||||||
t.string "slug"
|
t.string "slug"
|
||||||
@ -172,7 +132,6 @@ ActiveRecord::Schema[8.0].define(version: 2025_01_26_155239) do
|
|||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
t.datetime "updated_at", null: false
|
t.datetime "updated_at", null: false
|
||||||
t.string "slug"
|
t.string "slug"
|
||||||
t.index ["city_id", "weather_date"], name: "index_weather_arts_on_city_id_and_weather_date"
|
|
||||||
t.index ["city_id"], name: "index_weather_arts_on_city_id"
|
t.index ["city_id"], name: "index_weather_arts_on_city_id"
|
||||||
t.index ["slug"], name: "index_weather_arts_on_slug", unique: true
|
t.index ["slug"], name: "index_weather_arts_on_slug", unique: true
|
||||||
end
|
end
|
||||||
|
@ -8,7 +8,9 @@ City.create!([
|
|||||||
country: australia,
|
country: australia,
|
||||||
timezone: 'Australia/Sydney',
|
timezone: 'Australia/Sydney',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 80
|
priority: 80,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Melbourne',
|
name: 'Melbourne',
|
||||||
@ -17,6 +19,8 @@ City.create!([
|
|||||||
country: australia,
|
country: australia,
|
||||||
timezone: 'Australia/Melbourne',
|
timezone: 'Australia/Melbourne',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 75
|
priority: 75,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
@ -8,6 +8,8 @@ City.create!([
|
|||||||
country: bangladesh,
|
country: bangladesh,
|
||||||
timezone: 'Asia/Dhaka',
|
timezone: 'Asia/Dhaka',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 85
|
priority: 85,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
@ -8,6 +8,8 @@ City.create!([
|
|||||||
country: brazil,
|
country: brazil,
|
||||||
timezone: 'America/Sao_Paulo',
|
timezone: 'America/Sao_Paulo',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 80
|
priority: 80,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
@ -6,5 +6,7 @@ City.create!(
|
|||||||
priority: 50,
|
priority: 50,
|
||||||
country: canada,
|
country: canada,
|
||||||
timezone: 'America/Toronto',
|
timezone: 'America/Toronto',
|
||||||
active: true
|
active: true,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
)
|
)
|
||||||
|
@ -8,7 +8,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Beijing',
|
name: 'Beijing',
|
||||||
@ -17,7 +19,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Shenzhen',
|
name: 'Shenzhen',
|
||||||
@ -26,7 +30,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Guangzhou',
|
name: 'Guangzhou',
|
||||||
@ -35,7 +41,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Chengdu',
|
name: 'Chengdu',
|
||||||
@ -44,7 +52,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Tianjin',
|
name: 'Tianjin',
|
||||||
@ -53,7 +63,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Wuhan',
|
name: 'Wuhan',
|
||||||
@ -62,7 +74,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Dongguan',
|
name: 'Dongguan',
|
||||||
@ -71,7 +85,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Chongqing',
|
name: 'Chongqing',
|
||||||
@ -80,7 +96,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Xi'an",
|
name: "Xi'an",
|
||||||
@ -89,7 +107,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Hangzhou',
|
name: 'Hangzhou',
|
||||||
@ -98,7 +118,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Foshan',
|
name: 'Foshan',
|
||||||
@ -107,7 +129,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Nanjing',
|
name: 'Nanjing',
|
||||||
@ -116,7 +140,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Hong Kong',
|
name: 'Hong Kong',
|
||||||
@ -125,7 +151,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Hong_Kong',
|
timezone: 'Asia/Hong_Kong',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Shenyang',
|
name: 'Shenyang',
|
||||||
@ -134,7 +162,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Zhengzhou',
|
name: 'Zhengzhou',
|
||||||
@ -143,7 +173,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Qingdao',
|
name: 'Qingdao',
|
||||||
@ -152,7 +184,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Suzhou',
|
name: 'Suzhou',
|
||||||
@ -161,7 +195,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Changsha',
|
name: 'Changsha',
|
||||||
@ -170,7 +206,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Jinan',
|
name: 'Jinan',
|
||||||
@ -179,7 +217,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Kunming',
|
name: 'Kunming',
|
||||||
@ -188,7 +228,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Harbin',
|
name: 'Harbin',
|
||||||
@ -197,7 +239,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Shijiazhuang',
|
name: 'Shijiazhuang',
|
||||||
@ -206,7 +250,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Hefei',
|
name: 'Hefei',
|
||||||
@ -215,7 +261,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Dalian',
|
name: 'Dalian',
|
||||||
@ -224,7 +272,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Xiamen',
|
name: 'Xiamen',
|
||||||
@ -233,7 +283,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Nanning',
|
name: 'Nanning',
|
||||||
@ -242,7 +294,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Changchun',
|
name: 'Changchun',
|
||||||
@ -251,7 +305,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Taiyuan',
|
name: 'Taiyuan',
|
||||||
@ -260,7 +316,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'New Taipei City',
|
name: 'New Taipei City',
|
||||||
@ -269,7 +327,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Taipei',
|
timezone: 'Asia/Taipei',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Guiyang',
|
name: 'Guiyang',
|
||||||
@ -278,7 +338,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Wuxi',
|
name: 'Wuxi',
|
||||||
@ -287,7 +349,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Shantou',
|
name: 'Shantou',
|
||||||
@ -296,7 +360,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Ürümqi',
|
name: 'Ürümqi',
|
||||||
@ -305,7 +371,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Zhongshan',
|
name: 'Zhongshan',
|
||||||
@ -314,7 +382,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Ningbo',
|
name: 'Ningbo',
|
||||||
@ -323,7 +393,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Fuzhou',
|
name: 'Fuzhou',
|
||||||
@ -332,7 +404,9 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Nanchang',
|
name: 'Nanchang',
|
||||||
@ -341,6 +415,8 @@ City.create!([
|
|||||||
country: china,
|
country: china,
|
||||||
timezone: 'Asia/Shanghai',
|
timezone: 'Asia/Shanghai',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
@ -8,6 +8,8 @@ City.create!([
|
|||||||
country: egypt,
|
country: egypt,
|
||||||
timezone: 'Africa/Cairo',
|
timezone: 'Africa/Cairo',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
@ -8,6 +8,8 @@ City.create!([
|
|||||||
country: france,
|
country: france,
|
||||||
timezone: 'Europe/Paris',
|
timezone: 'Europe/Paris',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
@ -8,7 +8,9 @@ City.create!([
|
|||||||
country: germany,
|
country: germany,
|
||||||
timezone: 'Europe/Berlin',
|
timezone: 'Europe/Berlin',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Berlin',
|
name: 'Berlin',
|
||||||
@ -17,6 +19,8 @@ City.create!([
|
|||||||
country: germany,
|
country: germany,
|
||||||
timezone: 'Europe/Berlin',
|
timezone: 'Europe/Berlin',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
@ -8,7 +8,9 @@ City.create!([
|
|||||||
country: india,
|
country: india,
|
||||||
timezone: 'Asia/Kolkata',
|
timezone: 'Asia/Kolkata',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Bengaluru',
|
name: 'Bengaluru',
|
||||||
@ -17,6 +19,8 @@ City.create!([
|
|||||||
country: india,
|
country: india,
|
||||||
timezone: 'Asia/Kolkata',
|
timezone: 'Asia/Kolkata',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
@ -8,7 +8,9 @@ City.create!([
|
|||||||
country: japan,
|
country: japan,
|
||||||
timezone: 'Asia/Tokyo',
|
timezone: 'Asia/Tokyo',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Yokohama',
|
name: 'Yokohama',
|
||||||
@ -17,6 +19,8 @@ City.create!([
|
|||||||
country: japan,
|
country: japan,
|
||||||
timezone: 'Asia/Tokyo',
|
timezone: 'Asia/Tokyo',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
@ -8,6 +8,8 @@ City.create!([
|
|||||||
country: mexico,
|
country: mexico,
|
||||||
timezone: 'America/Mexico_City',
|
timezone: 'America/Mexico_City',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
@ -8,6 +8,8 @@ City.create!([
|
|||||||
country: nigeria,
|
country: nigeria,
|
||||||
timezone: 'Africa/Lagos',
|
timezone: 'Africa/Lagos',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
@ -8,6 +8,8 @@ City.create!([
|
|||||||
country: pakistan,
|
country: pakistan,
|
||||||
timezone: 'Asia/Karachi',
|
timezone: 'Asia/Karachi',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
@ -8,7 +8,9 @@ City.create!([
|
|||||||
country: russia,
|
country: russia,
|
||||||
timezone: 'Europe/Moscow',
|
timezone: 'Europe/Moscow',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Sankt Petersburg',
|
name: 'Sankt Petersburg',
|
||||||
@ -17,6 +19,8 @@ City.create!([
|
|||||||
country: russia,
|
country: russia,
|
||||||
timezone: 'Europe/Moscow',
|
timezone: 'Europe/Moscow',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
@ -8,6 +8,8 @@ City.create!([
|
|||||||
country: saudi_arabia,
|
country: saudi_arabia,
|
||||||
timezone: 'Asia/Riyadh',
|
timezone: 'Asia/Riyadh',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
@ -8,6 +8,8 @@ City.create!([
|
|||||||
country: singapore,
|
country: singapore,
|
||||||
timezone: 'Asia/Singapore',
|
timezone: 'Asia/Singapore',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
@ -8,6 +8,8 @@ City.create!([
|
|||||||
country: south_korea,
|
country: south_korea,
|
||||||
timezone: 'Asia/Seoul',
|
timezone: 'Asia/Seoul',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
@ -8,6 +8,8 @@ City.create!([
|
|||||||
country: thailand,
|
country: thailand,
|
||||||
timezone: 'Asia/Bangkok',
|
timezone: 'Asia/Bangkok',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
@ -8,7 +8,9 @@ City.create!([
|
|||||||
country: turkey,
|
country: turkey,
|
||||||
timezone: 'Europe/Istanbul',
|
timezone: 'Europe/Istanbul',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Ankara',
|
name: 'Ankara',
|
||||||
@ -17,6 +19,8 @@ City.create!([
|
|||||||
country: turkey,
|
country: turkey,
|
||||||
timezone: 'Europe/Istanbul',
|
timezone: 'Europe/Istanbul',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
@ -8,6 +8,8 @@ City.create!([
|
|||||||
country: uk,
|
country: uk,
|
||||||
timezone: 'Europe/London',
|
timezone: 'Europe/London',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
@ -8,7 +8,9 @@ City.create!([
|
|||||||
country: usa,
|
country: usa,
|
||||||
timezone: 'America/Los_Angeles',
|
timezone: 'America/Los_Angeles',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Chicago',
|
name: 'Chicago',
|
||||||
@ -17,7 +19,9 @@ City.create!([
|
|||||||
country: usa,
|
country: usa,
|
||||||
timezone: 'America/Chicago',
|
timezone: 'America/Chicago',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'New York City',
|
name: 'New York City',
|
||||||
@ -26,7 +30,9 @@ City.create!([
|
|||||||
country: usa,
|
country: usa,
|
||||||
timezone: 'America/New_York',
|
timezone: 'America/New_York',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Los Angeles',
|
name: 'Los Angeles',
|
||||||
@ -35,6 +41,8 @@ City.create!([
|
|||||||
country: usa,
|
country: usa,
|
||||||
timezone: 'America/Los_Angeles',
|
timezone: 'America/Los_Angeles',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
@ -8,7 +8,9 @@ City.create!([
|
|||||||
country: vietnam,
|
country: vietnam,
|
||||||
timezone: 'Asia/Ho_Chi_Minh',
|
timezone: 'Asia/Ho_Chi_Minh',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Hanoi',
|
name: 'Hanoi',
|
||||||
@ -17,6 +19,8 @@ City.create!([
|
|||||||
country: vietnam,
|
country: vietnam,
|
||||||
timezone: 'Asia/Ho_Chi_Minh',
|
timezone: 'Asia/Ho_Chi_Minh',
|
||||||
active: true,
|
active: true,
|
||||||
priority: 100
|
priority: 100,
|
||||||
|
last_weather_fetch: 10.days.ago,
|
||||||
|
last_image_generation: 10.days.ago
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
@ -16,8 +16,6 @@
|
|||||||
"@hotwired/stimulus": "^3.2.2",
|
"@hotwired/stimulus": "^3.2.2",
|
||||||
"@hotwired/turbo-rails": "^8.0.12",
|
"@hotwired/turbo-rails": "^8.0.12",
|
||||||
"autoprefixer": "^10.4.20",
|
"autoprefixer": "^10.4.20",
|
||||||
"jquery": "^3.7.1",
|
|
||||||
"jquery-ui": "^1.14.1",
|
|
||||||
"postcss": "^8.5.1",
|
"postcss": "^8.5.1",
|
||||||
"sass": "^1.83.4",
|
"sass": "^1.83.4",
|
||||||
"tailwindcss": "^3.4.17"
|
"tailwindcss": "^3.4.17"
|
||||||
|
@ -1 +0,0 @@
|
|||||||
google.com, pub-7296634171837358, DIRECT, f08c47fec0942fa0
|
|
@ -1,7 +1 @@
|
|||||||
# See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
|
# See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
|
||||||
User-agent: *
|
|
||||||
Allow: /
|
|
||||||
Disallow: /admin/
|
|
||||||
Disallow: /admin
|
|
||||||
|
|
||||||
Sitemap: https://todayaiweather.com/sitemap.xml.gz
|
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
require "test_helper"
|
|
||||||
|
|
||||||
class SitemapsControllerTest < ActionDispatch::IntegrationTest
|
|
||||||
# test "the truth" do
|
|
||||||
# assert true
|
|
||||||
# end
|
|
||||||
end
|
|
@ -729,19 +729,12 @@ jquery-ui@^1.13.3:
|
|||||||
dependencies:
|
dependencies:
|
||||||
jquery ">=1.12.0 <5.0.0"
|
jquery ">=1.12.0 <5.0.0"
|
||||||
|
|
||||||
jquery-ui@^1.14.1:
|
|
||||||
version "1.14.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/jquery-ui/-/jquery-ui-1.14.1.tgz#ba342ea3ffff662b787595391f607d923313e040"
|
|
||||||
integrity sha512-DhzsYH8VeIvOaxwi+B/2BCsFFT5EGjShdzOcm5DssWjtcpGWIMsn66rJciDA6jBruzNiLf1q0KvwMoX1uGNvnQ==
|
|
||||||
dependencies:
|
|
||||||
jquery ">=1.12.0 <5.0.0"
|
|
||||||
|
|
||||||
jquery-ujs@^1.2.2:
|
jquery-ujs@^1.2.2:
|
||||||
version "1.2.3"
|
version "1.2.3"
|
||||||
resolved "https://registry.npmjs.org/jquery-ujs/-/jquery-ujs-1.2.3.tgz"
|
resolved "https://registry.npmjs.org/jquery-ujs/-/jquery-ujs-1.2.3.tgz"
|
||||||
integrity sha512-59wvfx5vcCTHMeQT1/OwFiAj+UffLIwjRIoXdpO7Z7BCFGepzq9T9oLVeoItjTqjoXfUrHJvV7QU6pUR+UzOoA==
|
integrity sha512-59wvfx5vcCTHMeQT1/OwFiAj+UffLIwjRIoXdpO7Z7BCFGepzq9T9oLVeoItjTqjoXfUrHJvV7QU6pUR+UzOoA==
|
||||||
|
|
||||||
"jquery@>=1.12.0 <5.0.0", jquery@^3.4.1, jquery@^3.7.1:
|
"jquery@>=1.12.0 <5.0.0", jquery@^3.4.1:
|
||||||
version "3.7.1"
|
version "3.7.1"
|
||||||
resolved "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz"
|
resolved "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz"
|
||||||
integrity sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==
|
integrity sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==
|
||||||
|
Loading…
Reference in New Issue
Block a user