refactor: improve: changes in admin panel

The commit message implements a new feature
in the admin panel for the Sidekiq tasks
allowing users to input the city ID. The
previous implementation uses a selection approach
where users can input the city ID.
The new feature allows for a more streamlined,
direct data input method for the users.
</commit_ message>
This commit is contained in:
songtianlun 2025-02-16 13:42:13 +08:00
parent 0ef979e5c4
commit afc871deb1

View File

@ -12,10 +12,9 @@ ActiveAdmin.register_page "Sidekiq Tasks" do
form action: admin_sidekiq_tasks_run_task_path, method: :post do form action: admin_sidekiq_tasks_run_task_path, method: :post do
input type: "hidden", name: "authenticity_token", value: form_authenticity_token input type: "hidden", name: "authenticity_token", value: form_authenticity_token
input type: "hidden", name: "task", value: "GenerateWeatherArtsWorker" input type: "hidden", name: "task", value: "GenerateWeatherArtsWorker"
select name: "city_id" do div class: "input-field" do
City.all.map do |city| label "City ID"
option city.name, value: city.id input type: "number", name: "city_id", placeholder: "Enter city ID", required: true
end
end end
input type: "submit", value: "Run Task", class: "button" input type: "submit", value: "Run Task", class: "button"
end end